111 lines
4.1 KiB
Java
111 lines
4.1 KiB
Java
|
|
package com.saye.hospitalgd.scheduler.job;
|
||
|
|
|
||
|
|
import com.saye.hospitalgd.commons.string.StringDUtil;
|
||
|
|
import com.saye.hospitalgd.scheduler.jobMethod.BankGetDataMethod;
|
||
|
|
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
|
||
|
|
private ThirdSftpConfigService thirdSftpConfigService;
|
||
|
|
|
||
|
|
@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<>();
|
||
|
|
searchMap.put("FUBS", "1");
|
||
|
|
// List<HashMap<Object, Object>> thirdFtpConfigList = thirdSftpConfigService.findThirdSftpConfigList(searchMap);
|
||
|
|
List<HashMap<Object, Object>> wlConfigList = thirdSftpConfigService.findWLIF(searchMap);
|
||
|
|
|
||
|
|
for (int i = 0; i < wlConfigList.size(); i++) {
|
||
|
|
|
||
|
|
|
||
|
|
HashMap<Object, Object> hashMap = wlConfigList.get(i);
|
||
|
|
String execute_class = StringDUtil.changeNullToEmpty(hashMap.get("EXECUTE_CLASS"));
|
||
|
|
|
||
|
|
//商户pos通过对账
|
||
|
|
if ("BankGetDataMethod".equals(execute_class)) {
|
||
|
|
Thread thread = new Thread(() -> new BankGetDataMethod().getDate(id, name, trade_date, hashMap));
|
||
|
|
thread.start();
|
||
|
|
}
|
||
|
|
|
||
|
|
// //商户对账单
|
||
|
|
// if ("BankGetDataBySH".equals(execute_class)){
|
||
|
|
// Thread thread = new Thread(() -> new BankGetDataBySH().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 ("BankGetDataBySHYXLM".equals(execute_class)){
|
||
|
|
// Thread thread = new Thread(() -> new BankGetDataBySHYXLM().getDate(id,name,trade_date,hashMap));
|
||
|
|
// thread.start();
|
||
|
|
// }
|
||
|
|
}
|
||
|
|
|
||
|
|
} 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"));
|
||
|
|
|
||
|
|
//商户pos通过对账
|
||
|
|
if ("BankGetDataMethod".equals(execute_class)) {
|
||
|
|
return new BankGetDataMethod().getDate(id, name, trade_date, hashMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
// //商户对账单
|
||
|
|
// if ("BankGetDataBySH".equals(execute_class)){
|
||
|
|
// return new BankGetDataBySH().getDate(id,name,trade_date,hashMap);
|
||
|
|
// }
|
||
|
|
//
|
||
|
|
// //商户银联卡对账单
|
||
|
|
// if ("BankGetDataBySHYLK".equals(execute_class)){
|
||
|
|
// return new BankGetDataBySHYLK().getDate(id,name,trade_date,hashMap);
|
||
|
|
// }
|
||
|
|
//
|
||
|
|
// //商户营销联盟对账单
|
||
|
|
// if ("BankGetDataBySHYXLM".equals(execute_class)){
|
||
|
|
// return new BankGetDataBySHYXLM().getDate(id,name,trade_date,hashMap);
|
||
|
|
// }
|
||
|
|
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|