yaozhixue il y a 1 an
Parent
commit
39d1000942

+ 12 - 4
src/main/java/com/zfire/jiasm/syncdata/service/impl/AddInstallBusinessImpl.java

@@ -244,7 +244,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         // 生成工单
         return createInstallOrder(item, orderProducts, oiolList, odfs, synReqIds,
                 synReqFkMxIds, synReqYfYyIds, faGreeSms, orderAppeal, its,
-                orderBase, orderWorker, fyqd, orderInstall, getpjSynReqId, flag);
+                orderBase, orderWorker, fyqd, orderInstall, getpjSynReqId, flag,oids );
     }
 
     @NotNull
@@ -254,7 +254,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
                                        List<Long> synReqYfYyIds, List<FaGreeSms> faGreeSms, List<OrderAppeal> orderAppeal,
                                        List<ItfGreeToFaDownloadTaskList> its, OrderBase orderBase, OrderWorker orderWorker,
                                        List<ItfTblAzAssignFeeDownload> fyqd,
-                                       OrderInstall orderInstall, List<Long> getpjSynReqId, Boolean flag) throws Exception {
+                                       OrderInstall orderInstall, List<Long> getpjSynReqId, Boolean flag,
+                                       List<OrderInstallDetail> oids) throws Exception {
         // 创建工单
         OrderAddBeanDTO createOrder = new OrderAddBeanDTO();
         // 工单机型
@@ -273,7 +274,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         if (respone.getCode()==200){
             // 安装工单数据落本地表
             addOrderDataApi(item.getSynReqId(), synReqIds, synReqFkMxIds, synReqYfYyIds, fyqd, getpjSynReqId,
-                    faGreeSms, orderAppeal, its, odfs, oiolList);
+                    faGreeSms, orderAppeal, its, odfs, oiolList, oids);
             return Boolean.TRUE;
         } else {
             String msg = publicService.getErrormessage(respone);
@@ -554,7 +555,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
                                 List<ItfTblAzAssignFeeDownload> fyqd, List<Long> getpjSynReqId,
                                 List<FaGreeSms> faGreeSms,List<OrderAppeal> orderAppeal,
                                 List<ItfGreeToFaDownloadTaskList> its,
-                                List<OrderDetailFile> odfs, List<OrderInstallOperatingLog> oiolList) {
+                                List<OrderDetailFile> odfs, List<OrderInstallOperatingLog> oiolList,
+                                List<OrderInstallDetail> oids) {
         // 工单基础表
         // 工单扩展信息
         // 工单师傅表
@@ -571,6 +573,12 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
             synReqIds.clear();
         }
 
+        // 采集明细
+        /*if (oids.size()>0){
+            orderInstallDetailService.saveBatch(oids);
+            oids.clear();
+        }*/
+
         // 同步新增操作日志表
         if (oiolList.size()>0){
             orderInstallOperatingLogService.saveBatch(oiolList);

+ 17 - 9
src/main/java/com/zfire/jiasm/syncdata/service/impl/DetailDownloadServiceImpl.java

@@ -215,37 +215,45 @@ public class DetailDownloadServiceImpl implements DetailDownloadService {
 	public void process(String downloadTaskNo, int downloadTaskType, String pgguid, Map<String, List<SysDict>> sysDictRefDLMap) {
 		if (downloadTaskType == 2201){
 			// 安装工单采集数据下载(家用空调)	TL_SynDataFrom_tbl_az_wgmx_jykt
+			// 安装工单主表的order_base pgguid OK
 			processOrderInstallDetailJ(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 220101){
 			// 安装工单采集附件表数据下载(家用空调)	TL_SynDataFrom_tbl_az_wgmx_jykt_child
+			// pgguid = 家用空调完工明细(itf_tbl_az_wgmx_jykt_download)的pgwcmxid ok
 			processJyktFj(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 2202){
 			// 安装工单采集数据下载(商用空调)	TL_SynDataFrom_tbl_az_wgmx_sykt
+			// 安装工单主表的order_base pgguid OK
 			processOrderInstallDetailS(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 220201){
 			//  安装工单采集附件表数据下载(商用空调) TL_SynDataFrom_tbl_az_wgmx_sykt_child
+			// pgguid = 商用空调完工明细itf_tbl_az_wgmx_sykt_download的pgwcmxid ok
 			processSyktFjAndTM(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 2203){
 			// 安装工单采集数据下载(其他)	TL_SynDataFrom_tbl_az_wgmx_qita
+			// 安装工单主表的order_base pgguid OK
 			processOrderInstallDetailO(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 220301){
 			// 安装工单采集附件表数据下载(其他) 	TL_SynDataFrom_tbl_az_wgmx_qita_child
+			// pgguid = 其他完工明细itf_tbl_az_wgmx_qita_download.pgwcmxid ok
 			processOktFj(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 2204){
 			// 以旧换新鉴定单 itf_tbl_yjhx_jdd_download  TL_SynDataFrom_tbl_yjhx_jdd
+			// pgguid 为安装工单下载主表的itf_tbl_az_assign_lc_ls_download pgguid OK
 			processYjhxJdd(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 2205){
 			// 以旧换新旧机信息 itf_tbl_trade_new_for_old_download  TL_SynDataFrom_tbl_trade_new_for_old
+			// pgguid 为安装工单下载主表的itf_tbl_az_assign_lc_ls_download pgguid OK
 			processOldForNewProduct(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 2206){
 			// 安装工单子表数据阅读信息 itf_tbl_az_assign_xzyd_download  TL_SynDataFrom_tbl_az_assign_xzyd
-			// pgguid 为安装工单下载主表的pgguid
+			// pgguid 为安装工单下载主表的itf_tbl_az_assign_lc_ls_download pgguid OK
 			processInformatino(downloadTaskNo, pgguid, sysDictRefDLMap);
 		} else if (downloadTaskType == 6601){
-			// 维修工单二子表下载	TL_SynDataFrom_tbl_wxjs_jykt
+			// 维修工单二子表下载	TL_SynDataFrom_tbl_wxjs_jykt OK
 			processWxjsJykt(downloadTaskNo, pgguid);
 		} else if (downloadTaskType == 660101){
-			// 维修工单三子表下载  TL_SynDataFrom_tbl_wxjs_jykt_child
+			// 维修工单三子表下载  TL_SynDataFrom_tbl_wxjs_jykt_child OK
 			processSix(downloadTaskNo, pgguid);
 		}
 	}
@@ -899,13 +907,13 @@ public class DetailDownloadServiceImpl implements DetailDownloadService {
 		// 提取采集数据
 		oids = orderInstallDetailService.lambdaQuery()
 				.select(OrderInstallDetail::getPgwcmxid,OrderInstallDetail::getId)
-				.eq(OrderInstallDetail::getPgguid,pgguid).list();
+				.eq(OrderInstallDetail::getPgwcmxid,pgguid).list();
 		oidsMap = oids.stream().collect(Collectors.groupingBy(OrderInstallDetail::getPgwcmxid));
 
 		if (!CollectionUtils.isEmpty(fjs)){
 			// 提取工单数据
 			OrderBase order = orderBaseService.lambdaQuery()
-					.eq(OrderBase::getPgguid,pgguid)
+					.eq(OrderBase::getId,oids.get(0).getOrderBaseId())
 					.last("limit 1").one();
 			if (order!=null){
 				// 提取现有的采集附件数据
@@ -954,13 +962,13 @@ public class DetailDownloadServiceImpl implements DetailDownloadService {
 		// 提取采集数据
 		oids = orderInstallDetailService.lambdaQuery()
 				.select(OrderInstallDetail::getPgwcmxid,OrderInstallDetail::getId)
-				.eq(OrderInstallDetail::getPgguid,pgguid).list();
+				.eq(OrderInstallDetail::getPgwcmxid,pgguid).list();
 		oidsMap = oids.stream().collect(Collectors.groupingBy(OrderInstallDetail::getPgwcmxid));
 
 		if (!CollectionUtils.isEmpty(tms)){
 			// 提取工单数据
 			OrderBase order = orderBaseService.lambdaQuery()
-					.eq(OrderBase::getPgguid,pgguid)
+					.eq(OrderBase::getId,oids.get(0).getOrderBaseId())
 					.last("limit 1").one();
 			if (order!=null){
 				// 提取现有的条码数据
@@ -1008,13 +1016,13 @@ public class DetailDownloadServiceImpl implements DetailDownloadService {
 		// 提取采集数据
 		oids = orderInstallDetailService.lambdaQuery()
 				.select(OrderInstallDetail::getPgwcmxid,OrderInstallDetail::getId)
-				.eq(OrderInstallDetail::getPgguid,pgguid).list();
+				.eq(OrderInstallDetail::getPgwcmxid,pgguid).list();
 		oidsMap = oids.stream().collect(Collectors.groupingBy(OrderInstallDetail::getPgwcmxid));
 
 		if (!CollectionUtils.isEmpty(kts)){
 			// 提取工单数据
 			OrderBase order = orderBaseService.lambdaQuery()
-					.eq(OrderBase::getPgguid,pgguid)
+					.eq(OrderBase::getId,oids.get(0).getOrderBaseId())
 					.last("limit 1").one();
 			if (order!=null){
 				// 提取现有的采集附件数据