yaozhixue 1 年之前
父节点
当前提交
8a7606b103

+ 7 - 43
src/main/java/com/zfire/jiasm/syncdata/download/order/SaleOrderEvaluate.java

@@ -1,17 +1,12 @@
 package com.zfire.jiasm.syncdata.download.order;
 
-import com.zfire.jiasm.syncdata.plus.entity.ItfReceiveSms;
-import com.zfire.jiasm.syncdata.plus.entity.ItfTblAzAssignLcLsDownload;
-import com.zfire.jiasm.syncdata.plus.service.ItfReceiveSmsService;
 import com.zfire.jiasm.syncdata.service.AddInstallBusiness;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
 import java.util.Date;
-import java.util.List;
 
 /** 接口方式生成工单
  * 格力品牌安装工单下载后落本地数据表
@@ -25,53 +20,22 @@ public class SaleOrderEvaluate {
 
     @Resource
     AddInstallBusiness addInstallBusiness;
-    @Resource
-    ItfReceiveSmsService itfReceiveSmsService;
 
 
     // 自建工单短信回复 生成评价信息 + 申诉
     // @Scheduled(fixedDelayString = "${installin}")
     public void orderAppraise() {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        List<ItfTblAzAssignLcLsDownload> lcls = new ArrayList<>();
-
-
-        List<ItfReceiveSms> irsms = new ArrayList<>();
-
-        // 提取需要处理的数据
-        irsms = itfReceiveSmsService.lambdaQuery()
-                .eq(ItfReceiveSms::getSynStatus,0)
-                .list();
-
-        log.info("自建工单生成评价短信开始处理: \uF0B7{}",sdf.format(new Date()));
-        for (ItfReceiveSms item:irsms){
-
-
-        }
-
 
+        log.info("自建工单完工评价短信开始处理: \uF0B7{}",sdf.format(new Date()));
 
-
-        // 按任务号download_task_no,按单来处理
-        for (ItfTblAzAssignLcLsDownload item: lcls) {
-            try{
-
-            } catch (Exception ex) {
-                ex.printStackTrace();
-                String msg = "自建工单生成评价短信失败: ";
-                if (ex.getMessage()!=null){
-                    msg = msg + ex.getMessage();
-                }
-                item.setSynErrMsg(msg);
-                if (msg.length()>1020){
-                    item.setSynErrMsg(msg.substring(0,1020));
-                }
-                item.setSynTime(new Date());
-                item.setSynTimes(item.getSynTimes()+1);
-            }
+        try{
+            addInstallBusiness.getOrderAppraiseSelf();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            log.info("自建工单完工评价短信处理失败: \uF0B7{}",sdf.format(new Date()));
         }
-
-        log.info("安装工单落本地表完成: \uF0B7{}",sdf.format(new Date()));
+        log.info("自建工单完工评价短信处理完成: \uF0B7{}",sdf.format(new Date()));
     }
 
 }

+ 1 - 4
src/main/java/com/zfire/jiasm/syncdata/service/AddInstallBusiness.java

@@ -21,9 +21,6 @@ public interface AddInstallBusiness {
                      Map<String, List<SysDictRef>> sysDictRefXiLieMap, Brand brand, ItfTblAzAssignLcLsDownload item,
                         Boolean flag, Map<String,String> productMap) throws Exception;
 
-    void getOrderAppraiseSelf(OrderBase orderBase, Map<String, List<SysDictRef>> sysDictRefDLMap,
-                         List<OrderAppraise> oanew,
-                         String downloadTaskNo, List<Long> getSynReqId,
-                         List<FaGreeSms> faGreeSms, List<OrderAppeal> orderAppeal);
+    void getOrderAppraiseSelf();
 
     }

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

@@ -172,4 +172,5 @@ public interface PublicService {
     void setSyktKjmm(ItfTblAzWgmxSyktUpload mxup);
     void setQitaKjmm(ItfTblAzWgmxQitaUpload mxup);
     Integer setfjType(Integer type,OrderInstallDetail detailone);
+    String getFaOrderSmsfsma(String phone);
 }

+ 294 - 114
src/main/java/com/zfire/jiasm/syncdata/service/impl/AddInstallBusinessImpl.java

@@ -12,6 +12,7 @@ import com.zfire.jiasm.syncdata.parameter.OrderPar;
 import com.zfire.jiasm.syncdata.plus.entity.*;
 import com.zfire.jiasm.syncdata.plus.service.*;
 import com.zfire.jiasm.syncdata.response.WebsitFWS;
+import com.zfire.jiasm.syncdata.response.WebsitSH;
 import com.zfire.jiasm.syncdata.service.AddInstallBusiness;
 import com.zfire.jiasm.syncdata.service.JiasmApi;
 import com.zfire.jiasm.syncdata.service.OrderService;
@@ -91,6 +92,12 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
     SyncCreateOrderService syncCreateOrderService;
     @Resource
     ItfReceiveSmsService itfReceiveSmsService;
+    @Resource
+    SmsRecordService smsRecordService;
+    @Resource
+    FaOrderSmsService faOrderSmsService;
+
+
 
 
 
@@ -496,160 +503,173 @@ 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) {
+    @Transactional(rollbackFor = Exception.class)
+    public void getOrderAppraiseSelf() {
+        // 提取需要处理的数据
+        List<ItfReceiveSms> irsms = itfReceiveSmsService.lambdaQuery()
+                .eq(ItfReceiveSms::getSynStatus,0)
+                .orderByAsc(ItfReceiveSms::getSynReqId)
+                .list();
+
+        for (ItfReceiveSms item:irsms){
+            // 提取工单信息 部分工单可能不在平台系统中,不在的不处理
+            // 同步工单回复信息 这里使用手机号+发送码来确认 存在无对应的情况不处理
+            // 最近两个月的一定只有一条,为防止出现问题,用list
+            SmsRecord smsRecord = smsRecordService.lambdaQuery()
+                    .eq(SmsRecord::getPhone, item.getFromNum())
+                    .eq(SmsRecord::getFsma, item.getSubappend())
+                    .ge(SmsRecord::getCreateTime,publicService.stepMonth(new Date(),-2))
+                    .last("limit 1").one();
+
+            // 无工单数据不处理
+            if (smsRecord == null){
+                setItfReceiveSmsstatus(item,9,"找不到对应的工单不处理");
+                continue;
+            }
+            // 提取工单数据 只处理自建工单
+            OrderBase orderBase = orderBaseService.lambdaQuery()
+                    .eq(OrderBase::getId,smsRecord.getOrderBaseId())
+                    .eq(OrderBase::getUploadFlag,Boolean.FALSE).one();
+            if (orderBase == null){
+                setItfReceiveSmsstatus(item,9,"【"+smsRecord.getOrderBaseId()+"】非自建工单不处理");
+                continue;
+            }
+
+            // 按记录处理
+            if (processOrderAppraise(item, orderBase)) {
+                continue;
+            }
+
+            setItfReceiveSmsstatus(item,1,"成功");
+        }
+
+        // 更新同步状态
+        itfReceiveSmsService.updateBatchById(irsms);
+        irsms.clear();
+    }
+
+    public boolean processOrderAppraise(ItfReceiveSms item, OrderBase orderBase) {
+        int cpflag=0;
         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<>();
+        List<OrderAppraise> oanew = new ArrayList<>();
+        List<FaOrderSms> foslist = new ArrayList<>();
+        List<OrderAppeal> orderAppeal = new ArrayList<>();
+
         // 首评信息用于填写差评中的首评内容
         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())
+                .eq(OrderAppeal::getOrderBaseId, orderBase.getId())
                 .last("limit 1").one();
 
-        for (ItfTblAzAssignSatisfactionDownload s :sas){
-            // cppjly = Boolean.FALSE;
-            // canappeal=0;
-            jcaninsert=1;
+        jcaninsert=1;
 
+        // 首评内容
+        OrderAppraise oldoa = orderAppraiseService.lambdaQuery()
+                .eq(OrderAppraise::getOrderBaseId, orderBase.getId())
+                .last("limit 1").one();
+        // 无数据为首评
+        if (oldoa == null){
             // 首评内容
-            if (s.getSxlx()==0){
-                spmessage = s.getPjnr();
-            }
+            spmessage = item.getContent();
+        }
 
-            // 评价短信已同步过不再同步
-            if (checkRecord(orderBase, s)) {
-                continue;
-            }
+        // 评价短信已同步过不再同步
+        if (checkRecordSelf(orderBase, item)) {
+            setItfReceiveSmsstatus(item,9,"评价已同步,忽略更新");
+            return true;
+        }
 
-            // 该记录前面已同步过,这里也不再同步
-            if (checkFrontRecord(s)) {
-                continue;
+        // 置可生成评价标识 jcaninsert 当前记录为首评且已同步记录表中存在首评时置 jcaninsert = 0 不能再插入首评
+        if (item.getSynStatus().equals(0) && StringUtils.isNotEmpty(spmessage)){
+            OrderAppraise oldoatt = orderAppraiseService.lambdaQuery()
+                    .eq(OrderAppraise::getOrderBaseId, orderBase.getId())
+                    .eq(OrderAppraise::getPid,String.valueOf(item.getSynReqId()))
+                    .eq(OrderAppraise::getType,1)
+                    .last("limit 1").one();
+            if (oldoatt !=null){
+                jcaninsert=0;
             }
+        }
 
-            // 置能否申诉标识 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;
-                }
-            }
+        // 工单看用户电话和完工时间  未报完工不处理评价短信
+        if (StringUtils.isEmpty(orderBase.getUserMobile()) &&
+                (orderBase.getOverTime()==null && orderBase.getWebsitOverTime()==null)){
+            setItfReceiveSmsstatus(item,9,"工单【"+ orderBase.getId()+"】未报完工不处理评价短信");
+            return true;
+        }
 
-            // 置可生成评价标识 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 (jcaninsert==1){
+            websitFWS = getOrderAppreiseSelf(orderBase, oanew, item, spmessage);
+            // 提取追评信息 即最后一条评价短信信息(一般来讲最后一条评价为好评,非好评时回访处理的事)
+            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 (StringUtils.isEmpty(orderBase.getUserMobile()) &&
-                    (orderBase.getOverTime()==null && orderBase.getWebsitOverTime()==null)){
-                s.setSynStatus(9);
-                s.setSynTime(new Date());
-                s.setSynErrMsg("工单未报完工不处理评价短信");
-                s.updateById();
-                continue;
+            // 工单评价表直接插入
+            if (oanew.size()>0){
+                orderAppraiseService.saveBatch(oanew);
+                oanew.clear();
             }
 
-            // 生成评价对像
-            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();
-                }
+            // 若插入的为差评时且非中心网点时给网点负责人发短信
+            addcpsmsSelf(orderBase, item, websitFWS, foslist, jzDate);
 
-                // 若插入的为差评时且非中心网点时给网点负责人发短信
-                addcpsms(orderBase, s, websitFWS, faGreeSms, jzDate);
+            // 投诉工单 这里不再总部发送
+            if (foslist.size()>0){
+                faOrderSmsService.saveBatch(foslist);
+                foslist.clear();
             }
+        }
 
-            // 同步工单主表的追评信息或首评信息
-            setOrderAppraisemessage(orderBase, s);
+        // 同步工单主表的追评信息或首评信息
+        setOrderAppraisemessageSelf(orderBase, item);
 
-            // 差评申诉 仅一次
-            // 无申诉记录,看本次的评价是否为中差评为中差评时生成申诉对像并记下评价短信的ID目的是填写追评信息时不填写差评内容
-            if (oldcpss==null && cpflag==0) {
-                // 生成差评申诉信息实体对像 只能申诉一次
-                cpflag = getCp(orderBase, orderAppeal,s,ssDate);
-                if (cpflag==1){
-                    cpid=s.getId();
-                }
+        // 差评申诉 仅一次
+        // 无申诉记录,看本次的评价是否为中差评为中差评时生成申诉对像并记下评价短信的ID目的是填写追评信息时不填写差评内容
+        if (oldcpss==null && cpflag==0) {
+            // 生成差评申诉信息实体对像 只能申诉一次
+            cpflag = getCpSelf(orderBase, orderAppeal, item,ssDate);
+            if (cpflag==1){
+                cpid=String.valueOf(item.getSynReqId());
             }
-
-            s.setSynStatus(1);
-            s.setSynTime(new Date());
-            s.updateById();
         }
-
         // 差评申诉增加首次评价及追评信息 差评申诉可能是本次产生的,也可能是上次已生成的
         // 本次产生的差评申诉 补填首次评价内容(存在首评即差评的情况)
         getOrderAppeal(orderAppeal, cpflag, spmessage, cpid, zpoa, oldcpss);
+
+        // 差评申诉
+        if (orderAppeal.size()>0){
+            orderAppealService.saveBatch(orderAppeal);
+            orderAppeal.clear();
+        }
+
+        orderBase.updateById();
+
+        return false;
+    }
+
+    public void setItfReceiveSmsstatus(ItfReceiveSms item, Integer synStatus ,String msg){
+        item.setSynStatus(synStatus);
+        item.setSynTime(new Date());
+        item.setSynErrMsg(msg);
     }
 
     public void addOrUpdateOrderDataApi(ItfTblAzAssignLcLsDownload item,
@@ -2457,6 +2477,29 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         }
     }
 
+    private void setOrderAppraisemessageSelf(OrderBase orderBase, ItfReceiveSms s) {
+        if (orderBase.getAppraiseTime()==null &&
+                (orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G7.getCode()) ||
+                        orderBase.getOrderStatus().equals(GDOrderStatusEnum.INSTALL_STATUS_G10.getCode()))){
+            // 首评
+            // 首次评价
+            orderBase.setAppraiseStatus(publicService.getAppraiseStatusT(s.getContent().trim()));
+            // 首次评价内容
+            orderBase.setAppraiseContent(s.getContent().trim());
+            // 首次评价时间
+            orderBase.setAppraiseTime(s.getRecvTime());
+            // 评价来源 无法区分
+            // orderBase.setAppraiseSource();
+        } else {
+            // 追评评价状态
+            orderBase.setSecondAppraiseStatus(publicService.getAppraiseStatusT(s.getContent().trim()));
+            // 追评评价内容
+            orderBase.setSecondContent(s.getContent().trim());
+            // 追评评价时间
+            orderBase.setSecondAppraiseTime(s.getRecvTime());
+        }
+    }
+
     private boolean checkFrontRecord(ItfTblAzAssignSatisfactionDownload s) {
         ItfTblAzAssignSatisfactionDownload azas = itfTblAzAssignSatisfactionDownloadService.lambdaQuery()
                 .lt(ItfTblAzAssignSatisfactionDownload::getSynReqId, s.getSynReqId())
@@ -2490,6 +2533,17 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         return false;
     }
 
+    private boolean checkRecordSelf(OrderBase orderBase, ItfReceiveSms s) {
+        OrderAppraise oldoa = orderAppraiseService.lambdaQuery()
+                .eq(OrderAppraise::getOrderBaseId, orderBase.getId())
+                .eq(OrderAppraise::getPid, String.valueOf(s.getSynReqId()))
+                .last("limit 1").one();
+        if (oldoa !=null){
+            return true;
+        }
+        return false;
+    }
+
     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())){
@@ -2513,6 +2567,29 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         return 0;
     }
 
+    private int getCpSelf(OrderBase orderBase, List<OrderAppeal> orderAppeals,
+                          ItfReceiveSms s, Date ssDate) {
+        if (s.getContent().equals("3") || s.getContent().indexOf("不满意")>=0 || publicService.getCppjly(s.getContent().trim())){
+            OrderAppeal orderAppeal=new OrderAppeal();
+            orderAppeal.setOrderBaseId(orderBase.getId());
+            orderAppeal.setPgid(orderBase.getPgid());
+            orderAppeal.setWorkerName(orderBase.getWorkerName());
+            orderAppeal.setWorkerId(orderBase.getWorkerId());
+            // 网点必填
+            orderAppeal.setWebsitId(orderBase.getWebsitId());
+            orderAppeal.setBadEvaluate(s.getContent());
+            orderAppeal.setAppraiseStatus(publicService.getAppraiseStatusT(s.getContent()));
+            orderAppeal.setStatus(1);
+            orderAppeal.setCanApply(Boolean.TRUE);
+            orderAppeal.setCreateTime(new Date());
+            orderAppeal.setCreateBy("system");
+            orderAppeal.setEvaluateTime(ssDate);
+            orderAppeals.add(orderAppeal);
+            return 1;
+        }
+        return 0;
+    }
+
     private void addcpsms(OrderBase order, ItfTblAzAssignSatisfactionDownload s, WebsitFWS websitFWS,
                           List<FaGreeSms> fsList, Date jzDate) {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -2536,6 +2613,46 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         }
     }
 
+    private void addcpsmsSelf(OrderBase order, ItfReceiveSms s, WebsitFWS websitFWS,
+                          List<FaOrderSms> foslist, Date jzDate) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        WebsitSH websitSH = publicService.ptshwdToshshwd(order.getWebsitId(), order.getMainId());
+
+        if (s.getContent().equals("3") || s.getContent().indexOf("不满意")>=0 ||
+                publicService.getCppjly(s.getContent().trim())){
+            if (StringUtils.isNotEmpty(websitSH.getWdId()) &&
+                    !websitSH.getWdId().equals("99999999") &&
+                    StringUtils.isNotEmpty(websitFWS.getWdlxdh())){
+                FaOrderSms add = new FaOrderSms();
+                add.setWorkerOrderNo(order.getId());
+                // 工单类型 (1:安装,2:维修,3:回收工单,4:以旧换新)
+                add.setAzorwx(4);
+                // 工单类型 INSTALL=安装单  REPAIR=维修单  RETURN_EXCHANGE=退换货  TRADE_IN=以旧换新 MAINTENANCE=维保工单
+                if (order.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_INSTALL.getCode())){
+                    add.setAzorwx(1);
+                } else if (order.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_REPAIR.getCode())){
+                    add.setAzorwx(2);
+                } else if (order.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_RECOVERY.getCode())){
+                    add.setAzorwx(3);
+                }
+                // 维修工单pgid 其他工单pggid
+                if (order.getOrderType().equals(OrderTypeEnum.ORDER_TYPE_REPAIR.getCode())){
+                    add.setFjid(order.getPgid());
+                } else {
+                    add.setFjid(order.getPgguid());
+                }
+                add.setSjid(order.getUserMobile());
+                add.setFjwd(order.getWebsitId());
+                add.setFsma(publicService.getFaOrderSmsfsma(order.getUserMobile()));
+                add.setFsnr("您收到一张客户的投诉工单,请及时处理!工单号:" + String.valueOf(order.getPgid()) +
+                        ",服务人员:" + order.getWorkerName()+ ",首次申诉截止时间:" + sdf.format(jzDate));
+                add.setSjid(order.getUserMobile());
+                add.setYhlb(2);
+                foslist.add(add);
+            }
+        }
+    }
+
     private WebsitFWS getOrderAppreise(OrderBase orderBase, Map<String, List<SysDictRef>> sysDictRefDLMap,
                                        List<OrderAppraise> oanew, ItfTblAzAssignSatisfactionDownload s) {
         WebsitFWS websitFWS;
@@ -2611,6 +2728,69 @@ public class AddInstallBusinessImpl implements AddInstallBusiness {
         return websitFWS;
     }
 
+    private WebsitFWS getOrderAppreiseSelf(OrderBase orderBase,
+                                       List<OrderAppraise> oanew, ItfReceiveSms s, String spmessage) {
+        WebsitFWS websitFWS;
+        OrderAppraise o = new OrderAppraise();
+        // id为主键,放在pid 中
+        o.setPid(String.valueOf(s.getSynReqId()));
+        o.setPgguid(orderBase.getPgguid());
+        // 工单号
+        o.setOrderBaseId(orderBase.getId());
+        o.setPgid(orderBase.getPgid());
+
+        o.setOrderType(orderBase.getOrderType());
+        o.setWebsitId(orderBase.getWebsitId());
+        o.setWebsitName(orderBase.getWebsitName());
+        o.setWorkerId(orderBase.getWorkerId());
+        o.setWorkerName(orderBase.getWorkerName());
+        o.setUserName(orderBase.getUserName());
+        o.setUserPhone(orderBase.getUserMobile());
+        o.setAddress(orderBase.getAddress());
+        // 产品大类
+        o.setMainId(orderBase.getMainId());
+        o.setMainName(orderBase.getMainName());
+
+        o.setAppraiseStatus(publicService.getAppraiseStatusT(s.getContent()));
+
+        o.setAppraiseContent(s.getContent());
+        o.setSource("JSM");
+
+        // 回访人id无
+        o.setRvisitNickName("");
+        // 回访人网点信息
+        // 售后网点处理
+        WebsitSH websitSH = publicService.ptshwdToshshwd(orderBase.getWebsitId(), orderBase.getMainId());
+        websitFWS = publicService.shshwdToptshwd(websitSH.getWdId(), orderBase);
+        if (StringUtils.isEmpty(websitFWS.getWebsitId())){
+            websitFWS = publicService.shxswdToptxswd(orderBase.getSaleWebsitId(), orderBase);
+        }
+        o.setRvisitWebsitId(websitFWS.getWebsitId());
+        o.setRvisitWebsitName(websitFWS.getWdmc());
+
+        /*
+        o.setRvisitTime(s.getHfsj());
+        o.setNegativeType(s.getBmylx());
+        o.setNegativeRemark(s.getBmybeiz());
+        o.setNegativeTime(s.getCreatedDate());
+        o.setAppointmentType(s.getMydlx());
+        */
+
+        if (StringUtils.isNotEmpty(spmessage)){
+            o.setType(1);
+        } else {
+            o.setType(2);
+        }
+
+        o.setCreateBy("syncdata");
+        o.setCreateTime(new Date());
+        if (s.getRecvTime()!=null){
+            o.setCreateTime(s.getRecvTime());
+        }
+        oanew.add(o);
+        return websitFWS;
+    }
+
     private void getOrderAppointment(OrderBase orderBase, List<OrderReAppointment> oa, List<ItfTblAzAssignAppointmentDownload> appointments) {
         for (ItfTblAzAssignAppointmentDownload a :appointments){
             OrderReAppointment v = new OrderReAppointment();

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

@@ -2308,7 +2308,8 @@ public class PublicServiceImpl implements PublicService {
         }
     }
 
-    private String getFaOrderSmsfsma(String phone) {
+    @Override
+    public String getFaOrderSmsfsma(String phone) {
         Random random = new Random(System.currentTimeMillis());
         String fsma="";
         List<FaOrderSms> fos = new ArrayList<>();