yaozhixue 1 年之前
父节点
当前提交
c5d68dc028

+ 11 - 0
src/main/java/com/zfire/jiasm/syncdata/api/OrderAddBeanDTO.java

@@ -240,4 +240,15 @@ public class OrderAddBeanDTO {
     private Integer outCjDownloadFlag;
     // 源系统信息主键 京东商城用到该值做为销售单号回传使用
     private String externalPk;
+
+    // 师傅完工时间
+    private Date overTime;
+    // 师傅接单时间
+    private Date workerReceTime;
+    // 网点报完工时间
+    private Date websitOverTime;
+    // 关闭工单时间
+    private Date closeTime;
+    // 派单给师傅的时间
+    private Date dispatchTime;
 }

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

@@ -19,8 +19,9 @@ import java.util.Date;
 import java.util.List;
 
 /**定时执行一次 师傅端使用 两表配合使用 只需修改其中一个表
- * select * from itf_gree_to_fa_download_task;
+ * select * from itf_gree_to_fa_download_task;  - TL_fa_download_task_aftr过程向itf_gree_to_fa_syn_task_list表写数据 9002
  * select * from itf_gree_to_fa_syn_task_list
+ * TL_SynData_to_fa_order_repair_malfunction_and_project 过程处理
  */
 @Slf4j
 @Component

+ 1 - 1
src/main/java/com/zfire/jiasm/syncdata/download/order/InstallBusinessApiT.java

@@ -86,7 +86,7 @@ public class InstallBusinessApiT {
         lcls = itfTblAzAssignLcLsDownloadService.lambdaQuery()
                 .eq(ItfTblAzAssignLcLsDownload::getSynStatus, SynStatusEnum.UN_SYN.getCode())
                 .ge(ItfTblAzAssignLcLsDownload::getSynTimes, 2)
-                // .eq(ItfTblAzAssignLcLsDownload::getSynReqId,57290L)// 测试使
+                // .eq(ItfTblAzAssignLcLsDownload::getSynReqId,57290L)// 测试用
                 .orderByAsc(ItfTblAzAssignLcLsDownload::getSynReqId)
                 .list();
 

+ 1 - 1
src/main/java/com/zfire/jiasm/syncdata/download/order/RepairBusinessApi.java

@@ -77,7 +77,7 @@ public class RepairBusinessApi {
         // 提取待落本地表的数据
         repairRec = itfTblAssignDownloadService.lambdaQuery()
                 .eq(ItfTblAssignDownload::getSynStatus, 0)
-                // .eq(ItfTblAssignDownload::getSynReqId, 125555L)// 测试使
+                // .eq(ItfTblAssignDownload::getSynReqId, 125555L)// 测试用
                 .lt(ItfTblAssignDownload::getSynTimes, 2)
                 .orderByAsc(ItfTblAssignDownload::getSynReqId)
                 .list();

+ 1 - 1
src/main/java/com/zfire/jiasm/syncdata/download/order/RepairBusinessApiT.java

@@ -79,7 +79,7 @@ public class RepairBusinessApiT {
         // 提取待落本地表的数据
         repairRec = itfTblAssignDownloadService.lambdaQuery()
                 .eq(ItfTblAssignDownload::getSynStatus, 0)
-                // .eq(ItfTblAssignDownload::getSynReqId, 35484L)// 测试使
+                // .eq(ItfTblAssignDownload::getSynReqId, 35484L)// 测试用
                 .ge(ItfTblAssignDownload::getSynTimes, 2)
                 .orderByAsc(ItfTblAssignDownload::getSynReqId)
                 .list();

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

@@ -1565,8 +1565,8 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
     private OrderBase getOrderBaseUp(OrderBase old, ItfTblAzAssignLcLsDownload item, OrderBase lclsNew) {
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        log.info("平台表数据时间 {}",sdf.format(old.getUpdateTime()));
-        log.info("云售后表数据时间 {}",sdf.format(item.getLastModifiedDate()));
+        /*log.info("平台表数据时间 {}",sdf.format(old.getUpdateTime()));
+        log.info("云售后表数据时间 {}",sdf.format(item.getLastModifiedDate()));*/
 
         // 本地订单已关闭 且总部的最后修改时间在本地数据修改时间之前 不可修改
         /*if (old.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()) &&
@@ -1766,6 +1766,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         old.setRegion(lclsNew.getRegion());
         old.setExternalName2(lclsNew.getExternalName2());
         old.setOutCjDownloadFlag(lclsNew.getOutCjDownloadFlag());
+        old.setOverTime(lclsNew.getOverTime());
     }
 
 
@@ -2475,6 +2476,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
             // 追评评价时间
             orderBase.setSecondAppraiseTime(s.getCreatedDate());
         }
+        orderBase.updateById();
     }
 
     private void setOrderAppraisemessageSelf(OrderBase orderBase, ItfReceiveSms s) {

+ 41 - 11
src/main/java/com/zfire/jiasm/syncdata/service/impl/MasterDownloadServiceImpl.java

@@ -152,6 +152,7 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 
 
 
+	// 20231018 去除维修项目的小类去重判断
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void masterProcessData(String synTaskNo,Integer id) {
@@ -165,7 +166,7 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		//  清除 维修故障现象表、维修项目表
 		processDelete(brandRec);
 
-		// 处理空调 维修-产品故障基表下载记录 itf_tbl_wx_cpgz_download
+		// 处理空调 维修-产品故障基表下载记录 itf_tbl_wx_cpgz_download  TL_SynDataFrom_tbl_wx_cpgz_jykt
 		// 生成故障现象数据(repair_bug) 故障现象类型为家用空调及商用空调,通用的分两部分家用与商用 1-2
 		// 进行了大小类处理,但同步过来的数据并无大小类数据     OK
 		addItfTblWxCpgzDownloadOld(synTaskNo, brandRec);
@@ -173,7 +174,8 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		// 维修项目分类信息表 添加一条 家用空调
 		addRepairProjectType(1, "家用空调");
 
-		// 最后放在这里
+
+		// 最后放在这里  TL_SynDataFrom_tbl_wx_wxxmjc
 		// 维修项目基础数据处理 生成维修项目分类表数据(取xmfl)-维修项目(商用空调)
 		// 维修项目分组取
 		// 无大小类信息
@@ -182,7 +184,7 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		addItfTblWxWxxmjcDownloadOld(synTaskNo,brandRec);
 
 
-		// 生成故障代码与维修项目对应关系数据
+		// 生成故障代码与维修项目对应关系数据 TL_SynDataFrom_tbl_wx_gzdm_wxxmjc
 		// 故障代码与维修项目有(商用空调|家用空调)
 		// 用到了维修项目分类表ID已处理      维修项目分类表上面只加了一条家用的,并无商用的有问题
 		addItfTblWxGzdmWxxmjcDownloadOld(synTaskNo, brandRec);
@@ -190,12 +192,12 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		// 处理冰箱 维修项目分类信息表 添加一条 晶弘冰箱
 		addRepairProjectType(4, "晶弘冰箱");
 
-		// 生成晶弘冰箱故障代码数据(repair_bug)
+		// 生成晶弘冰箱故障代码数据(repair_bug) TL_SynDataFrom_jh_azd_cause_sort_new
 		// 无大小类信息,故障现象类型为晶弘冰箱  4
 		// 分两个层级,有故障名称 第二层给到故障代码
 		// 这里的故障代码都会在晶弘冰箱维修项目数据中存在                        OK
 		addItfJhAzdCauseSortNewDownloadOld(synTaskNo, brandRec);
-		// 生成晶弘冰箱维修项目数据
+		// 生成晶弘冰箱维修项目数据 TL_SynDataFrom_jh_azd_cause_atter
 		// (repair_project)   有故障代码 维修项目(晶弘冰箱)
 		// 用到了维修项目分类表ID已处理                                       OK
 		addItfJhAzdCauseAtterDownloadOld(synTaskNo, brandRec);
@@ -203,15 +205,19 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		// 处理小家电 维修项目分类信息表 添加一条 生活电器
 		addRepairProjectType(3, "生活电器");
 
-		// 小家电故障现象处理
+		// 小家电故障现象处理 TL_SynDataFrom_tbl_wx_cpgz_xjd
 		//  故障代码只放入了大类    故障现象类型为生活电器  3
 		//  第一级为大类,故障现象从第二节开始获取 未级有故障编码                OK
 		addItfTblWxCpgzXjdDownloadOld(synTaskNo,brandRec);
-		// 小家电维修项目数据处理
+		// 小家电维修项目数据处理 TL_SynDataFrom_tbl_wx_wxxm_xjd
 		// 这里给了小类信息  用到了维修项目分类表ID已处理
 		// 无故障代码  有维修项目(生活电器)                                   OK
 		addItfTblWxWxxmXjdDownloadOld(synTaskNo, brandRec);
 
+
+
+
+
 		// 修改同步状态
 		ItfGreeToFaSynTaskList record =  new ItfGreeToFaSynTaskList();
 		record.setId(id);
@@ -363,7 +369,9 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 				.eq(ItfTblWxWxxmjcDownload::getSynTaskNo,synTaskNo).list();
 
 		if (CollectionUtils.isNotEmpty(addRec)){
-			getAddRepairProjectType(addRec, rpts);
+			// 添加为2的数据
+			getAddRepairProjectType(synTaskNo, rpts);
+
 			// 新增的插入到表
 			if (rpts.size()>0){
 				repairProjectTypeService.saveBatch(rpts);
@@ -952,7 +960,7 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 	}
 
 
-	private void getAddRepairProjectType(List<ItfTblWxWxxmjcDownload> addRec,List<RepairProjectType> rpts) {
+	private void getAddRepairProjectTypeBak(List<ItfTblWxWxxmjcDownload> addRec,List<RepairProjectType> rpts) {
 		// 按项目分类分组,只取其一
 		List<String> xmfls = new ArrayList<>();
 		for (ItfTblWxWxxmjcDownload item: addRec){
@@ -975,6 +983,27 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 		}
 	}
 
+	private void getAddRepairProjectType(String synTaskNo,List<RepairProjectType> rpts) {
+		List<ItfTblWxWxxmjcDownload> addRec = itfTblWxWxxmjcDownloadService.lambdaQuery()
+				.eq(ItfTblWxWxxmjcDownload::getSynTaskNo,synTaskNo)
+				.groupBy(ItfTblWxWxxmjcDownload::getXmfl).list();
+
+		for (ItfTblWxWxxmjcDownload item: addRec){
+			RepairProjectType v = new RepairProjectType();
+			v.setParentId(0);
+			v.setName(item.getXmfl());
+			v.setStatus(1);
+			v.setType(2);
+			v.setMalSmallName("");
+			v.setCreateBy("system");
+			v.setUpdateBy("system");
+			if (item.getCreatedBy() !=null){
+				v.setCreateBy(item.getCreatedBy());
+			}
+			rpts.add(v);
+		}
+	}
+
 	private void getAddRepairProject(Brand brandRec, List<ItfTblWxWxxmjcDownload> addRec) {
 		Map<String,List<RepairProjectType>> rptsMap = new HashMap<>();
 		// 提取项目类型ID
@@ -1083,8 +1112,9 @@ public class MasterDownloadServiceImpl implements MasterDownloadService {
 				// 查看是否存在,已存在不处理
 				List<RepairProject> oldBugs = repairProjectService.lambdaQuery()
 						.eq(RepairProject::getRepairProjectType,3)
-						.eq(RepairProject::getSmallName, result[i])
-						.eq(RepairProject::getRepairProjectCode,item.getWxdm()).list();
+						// .eq(RepairProject::getSmallName, result[i])
+						.eq(RepairProject::getRepairProjectCode,item.getWxdm())
+						.list();
 				if (CollectionUtils.isNotEmpty(oldBugs)){
 					continue;
 				}

+ 1 - 1
src/main/java/com/zfire/jiasm/syncdata/service/impl/UploadWorkeCertificateServiceImpl.java

@@ -1668,7 +1668,7 @@ public class UploadWorkeCertificateServiceImpl implements UploadWorkeCertificate
     private List<WorkerCert> getWorkerUploadstest() {
         // 同步标志-synStatus(0:待同步;1:已同步;99:同步失败)
         return workerCertService.lambdaQuery()
-                .eq(WorkerCert::getId,"469044823285893")
+                .eq(WorkerCert::getId,"472673885597957")
                 .list();
     }
 

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

@@ -401,7 +401,7 @@ public class UploadWorkerTOGreeServiceImpl implements UploadWorkerTOGreeService
         recs = getWorkerUploads(1);
 
         // 测试用
-        recs = getWorkerUploadstest();
+        // recs = getWorkerUploadstest();
 
         for (OutWorkerUpload item:recs){
             try{
@@ -2150,7 +2150,7 @@ public class UploadWorkerTOGreeServiceImpl implements UploadWorkerTOGreeService
     private List<OutWorkerUpload> getWorkerUploadstest() {
         // 同步标志-synStatus(0:待同步;1:已同步;99:同步失败)
         List<OutWorkerUpload> recs = outWorkerUploadService.lambdaQuery()
-                .eq(OutWorkerUpload::getSynReqId,176).list();
+                .eq(OutWorkerUpload::getSynReqId,242).list();
         return recs;
     }
 }

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

@@ -300,7 +300,7 @@ greesms=10000
 SMSSelf_marketing_Rate=5000
 ######################## 同步定时任务配置 ########################
 #师傅 证件、师傅、工单子表信息
-workercertificatec=FALSE
+workercertificatec=TRUE
 workerceruploadc=FALSE
 detaildownc=FALSE
 workercertbxc=FALSE
@@ -415,7 +415,7 @@ hsgdcjtmc=FALSE
 datauploadc=FALSE
 #安装、维修工单入本地表
 installinc=FALSE
-repairinc=TRUE
+repairinc=FALSE
 smsinselfc=FALSE
 #完工评价短信格力总部发送,自建工单联通发送,查看评价短信回复信息,自建完工评价短信联通发送,派服务人员格力发送
 wgmsgsendc=FALSE

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

@@ -16,7 +16,7 @@
                a.cjwdno as create_websit_id,a.cjrmc as create_websit_name,
                a.xsdwno as sale_websit_id, a.xswdmc as sale_websit_name,a.xsdwxtbh as sale_websit_sys_number,
                a.zjczwd as last_operator_websit,a.zjczwdxtbh as sys_websit_number,
-               a.jspgwdsj as rece_time,
+               a.jspgwdsj as rece_time,a.jspgwdsj as worker_rece_time,
                a.zxha as seat_no,a.ssqy as region,a.qqlyno as external_sys,a.qqlymc as external_name2,
                a.qqlyxh as external_no,a.qqlyzj as external_pk,a.bjustat as bjy_check_status,
                a.yhqwkssj as expect_start_time,a.yhqwjssj as expect_end_time,IFNULL(a.gpsdzxx,'') as gps_address,

+ 3 - 2
src/main/resources/mapper/RepairDownloadMapper.xml

@@ -25,7 +25,7 @@
                a.xsorsh as data_push_attr,
                a.jindu as lng,a.weidu as lat,a.wcsj as over_time,a.cjdt as create_time,a.cjren as create_by,a.cjrmc as create_name,
                IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.last_modified_by as update_by,a.wxrenid as dispatch_flag,1 as upload_flag,
-               a.xjwdsj as rece_time,a.xxlbid as info_type_id,
+               a.xjwdsj as rece_time,a.xjwdsj as worker_rece_time,a.xxlbid as info_type_id,
                a.yhsxid as user_attr_id,a.qqlymc as external_name2,a.qqlyxh as external_no,a.wxcount as out_wxcount,
                case a.tsdengji when '一级投诉' then 'FIRST'
                                when '二级投诉' then 'SECOND'
@@ -57,7 +57,8 @@
                a.wcsj as over_time,IFNULL(a.zjczsj,a.last_modified_date) as last_operator_time,
                IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.yhsx as user_attr,a.yhsxid as user_attr_id,
                a.fjhm as gree_virtualnumber,
-               a.gdhao as file_no,a.zxhao as seat_no,a.xjwdsj as rece_time,a.yhqwsmsj as appointment_time,
+               a.gdhao as file_no,a.zxhao as seat_no,a.xjwdsj as rece_time,a.xjwdsj as worker_rece_time,
+               a.yhqwsmsj as appointment_time,
                a.yhqwsmsj as expect_start_time,a.qwsmjssj as expect_end_time,
                a.wxcount as out_wxcount,a.ssqy as region,a.xsdh as external_pk
         from itf_tbl_assign_download a