吴树波 vor 3 Monaten
Ursprung
Commit
6cc51dc2c3

+ 2 - 2
fs-company/src/main/resources/application.yml

@@ -43,8 +43,8 @@ spring:
     # 国际化资源文件路径
     basename: i18n/messages
   profiles:
-#    active: dev
-    active: druid
+    active: dev
+#    active: druid
     include: config
   # 文件上传
   servlet:

+ 13 - 1
fs-service-system/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -1788,7 +1788,6 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
             qwSopAutoByTags.setSendType(2);
             List<QwSopRuleTimeVO> qwSopRuleTimeVOS = qwSopMapper.selectQwSopAutoByTagsByForeach(qwSopAutoByTags);
             try {
-                log.info("SOP任务:{}", qwSopRuleTimeVOS.size());
                 if (qwSopRuleTimeVOS != null && !qwSopRuleTimeVOS.isEmpty()) {
                     //SOP规则
                     qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
@@ -2592,7 +2591,20 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
     }
 
     private void qwAiSopRuleTimeTools(List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS, String userID, QwUser qwUser, String corpId, String externalUserID, String externalContactName, QwExternalContact contact) {
+
+        SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("qw.config");
+        List<SopUserLogsInfo> sopUserLogsInfos = sopUserLogsInfoMapper.repeatProject(PubFun.listToNewList(qwSopAiRuleTimeVOS, QwSopRuleTimeVO::getProject), externalUserID);
+        Map<Integer, List<String>> collect = sopUserLogsInfos.stream().collect(Collectors.groupingBy(SopUserLogsInfo::getProject, Collectors.mapping(SopUserLogsInfo::getSopId, Collectors.toList())));
         qwSopAiRuleTimeVOS.forEach(ruleTimeVO -> {
+            if(sysConfig != null){
+                QwConfig qwConfig = JSON.parseObject(sysConfig.getConfigValue(), QwConfig.class);
+                if(qwConfig.isProject()){
+                    List<String> sopIdList = collect.get(ruleTimeVO.getProject());
+                    log.info("是否多个项目:{}", sopIdList);
+                    if(sopIdList.isEmpty()) return;
+                    if(sopIdList.contains(ruleTimeVO.getId())) return;
+                }
+            }
             SopUserLogsInfo sopUserLogsInfo = new SopUserLogsInfo();
             sopUserLogsInfo.setQwUserId(userID.trim());
             sopUserLogsInfo.setCorpId(corpId.trim());