2025-07-23 09:55:50 +08:00
|
|
|
package com.saye.hospitalgd.scheduler.job;
|
|
|
|
|
|
|
|
|
|
import com.saye.hospitalgd.commons.string.StringDUtil;
|
2025-07-31 15:27:47 +08:00
|
|
|
import com.saye.hospitalgd.scheduler.jobMethod.*;
|
|
|
|
|
import com.saye.hospitalgd.service.ThirdFtpConfigService;
|
2025-07-23 09:55:50 +08:00
|
|
|
import com.saye.hospitalgd.service.ThirdSftpConfigService;
|
|
|
|
|
import org.quartz.Job;
|
|
|
|
|
import org.quartz.JobDataMap;
|
|
|
|
|
import org.quartz.JobExecutionContext;
|
|
|
|
|
import org.quartz.JobExecutionException;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author thuang
|
|
|
|
|
* @version 1.0
|
|
|
|
|
* @description: 从银行接口下载对账信息并存入数据库
|
|
|
|
|
* @date 2021/8/30 16:03
|
|
|
|
|
*/
|
|
|
|
|
public class BankGetData implements Job {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
2025-07-31 15:27:47 +08:00
|
|
|
private ThirdFtpConfigService thirdFtpConfigService;
|
2025-07-23 09:55:50 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
|
|
|
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
|
|
|
|
|
String id = StringDUtil.changeNullToEmpty(jobDataMap.get("id"));
|
|
|
|
|
String name = StringDUtil.changeNullToEmpty(jobDataMap.get("name"));
|
|
|
|
|
String trade_date = StringDUtil.changeNullToEmpty(jobDataMap.get("trade_date"));
|
|
|
|
|
|
|
|
|
|
System.out.println("/****************************定时任务[" + name + "]开始执行*********************************/");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
HashMap<Object, Object> searchMap = new HashMap<>();
|
2025-07-31 15:27:47 +08:00
|
|
|
searchMap.put("is_active", "1");
|
|
|
|
|
HashMap<Object, Object> wlifSearchMap = new HashMap<>();
|
|
|
|
|
wlifSearchMap.put("FUBS", "1");
|
|
|
|
|
List<HashMap<Object, Object>> thirdFtpConfigList = thirdFtpConfigService.findThirdFtpConfigList(searchMap);
|
|
|
|
|
List<HashMap<Object, Object>> wlConfigList = thirdFtpConfigService.findWLIF(searchMap);
|
2025-07-23 09:55:50 +08:00
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
for (int i = 0; i < thirdFtpConfigList.size(); i++) {
|
2025-07-23 09:55:50 +08:00
|
|
|
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
HashMap<Object, Object> hashMap = thirdFtpConfigList.get(i);
|
2025-07-23 09:55:50 +08:00
|
|
|
String execute_class = StringDUtil.changeNullToEmpty(hashMap.get("EXECUTE_CLASS"));
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
|
|
|
|
|
//商户对账单
|
|
|
|
|
if ("BankGetDataBySH".equals(execute_class)){
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataBySH().getDate(id,name,trade_date,hashMap));
|
2025-07-23 09:55:50 +08:00
|
|
|
thread.start();
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
//商户POS对账单
|
|
|
|
|
if ("BankGetDataBySHPOS".equals(execute_class)){
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataBySHPOS().getDate(id,name,trade_date,hashMap));
|
|
|
|
|
thread.start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 银行商户银行卡对账单
|
|
|
|
|
if ("BankGetDataBySHYLK".equals(execute_class)) {
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataBySHYLK().getDate(id, name, trade_date, hashMap));
|
|
|
|
|
thread.start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 商户银联外卡对账单
|
|
|
|
|
if ("BankGetDataBySHYLWK".equals(execute_class)) {
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataBySHYLWK().getDate(id, name, trade_date, hashMap));
|
|
|
|
|
thread.start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 微信账单
|
|
|
|
|
if ("BankGetDataByWXAPI".equals(execute_class)) {
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataByWXAPI().getDate(id, name, trade_date, hashMap));
|
|
|
|
|
thread.start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < wlConfigList.size(); i++) {
|
|
|
|
|
|
|
|
|
|
HashMap<Object, Object> hashMap = wlConfigList.get(i);
|
|
|
|
|
String execute_class = StringDUtil.changeNullToEmpty(hashMap.get("EXECUTE_CLASS"));
|
|
|
|
|
|
|
|
|
|
//建行龙支付
|
|
|
|
|
if ("BankGetDataMethodByJHLZF".equals(execute_class)) {
|
|
|
|
|
Thread thread = new Thread(() -> new BankGetDataMethodByJHLZF().getDate(id, name, trade_date, hashMap));
|
|
|
|
|
thread.start();
|
|
|
|
|
}
|
2025-07-23 09:55:50 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
|
|
|
|
|
|
2025-07-23 09:55:50 +08:00
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 手动执行一次任务
|
|
|
|
|
* @author thuang
|
|
|
|
|
* @date 2021/9/22 15:07
|
|
|
|
|
* @version 1.0
|
|
|
|
|
*/
|
|
|
|
|
public static HashMap<Object, Object> oneExecute(String id, String name, String trade_date, HashMap<Object, Object> hashMap) {
|
|
|
|
|
|
|
|
|
|
String execute_class = StringDUtil.changeNullToEmpty(hashMap.get("EXECUTE_CLASS"));
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
//建行龙支付
|
|
|
|
|
if ("BankGetDataMethodByJHLZF".equals(execute_class)) {
|
|
|
|
|
return new BankGetDataMethodByJHLZF().getDate(id, name, trade_date, hashMap);
|
2025-07-23 09:55:50 +08:00
|
|
|
}
|
|
|
|
|
|
2025-07-31 15:27:47 +08:00
|
|
|
//商户对账单
|
|
|
|
|
if ("BankGetDataBySH".equals(execute_class)){
|
|
|
|
|
return new BankGetDataBySH().getDate(id,name,trade_date,hashMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//商户POS对账单
|
|
|
|
|
if ("BankGetDataBySHPOS".equals(execute_class)){
|
|
|
|
|
return new BankGetDataBySHPOS().getDate(id,name,trade_date,hashMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 银行商户银联卡对账单
|
|
|
|
|
if ("BankGetDataBySHYLK".equals(execute_class)) {
|
|
|
|
|
return new BankGetDataBySHYLK().getDate(id, name, trade_date, hashMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 商户银联外卡对账单
|
|
|
|
|
if ("BankGetDataBySHYLWK".equals(execute_class)) {
|
|
|
|
|
return new BankGetDataBySHYLWK().getDate(id, name, trade_date, hashMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 微信账单
|
|
|
|
|
if ("BankGetDataByWXAPI".equals(execute_class)) {
|
|
|
|
|
return new BankGetDataByWXAPI().getDate(id, name, trade_date, hashMap);
|
|
|
|
|
}
|
2025-07-23 09:55:50 +08:00
|
|
|
//
|
|
|
|
|
// //商户营销联盟对账单
|
|
|
|
|
// if ("BankGetDataBySHYXLM".equals(execute_class)){
|
|
|
|
|
// return new BankGetDataBySHYXLM().getDate(id,name,trade_date,hashMap);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|