|
@@ -1157,7 +1157,7 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private void saveQwUserMsg(FastGptChatSession fastGptChatSession,Integer sendType,String content) {
|
|
|
|
|
|
|
+ private void saveQwUserMsg(FastGptChatSession fastGptChatSession,Integer sendType,String content,QwUser sendUser) {
|
|
|
content = replaceWxEmo(content);
|
|
content = replaceWxEmo(content);
|
|
|
if(content.isEmpty()){
|
|
if(content.isEmpty()){
|
|
|
return;
|
|
return;
|
|
@@ -1168,6 +1168,7 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
fastGptChatMsgAi.setRoleId(Long.parseLong(fastGptChatSession.getKfId()));
|
|
fastGptChatMsgAi.setRoleId(Long.parseLong(fastGptChatSession.getKfId()));
|
|
|
fastGptChatMsgAi.setSendType(sendType);
|
|
fastGptChatMsgAi.setSendType(sendType);
|
|
|
fastGptChatMsgAi.setCompanyId(fastGptChatSession.getCompanyId());
|
|
fastGptChatMsgAi.setCompanyId(fastGptChatSession.getCompanyId());
|
|
|
|
|
+ fastGptChatMsgAi.setCompanyUserId(sendUser.getCompanyUserId());
|
|
|
fastGptChatMsgAi.setUserId(fastGptChatSession.getUserId());
|
|
fastGptChatMsgAi.setUserId(fastGptChatSession.getUserId());
|
|
|
fastGptChatMsgAi.setUserType(1);
|
|
fastGptChatMsgAi.setUserType(1);
|
|
|
fastGptChatMsgAi.setMsgType(1);
|
|
fastGptChatMsgAi.setMsgType(1);
|
|
@@ -1972,7 +1973,7 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
}
|
|
}
|
|
|
FastGptChatSession fastGptChatSession = fastGptChatSessionMapper.selectFastGptChatSessionByQwExternalContactsAndUserId(qwExternalContacts.getId(), sendUser.getId());
|
|
FastGptChatSession fastGptChatSession = fastGptChatSessionMapper.selectFastGptChatSessionByQwExternalContactsAndUserId(qwExternalContacts.getId(), sendUser.getId());
|
|
|
if (fastGptChatSession!=null){
|
|
if (fastGptChatSession!=null){
|
|
|
- saveQwUserMsg(fastGptChatSession,2,count);
|
|
|
|
|
|
|
+ saveQwUserMsg(fastGptChatSession,2,count,sendUser);
|
|
|
// 客服进行回复后就转人工10分钟
|
|
// 客服进行回复后就转人工10分钟
|
|
|
if(type == 1){
|
|
if(type == 1){
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
@@ -2012,9 +2013,10 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
fastGptChatSession.setCompanyId(sendUser.getCompanyId());
|
|
fastGptChatSession.setCompanyId(sendUser.getCompanyId());
|
|
|
fastGptChatSession.setLastTime(new Date());
|
|
fastGptChatSession.setLastTime(new Date());
|
|
|
fastGptChatSession.setIsReply(0);
|
|
fastGptChatSession.setIsReply(0);
|
|
|
|
|
+ fastGptChatSession.setUserId(String.valueOf(sender));
|
|
|
fastGptChatSessionMapper.insertFastGptChatSession(fastGptChatSession);
|
|
fastGptChatSessionMapper.insertFastGptChatSession(fastGptChatSession);
|
|
|
addUserSex(qwExternalContacts);
|
|
addUserSex(qwExternalContacts);
|
|
|
- saveQwUserMsg(fastGptChatSession,2,count);
|
|
|
|
|
|
|
+ saveQwUserMsg(fastGptChatSession,2,count,sendUser);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2036,7 +2038,7 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
}
|
|
}
|
|
|
FastGptChatSession fastGptChatSession = fastGptChatSessionMapper.selectFastGptChatSessionByQwExternalContactsAndUserId(qwExternalContacts.getId(), sendUser.getId());
|
|
FastGptChatSession fastGptChatSession = fastGptChatSessionMapper.selectFastGptChatSessionByQwExternalContactsAndUserId(qwExternalContacts.getId(), sendUser.getId());
|
|
|
if (fastGptChatSession!=null){
|
|
if (fastGptChatSession!=null){
|
|
|
- saveQwUserMsg(fastGptChatSession,2,count);
|
|
|
|
|
|
|
+ saveQwUserMsg(fastGptChatSession,2,count,sendUser);
|
|
|
}else {
|
|
}else {
|
|
|
|
|
|
|
|
if(qwExternalContacts.getType()!=null&&qwExternalContacts.getType()==1){
|
|
if(qwExternalContacts.getType()!=null&&qwExternalContacts.getType()==1){
|
|
@@ -2059,7 +2061,7 @@ public class AiHookServiceImpl implements AiHookService {
|
|
|
fastGptChatSession.setIsReply(0);
|
|
fastGptChatSession.setIsReply(0);
|
|
|
fastGptChatSessionMapper.insertFastGptChatSession(fastGptChatSession);
|
|
fastGptChatSessionMapper.insertFastGptChatSession(fastGptChatSession);
|
|
|
addUserSex(qwExternalContacts);
|
|
addUserSex(qwExternalContacts);
|
|
|
- saveQwUserMsg(fastGptChatSession,2,count);
|
|
|
|
|
|
|
+ saveQwUserMsg(fastGptChatSession,2,count,sendUser);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|