|
@@ -716,7 +716,8 @@ public class CorpServiceImpl implements CorpService {
|
|
|
String newServicerUserId = event.getNewServicerUserId();
|
|
String newServicerUserId = event.getNewServicerUserId();
|
|
|
String msgId = wxCpKfMsgItem.getMsgId();
|
|
String msgId = wxCpKfMsgItem.getMsgId();
|
|
|
String msgCode = wxCpKfMsgItem.getEvent().getMsgCode();
|
|
String msgCode = wxCpKfMsgItem.getEvent().getMsgCode();
|
|
|
- if (changeType == 1) {
|
|
|
|
|
|
|
+ //1-从接待池接入会话 4-重新接入已结束/已转接会话
|
|
|
|
|
+ if (changeType == 1 || changeType == 4) {
|
|
|
CorpKfServicerSessionRecord newSession = new CorpKfServicerSessionRecord();
|
|
CorpKfServicerSessionRecord newSession = new CorpKfServicerSessionRecord();
|
|
|
newSession.setOpenKfId(openKfId);
|
|
newSession.setOpenKfId(openKfId);
|
|
|
newSession.setServicerUserid(newServicerUserId);
|
|
newSession.setServicerUserid(newServicerUserId);
|
|
@@ -736,8 +737,8 @@ public class CorpServiceImpl implements CorpService {
|
|
|
setDbSessionState(openKfId, oldServicerUserId, externalUserId, sendDate, changeType, msgId, msgCode);
|
|
setDbSessionState(openKfId, oldServicerUserId, externalUserId, sendDate, changeType, msgId, msgCode);
|
|
|
transCorpKfSessionToServicer(corpId, openKfId, oldServicerUserId, newServicerUserId, externalUserId, changeType, 3, sendDate, msgId);
|
|
transCorpKfSessionToServicer(corpId, openKfId, oldServicerUserId, newServicerUserId, externalUserId, changeType, 3, sendDate, msgId);
|
|
|
}
|
|
}
|
|
|
- //3-结束会话 4-重新接入已结束/已转接会话
|
|
|
|
|
- if (changeType == 3 || changeType == 4) {
|
|
|
|
|
|
|
+ //3-结束会话
|
|
|
|
|
+ if (changeType == 3) {
|
|
|
setDbSessionState(openKfId, oldServicerUserId, externalUserId, sendDate, changeType, msgId, msgCode);
|
|
setDbSessionState(openKfId, oldServicerUserId, externalUserId, sendDate, changeType, msgId, msgCode);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1000,27 +1001,6 @@ public class CorpServiceImpl implements CorpService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
corpKfServicerSessionRecordMapper.updateById(corpKfServicerSessionRecord);
|
|
corpKfServicerSessionRecordMapper.updateById(corpKfServicerSessionRecord);
|
|
|
- } else {
|
|
|
|
|
- corpKfServicerSessionRecord = new CorpKfServicerSessionRecord();
|
|
|
|
|
- corpKfServicerSessionRecord.setOpenKfId(openKfId);
|
|
|
|
|
- corpKfServicerSessionRecord.setServicerUserid(servicerUserid);
|
|
|
|
|
- corpKfServicerSessionRecord.setExternalUserid(externalUserId);
|
|
|
|
|
- corpKfServicerSessionRecord.setServiceState(changeType != 2 ? 1 : changeType);
|
|
|
|
|
- corpKfServicerSessionRecord.setMsgid(msgid);
|
|
|
|
|
- corpKfServicerSessionRecord.setCloseTime(sendDate);
|
|
|
|
|
- corpKfServicerSessionRecordMapper.insert(corpKfServicerSessionRecord);
|
|
|
|
|
- //同步用户该次接待记录
|
|
|
|
|
- syncUserChatSession(corpKfServicerSessionRecord.getId(), externalUserId);
|
|
|
|
|
- //同步会话最早德发送时间
|
|
|
|
|
- CorpKfAccountSessionChat beginChat = corpKfAccountSessionChatMapper.selectOne(Wrappers.lambdaQuery(CorpKfAccountSessionChat.class)
|
|
|
|
|
- .eq(CorpKfAccountSessionChat::getSessionId, corpKfServicerSessionRecord.getId())
|
|
|
|
|
- .eq(CorpKfAccountSessionChat::getExternalUserid, externalUserId)
|
|
|
|
|
- .orderByAsc(CorpKfAccountSessionChat::getId)
|
|
|
|
|
- .last("limit 1"));
|
|
|
|
|
- if (beginChat != null) {
|
|
|
|
|
- corpKfServicerSessionRecord.setStartTime(beginChat.getSendDate());
|
|
|
|
|
- corpKfServicerSessionRecordMapper.updateById(corpKfServicerSessionRecord);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|