|
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fs.ad.enums.AdUploadType;
|
|
import com.fs.ad.enums.AdUploadType;
|
|
|
import com.fs.ad.service.IAdHtmlClickLogService;
|
|
import com.fs.ad.service.IAdHtmlClickLogService;
|
|
@@ -49,6 +50,7 @@ import com.fs.qwApi.domain.*;
|
|
|
import com.fs.qwApi.domain.inner.*;
|
|
import com.fs.qwApi.domain.inner.*;
|
|
|
import com.fs.qwApi.param.*;
|
|
import com.fs.qwApi.param.*;
|
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
|
|
|
+import com.fs.repeat.vo.RepeatUploadVo;
|
|
|
import com.fs.sop.domain.QwSop;
|
|
import com.fs.sop.domain.QwSop;
|
|
|
import com.fs.sop.domain.SopUserLogs;
|
|
import com.fs.sop.domain.SopUserLogs;
|
|
|
import com.fs.sop.domain.SopUserLogsInfo;
|
|
import com.fs.sop.domain.SopUserLogsInfo;
|
|
@@ -202,6 +204,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysDictTypeService dictTypeService;
|
|
private ISysDictTypeService dictTypeService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private AsyncQwAiChatSopService asyncQwAiChatSopService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
@@ -2168,9 +2173,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Override
|
|
@Override
|
|
|
public QwUser getQwUserByRedisForId(String qwUserId) {
|
|
public QwUser getQwUserByRedisForId(String qwUserId) {
|
|
|
String key =(String)redisCache.getCacheObject("qwUserRdById:"+qwUserId);
|
|
String key =(String)redisCache.getCacheObject("qwUserRdById:"+qwUserId);
|
|
|
- if (!StringUtil.strIsNullOrEmpty(key)){
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(key)&& !StringUtil.strIsNullOrEmpty(key)){
|
|
|
return JSON.parseObject(key, QwUser.class);
|
|
return JSON.parseObject(key, QwUser.class);
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.error("qwUserId:{}",qwUserId);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(qwUserId)||qwUserId.equals("null")){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
QwUser qwUser = qwUserMapper.selectQwUserById(Long.valueOf(qwUserId));
|
|
QwUser qwUser = qwUserMapper.selectQwUserById(Long.valueOf(qwUserId));
|
|
|
if (qwUser==null){
|
|
if (qwUser==null){
|
|
|
return null;
|
|
return null;
|
|
@@ -2183,6 +2192,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Override
|
|
@Override
|
|
|
public void insertQwExternalContactByExternalUserId(String externalUserID, String userID, Long companyId, String corpId, String state, String welcomeCode) throws ParseException {
|
|
public void insertQwExternalContactByExternalUserId(String externalUserID, String userID, Long companyId, String corpId, String state, String welcomeCode) throws ParseException {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String qwApiExternal=redisCache.getCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID);
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(qwApiExternal)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ redisCache.setCacheObject("qwApiExternal:"+userID+":"+corpId+":"+externalUserID ,"1",10, TimeUnit.MINUTES);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 获取当前日期(只包含年月日)
|
|
// 获取当前日期(只包含年月日)
|
|
|
LocalDate currentDate = LocalDate.now();
|
|
LocalDate currentDate = LocalDate.now();
|
|
|
// 获取当前系统时间 (HH:mm)
|
|
// 获取当前系统时间 (HH:mm)
|
|
@@ -2221,6 +2238,21 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
// logger.error("重粉提交mq失败", e);
|
|
// logger.error("重粉提交mq失败", e);
|
|
|
// }
|
|
// }
|
|
|
// iAdHtmlClickLogService.upload(state, AdUploadType.ADD_WX, e -> finalQwExternalContact.setUploadAddWxStatus(1));
|
|
// iAdHtmlClickLogService.upload(state, AdUploadType.ADD_WX, e -> finalQwExternalContact.setUploadAddWxStatus(1));
|
|
|
|
|
+ //重粉问题
|
|
|
|
|
+ try {
|
|
|
|
|
+ new Thread(() -> {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Thread.sleep(3000);
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ logger.error("添加等待时长错误", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ rocketMQTemplate.syncSend("repeat-upload", JSON.toJSONString(RepeatUploadVo.builder().type(0).externalUserId(externalUserID).build()));
|
|
|
|
|
+ }).start();
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ logger.error("重粉提交mq失败", e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//先入一次库
|
|
//先入一次库
|
|
|
if (isNewQwExternalContact) {
|
|
if (isNewQwExternalContact) {
|
|
@@ -2503,65 +2535,84 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
String tagRemark = null;
|
|
String tagRemark = null;
|
|
|
//根据qwUser 匹配 分时段的标签
|
|
//根据qwUser 匹配 分时段的标签
|
|
|
QwAutoTags qwAutoTags = qwAutoTagsMapper.selectQwAutoTagsByIdJSON(corpId, qwUser.getId());
|
|
QwAutoTags qwAutoTags = qwAutoTagsMapper.selectQwAutoTagsByIdJSON(corpId, qwUser.getId());
|
|
|
- if (qwAutoTags != null) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 渠道活码是否有标签
|
|
|
|
|
+ boolean isContactWay = isWay && wayId.getIsTag() == 1;
|
|
|
|
|
+ logger.info("渠道活码是否有标签,{}", isContactWay);
|
|
|
|
|
+
|
|
|
|
|
+ if (qwAutoTags != null || isContactWay) {
|
|
|
|
|
+ boolean isMatch = false;
|
|
|
|
|
+ //存符合条件的标签
|
|
|
|
|
+ Set<String> combinedTagsItem = new HashSet<>();
|
|
|
//标签日志记录
|
|
//标签日志记录
|
|
|
- qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
|
|
|
|
|
- qwAutoTagsLogs.setType(3L);
|
|
|
|
|
- qwAutoTagsLogs.setQwUserid(qwUser.getId());
|
|
|
|
|
- qwAutoTagsLogs.setExternalUserId(externalUserID);
|
|
|
|
|
- List<QwAutoTagsRulesTags> qwAutoTagsRulesTagsList = JSON.parseArray(qwAutoTags.getRulesTags(), QwAutoTagsRulesTags.class);
|
|
|
|
|
- boolean isMatch = false;
|
|
|
|
|
- //存分时段里符合条件的标签
|
|
|
|
|
- Set<String> combinedTagsItem = new HashSet<>();
|
|
|
|
|
- // 获取今天的星期数
|
|
|
|
|
- DayOfWeek today = LocalDate.now().getDayOfWeek();
|
|
|
|
|
- int todayIndex = today.getValue(); // 1: Monday, 2: Tuesday, ..., 7: Sunday
|
|
|
|
|
- // 获取当前时间
|
|
|
|
|
- LocalTime now = LocalTime.now();
|
|
|
|
|
- // 遍历所有规则
|
|
|
|
|
- for (QwAutoTagsRulesTags rulesTags : qwAutoTagsRulesTagsList) {
|
|
|
|
|
- List<String> tagsItem = rulesTags.getTags();
|
|
|
|
|
- List<Integer> week = rulesTags.getWeek();
|
|
|
|
|
- String startTime = rulesTags.getStartTime();
|
|
|
|
|
- String endTime = rulesTags.getEndTime();
|
|
|
|
|
- String remarks = rulesTags.getRemarks();
|
|
|
|
|
-
|
|
|
|
|
- // 检查今天是否在 week 集合中
|
|
|
|
|
- boolean isTodayInWeek = week.contains(todayIndex);
|
|
|
|
|
- // 转换时间字符串为 LocalTime
|
|
|
|
|
- LocalTime start = LocalTime.parse(startTime);
|
|
|
|
|
- LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
|
|
|
|
|
- // 检查当前时间是否在 startTime 和 endTime 之间
|
|
|
|
|
- boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
|
|
|
|
|
- // 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
|
|
|
|
|
- if (isTodayInWeek && isNowInTimeRange) {
|
|
|
|
|
-
|
|
|
|
|
- combinedTagsSet.addAll(tagsItem);
|
|
|
|
|
- combinedTagsItem.addAll(tagsItem);
|
|
|
|
|
- isMatch = true;
|
|
|
|
|
- if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
|
|
|
|
|
- String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
|
|
|
|
|
- tagRemark=DayDate.substring(1);
|
|
|
|
|
- }
|
|
|
|
|
- //如果备注不为空
|
|
|
|
|
- if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
|
|
|
|
|
- String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
|
|
|
|
|
- tagRemark=DayDate.substring(1);
|
|
|
|
|
- }
|
|
|
|
|
- //如果备注不为空
|
|
|
|
|
- if (!StringUtil.strIsNullOrEmpty(remarks)){
|
|
|
|
|
- tagRemark = (tagRemark==null?"":(tagRemark+ "-") ) +remarks;
|
|
|
|
|
|
|
+ if(qwAutoTags != null) {
|
|
|
|
|
+ qwAutoTagsLogs.setAutoTagId(qwAutoTags.getId());
|
|
|
|
|
+ qwAutoTagsLogs.setType(3L);
|
|
|
|
|
+ qwAutoTagsLogs.setQwUserid(qwUser.getId());
|
|
|
|
|
+ qwAutoTagsLogs.setExternalUserId(externalUserID);
|
|
|
|
|
+ List<QwAutoTagsRulesTags> qwAutoTagsRulesTagsList = JSON.parseArray(qwAutoTags.getRulesTags(), QwAutoTagsRulesTags.class);
|
|
|
|
|
+ // 获取今天的星期数
|
|
|
|
|
+ DayOfWeek today = LocalDate.now().getDayOfWeek();
|
|
|
|
|
+ int todayIndex = today.getValue(); // 1: Monday, 2: Tuesday, ..., 7: Sunday
|
|
|
|
|
+ // 获取当前时间
|
|
|
|
|
+ LocalTime now = LocalTime.now();
|
|
|
|
|
+ // 遍历所有规则
|
|
|
|
|
+ for (QwAutoTagsRulesTags rulesTags : qwAutoTagsRulesTagsList) {
|
|
|
|
|
+ List<String> tagsItem = rulesTags.getTags();
|
|
|
|
|
+ List<Integer> week = rulesTags.getWeek();
|
|
|
|
|
+ String startTime = rulesTags.getStartTime();
|
|
|
|
|
+ String endTime = rulesTags.getEndTime();
|
|
|
|
|
+ String remarks = rulesTags.getRemarks();
|
|
|
|
|
+
|
|
|
|
|
+ // 检查今天是否在 week 集合中
|
|
|
|
|
+ boolean isTodayInWeek = week.contains(todayIndex);
|
|
|
|
|
+ // 转换时间字符串为 LocalTime
|
|
|
|
|
+ LocalTime start = LocalTime.parse(startTime);
|
|
|
|
|
+ LocalTime end = LocalTime.parse(endTime.equals("24:00") ? "23:59:59" : endTime);
|
|
|
|
|
+ // 检查当前时间是否在 startTime 和 endTime 之间
|
|
|
|
|
+ boolean isNowInTimeRange = !now.isBefore(start) && !now.isAfter(end);
|
|
|
|
|
+ // 如果当前时间和日期匹配规则,将 tagsItem 添加到 combinedTagsSet 中
|
|
|
|
|
+ if (isTodayInWeek && isNowInTimeRange) {
|
|
|
|
|
+
|
|
|
|
|
+ combinedTagsSet.addAll(tagsItem);
|
|
|
|
|
+ combinedTagsItem.addAll(tagsItem);
|
|
|
|
|
+ isMatch = true;
|
|
|
|
|
+ if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
|
|
|
|
|
+ String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
|
|
|
|
|
+ tagRemark=DayDate.substring(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ //如果备注不为空
|
|
|
|
|
+ if (rulesTags.getIsDay()!=null&&rulesTags.getIsDay()==1){
|
|
|
|
|
+ String DayDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyMMdd"));
|
|
|
|
|
+ tagRemark=DayDate.substring(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ //如果备注不为空
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(remarks)){
|
|
|
|
|
+ tagRemark = (tagRemark==null?"":(tagRemark+ "-") ) +remarks;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 如果有匹配的规则,使用 combinedTagsList
|
|
// 如果有匹配的规则,使用 combinedTagsList
|
|
|
- if (isMatch) {
|
|
|
|
|
|
|
+ if (isMatch || isContactWay) {
|
|
|
// 转换一下分时段-符合 条件的 列表
|
|
// 转换一下分时段-符合 条件的 列表
|
|
|
List<String> combinedTags = new ArrayList<>(combinedTagsItem);
|
|
List<String> combinedTags = new ArrayList<>(combinedTagsItem);
|
|
|
qwAutoTagsLogs.setEffectiveRules(JSON.toJSONString(combinedTags));
|
|
qwAutoTagsLogs.setEffectiveRules(JSON.toJSONString(combinedTags));
|
|
|
qwAutoTagsLogs.setAddTime(new Date());
|
|
qwAutoTagsLogs.setAddTime(new Date());
|
|
|
qwAutoTagsLogs.setCompanyId(qwUser.getCompanyId());
|
|
qwAutoTagsLogs.setCompanyId(qwUser.getCompanyId());
|
|
|
qwAutoTagsLogs.setCorpId(qwUser.getCorpId());
|
|
qwAutoTagsLogs.setCorpId(qwUser.getCorpId());
|
|
|
|
|
+
|
|
|
|
|
+ //有标签
|
|
|
|
|
+ if (isWay && wayId.getIsTag() == 1) {
|
|
|
|
|
+ //渠道活码的标签
|
|
|
|
|
+ List<String> wayTags = JSON.parseArray(wayId.getTags(), String.class);
|
|
|
|
|
+ //总添加标签
|
|
|
|
|
+// combinedTagsSet.addAll(wayTags);
|
|
|
|
|
+ combinedTagsSet = new HashSet<>(wayTags);
|
|
|
|
|
+ logger.info("渠道活码标签,{}===============,打的标签={}", wayTags,combinedTagsSet);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//总标签 转换回列表
|
|
//总标签 转换回列表
|
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
|
// 设置标签
|
|
// 设置标签
|
|
@@ -2592,7 +2643,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
// 转换回列表
|
|
// 转换回列表
|
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
|
|
|
|
|
|
- logger.info("不符合分时段条件2--看全部标签是否有符合的:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
|
|
|
|
+ logger.info("不符合分时段条件2--看全部标签是否有符合的11111:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
//检查sop进营期
|
|
//检查sop进营期
|
|
@@ -2608,7 +2659,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
// 转换回列表
|
|
// 转换回列表
|
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
List<String> combinedTagsList = new ArrayList<>(combinedTagsSet);
|
|
|
|
|
|
|
|
- logger.error("不符合分时段条件2--看全部标签是否有符合的:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
|
|
|
|
+ logger.error("不符合分时段条件2--看全部标签是否有符合的22222:"+combinedTagsList+"|"+externalUserID+"|"+userID+"|"+corpId);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
checkHaveQwSop(combinedTagsSet, qwUser, corpId,combinedTagsList, userID, externalUserID,
|
|
checkHaveQwSop(combinedTagsSet, qwUser, corpId,combinedTagsList, userID, externalUserID,
|
|
@@ -2624,27 +2675,28 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
|
|
//有渠道活码
|
|
//有渠道活码
|
|
|
if (isWay && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
|
|
if (isWay && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
|
|
|
-
|
|
|
|
|
|
|
+ logger.info("已进入有渠道活码的方法===============");
|
|
|
if (wayId.getIsDescription() == 1) {
|
|
if (wayId.getIsDescription() == 1) {
|
|
|
qwExternalContact.setDescription(wayId.getDescription());
|
|
qwExternalContact.setDescription(wayId.getDescription());
|
|
|
}
|
|
}
|
|
|
if (wayId.getIsRemark() == 1) {
|
|
if (wayId.getIsRemark() == 1) {
|
|
|
if (wayId.getRemarkStatus() == 1) {
|
|
if (wayId.getRemarkStatus() == 1) {
|
|
|
- if (!StringUtil.strIsNullOrEmpty(tagRemark)){
|
|
|
|
|
- qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark()+"-"+tagRemark);
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+// if (!StringUtil.strIsNullOrEmpty(tagRemark)){
|
|
|
|
|
+// qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark()+"-"+tagRemark);
|
|
|
|
|
+// }else {
|
|
|
qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark());
|
|
qwExternalContact.setRemark(externalContact.getName() + "-" + wayId.getRemark());
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
- if (!StringUtil.strIsNullOrEmpty(tagRemark)){
|
|
|
|
|
- qwExternalContact.setRemark(tagRemark+"-"+wayId.getRemark() + "-" + externalContact.getName());
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+// if (!StringUtil.strIsNullOrEmpty(tagRemark)){
|
|
|
|
|
+// qwExternalContact.setRemark(tagRemark+"-"+wayId.getRemark() + "-" + externalContact.getName());
|
|
|
|
|
+// }else {
|
|
|
qwExternalContact.setRemark(wayId.getRemark() + "-" + externalContact.getName());
|
|
qwExternalContact.setRemark(wayId.getRemark() + "-" + externalContact.getName());
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ logger.info("最终的备注:{}", qwExternalContact.getRemark());
|
|
|
if (wayId.getIsDescription() == 1 || wayId.getIsRemark() == 1) {
|
|
if (wayId.getIsDescription() == 1 || wayId.getIsRemark() == 1) {
|
|
|
|
|
|
|
|
QwExternalContactRemarkParam param = new QwExternalContactRemarkParam();
|
|
QwExternalContactRemarkParam param = new QwExternalContactRemarkParam();
|
|
@@ -2665,15 +2717,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
logger.info("修改备注:{}", remarkResult);
|
|
logger.info("修改备注:{}", remarkResult);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- //有标签
|
|
|
|
|
- if (wayId.getIsTag() == 1) {
|
|
|
|
|
- //渠道活码的标签
|
|
|
|
|
- List<String> wayTags = JSON.parseArray(wayId.getTags(), String.class);
|
|
|
|
|
- //总添加标签
|
|
|
|
|
- combinedTagsSet.addAll(wayTags);
|
|
|
|
|
- //用户存标签
|
|
|
|
|
- qwExternalContact.setTagIds(wayId.getTags());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
if (!StringUtil.strIsNullOrEmpty(tagRemark) && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
|
|
if (!StringUtil.strIsNullOrEmpty(tagRemark) && (StringUtil.strIsNullOrEmpty(followUser.getRemark()) || StringUtils.equals(followUser.getRemark().trim(),externalContact.getName().trim()))) {
|
|
@@ -2767,6 +2811,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS,userID,qwUser,corpId,externalUserID,externalContact.getName(),contact,currentDate,localTime,combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS,userID,qwUser,corpId,externalUserID,externalContact.getName(),contact,currentDate,localTime,combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //新客对话任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
//aiSop任务
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
@@ -3216,6 +3267,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS,contact.getUserId(),qwUser,contact.getCorpId(),contact.getExternalUserId(),contact.getName(),contact,currentDate,localTime,combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS,contact.getUserId(),qwUser,contact.getCorpId(),contact.getExternalUserId(),contact.getName(),contact,currentDate,localTime,combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(qwUser.getQwUserId(), qwUser.getCorpId(), contact.getExternalUserId());
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,qwUser.getQwUserId(),qwUser, contact.getExternalUserId()
|
|
|
|
|
+ ,contact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
// //aiSop任务
|
|
// //aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
@@ -4976,6 +5033,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //aiSop任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//aiSop任务
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5014,6 +5079,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //aiSop任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// //aiSop任务
|
|
// //aiSop任务
|
|
|
// logger.info("/n 传参:" + qwSopAutoByTags);
|
|
// logger.info("/n 传参:" + qwSopAutoByTags);
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
@@ -5048,6 +5121,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //新客对话任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// //aiSop任务
|
|
// //aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5264,6 +5345,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //aiSop任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//aiSop任务
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5295,6 +5384,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //aiSop任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
//aiSop任务
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5322,6 +5418,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, userID, qwUser, corpId, externalUserID, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //aiSop任务
|
|
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
|
|
+ if (!sopAiChatByRedis){
|
|
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags,userID,qwUser,externalUserID
|
|
|
|
|
+ ,externalContact.getName(),contact.getId(),contact.getFsUserId(),currentDate,localTime);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//aiSop任务
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|