Ver Fonte

补评级差的/流失从营期剔除

三七 há 1 semana atrás
pai
commit
b64303e1fd

+ 5 - 0
fs-qw-task/src/main/java/com/fs/app/taskService/impl/QwExternalContactRatingServiceImpl.java

@@ -13,6 +13,7 @@ import com.fs.sop.mapper.SopUserLogsInfoMapper;
 import com.fs.sop.mapper.SopUserLogsMapper;
 import com.fs.sop.params.QwRatingConfig;
 import com.fs.sop.service.IQwSopTempDayService;
+import com.fs.sop.service.ISopUserLogsInfoService;
 import com.fs.sop.vo.QwRatingVO;
 import com.fs.system.service.ISysConfigService;
 import com.fs.voice.utils.StringUtil;
@@ -61,6 +62,9 @@ public class QwExternalContactRatingServiceImpl implements QwExternalContactRati
     @Autowired
     private QwExternalContactMapper qwExternalContactMapper;
 
+    @Autowired
+    private ISopUserLogsInfoService iSopUserLogsInfoService;
+
     @Autowired
     private ExecutorService sopRatingExecutor;  // 自定义线程池
 
@@ -247,6 +251,7 @@ public class QwExternalContactRatingServiceImpl implements QwExternalContactRati
             CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
                 try {
                     qwExternalContactMapper.batchUpdateQwExternalContact(batchList);
+                    iSopUserLogsInfoService.batchUpdateSopUserLogsInfoByLevel(batchList);
                     log.info("成功更新评级数据,起始索引: {}, 数量: {}", finalI, batchList.size());
                 } catch (Exception e) {
                     log.error("批量更新异常,批次起始索引: {}", finalI, e);

+ 13 - 7
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -713,7 +713,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             ruleTimeVO.setSendType(6);
             ruleTimeVO.setType(2);
             if (content.getIndex() == 0) {
-                QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null);
+                QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null,null);
                 handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                         type, qwUserId, companyUserId, companyId, groupChat.getChatId(), welcomeText, qwUserName,
                         null, true, miniAppId, groupChat,config, miniMap, null, sendMsgType,companies);
@@ -722,7 +722,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     groupChat.getChatUserList().forEach(user -> {
                         ruleTimeVO.setSendType(2);
                         ruleTimeVO.setRemark("客户群催课");
-                        QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, user.getUserId(), user.getName(), null, isOfficial, null);
+                        QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, user.getUserId(), user.getName(), null, isOfficial, null,null);
                         handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                                 type, qwUserId, companyUserId, companyId, user.getId().toString(), welcomeText, qwUserName,
                                 null, false, miniAppId, groupChat,config, miniMap, null, sendMsgType,companies);
@@ -737,7 +737,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     String externalUserName = contactId.getExternalUserName();
                     Long fsUserId = contactId.getFsUserId();
                     Integer grade = contactId.getGrade();
-                    QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, contactId.getExternalContactId(), externalUserName, fsUserId, isOfficial, contactId.getExternalId());
+                    QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, contactId.getExternalContactId(), externalUserName, fsUserId, isOfficial, contactId.getExternalId(),contactId.getIsDaysNotStudy());
                     handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                             type, qwUserId, companyUserId, companyId, externalId, welcomeText, qwUserName, fsUserId, false, miniAppId,
                             null,config, miniMap, grade, sendMsgType,companies);
@@ -783,7 +783,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
     private QwSopLogs createBaseLog(String formattedSendTime, SopUserLogsVo logVo,
                                     QwSopRuleTimeVO ruleTimeVO, String externalContactId,
                                     String externalUserName, Long fsUserId,Integer isOfficial,
-                                    Long externalId) {
+                                    Long externalId,Integer isDaysNotStudy) {
         QwSopLogs sopLogs = new QwSopLogs();
         sopLogs.setSendTime(formattedSendTime);
         sopLogs.setQwUserid(logVo.getQwUserId());
@@ -791,6 +791,15 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         sopLogs.setLogType(ruleTimeVO.getType());
         sopLogs.setTakeRecords(0);
 
+        if (isOfficial != 1 && Integer.valueOf(1).equals(isDaysNotStudy)) {
+            sopLogs.setSendStatus(5L);
+            sopLogs.setRemark("E级客户不发送");
+        }else {
+            sopLogs.setSendStatus(3L);
+        }
+
+        sopLogs.setReceivingStatus(0L);
+
         if (isOfficial == 1) {
 
             if (logVo.getIsSampSend()== 1) {
@@ -820,9 +829,6 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         }
 
 
-        sopLogs.setSendStatus(3L);
-        sopLogs.setReceivingStatus(0L);
-
         String[] userKey = logVo.getUserId().split("\\|");
         log.info("sopLogVo:{}", JSON.toJSONString(logVo));
         log.info("sop_logs -》 userId:{}", logVo.getUserId());

+ 2 - 2
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -4183,8 +4183,8 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     @Override
     public void deletefollowUserByExternalUserId(String externalUserID, String userID, String corpId) {
 
-        //客户删除销售-找这个销售的sop任务中所有的营期里有没有这个客户,删了(暂时不要删-这种流失的有些一样能发消息)
-//        sopUserLogsInfoMapper.deleteByQwUserIdAndCorpIdToContactId(userID,corpId, externalUserID);
+        //客户删除销售-找这个销售的sop任务中所有的营期里有没有这个客户(剔除营期)
+        sopUserLogsInfoMapper.deleteByQwUserIdAndCorpIdToContactId(userID,corpId, externalUserID);
         logger.error("客户删除销售-"+"|"+externalUserID+"|"+userID+"|"+corpId);
 
         QwExternalContact qwExternalContact = qwExternalContactMapper.selectQwExternalContactUserIdAndExternalIdAndCompanyId(externalUserID, userID, corpId);