yaozhixue 1 year ago
parent
commit
a87040333b

+ 5 - 5
src/main/java/com/zfire/jiasm/syncdata/service/impl/OrderBaseInstallCjOrWgServiceImpl.java

@@ -369,7 +369,7 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
     }
     }
 
 
 
 
-    private Boolean generateCJData(Brand brand, Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls) {
+    public Boolean generateCJData(Brand brand, Map<String, List<SysDictRef>> CategoryRefmap, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls) {
         // 工单状态order_status 6, 7, 9, 10 且为非预派工订单
         // 工单状态order_status 6, 7, 9, 10 且为非预派工订单
         if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
         if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G6.getCode()) ||
                 orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
                 orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
@@ -409,7 +409,7 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
         return Boolean.TRUE;
         return Boolean.TRUE;
     }
     }
 
 
-    private void getDetailCode(OrderBase orderBase, OrderInstallDetail detail, String mainName) {
+    public void getDetailCode(OrderBase orderBase, OrderInstallDetail detail, String mainName) {
         String oldFile ="";
         String oldFile ="";
         String newFile ="";
         String newFile ="";
 
 
@@ -457,7 +457,7 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
         }
         }
     }
     }
 
 
-    private void generateDetailCode(OrderBase orderBase, OrderInstallDetailCode code, String mainName) {
+    public void generateDetailCode(OrderBase orderBase, OrderInstallDetailCode code, String mainName) {
         // 采集条码表中的pgguid 统一改成工单基础表的pgguid
         // 采集条码表中的pgguid 统一改成工单基础表的pgguid
         /*InstalDetailCode upcode = new InstalDetailCode();
         /*InstalDetailCode upcode = new InstalDetailCode();
         upcode.setOrderNo(code.getOrderBaseId());
         upcode.setOrderNo(code.getOrderBaseId());
@@ -491,7 +491,7 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
     }
     }
 
 
     @Nullable
     @Nullable
-    private void getCJMXData(Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,
+    public void getCJMXData(Brand brand, OrderBase orderBase, ItfTblAzAssignLcLsUpload lcls,
                              OrderInstallDetail detail,String mainName) {
                              OrderInstallDetail detail,String mainName) {
 
 
         /*// 修改采集明细的序 pgwcmxid 生成格力总部-采集明细序号
         /*// 修改采集明细的序 pgwcmxid 生成格力总部-采集明细序号
@@ -709,7 +709,7 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
         return result;
         return result;
     }
     }
 
 
-    private Boolean getFeeUpload(OrderBase orderBase) {
+    public Boolean getFeeUpload(OrderBase orderBase) {
         // 根据辅材订单支付表存在支付时生成安装费用数据
         // 根据辅材订单支付表存在支付时生成安装费用数据
         List<OrderPayOutlayItem> pitems = orderPayOutlayItemService.lambdaQuery()
         List<OrderPayOutlayItem> pitems = orderPayOutlayItemService.lambdaQuery()
                 .eq(OrderPayOutlayItem::getOrderBaseId, orderBase.getId()).list();
                 .eq(OrderPayOutlayItem::getOrderBaseId, orderBase.getId()).list();

+ 13 - 5
src/main/java/com/zfire/jiasm/syncdata/service/impl/RepairProduceDataUploadServiceImpl.java

@@ -203,6 +203,14 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                         // 维修工单 基础表数据同步
                         // 维修工单 基础表数据同步
                         if (row.getTableName().equals("order_base") &&
                         if (row.getTableName().equals("order_base") &&
                                 row.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_REPAIR.getCode())){
                                 row.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_REPAIR.getCode())){
+
+                            // 提取工单数据
+                            OrderBase orderBase = orderBaseService.lambdaQuery()
+                                    .eq(OrderBase::getId, sourceData.getOrderNo()).one();
+                            if (orderBase !=null && orderBase.getUploadFlag()){
+                                // 增加初始化处理,不需要事务
+                                dataInit(sourceData, newDykh, orderBase);
+                            }
                             if (uploadTaskType==66){
                             if (uploadTaskType==66){
                                 generateItfTblAssignUpload(brand, sysDictRefXLMapXq, taskId,
                                 generateItfTblAssignUpload(brand, sysDictRefXLMapXq, taskId,
                                         sourceData, newDykh, row);
                                         sourceData, newDykh, row);
@@ -695,10 +703,10 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 return true;
                 return true;
             }
             }
             // 品牌方fileindex未获取上传被忽略
             // 品牌方fileindex未获取上传被忽略
-            if (StringUtils.isEmpty(file.getBrandFileIndex())){
+            if (StringUtils.isEmpty(file.getBrandFilePath())){
                 return true;
                 return true;
             }
             }
-            // 修改附件的fjguid
+           /* // 修改附件的fjguid
             if (StringUtils.isEmpty(file.getFjguid())){
             if (StringUtils.isEmpty(file.getFjguid())){
                 OrderDetailFile upf = new OrderDetailFile();
                 OrderDetailFile upf = new OrderDetailFile();
                 upf.setId(file.getId());
                 upf.setId(file.getId());
@@ -713,7 +721,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 upf.setPgwcmxid(UUID.randomUUID().toString());
                 upf.setPgwcmxid(UUID.randomUUID().toString());
                 orderDetailFileService.updateById(upf);
                 orderDetailFileService.updateById(upf);
                 file.setPgwcmxid(upf.getPgwcmxid());
                 file.setPgwcmxid(upf.getPgwcmxid());
-            }
+            }*/
             // 生成附件数据
             // 生成附件数据
             ItfTblWxjsFjJyktUpload fj = generateInstallCJDetailFile(orderBase, file);
             ItfTblWxjsFjJyktUpload fj = generateInstallCJDetailFile(orderBase, file);
             // 生成附件2表数据
             // 生成附件2表数据
@@ -758,7 +766,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 continue;
                 continue;
             }
             }
             // 修改 维修现象主键、维修明细主键
             // 修改 维修现象主键、维修明细主键
-            upxxyyguid(r);
+            // upxxyyguid(r);
             // 生成维修现象数据
             // 生成维修现象数据
             ItfTblWxjsXxyyJyktUpload add = generateJyktUT(item, r);
             ItfTblWxjsXxyyJyktUpload add = generateJyktUT(item, r);
             // 生成维修现象2表数据
             // 生成维修现象2表数据
@@ -921,7 +929,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 .eq(OrderBase::getId, sourceData.getOrderNo()).one();
                 .eq(OrderBase::getId, sourceData.getOrderNo()).one();
         if (orderBase !=null && orderBase.getUploadFlag()){
         if (orderBase !=null && orderBase.getUploadFlag()){
             // 增加初始化处理,不需要事务
             // 增加初始化处理,不需要事务
-            dataInit(sourceData, newDykh, orderBase);
+            // dataInit(sourceData, newDykh, orderBase);
 
 
             itfTblAssignUpload(brand, sysDictRefXLMapXq,taskId, sourceData, newDykh,row, orderBase);
             itfTblAssignUpload(brand, sysDictRefXLMapXq,taskId, sourceData, newDykh,row, orderBase);
         }
         }

+ 6 - 6
src/main/resources/mapper/DetailOrderInstallMapper.xml

@@ -9,7 +9,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'
@@ -44,7 +44,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'
@@ -80,7 +80,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'
@@ -115,7 +115,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'
@@ -150,7 +150,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'
@@ -185,7 +185,7 @@
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                e.ref_dict_code as xiid,IFNULL(e.ref_dict_name, '') as ximc,a.inside_number as jxmc,a.out_number as jxno,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                IFNULL(substr(a.inside_code, 1, 13), '') as njtm,'' as njtm2,
                case when a.out_code is null then ''
                case when a.out_code is null then ''
-                    when length(a.out_code)>13 then left(a.out_code,13) end as wjtm,
+                    when length(a.out_code)>13 then left(a.out_code,13) else a.out_code end as wjtm,
                '' as beiz,'' as installambient,
                '' as beiz,'' as installambient,
                case a.type when 'inside' 	then '更换内机'
                case a.type when 'inside' 	then '更换内机'
                            when 'out' 	then '更换外机'
                            when 'out' 	then '更换外机'

+ 2 - 2
src/main/resources/mapper/FileOrderDetailMapper.xml

@@ -16,14 +16,14 @@
         select id
         select id
         from order_detail_file
         from order_detail_file
         where order_base_id = #{request.orderNo} and
         where order_base_id = #{request.orderNo} and
-            (file_path is null or file_path = '' or brand_file_index is null or brand_file_index = '')
+            (file_path is null or file_path = '' or brand_file_path is null or brand_file_path = '')
     </select>
     </select>
 
 
     <select id="getIdReT" parameterType="com.zfire.jiasm.syncdata.parameter.InstallCJDetailFile" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderDetailFile">
     <select id="getIdReT" parameterType="com.zfire.jiasm.syncdata.parameter.InstallCJDetailFile" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderDetailFile">
         select id,order_detail_id
         select id,order_detail_id
         from order_detail_file
         from order_detail_file
         where order_base_id = #{request.orderNo} and file_type = #{request.type}  and
         where order_base_id = #{request.orderNo} and file_type = #{request.type}  and
-            (file_path is null or file_path = '' or brand_file_index is null or brand_file_index = '') limit 1
+            (file_path is null or file_path = '' or brand_file_path is null or brand_file_path = '') limit 1
     </select>
     </select>
 
 
     <select id="getFileUpload" parameterType="com.zfire.jiasm.syncdata.parameter.InstallCJDetailFile" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAzWgmxJyktFjUpload">
     <select id="getFileUpload" parameterType="com.zfire.jiasm.syncdata.parameter.InstallCJDetailFile" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAzWgmxJyktFjUpload">