|
@@ -202,6 +202,9 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Autowired
|
|
|
private ISysDictTypeService dictTypeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AsyncQwAiChatSopService asyncQwAiChatSopService;
|
|
|
+
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
@@ -2183,6 +2186,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
@Override
|
|
|
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();
|
|
|
// 获取当前系统时间 (HH:mm)
|
|
@@ -2767,6 +2778,13 @@ 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()){
|
|
@@ -3216,6 +3234,12 @@ 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()){
|
|
@@ -3398,6 +3422,15 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
|
|
|
}
|
|
|
|
|
|
+ try {
|
|
|
+
|
|
|
+ asyncQwAiChatSopService.executeQwSopJobTransfer(transferLogVO.getExternalContactId(), logsInfoNew.getExternalId());
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("在职转接-转接客户AI信息失败:{},{}",transferLogVO.getExternalContactId(),logsInfoNew.getExternalId(),e);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//删除原员工对此客户的营期信息
|
|
|
sopUserLogsInfoMapper.deleteById(logsInfoOld.getId());
|
|
|
|
|
@@ -4976,6 +5009,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5014,6 +5055,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// logger.info("/n 传参:" + qwSopAutoByTags);
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
@@ -5048,6 +5097,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()) {
|
|
@@ -5264,6 +5321,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5295,6 +5360,13 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|
|
@@ -5322,6 +5394,14 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
//SOP规则
|
|
|
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任务
|
|
|
// List<QwSopRuleTimeVO> qwSopAiRuleTimeVOS = qwSopMapper.selectQwAiSopAutoByTagsByForeach(qwSopAutoByTags);
|
|
|
// if (qwSopAiRuleTimeVOS != null && !qwSopAiRuleTimeVOS.isEmpty()) {
|