yaozhixue 1 year ago
parent
commit
6726746d0a

+ 5 - 2
src/main/java/com/zfire/jiasm/syncdata/download/basedata/GLPPGFWebsitWorker.java

@@ -33,6 +33,9 @@ public class GLPPGFWebsitWorker {
     private String gfwwwc = "";
     @Value("${fsxwxgc}")
     private String fsxwxgc = "";
+    @Value("${createworkerc}")
+    private String createworkerc = "";
+
 
     @Resource
     TokenCenter tokenCenter;
@@ -111,10 +114,10 @@ public class GLPPGFWebsitWorker {
      * 数据同步到本地表 师傅信息
      * 师傅信息一定新增 - 多次变到后无则新增,有则修改
      */
-    @Scheduled(fixedDelayString = "${gfwww}")
+    @Scheduled(fixedDelayString = "${createworker}")
     private void processData() {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        if (gfwwwc.equals(TaskConfigEnum.FALSE.getCode())){
+        if (createworkerc.equals(TaskConfigEnum.FALSE.getCode())){
             return;
         }
         try {

+ 1 - 0
src/main/java/com/zfire/jiasm/syncdata/service/PublicService.java

@@ -166,4 +166,5 @@ public interface PublicService {
 
     Boolean getCppjly(String pjly);
     String getAppraiseStatusT(String pjly);
+    String getSpmessage(OrderBase orderBase, String spmessage);
 }

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

@@ -2147,7 +2147,7 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
                 .list();
 
         // 提取首评信息 目的放在追评信息中的首评信息内
-        spmessage = getSpmessage(orderBase, spmessage);
+        spmessage = publicService.getSpmessage(orderBase, spmessage);
 
         // 提取差评申诉信息
         OrderAppeal oldcpss = orderAppealService.lambdaQuery()
@@ -2328,18 +2328,6 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         return false;
     }
 
-    private String getSpmessage(OrderBase orderBase, String spmessage) {
-        OrderAppraise oaOne = orderAppraiseService.lambdaQuery()
-                .eq(OrderAppraise::getOrderBaseId, orderBase.getId())
-                .eq(OrderAppraise::getType,1)
-                .last("limit 1").one();
-        if (oaOne !=null){
-            spmessage = oaOne.getAppraiseContent();
-        }
-        return spmessage;
-    }
-
-
     private int getCp(OrderBase orderBase, List<OrderAppeal> orderAppeals,
                       ItfTblAzAssignSatisfactionDownload s, Date ssDate) {
         if (s.getPjnr().equals("3") || s.getPjnr().indexOf("不满意")>=0 || publicService.getCppjly(s.getPjly().trim())){

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

@@ -1840,7 +1840,7 @@ public class AddRepairBusinessServiceImpl implements AddRepairBusinessService {
         if (s.getSxlx().equals(0)){
             o.setType(1);
         } else {
-            o.setType(24);
+            o.setType(2);
         }
 
         if (s.getCreatedBy()!=null){

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

@@ -189,7 +189,7 @@ public class GLPPGFWebsitWorkerServiceImpl implements GLPPGFWebsitWorkerService
         // 有效
         recs = itfTblWangdianWxgDownloadService.lambdaQuery()
                 .select(ItfTblWangdianWxgDownload::getSfzen)
-                // .eq(ItfTblWangdianWxgDownload::getSfzen,"421022197809157619")// 测试用
+                // .eq(ItfTblWangdianWxgDownload::getSfzen,"440221198908132726")// 测试用
                 .ne(ItfTblWangdianWxgDownload::getFlag, "无效").list();
         recs.stream().forEach(wba -> {
             recins.add(wba.getSfzen());
@@ -200,7 +200,7 @@ public class GLPPGFWebsitWorkerServiceImpl implements GLPPGFWebsitWorkerService
         //无效
         recs = itfTblWangdianWxgDownloadService.lambdaQuery()
                 .select(ItfTblWangdianWxgDownload::getSfzen)
-                // .eq(ItfTblWangdianWxgDownload::getSfzen,"421022197809157619")// 测试用
+                // .eq(ItfTblWangdianWxgDownload::getSfzen,"440221198908132726")// 测试用
                 .eq(ItfTblWangdianWxgDownload::getFlag, "无效").list();
         recs.stream().forEach(wba -> {
             recouts.add(wba.getSfzen());
@@ -994,10 +994,7 @@ public class GLPPGFWebsitWorkerServiceImpl implements GLPPGFWebsitWorkerService
             if (sfzens.contains(m.getSfzen().trim())){
                 continue;
             }
-            // S + 手机号 作为ID主键,手机号是不能重的
-            if (mobiles.contains(m.getYddh().trim())){
-                continue;
-            }*/
+            */
 
             // 生成对象
             Worker v = addWorkerInfo(m, flag);
@@ -1013,6 +1010,10 @@ public class GLPPGFWebsitWorkerServiceImpl implements GLPPGFWebsitWorkerService
                     uupWorkerRec.add(v);
                 }
             } else {
+                // S + 手机号 作为ID主键,手机号是不能重的 不再新增,会报错主键冲突
+                if (mobiles.contains(m.getYddh().trim())){
+                    continue;
+                }
                 sfzens.add(m.getSfzen().trim());
                 mobiles.add(m.getYddh().trim());
                 addWorkerRec.add(v);

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

@@ -119,6 +119,8 @@ public class PublicServiceImpl implements PublicService {
     OrderDetailFileService orderDetailFileService;
     @Resource
     ProductService productService;
+    @Resource
+    OrderAppraiseService orderAppraiseService;
 
 
 
@@ -1844,7 +1846,7 @@ public class PublicServiceImpl implements PublicService {
         } else if (pjly.equals("3") || pjly.indexOf("不满意")>=0){
             cppjly = Boolean.TRUE;
         } else {
-            cppjly = publicService.checkEvaluatemessage(pjly);
+            cppjly = checkEvaluatemessage(pjly);
         }
         return cppjly;
     }
@@ -1867,6 +1869,18 @@ public class PublicServiceImpl implements PublicService {
         return appraiseStatus;
     }
 
+    @Override
+    public String getSpmessage(OrderBase orderBase, String spmessage){
+        OrderAppraise oaOne = orderAppraiseService.lambdaQuery()
+                .eq(OrderAppraise::getOrderBaseId, orderBase.getId())
+                .eq(OrderAppraise::getType,1)
+                .last("limit 1").one();
+        if (oaOne !=null){
+            spmessage = oaOne.getAppraiseContent();
+        }
+        return spmessage;
+    }
+
     private String getAppraiseStatusr(String pjly) {
         String appraiseStatus = "";
         SatisfactionList sfs = getAppraiseStatus(pjly);

+ 38 - 18
src/main/java/com/zfire/jiasm/syncdata/service/impl/SMSSelfGetArrivedServiceImpl.java

@@ -2,6 +2,7 @@ package com.zfire.jiasm.syncdata.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.zfire.jiasm.syncdata.constant.OrderTypeEnum;
 import com.zfire.jiasm.syncdata.plus.entity.*;
 import com.zfire.jiasm.syncdata.plus.service.*;
 import com.zfire.jiasm.syncdata.pojo.bo.DownRepairOrderGD;
@@ -219,7 +220,6 @@ public class SMSSelfGetArrivedServiceImpl {
 
 	private void syncSmsRecord(JSONObject data) {
 		Map<String,String> orderPjnr = new HashMap<>();
-		List<OrderAppeal> orderAppeals = new ArrayList<>();
 		// 同步工单回复信息 这里使用手机号+发送码来确认 存在无对应的情况不处理
 		// 最近两个月的一定只有一条,为防止出现问题,用list
 		List<SmsRecord> rec = smsRecordService.lambdaQuery()
@@ -238,21 +238,42 @@ public class SMSSelfGetArrivedServiceImpl {
 			smsRecordService.updateBatchById(u);
 			u.clear();
 
-			// 差评时向申诉表插入数据自工单插入差评申诉(非商用空调且为差评信息)
+			// 差评时向申诉表插入数据(工单插入差评申诉(非商用空调且为差评信息))
 			// 总部发送的短信回复在从总部同步时已做了处理
-			for (Map.Entry entry :orderPjnr.entrySet()){
-				OrderBase orderBase = orderBaseService.lambdaQuery()
-						.eq(OrderBase::getId,(String) entry.getKey())
-						.eq(OrderBase::getUploadFlag,Boolean.FALSE).one();
+			getOrderAppeal(orderPjnr);
+
+		}
+	}
+
+	private void getOrderAppeal(Map<String, String> orderPjnr) {
+		List<OrderAppeal> orderAppeals = new ArrayList<>();
+		// 首评信息用于填写差评中的首评内容
+		String spmessage="";
+
+		for (Map.Entry entry : orderPjnr.entrySet()){
+			OrderBase orderBase = orderBaseService.lambdaQuery()
+					.eq(OrderBase::getId,(String) entry.getKey())
+					.eq(OrderBase::getUploadFlag,Boolean.FALSE).one();
+			// 工单分安装工单与维修工单
+			if (orderBase!=null){
 				// 提取差评申诉信息 差评申诉 仅一次
 				OrderAppeal oldcpss = orderAppealService.lambdaQuery()
 						.eq(OrderAppeal::getOrderBaseId,(String) entry.getKey())
 						.last("limit 1").one();
 
-				if (orderBase!=null && oldcpss == null &&
+				// 生成差评申诉
+				if (oldcpss == null &&
 						!orderBase.getMainId().equals("102") && !orderBase.getMainId().equals("109") &&
 						publicService.getCppjly((String) entry.getValue())){
 					OrderAppeal orderAppeal=new OrderAppeal();
+					// 提取首评信息 目的放在追评信息中的首评信息内
+					spmessage = publicService.getSpmessage(orderBase, spmessage);
+					orderAppeal.setFirstEvaluate(spmessage);
+					// 首评即差评
+					if (StringUtils.isEmpty(spmessage)){
+						orderAppeal.setFirstEvaluate((String) entry.getValue());
+					}
+
 					orderAppeal.setOrderBaseId(orderBase.getId());
 					orderAppeal.setPgid(orderBase.getPgid());
 					orderAppeal.setWorkerName(orderBase.getWorkerName());
@@ -267,20 +288,19 @@ public class SMSSelfGetArrivedServiceImpl {
 					orderAppeal.setCreateBy("system");
 					orderAppeal.setEvaluateTime(new Date());
 					orderAppeals.add(orderAppeal);
-				}
-			}
-
-
-
+				} else if (oldcpss != null &&
+						!orderBase.getMainId().equals("102") && !orderBase.getMainId().equals("109")){
+					// 补追评信息 可能存在追评 判断不是差评记录
+					oldcpss.setLastEvaluate((String) entry.getValue());
 
-
-			// 生成申诉数据
-			if (orderAppeals.size()>0){
-				orderAppealService.saveOrUpdateBatch(orderAppeals);
-				orderAppeals.clear();
+				}
 			}
+		}
 
-
+		// 生成申诉数据
+		if (orderAppeals.size()>0){
+			orderAppealService.saveOrUpdateBatch(orderAppeals);
+			orderAppeals.clear();
 		}
 	}
 

+ 2 - 0
src/main/resources/bootstrap-dev.properties

@@ -222,6 +222,7 @@ fsswxg=60000
 gzxwxg=60000
 gzswxg=60000
 gfwww=300000
+createworker=60000
 #类别大类、小类、系列、机型
 lbdl=300000
 lbxl=60000
@@ -344,6 +345,7 @@ fsswxgc=FALSE
 gzxwxgc=FALSE
 gzswxgc=FALSE
 gfwwwc=FALSE
+createworkerc=FALSE
 #类别大类、小类、系列、机型
 lbdlc=FALSE
 lbxlc=FALSE

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

@@ -213,6 +213,7 @@ fsswxg=600000
 gzxwxg=600000
 gzswxg=600000
 gfwww=60000
+createworker=60000
 #类别大类、小类、系列、机型
 lbdl=600000
 lbxl=600000
@@ -335,6 +336,7 @@ fsswxgc=TRUE
 gzxwxgc=TRUE
 gzswxgc=TRUE
 gfwwwc=TRUE
+createworkerc=TRUE
 #类别大类、小类、系列、机型
 lbdlc=TRUE
 lbxlc=TRUE

+ 3 - 1
src/main/resources/bootstrap-prdt.properties

@@ -213,6 +213,7 @@ fsswxg=60000
 gzxwxg=60000
 gzswxg=60000
 gfwww=300000
+createworker=60000
 #类别大类、小类、系列、机型
 lbdl=300000
 lbxl=60000
@@ -335,6 +336,7 @@ fsswxgc=FALSE
 gzxwxgc=FALSE
 gzswxgc=FALSE
 gfwwwc=FALSE
+createworkerc=TRUE
 #类别大类、小类、系列、机型
 lbdlc=FALSE
 lbxlc=FALSE
@@ -376,7 +378,7 @@ ththhgxc=FALSE
 wxzjsc=FALSE
 wxzjscxc=FALSE
 #网点维修工 证件照,服务类目,位置、新增同步到本地、修改、保险、总部下载的采集图
-zjzxxc=TRUE
+zjzxxc=FALSE
 lmxxc=FALSE
 wxgwzc=FALSE
 wxgxgc=FALSE