|
@@ -89,6 +89,9 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
ItfMessagehuifangentityService itfMessagehuifangentityService;
|
|
|
@Resource
|
|
|
SyncCreateOrderService syncCreateOrderService;
|
|
|
+ @Resource
|
|
|
+ ItfReceiveSmsService itfReceiveSmsService;
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -492,6 +495,163 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void getOrderAppraiseSelf(OrderBase orderBase, Map<String, List<SysDictRef>> sysDictRefDLMap,
|
|
|
+ List<OrderAppraise> oanew,
|
|
|
+ String downloadTaskNo, List<Long> getSynReqId,
|
|
|
+ List<FaGreeSms> faGreeSms,List<OrderAppeal> orderAppeal) {
|
|
|
+ WebsitFWS websitFWS = new WebsitFWS();
|
|
|
+ int jcaninsert=1;
|
|
|
+ int cpflag=0;
|
|
|
+ int canappeal = 0;
|
|
|
+ Boolean cppjly = Boolean.FALSE;
|
|
|
+ List<ItfTblAzAssignSatisfactionDownload> sas = new ArrayList<>();
|
|
|
+ List<OrderAppraise> oa = new ArrayList<>();
|
|
|
+ Map<String,List<OrderAppraise>> oaMap = new HashMap<>();
|
|
|
+ // 首评信息用于填写差评中的首评内容
|
|
|
+ String spmessage="";
|
|
|
+ String cpid="";
|
|
|
+ OrderAppraise zpoa=null;
|
|
|
+
|
|
|
+
|
|
|
+ Date ssDate = new Date();
|
|
|
+ Date jzDate = new Date();
|
|
|
+ List<ItfReceiveSms> irsms = new ArrayList<>();
|
|
|
+
|
|
|
+ // 获取申诉单的截止申诉时间
|
|
|
+ publicService.getExpireTime(orderBase, ssDate, jzDate);
|
|
|
+
|
|
|
+ // 提取待同步的评价数据
|
|
|
+ sas = itfTblAzAssignSatisfactionDownloadService.lambdaQuery()
|
|
|
+ .eq(ItfTblAzAssignSatisfactionDownload::getDownloadTaskNo, downloadTaskNo)
|
|
|
+ .eq(ItfTblAzAssignSatisfactionDownload::getSynStatus,0)
|
|
|
+ .orderByAsc(ItfTblAzAssignSatisfactionDownload::getHfsj)
|
|
|
+ .list();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // 提取需要处理的数据
|
|
|
+ irsms = itfReceiveSmsService.lambdaQuery()
|
|
|
+ .eq(ItfReceiveSms::getSynStatus,0)
|
|
|
+ .orderByAsc(ItfReceiveSms::getSynReqId)
|
|
|
+ .list();
|
|
|
+
|
|
|
+ for (ItfReceiveSms item:irsms){
|
|
|
+ // 提取工单信息 部分工单可能不在平台系统中,不在的不处理
|
|
|
+ // OrderBase orderBase = orderBaseService.lambdaQuery().eq()
|
|
|
+
|
|
|
+ // 提取首评信息 目的放在追评信息中的首评信息内
|
|
|
+ spmessage = publicService.getSpmessage(orderBase, spmessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 提取首评信息 目的放在追评信息中的首评信息内
|
|
|
+ spmessage = publicService.getSpmessage(orderBase, spmessage);
|
|
|
+
|
|
|
+ // 提取差评申诉信息
|
|
|
+ OrderAppeal oldcpss = orderAppealService.lambdaQuery()
|
|
|
+ .eq(OrderAppeal::getOrderBaseId,orderBase.getId())
|
|
|
+ .last("limit 1").one();
|
|
|
+
|
|
|
+ for (ItfTblAzAssignSatisfactionDownload s :sas){
|
|
|
+ // cppjly = Boolean.FALSE;
|
|
|
+ // canappeal=0;
|
|
|
+ jcaninsert=1;
|
|
|
+
|
|
|
+ // 首评内容
|
|
|
+ if (s.getSxlx()==0){
|
|
|
+ spmessage = s.getPjnr();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 评价短信已同步过不再同步
|
|
|
+ if (checkRecord(orderBase, s)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 该记录前面已同步过,这里也不再同步
|
|
|
+ if (checkFrontRecord(s)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 置能否申诉标识 canappeal=1可申诉 中差评均可申诉
|
|
|
+ // 这里以后可能需要,不要删除
|
|
|
+ cppjly = publicService.getCppjly(s.getPjly().trim());
|
|
|
+ // 置可申诉标识 当前评价为中差评时看是否有已同步的差评,有不再产生申诉数据
|
|
|
+ if (cppjly){
|
|
|
+ OrderAppraise oldoat = orderAppraiseService.lambdaQuery()
|
|
|
+ .eq(OrderAppraise::getOrderBaseId,orderBase.getId())
|
|
|
+ .ne(OrderAppraise::getAppraiseStatus,"A").last("limit 1").one();
|
|
|
+ if (oldoat==null){
|
|
|
+ canappeal=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 置可生成评价标识 jcaninsert 当前记录为首评且已同步记录表中存在首评时置 jcaninsert = 0 不能再插入首评
|
|
|
+ if (s.getSynStatus().equals(0) && s.getSxlx().equals(0)){
|
|
|
+ OrderAppraise oldoatt = orderAppraiseService.lambdaQuery()
|
|
|
+ .eq(OrderAppraise::getOrderBaseId,orderBase.getId())
|
|
|
+ .eq(OrderAppraise::getPid,s.getId())
|
|
|
+ .eq(OrderAppraise::getType,1)
|
|
|
+ .last("limit 1").one();
|
|
|
+ if (oldoatt !=null){
|
|
|
+ jcaninsert=0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 工单看用户电话和完工时间 未报完工不处理评价短信
|
|
|
+ if (StringUtils.isEmpty(orderBase.getUserMobile()) &&
|
|
|
+ (orderBase.getOverTime()==null && orderBase.getWebsitOverTime()==null)){
|
|
|
+ s.setSynStatus(9);
|
|
|
+ s.setSynTime(new Date());
|
|
|
+ s.setSynErrMsg("工单未报完工不处理评价短信");
|
|
|
+ s.updateById();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成评价对像
|
|
|
+ if (jcaninsert==1){
|
|
|
+ websitFWS = getOrderAppreise(orderBase, sysDictRefDLMap, oanew, s);
|
|
|
+ // 提取追评信息 即最后一条评价短信信息(一般来讲最后一条评价为好评,非好评时回访处理的事)
|
|
|
+ if (zpoa==null){
|
|
|
+ zpoa=oanew.get(oanew.size()-1);
|
|
|
+ } else {
|
|
|
+ if (zpoa.getCreateTime().before(oanew.get(oanew.size()-1).getCreateTime())){
|
|
|
+ zpoa=oanew.get(oanew.size()-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 工单评价表直接插入
|
|
|
+ if (oanew.size()>0){
|
|
|
+ orderAppraiseService.saveBatch(oanew);
|
|
|
+ oanew.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 若插入的为差评时且非中心网点时给网点负责人发短信
|
|
|
+ addcpsms(orderBase, s, websitFWS, faGreeSms, jzDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 同步工单主表的追评信息或首评信息
|
|
|
+ setOrderAppraisemessage(orderBase, s);
|
|
|
+
|
|
|
+ // 差评申诉 仅一次
|
|
|
+ // 无申诉记录,看本次的评价是否为中差评为中差评时生成申诉对像并记下评价短信的ID目的是填写追评信息时不填写差评内容
|
|
|
+ if (oldcpss==null && cpflag==0) {
|
|
|
+ // 生成差评申诉信息实体对像 只能申诉一次
|
|
|
+ cpflag = getCp(orderBase, orderAppeal,s,ssDate);
|
|
|
+ if (cpflag==1){
|
|
|
+ cpid=s.getId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ s.setSynStatus(1);
|
|
|
+ s.setSynTime(new Date());
|
|
|
+ s.updateById();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 差评申诉增加首次评价及追评信息 差评申诉可能是本次产生的,也可能是上次已生成的
|
|
|
+ // 本次产生的差评申诉 补填首次评价内容(存在首评即差评的情况)
|
|
|
+ getOrderAppeal(orderAppeal, cpflag, spmessage, cpid, zpoa, oldcpss);
|
|
|
+ }
|
|
|
+
|
|
|
public void addOrUpdateOrderDataApi(ItfTblAzAssignLcLsDownload item,
|
|
|
List<ItfTblAzAssignMxDownload> mxsynreqids,
|
|
|
List<ItfTblAzAssignFkmxDownload> synreqids,List<OrderInstallOperatingLog> addoiolList,
|