소스 검색

oracle数据同步代码

0027005599 1 년 전
부모
커밋
0eee05ca4b

+ 5 - 10
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/job/XCFYDataV_PRESCRIPTION_ORDERJob.java

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