yaozhixue 1 年之前
父节点
当前提交
3525ee8822
共有 1 个文件被更改,包括 11 次插入9 次删除
  1. 11 9
      src/main/java/com/zfire/jiasm/syncdata/service/impl/AddInstallBusinessImpl.java

+ 11 - 9
src/main/java/com/zfire/jiasm/syncdata/service/impl/AddInstallBusinessImpl.java

@@ -434,7 +434,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         OrderBase upInfo = getOrderBaseUp(old, item, newLCLS);
 
         // 以旧换新数据下载同步表
-        getOldForNewProductt(item, newLCLS,its,old);
+        getOldForNewProductt(item, newLCLS,its,old, upInfo);
 
         // 获取工单师傅信息来自于工单主表数据只有修改的情况
         OrderWorker own =getOrderWorkerUpdate(old.getId(), upInfo, newLCLS);
@@ -1075,17 +1075,19 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
     }
 
     private OrderWorker getOrderWorkerUpdate(String id, OrderBase upInfo, OrderBase newLCLS){
+        OrderWorker own = new OrderWorker();
+        Boolean uf = Boolean.FALSE;
+
         OrderWorker oow = orderWorkerService.lambdaQuery()
                 .eq(OrderWorker::getOrderBaseId,id)
                 .eq(OrderWorker::getOutWorkerSource,Boolean.FALSE)
                 .eq(OrderWorker::getIsMaster,Boolean.TRUE)
                 .last("limit 1").one();
-        OrderWorker own = new OrderWorker();
-        Boolean uf = Boolean.FALSE;
 
         if (upInfo !=null){
             OrderWorker newow = getOrderWorker(newLCLS);
             if (oow ==null){
+                // 工单中取师傅已存在直接返回
                 if (newow !=null){
                     return newow;
                 }
@@ -1093,10 +1095,10 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
             }
             // 工单师傅信息为空时用本地的师傅信息
             if (newow==null){
-                newLCLS.setWorkerId(own.getWorkerId());
-                newLCLS.setWorkerName(own.getWorkerName());
-                newLCLS.setWorkerMobile(own.getWorkerMobile());
-                newLCLS.setWorkerIdcard(own.getWorkerIdcard());
+                upInfo.setWorkerId(own.getWorkerId());
+                upInfo.setWorkerName(own.getWorkerName());
+                upInfo.setWorkerMobile(own.getWorkerMobile());
+                upInfo.setWorkerIdcard(own.getWorkerIdcard());
                 return null;
             }
 
@@ -2009,7 +2011,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
     }
 
     private void getOldForNewProductt(ItfTblAzAssignLcLsDownload item, OrderBase orderBase,
-                                      List<ItfGreeToFaDownloadTaskList> its, OrderBase old ) {
+                                      List<ItfGreeToFaDownloadTaskList> its, OrderBase old, OrderBase upInfo) {
         // 这里为新增是一定没下载的 无需判断状态值
         if((orderBase.getSaleType().equals(OrderTypeEnum.ORDER_SALE_TYPE1.getCode()) ||
                 orderBase.getSaleType().equals(OrderTypeEnum.ORDER_SALE_TYPE2.getCode()) ||
@@ -2021,7 +2023,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
             tl.setDownloadTaskType(2205);
             tl.setDownloadStatus(0);
             its.add(tl);
-            orderBase.setYjhxDownloadFlag(1);
+            upInfo.setYjhxDownloadFlag(1);
         }
 
         if(orderBase.getSaleType().equals(OrderTypeEnum.ORDER_SALE_TYPE1.getCode()) ||