浏览代码

Merge branch 'master' of hyq/cus-wms-supervise2.0 into master

project 7 年之前
父节点
当前提交
de10fa2109

+ 1 - 1
src/main/java/com/emato/cus/supervise/biz/acqGoodsMoveSchedule/up/AcqGoodsMoveUpBiz.java

@@ -56,7 +56,7 @@ public class AcqGoodsMoveUpBiz implements CusWmsTask {
 
         }
 
-        // 扫描WMS 数据
+        // 扫描WMS 数据 , 根据emt_record_time的this_time字段,查询>=this_time的数据
         List<WmsAcqGoodsMove> wmsList = acqGoodsMoveUpWmsData.getWmsData(oldThisTime);
         if (wmsList == null || wmsList.size() == 0) {
             logger.info("--- 【" + DATA_TYPE_INFO + "】获取到本次扫描数据为空, 不执行写数据操作, 本次扫描提前结束!!!");

+ 2 - 3
src/main/java/com/emato/cus/supervise/biz/acqGoodsMoveSchedule/up/AcqGoodsMoveUpDataConversion.java

@@ -42,11 +42,10 @@ public class AcqGoodsMoveUpDataConversion implements DataConversion {
             CusAcqGoodsMove05 cusAcqGoodsMove05 = new CusAcqGoodsMove05();
             cusAcqGoodsMove05.setId(wmsAcqGoodsMove.getId());
             if("上架".equals(wmsAcqGoodsMove.getTaskType())){
-                //TODO 此处转换locaDate有异常
-                cusAcqGoodsMove05.setShelfLoadTime(LocalDateTime.parse(wmsAcqGoodsMove.getCreated(),df));
+                cusAcqGoodsMove05.setShelfLoadTime(wmsAcqGoodsMove.getCreated());
             }
             if("批量拣选".equals(wmsAcqGoodsMove.getTaskType())){
-                cusAcqGoodsMove05.setShelfUnloadTime(LocalDateTime.parse(wmsAcqGoodsMove.getCreated(),df));
+                cusAcqGoodsMove05.setShelfUnloadTime(wmsAcqGoodsMove.getCreated());
             }
             cusAcqGoodsMove05.setTargetSeatNo(wmsAcqGoodsMove.getTargetSeatNo());
             cusAcqGoodsMove05.setOriginSeatNo(wmsAcqGoodsMove.getOriginSeatNo());

+ 31 - 25
src/main/java/com/emato/cus/supervise/biz/acqGoodsSeat/AcqGoodsOnSeatDataConversion.java

@@ -42,32 +42,38 @@ public class AcqGoodsOnSeatDataConversion implements DataConversion{
         List<CusAcqGoodsSeat06> cusAcqGoodsSeat06List = Lists.newArrayList();
 
         for (int i = 0; i < wmsList.size(); i++) {
-            WmsAcqGoodsOnSeat wmsAcqGoodsOnSeat = wmsList.get(i);
-            OmsAcqInventoryInfo omsAcqInventoryInfo = omsAcqInventoryInfoMap.get(wmsAcqGoodsOnSeat.getMerchSn());
+            try{
+                WmsAcqGoodsOnSeat wmsAcqGoodsOnSeat = wmsList.get(i);
+                OmsAcqInventoryInfo omsAcqInventoryInfo = omsAcqInventoryInfoMap.get(wmsAcqGoodsOnSeat.getMerchSn());
 
-            CusAcqGoodsSeat06 cusAcqGoodsSeat06 = new CusAcqGoodsSeat06();
-            cusAcqGoodsSeat06.setId(wmsAcqGoodsOnSeat.getId());
-            cusAcqGoodsSeat06.setSeatNo(wmsAcqGoodsOnSeat.getSeatNo());
-            cusAcqGoodsSeat06.setGoodsName(wmsAcqGoodsOnSeat.getGoodsName());
-            cusAcqGoodsSeat06.setCodeTs(wmsAcqGoodsOnSeat.getCodeTs());
-            cusAcqGoodsSeat06.setFormNoDec(wmsAcqGoodsOnSeat.getFormNoDec());
-            cusAcqGoodsSeat06.setFormNo(wmsAcqGoodsOnSeat.getFormNo());
-            cusAcqGoodsSeat06.setSkuNo(wmsAcqGoodsOnSeat.getSkuNo());
-            cusAcqGoodsSeat06.setGoodsId(wmsAcqGoodsOnSeat.getGoodsId());
-            cusAcqGoodsSeat06.setgUnit(wmsAcqGoodsOnSeat.getgUnit());
-            cusAcqGoodsSeat06.setgQty(wmsAcqGoodsOnSeat.getgQty());
-            cusAcqGoodsSeat06.setLegalUnit(wmsAcqGoodsOnSeat.getLegalUnit());
-            cusAcqGoodsSeat06.setLegalQty(wmsAcqGoodsOnSeat.getLegalQty());
-            cusAcqGoodsSeat06.setGoodsModel(wmsAcqGoodsOnSeat.getGoodsModel());
-            cusAcqGoodsSeat06.setLocalEmsNo(Dict.localEmsNo);
-            cusAcqGoodsSeat06.setOwnerCode(omsAcqInventoryInfo.getOwnerCode());
-            cusAcqGoodsSeat06.setOwnerName(omsAcqInventoryInfo.getOwnerName());
-            cusAcqGoodsSeat06.setStoreCompanyName(Dict.storeCompanyName);
-            cusAcqGoodsSeat06.setStoreUscCode(Dict.storeUscCode);
-            cusAcqGoodsSeat06.setStoreCustomsCode(Dict.storeCustomsCode);
-            cusAcqGoodsSeat06.setStoreCode(Dict.storeCode);
-            cusAcqGoodsSeat06.setCreateTime(LocalDateTime.now());
-            cusAcqGoodsSeat06List.add(cusAcqGoodsSeat06);
+                CusAcqGoodsSeat06 cusAcqGoodsSeat06 = new CusAcqGoodsSeat06();
+                cusAcqGoodsSeat06.setId(wmsAcqGoodsOnSeat.getId());
+                cusAcqGoodsSeat06.setSeatNo(wmsAcqGoodsOnSeat.getSeatNo());
+                cusAcqGoodsSeat06.setGoodsName(wmsAcqGoodsOnSeat.getGoodsName());
+                cusAcqGoodsSeat06.setCodeTs(wmsAcqGoodsOnSeat.getCodeTs());
+                cusAcqGoodsSeat06.setFormNoDec(wmsAcqGoodsOnSeat.getFormNoDec());
+                cusAcqGoodsSeat06.setFormNo(wmsAcqGoodsOnSeat.getFormNo());
+                cusAcqGoodsSeat06.setSkuNo(wmsAcqGoodsOnSeat.getSkuNo());
+                cusAcqGoodsSeat06.setGoodsId(wmsAcqGoodsOnSeat.getGoodsId());
+                cusAcqGoodsSeat06.setgUnit(wmsAcqGoodsOnSeat.getgUnit());
+                cusAcqGoodsSeat06.setgQty(wmsAcqGoodsOnSeat.getgQty());
+                cusAcqGoodsSeat06.setLegalUnit(wmsAcqGoodsOnSeat.getLegalUnit());
+                cusAcqGoodsSeat06.setLegalQty(wmsAcqGoodsOnSeat.getLegalQty());
+                cusAcqGoodsSeat06.setGoodsModel(wmsAcqGoodsOnSeat.getGoodsModel());
+                cusAcqGoodsSeat06.setLocalEmsNo(Dict.localEmsNo);
+                cusAcqGoodsSeat06.setOwnerCode(omsAcqInventoryInfo.getOwnerCode());
+                cusAcqGoodsSeat06.setOwnerName(omsAcqInventoryInfo.getOwnerName());
+                cusAcqGoodsSeat06.setStoreCompanyName(Dict.storeCompanyName);
+                cusAcqGoodsSeat06.setStoreUscCode(Dict.storeUscCode);
+                cusAcqGoodsSeat06.setStoreCustomsCode(Dict.storeCustomsCode);
+                cusAcqGoodsSeat06.setStoreCode(Dict.storeCode);
+                cusAcqGoodsSeat06.setCreateTime(LocalDateTime.now());
+                cusAcqGoodsSeat06List.add(cusAcqGoodsSeat06);
+            }catch (Exception e){
+                logger.error("库位货物组装cus数据系统异常", e);
+            }finally {
+                continue;
+            }
         }
         logger.info("转换oms,wms 组装cus数据结束===========================");
         return cusAcqGoodsSeat06List;

+ 36 - 28
src/main/java/com/emato/cus/supervise/biz/acqInventoryInfo/AcqInventoryInfoDataConversion.java

@@ -45,34 +45,42 @@ public class AcqInventoryInfoDataConversion implements DataConversion {
         List<CusAcqInventoryInfo03> cusAcqInventoryInfo03List = Lists.newArrayList();
 
         for (int i = 0; i < wmsList.size(); i++) {
-            WmsAcqInventoryInfo wmsAcqInventoryInfo = wmsList.get(i);
-            OmsAcqInventoryInfo omsAcqInventoryInfo = omsAcqInventoryInfoMap.get(wmsAcqInventoryInfo.getMerchSn());
-
-            CusAcqInventoryInfo03 cusAcqInventoryInfo03 = new CusAcqInventoryInfo03();
-            cusAcqInventoryInfo03.setGoodsName(wmsAcqInventoryInfo.getGoodsName());
-            //wms codeTs(商品编码) = 料件号,sku
-            cusAcqInventoryInfo03.setCodeTs(wmsAcqInventoryInfo.getCodeTs());
-            cusAcqInventoryInfo03.setSkuNo(wmsAcqInventoryInfo.getCodeTs());
-            cusAcqInventoryInfo03.setGoodsId(wmsAcqInventoryInfo.getCodeTs());
-
-            cusAcqInventoryInfo03.setGUnit(wmsAcqInventoryInfo.getgUnit());
-            cusAcqInventoryInfo03.setgQty(wmsAcqInventoryInfo.getgQty());
-
-            //法定单位,法定数量暂时未查询
-            cusAcqInventoryInfo03.setLegalUnit(wmsAcqInventoryInfo.getLegalUnit());
-            cusAcqInventoryInfo03.setLegalQty(wmsAcqInventoryInfo.getLegalQty());
-
-            cusAcqInventoryInfo03.setGoodsModel(wmsAcqInventoryInfo.getGoodsModel());
-            cusAcqInventoryInfo03.setLocalEmsNo(Dict.localEmsNo);
-            cusAcqInventoryInfo03.setOwnerCode(omsAcqInventoryInfo.getOwnerCode());
-            cusAcqInventoryInfo03.setOwnerName(omsAcqInventoryInfo.getOwnerName());
-
-            cusAcqInventoryInfo03.setStoreCompanyName(Dict.storeCompanyName);
-            cusAcqInventoryInfo03.setStoreUscCode(Dict.storeUscCode);
-            cusAcqInventoryInfo03.setStoreCustomsCode(Dict.storeCustomsCode);
-            cusAcqInventoryInfo03.setStoreCode(Dict.storeCode);
-            cusAcqInventoryInfo03.setCreateTime(LocalDateTime.now());
-            cusAcqInventoryInfo03List.add(cusAcqInventoryInfo03);
+            try {
+                WmsAcqInventoryInfo wmsAcqInventoryInfo = wmsList.get(i);
+                OmsAcqInventoryInfo omsAcqInventoryInfo = omsAcqInventoryInfoMap.get(wmsAcqInventoryInfo.getMerchSn());
+
+                CusAcqInventoryInfo03 cusAcqInventoryInfo03 = new CusAcqInventoryInfo03();
+                cusAcqInventoryInfo03.setGoodsName(wmsAcqInventoryInfo.getGoodsName());
+                //wms codeTs(商品编码) = 料件号,sku
+                cusAcqInventoryInfo03.setCodeTs(wmsAcqInventoryInfo.getCodeTs());
+                cusAcqInventoryInfo03.setSkuNo(wmsAcqInventoryInfo.getCodeTs());
+                cusAcqInventoryInfo03.setGoodsId(wmsAcqInventoryInfo.getCodeTs());
+
+                cusAcqInventoryInfo03.setGUnit(wmsAcqInventoryInfo.getgUnit());
+                cusAcqInventoryInfo03.setgQty(wmsAcqInventoryInfo.getgQty());
+
+                //法定单位,法定数量暂时未查询
+                cusAcqInventoryInfo03.setLegalUnit(wmsAcqInventoryInfo.getLegalUnit());
+                cusAcqInventoryInfo03.setLegalQty(wmsAcqInventoryInfo.getLegalQty());
+
+                cusAcqInventoryInfo03.setGoodsModel(wmsAcqInventoryInfo.getGoodsModel());
+                cusAcqInventoryInfo03.setLocalEmsNo(Dict.localEmsNo);
+
+                cusAcqInventoryInfo03.setOwnerCode(omsAcqInventoryInfo.getOwnerCode());
+                cusAcqInventoryInfo03.setOwnerName(omsAcqInventoryInfo.getOwnerName());
+
+                cusAcqInventoryInfo03.setStoreCompanyName(Dict.storeCompanyName);
+                cusAcqInventoryInfo03.setStoreUscCode(Dict.storeUscCode);
+                cusAcqInventoryInfo03.setStoreCustomsCode(Dict.storeCustomsCode);
+                cusAcqInventoryInfo03.setStoreCode(Dict.storeCode);
+                cusAcqInventoryInfo03.setCreateTime(LocalDateTime.now());
+                cusAcqInventoryInfo03List.add(cusAcqInventoryInfo03);
+
+            }catch (Exception e){
+                logger.error("货物库存组装cus数据系统异常", e);
+            }finally {
+                continue;
+            }
         }
         logger.info("转换oms,wms 组装cus数据结束===========================");
         return cusAcqInventoryInfo03List;

+ 3 - 3
src/main/java/com/emato/cus/supervise/domain/WmsAcqGoodsMove.java

@@ -45,7 +45,7 @@ public class WmsAcqGoodsMove implements Serializable {
     private LocalDateTime modTime;
 
     private String taskType;
-    private String created;
+    private LocalDateTime created;
 
     public String getId() {
         return id;
@@ -239,11 +239,11 @@ public class WmsAcqGoodsMove implements Serializable {
         this.taskType = taskType;
     }
 
-    public String getCreated() {
+    public LocalDateTime getCreated() {
         return created;
     }
 
-    public void setCreated(String created) {
+    public void setCreated(LocalDateTime created) {
         this.created = created;
     }
 }

+ 2 - 3
src/main/java/com/emato/cus/supervise/schedule/AcqGoodsMoveSchedule.java

@@ -29,13 +29,12 @@ public class AcqGoodsMoveSchedule {
      * 货物库位移动数据
      */
     //每月1号开始,每天12,18点执行各1次,共2次
-    //@Scheduled(cron = "0 0 12,18 1/1 * ?")
-    @Scheduled(cron = "0/10 * * * * ? ")
+    @Scheduled(cron = "0 0 12,18 1/1 * ?")
+//    @Scheduled(cron = "0/10 * * * * ? ")
     public void timerUp() {
         logger.info("==================== 货物库位移动数据:上架:监控数据读取开始 ====================");
         String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
         logger.info("--- 任务开始时间: {}", begDateTime);
-
         acqGoodsMoveUpBiz.task();
 
 

+ 21 - 12
src/main/resources/application.yml

@@ -21,13 +21,16 @@ spring:
   # 数据源
   datasource:
     primary:
-      # 数据源zaxxer HikariCP
+      # 数据源zaxxer HikariCP 读取通天晓数据库
       type: com.zaxxer.hikari.HikariDataSource
       driver-class-name: org.mariadb.jdbc.Driver
       # url: jdbc:sqlserver://120.24.12.161:60001;DatabaseName=qhwms
-      url: jdbc:mysql://127.0.0.1:3306/wms_test?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-      username: root
-      password: root
+#      url: jdbc:mysql://127.0.0.1:3306/wms_test?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#      username: root
+#      password: root
+      url: jdbc:mysql://120.25.147.93:60002/wms_test?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+      username: qhdsrds
+      password: CcopQ33^$
       # hikari连接池配置
       hikari:
         readOnly: true
@@ -38,12 +41,15 @@ spring:
         maximumPoolSize: 3
         minimumIdle: 3
     second:
-      # 数据源zaxxer HikariCP
+      # 数据源zaxxer HikariCP 写入数据库
       type: com.zaxxer.hikari.HikariDataSource
       driver-class-name: org.mariadb.jdbc.Driver
-      url: jdbc:mysql://127.0.0.1:3306/wms_data?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-      username: root
-      password: root
+#      url: jdbc:mysql://127.0.0.1:3306/wms_data?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#      username: root
+#      password: root
+      url: jdbc:mysql://192.168.1.233:3306/wms_jk?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+      username: wmsjk
+      password: wmsjk123
       # hikari连接池配置
       hikari:
         connectionTimeout: 10000
@@ -53,12 +59,15 @@ spring:
         maximumPoolSize: 10
         minimumIdle: 3
     third:
-          # 数据源zaxxer HikariCP
+          # 数据源zaxxer HikariCP 读取oms
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: org.mariadb.jdbc.Driver
-          url: jdbc:mysql://127.0.0.1/oms_write?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
-          username: root
-          password: root
+#          url: jdbc:mysql://127.0.0.1/oms_write?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#          username: root
+#          password: root
+          url: jdbc:mysql://120.76.84.45:3306/oms_write?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+          username: ceshi
+          password: abc-123
           # hikari连接池配置
           hikari:
             connectionTimeout: 10000