yaozhixue 1 year ago
parent
commit
ca24be8883

+ 1 - 1
src/main/java/com/zfire/jiasm/syncdata/download/basedata/BaseDataTask.java

@@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
-// 合到一个线程中
+// 合到一个线程中 再次分线程
 
 @Slf4j
 @Component

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

@@ -10,6 +10,7 @@ import com.zfire.jiasm.syncdata.data.Token;
 import com.zfire.jiasm.syncdata.plus.entity.*;
 import com.zfire.jiasm.syncdata.plus.service.*;
 import com.zfire.jiasm.syncdata.service.InstallDownloadService;
+import com.zfire.jiasm.syncdata.service.PublicService;
 import com.zfire.jiasm.syncdata.utils.DataUtil;
 import com.zfire.jiasm.syncdata.utils.HttpUtil;
 import com.zfire.jiasm.syncdata.utils.JSONResult;
@@ -52,7 +53,8 @@ public class InstallDownloadServiceImpl implements InstallDownloadService {
     ItfTblAzAssignSatisfactionDownloadService itfTblAzAssignSatisfactionDownloadService;
     @Resource
     ItfTblAzAssignPlatformDownloadService itfTblAzAssignPlatformDownloadService;
-
+    @Resource
+    PublicService publicService;
 
 
     @Override
@@ -62,7 +64,7 @@ public class InstallDownloadServiceImpl implements InstallDownloadService {
 
         log.info("开始下载安装工单: \uF0B7{}",sdf.format(new Date()));
 
-        String downloadBatchNo = UUID.randomUUID().toString();
+        String downloadBatchNo = publicService.getUUID();
         // 按批次-获取数据
         JSONArray datas = getDownloadData(downloadBatchNo, ESInstallEnum.SALES_WEBSIT_NUMBER.getCode());
 
@@ -79,7 +81,7 @@ public class InstallDownloadServiceImpl implements InstallDownloadService {
                 // 提取主表数据 主表无数据时不处理
                 JSONArray mainTableData = sheet.getJSONArray("TBL_AZ_ASSIGN_LC_LS");
                 if (mainTableData != null && mainTableData.size() > 0) {
-                    String downloadTaskNo = UUID.randomUUID().toString();
+                    String downloadTaskNo = publicService.getUUID();
                     // 最后修改日期不能为空处理
                     DataUtil.initLastModifiedDate(mainTableData.getJSONObject(0),"lastModifiedDate");
                     // 添加数据

+ 6 - 6
src/main/java/com/zfire/jiasm/syncdata/service/impl/InstallProduceDataUploadServiceImpl.java

@@ -636,7 +636,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
             if (detailone != null && StringUtils.isEmpty(file.getFjguid())){
                 OrderDetailFile upf = new OrderDetailFile();
                 upf.setId(file.getId());
-                upf.setFjguid(UUID.randomUUID().toString());
+                upf.setFjguid(publicService.getUUID());
                 orderDetailFileService.updateById(upf);
             }
         }
@@ -651,7 +651,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
             InstalDetailCode upcode = new InstalDetailCode();
             upcode.setOrderNo(orderBase.getId());
             upcode.setPgguId(orderBase.getPgguid());
-            upcode.setTmguid(UUID.randomUUID().toString());
+            upcode.setTmguid(publicService.getUUID());
             codeOrderInstallDetailMapper.updateCodePgguid(upcode);
         }
     }
@@ -789,7 +789,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
                     websitSH = publicService.ptshwdToshshwd(addms.getFjwd(), orderBase.getMainId());
                     addms.setFjwd(websitSH.getWdId());
 
-                    String id = UUID.randomUUID().toString();
+                    String id = publicService.getUUID();
                     if (id.length()>32){
                         addms.setSynTaskNo(id.substring(0,32));
                     } else {
@@ -797,7 +797,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
                     }
                     addms.setFsma(publicService.getfsma(addms.getSjid()));
                     addms.setFsnr("尊敬的用户:请对本次服务评价:满意回复1;一般回复2;不满意回复3。并注明原因!关注官微“格力售后服务”,为您提供更优质服务!");
-                    addms.setDxguid(UUID.randomUUID().toString());
+                    addms.setDxguid(publicService.getUUID());
                     return publicService.addItfMessagehuifangentity(addms,orderBase.getOrderType(),6);
                 }
             } else if ((orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
@@ -812,7 +812,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
                     if (addms==null){
                         return Boolean.TRUE;
                     }
-                    String id = UUID.randomUUID().toString();
+                    String id = publicService.getUUID();
                     if (id.length()>32){
                         addms.setSynTaskNo(id.substring(0,32));
                     } else {
@@ -1560,7 +1560,7 @@ public class InstallProduceDataUploadServiceImpl implements InstallProduceDataUp
     public void upCerrentRec(OrderInstallDetail detail) {
         OrderInstallDetail updetail = new OrderInstallDetail();
         updetail.setId(detail.getId());
-        updetail.setPgwcmxid(UUID.randomUUID().toString());
+        updetail.setPgwcmxid(publicService.getUUID());
         orderInstallDetailService.updateById(updetail);
     }
 

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

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.zfire.jiasm.syncdata.data.Token;
 import com.zfire.jiasm.syncdata.plus.entity.ItfGreeToFaRepairSynRule;
 import com.zfire.jiasm.syncdata.plus.service.ItfGreeToFaRepairSynRuleService;
+import com.zfire.jiasm.syncdata.service.PublicService;
 import com.zfire.jiasm.syncdata.service.RepairDownloadService;
 import com.zfire.jiasm.syncdata.utils.DataUtil;
 import com.zfire.jiasm.syncdata.utils.HttpUtil;
@@ -47,6 +48,8 @@ public class RepairDownloadServiceImpl implements RepairDownloadService {
     @Autowired
     private JdbcTemplate jdbcTemplate;
     private Set<String> nullDateCols;
+    @Resource
+    PublicService publicService;
 
 
 
@@ -83,7 +86,7 @@ public class RepairDownloadServiceImpl implements RepairDownloadService {
 
             // 销售公司编码
             String salesWebsitNumber = synRule.getSalesWebsitNumber();
-            String downloadBatchNo = UUID.randomUUID().toString();
+            String downloadBatchNo = publicService.getUUID();
             // 获取数据
             JSONArray datas = downloadData(downloadBatchNo, salesWebsitNumber);
 
@@ -97,7 +100,7 @@ public class RepairDownloadServiceImpl implements RepairDownloadService {
                     // 维修工单主表必须存在
                     JSONObject mainTableData = sheet.getJSONObject("tblAssign");
                     if (mainTableData != null) {
-                        String downloadTaskNo = UUID.randomUUID().toString();
+                        String downloadTaskNo = publicService.getUUID();
                         DataUtil.initLastModifiedDate(mainTableData,"last_modified_date");
                         addRepairData(mainTableData, downloadBatchNo, downloadTaskNo, sheet,
                                 srcTabnameArray, srcTabColListArray, destTabNameArray, destTabColListArray,

+ 56 - 21
src/main/java/com/zfire/jiasm/syncdata/service/impl/RepairProduceDataUploadServiceImpl.java

@@ -622,7 +622,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
     public boolean generateData(Brand brand, OrderBase orderBase) {
         // 工单,采集表id,uuid, TL_fa_order_repair_detail_js
         // j_syn_task_no 统一uuid
-        String j_syn_task_no = UUID.randomUUID().toString();
+        String j_syn_task_no = publicService.getUUID();
         // 提取所有采集数据
         List<OrderRepairDetail> ords = orderRepairDetailService.lambdaQuery()
                 .eq(OrderRepairDetail::getOrderBaseId, orderBase.getId()).list();
@@ -679,7 +679,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 orderBase.setPgguid(newDykh);
             }
             if (StringUtils.isEmpty(orderBase.getPgguid())){
-                up.setPgguid(UUID.randomUUID().toString());
+                up.setPgguid(publicService.getUUID());
                 orderBase.setPgguid(up.getPgguid());
             }
             orderBaseService.updateById(up);
@@ -1073,10 +1073,12 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         // 格力总部数据采集主键为空时代表为公司采集的数据,brandwxjsguid填写UUID
         updateOrderRepairDetailWxjsguid(orderBase.getId());
 
+        // 修改 wxjsmxguid
+        updateOrderRepairDetailWxjsmxguid(orderBase);
+
         // 采集明细表全表更新pgid = brand_pgid
         upBrandPgid(orderBase);
 
-
         // 故障现象原因序
         upOrderRepairDetailReasonOutId(orderBase.getId());
 
@@ -1092,6 +1094,27 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         return checkOrderDetailFile(orderBase.getId());
     }
 
+    private void updateOrderRepairDetailWxjsmxguid(OrderBase orderBase) {
+        List<OrderRepairDetail> upList = new ArrayList<>();
+        // 看有无需要修改的数据
+        List<OrderRepairDetail> detaillistz = orderRepairDetailService.lambdaQuery()
+                .eq(OrderRepairDetail::getOrderBaseId, orderBase.getId())
+                .eq(OrderRepairDetail::getWxjsmxguid, "").list();
+        if (CollectionUtils.isEmpty(detaillistz)){
+            return;
+        }
+        for (OrderRepairDetail i:detaillistz){
+            i.setWxjsmxguid(publicService.getUUID());
+            upList.add(i);
+        }
+        // 修改序
+        if (upList.size()>0){
+            orderRepairDetailService.updateBatchById(upList);
+            upList.clear();
+        }
+        detaillistz.clear();
+    }
+
     public void upOrderDetailFileOutId(String orderBaseId) {
         List<OrderDetailFile> upList = new ArrayList<>();
         // 查看是否有需要修改的数据
@@ -1159,9 +1182,9 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
             if (ite.getOutId() == 0){
                 outId++;
                 ite.setOutId(outId);
-                ite.setXxyyguid(IdWorker.getIdStr());
+                ite.setXxyyguid(publicService.getUUID());
                 if (StringUtils.isEmpty(ite.getWxjsguid())){
-                    ite.setWxjsguid(UUID.randomUUID().toString());
+                    ite.setWxjsguid(publicService.getUUID());
                 }
 
                 upList.add(ite);
@@ -1210,7 +1233,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         for (OrderRepairDetail i:detaillistz){
             OrderRepairDetail u = new OrderRepairDetail();
             MyBeanUtils.copyProperties(i,u);
-            u.setBrandWxjsguid(UUID.randomUUID().toString());
+            u.setBrandWxjsguid(publicService.getUUID());
             upList.add(u);
         }
         // 修改序
@@ -1254,10 +1277,10 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                     if (StringUtils.isEmpty(r.getXxyyguid()) || StringUtils.isEmpty(r.getWxjsguid())) {
                         OrderRepairDetailReason up = new OrderRepairDetailReason();
                         if (StringUtils.isEmpty(r.getXxyyguid())) {
-                            r.setXxyyguid(UUID.randomUUID().toString());
+                            r.setXxyyguid(publicService.getUUID());
                         }
                         if (StringUtils.isEmpty(r.getWxjsguid())) {
-                            r.setWxjsguid(UUID.randomUUID().toString());
+                            r.setWxjsguid(publicService.getUUID());
                         }
                         ulist.add(up);
                     }
@@ -1486,12 +1509,12 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                 MyBeanUtils.copyProperties(file,upf);
                 // 修改附件的fjguid
                 if (StringUtils.isEmpty(file.getFjguid())){
-                    upf.setFjguid(UUID.randomUUID().toString());
+                    upf.setFjguid(publicService.getUUID());
                     file.setFjguid(upf.getFjguid());
                 }
                 // 修改采集明细序号 wxmxguid
                 if (StringUtils.isEmpty(file.getPgwcmxid())){
-                    upf.setPgwcmxid(UUID.randomUUID().toString());
+                    upf.setPgwcmxid(publicService.getUUID());
                 }
                 upodfs.add(upf);
             }
@@ -1630,7 +1653,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         } else if (StringUtils.isNotEmpty(r.getName())){
             add.setMshu(r.getName());
         }
-        add.setWxjsmxguid(r.getWxjsguid());
+        add.setWxjsmxguid(detail.getWxjsmxguid());
         add.setCjsj(r.getCreateTime());
         add.setXxyyhmc(r.getName());
         jyktus.add(add);
@@ -1652,7 +1675,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         } else if (StringUtils.isNotEmpty(r.getName())){
             add.setMshu(r.getName());
         }
-        add.setWxjsmxguid(r.getWxjsguid());
+        add.setWxjsmxguid(detail.getWxjsmxguid());
         add.setCjsj(r.getCreateTime());
         add.setXxyyhmc(r.getName());
         add.setSynStatus(44);
@@ -1664,11 +1687,11 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         OrderRepairDetailReason up = new OrderRepairDetailReason();
         up.setId(r.getId());
         if (StringUtils.isEmpty(r.getXxyyguid())){
-            up.setXxyyguid(UUID.randomUUID().toString());
+            up.setXxyyguid(publicService.getUUID());
             r.setXxyyguid(up.getXxyyguid());
         }
         if (StringUtils.isEmpty(r.getWxjsguid())){
-            up.setWxjsguid(UUID.randomUUID().toString());
+            up.setWxjsguid(publicService.getUUID());
             r.setWxjsguid(up.getWxjsguid());
         }
         orderRepairDetailReasonService.updateById(up);
@@ -1779,7 +1802,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
             // 修改uuid
             OrderRepairDetail up = new OrderRepairDetail();
             up.setId(detail.getId());
-            up.setBrandWxjsguid(UUID.randomUUID().toString());
+            up.setBrandWxjsguid(publicService.getUUID());
             orderRepairDetailService.updateById(up);
             detail.setBrandWxjsguid(up.getBrandWxjsguid());
         }
@@ -1814,6 +1837,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         orderPar.setOrderNo(sourceData.getOrderNo());
         ItfTblAssignUpload itass = gdOrderBaseMapper.getItfTblAssignUpload(orderPar);
 
+
         // 信息渠道id 取的是info_channel 有问题
         itass.setUploadTaskSynReqId(taskId);
         // 部分参数单独处理
@@ -1889,7 +1913,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                     websitSH = publicService.ptshwdToshshwd(addms.getFjwd(), orderBase.getMainId());
                     addms.setFjwd(websitSH.getWdId());
 
-                    String id = UUID.randomUUID().toString();
+                    String id = publicService.getUUID();
                     if (id.length()>32){
                         addms.setSynTaskNo(id.substring(0,32));
                     } else {
@@ -1898,7 +1922,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
 
                     addms.setFsma(publicService.getfsma(addms.getSjid()));
                     addms.setFsnr("尊敬的用户:请对本次服务评价:满意回复1;一般回复2;不满意回复3。并注明原因!关注官微“格力售后服务”,为您提供更优质服务!");
-                    addms.setDxguid(UUID.randomUUID().toString());
+                    addms.setDxguid(publicService.getUUID());
                     addms.setSjid(orderBase.getUserMobile().replace(" ",""));
                     publicService.addItfMessagehuifangentity(addms,orderBase.getOrderType(),6);
                 }
@@ -1940,7 +1964,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
                         websitSH = publicService.ptshwdToshshwd(addms.getFjwd(), orderBase.getMainId());
                         addms.setFjwd(websitSH.getWdId());
 
-                        String id = UUID.randomUUID().toString();
+                        String id = publicService.getUUID();
                         if (id.length()>32){
                             addms.setSynTaskNo(id.substring(0,32));
                         } else {
@@ -1949,7 +1973,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
 
                         addms.setFsma(publicService.getfsma(addms.getSjid()));
                         addms.setFsnr("尊敬的用户:请对本次服务评价:满意回复1;一般回复2;不满意回复3。并注明原因!关注官微“格力售后服务”,为您提供更优质服务!");
-                        addms.setDxguid(UUID.randomUUID().toString());
+                        addms.setDxguid(publicService.getUUID());
                         publicService.addItfMessagehuifangentity(addms,orderBase.getOrderType(),6);
                     }
                 }
@@ -2035,6 +2059,17 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
         } else {
             itass.setXqxiaolei(or.getDemandSmallTypeId());
         }
+
+        if (orderBase.getOverTime()!=null){
+            itass.setWcsj(orderBase.getOverTime());
+            itass.setFwrybwgsj(orderBase.getOverTime());
+        } else {
+            if (orderBase.getUpdateTime()!=null){
+                itass.setWcsj(orderBase.getUpdateTime());
+                itass.setFwrybwgsj(orderBase.getUpdateTime());
+            }
+        }
+
     }
 
     public void setYhyyczsj(ItfTblAssignUpload itass, String orderNo) {
@@ -2287,7 +2322,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
     public void upOrderBasePgguid(OutJiasmToGreeUploadTaskList sourceData, OrderBase orderBase) {
         if (StringUtils.isEmpty(orderBase.getPgguid()) || orderBase.getPgguid().equals("0")){
             OrderBase up = new OrderBase();
-            up.setPgguid(UUID.randomUUID().toString());
+            up.setPgguid(publicService.getUUID());
             QueryWrapper upWrapper = new QueryWrapper<OrderBase>()
                     .eq("id", sourceData.getOrderNo())
                     .and(wrapper->wrapper.isNull("pgguid")
@@ -2302,7 +2337,7 @@ public class RepairProduceDataUploadServiceImpl implements RepairProduceDataUplo
             orderBase.setPgid(newDykh);
         }
         if (StringUtils.isEmpty(orderBase.getPgguid()) || orderBase.getPgguid().equals("0")){
-            orderBase.setPgguid(UUID.randomUUID().toString());
+            orderBase.setPgguid(publicService.getUUID());
         }
 
         orderBase.updateById();

+ 2 - 2
src/main/resources/bootstrap-prd.properties

@@ -322,11 +322,11 @@ netfssc=TRUE
 netgzxc=TRUE
 netgzsc=TRUE
 #网点维修工 佛山销售|售后、广州销售|售后
-fsxwxgc=TRUE
+fsxwxgc=FALSE
 fsswxgc=TRUE
 gzxwxgc=TRUE
 gzswxgc=TRUE
-gfwwwc=TRUE
+gfwwwc=FALSE
 #类别大类、小类、系列、机型
 lbdlc=TRUE
 lbxlc=TRUE

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

@@ -80,7 +80,7 @@
                'guangfo' as last_modified_by,a.update_time as last_modified_date,
                b.brand_wxjsguid as wxjsguid,a.brand_file_path as wjlj,a.create_time as cjsj,
                a.file_type as tpms,a.file_path as wjnm,a.pgwcmxid as wxmxguid,
-               b.out_id as wxjsmxguid,a.repair_item_id as repairitemno,a.number as repairtroubleno
+               b.wxjsmxguid as wxjsmxguid,a.repair_item_id as repairitemno,a.number as repairtroubleno
         from order_detail_file a
                  left join order_repair_detail b on a.order_base_id = b.order_base_id and b.id=a.order_detail_id
         where a.order_base_id =  #{request.orderNo} and a.id =  #{request.id}

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

@@ -9,7 +9,7 @@
                a.update_time as last_modified_date,
                b.brand_wxjsguid as wxjsguid,ifnull(a.repair_item_id,'') as wxxmh,
                a.repair_item_name as mshu,ifnull(b.repair_fees,0) as wxfy,a.number as xxyyh,
-               a.xxyyguid,ifnull(a.wxjsguid,'') as wxjsmxguid,a.create_time as cjsj,ifnull(a.repair_item_name,'') as mshu,
+               b.wxjsmxguid as wxjsmxguid,a.create_time as cjsj,ifnull(a.repair_item_name,'') as mshu,
                a.repair_item_name as wxxmhmc,case b.flag when 'A' then '上门' else '送修' end as smorsx
         from order_repair_detail_reason a
                  left join order_repair_detail b on b.id=a.order_repair_detail_id
@@ -30,7 +30,7 @@
     </select>
 
     <select id="getItfTblWxjsPjmxJyktUpload" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblWxjsPjmxJyktUpload">
-        select a.out_id as fa_order_repair_part_info_id,ifnull(a.wxjsguid,'') as wxjsmxguid,
+        select a.out_id as fa_order_repair_part_info_id,b.wxjsmxguid as wxjsmxguid,
                'guangfo' as created_by,a.create_time as created_date,'guangfo' as last_modified_by,
                a.update_time as last_modified_date,b.brand_wxjsguid as wxjsguid,
                a.old_part_no as jpjbh,a.old_part_name as jpjmc,0 as jpjsl,0 as jpjdj,0 as jpjje,a.new_part_no as xpjbh,