|
@@ -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();
|
|
|
}
|
|
|
}
|
|
|
|