|
|
@@ -104,6 +104,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
private static final String miniappRealLink = "/pages_course/video.html?course=";
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AsyncQwAiChatSopService asyncQwAiChatSopService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private QwExternalContactMapper qwExternalContactMapper;
|
|
|
@Autowired
|
|
|
@@ -2793,6 +2796,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
|
@@ -3242,6 +3253,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()){
|
|
|
@@ -5023,6 +5041,11 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
|
+
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
+ if (!sopAiChatByRedis) {
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags, userID, qwUser, externalUserID, externalContact.getName(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
|
@@ -5061,6 +5084,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
+
|
|
|
// //aiSop任务
|
|
|
// logger.info("/n 传参:" + qwSopAutoByTags);
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
@@ -5095,6 +5124,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
+
|
|
|
// //aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
|
@@ -5312,6 +5347,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
qwSopRuleTimeTools(qwSopRuleTimeVOS, qwUserId, qwUser, corpId, ext, externalContact.getName(), contact, currentDate, localTime, combinedTagsList);
|
|
|
}
|
|
|
+
|
|
|
+ Boolean sopAiChatByRedis = getSopAiChatByRedis(userID, corpId, externalUserID);
|
|
|
+ if (!sopAiChatByRedis) {
|
|
|
+ asyncQwAiChatSopService.executeQwAiChatSop(qwSopAutoByTags, userID, qwUser, externalUserID, externalContact.getName(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
+
|
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
|
@@ -5343,6 +5384,11 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
|
@@ -5370,6 +5416,12 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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(), qwExternalContact.getId(), qwExternalContact.getFsUserId(), currentDate, localTime);
|
|
|
+ }
|
|
|
+
|
|
|
//aiSop任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
|
@@ -5827,7 +5879,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//更新客户营期是否已购字段
|
|
|
SopUserLogsInfo mapLog = new SopUserLogsInfo();
|
|
|
mapLog.setId(sop.getUserLogId());
|
|
|
- map.setIsProductBuy(2);
|
|
|
+ mapLog.setIsProductBuy(2);
|
|
|
sopUserLogsInfoMapper.updateById(mapLog);
|
|
|
}
|
|
|
if (sop.getUpsellProductIds().contains(packageId.toString())) {
|
|
|
@@ -5846,7 +5898,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//更新客户营期是否已购字段
|
|
|
SopUserLogsInfo mapLog = new SopUserLogsInfo();
|
|
|
mapLog.setId(sop.getUserLogId());
|
|
|
- map.setIsUpsellProductBuy(2);
|
|
|
+ mapLog.setIsUpsellProductBuy(2);
|
|
|
sopUserLogsInfoMapper.updateById(mapLog);
|
|
|
}
|
|
|
} catch (JSONException e) {
|