|
@@ -1,12 +1,8 @@
|
|
package org.jeecg.modules.medical.job;
|
|
package org.jeecg.modules.medical.job;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
-import jdk.nashorn.internal.scripts.JD;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.modules.medical.afterwaring.XCFYDataTransferService;
|
|
import org.jeecg.modules.medical.afterwaring.XCFYDataTransferService;
|
|
-import org.jeecg.modules.medical.entity.HospitalizatioSettleDetail;
|
|
|
|
import org.jeecg.modules.medical.ruleengine.TransferDataCallFunction;
|
|
import org.jeecg.modules.medical.ruleengine.TransferDataCallFunction;
|
|
-import org.jeecg.modules.medical.service.IHospitalizatioSettleDetailService;
|
|
|
|
import org.quartz.Job;
|
|
import org.quartz.Job;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionException;
|
|
import org.quartz.JobExecutionException;
|
|
@@ -15,7 +11,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
-import java.util.List;
|
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -47,13 +42,13 @@ public class XCFYDataV_PRESCRIPTION_ORDERJob implements Job {
|
|
@Override
|
|
@Override
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
String sql = "select * from V_PRESCRIPTION_ORDER where rownum<1000 %s";
|
|
String sql = "select * from V_PRESCRIPTION_ORDER where rownum<1000 %s";
|
|
- while(true) {
|
|
|
|
|
|
+ while (true) {
|
|
log.info("开始同步V_PRESCRIPTION_ORDER数据");
|
|
log.info("开始同步V_PRESCRIPTION_ORDER数据");
|
|
String whereSql = "";
|
|
String whereSql = "";
|
|
Date orderTime = getLastOpEndDate();
|
|
Date orderTime = getLastOpEndDate();
|
|
log.info("开始同步V_PRESCRIPTION_ORDER数据,获取上个同步记录访问最大ORDER_TIME:{}", orderTime);
|
|
log.info("开始同步V_PRESCRIPTION_ORDER数据,获取上个同步记录访问最大ORDER_TIME:{}", orderTime);
|
|
- Map<String,Object> paramMap = new HashMap<>();
|
|
|
|
- if(null != orderTime){
|
|
|
|
|
|
+ Map<String, Object> paramMap = new HashMap<>();
|
|
|
|
+ if (null != orderTime) {
|
|
whereSql = "and ORDER_TIME>:ORDER_TIME";
|
|
whereSql = "and ORDER_TIME>:ORDER_TIME";
|
|
paramMap.put("ORDER_TIME", orderTime);
|
|
paramMap.put("ORDER_TIME", orderTime);
|
|
}
|
|
}
|
|
@@ -68,7 +63,7 @@ public class XCFYDataV_PRESCRIPTION_ORDERJob implements Job {
|
|
dataMap.put("CREATE_TIME", new Date());
|
|
dataMap.put("CREATE_TIME", new Date());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if(count<=0){
|
|
|
|
|
|
+ if (count <= 0) {
|
|
log.info(" V_PRESCRIPTION_ORDER 大于ORDER_TIME:{} 没有的数据,停止同步", orderTime);
|
|
log.info(" V_PRESCRIPTION_ORDER 大于ORDER_TIME:{} 没有的数据,停止同步", orderTime);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -76,7 +71,7 @@ public class XCFYDataV_PRESCRIPTION_ORDERJob implements Job {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public Date getLastOpEndDate(){
|
|
|
|
|
|
+ public Date getLastOpEndDate() {
|
|
Date opEndDate = jdbcTemplate.queryForObject("select max(ORDER_TIME) as opEndDate from PRESCRIPTION_ORDER", Date.class);
|
|
Date opEndDate = jdbcTemplate.queryForObject("select max(ORDER_TIME) as opEndDate from PRESCRIPTION_ORDER", Date.class);
|
|
return opEndDate;
|
|
return opEndDate;
|
|
}
|
|
}
|