|
@@ -747,18 +747,25 @@ public class CorpServiceImpl implements CorpService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (beforeRecord == null) {
|
|
if (beforeRecord == null) {
|
|
|
- CorpKfServicerSessionRecord newSession = new CorpKfServicerSessionRecord();
|
|
|
|
|
- newSession.setOpenKfId(openKfId);
|
|
|
|
|
- newSession.setServicerUserid(newServicerUserId);
|
|
|
|
|
- newSession.setExternalUserid(externalUserId);
|
|
|
|
|
- newSession.setChangeType(changeType);
|
|
|
|
|
- newSession.setServiceState(0);
|
|
|
|
|
- newSession.setStartTime(sendDate);
|
|
|
|
|
- newSession.setMsgid(msgId);
|
|
|
|
|
- corpKfServicerSessionRecordMapper.insert(newSession);
|
|
|
|
|
- //等待用户删除
|
|
|
|
|
- delQueueUser(openKfId, externalUserId, sendDate);
|
|
|
|
|
- syncUserChatSession(newSession.getId(), externalUserId);
|
|
|
|
|
|
|
+ CorpKfServicerSessionRecord corpKfServicerSessionRecord = corpKfServicerSessionRecordMapper.selectOne(Wrappers.lambdaQuery(CorpKfServicerSessionRecord.class)
|
|
|
|
|
+ .eq(CorpKfServicerSessionRecord::getOpenKfId, openKfId)
|
|
|
|
|
+ .eq(CorpKfServicerSessionRecord::getExternalUserid, externalUserId)
|
|
|
|
|
+ .eq(CorpKfServicerSessionRecord::getServiceState, 0)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (corpKfServicerSessionRecord == null) {
|
|
|
|
|
+ CorpKfServicerSessionRecord newSession = new CorpKfServicerSessionRecord();
|
|
|
|
|
+ newSession.setOpenKfId(openKfId);
|
|
|
|
|
+ newSession.setServicerUserid(newServicerUserId);
|
|
|
|
|
+ newSession.setExternalUserid(externalUserId);
|
|
|
|
|
+ newSession.setChangeType(changeType);
|
|
|
|
|
+ newSession.setServiceState(0);
|
|
|
|
|
+ newSession.setStartTime(sendDate);
|
|
|
|
|
+ newSession.setMsgid(msgId);
|
|
|
|
|
+ corpKfServicerSessionRecordMapper.insert(newSession);
|
|
|
|
|
+ //等待用户删除
|
|
|
|
|
+ delQueueUser(openKfId, externalUserId, sendDate);
|
|
|
|
|
+ syncUserChatSession(newSession.getId(), externalUserId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//2-转接会话
|
|
//2-转接会话
|
|
@@ -1180,11 +1187,12 @@ public class CorpServiceImpl implements CorpService {
|
|
|
* 接待人员接待状态变更记录
|
|
* 接待人员接待状态变更记录
|
|
|
*/
|
|
*/
|
|
|
private void recordCorpKfServicerState(String openKfId, WxCpKfMsgListResp.WxCpKfMsgItem item) {
|
|
private void recordCorpKfServicerState(String openKfId, WxCpKfMsgListResp.WxCpKfMsgItem item) {
|
|
|
- String servicerUserId = item.getServicerUserId();
|
|
|
|
|
|
|
+ String servicerUserId = item.getEvent().getServicerUserId();
|
|
|
//状态类型。1-接待中 2-停止接待
|
|
//状态类型。1-接待中 2-停止接待
|
|
|
- Integer status = item.getStatus();
|
|
|
|
|
|
|
+ Integer status = item.getEvent().getStatus();
|
|
|
//0:停止接待,1:暂时挂起
|
|
//0:停止接待,1:暂时挂起
|
|
|
- Integer stopType = item.getStopType();
|
|
|
|
|
|
|
+ Integer stopType = item.getEvent().getStopType();
|
|
|
|
|
+ log.info("接待人员状态变更事件:{}", servicerUserId);
|
|
|
CorpKfServicerStatusChangeRecord corpKfServicerStatusChangeRecord = new CorpKfServicerStatusChangeRecord();
|
|
CorpKfServicerStatusChangeRecord corpKfServicerStatusChangeRecord = new CorpKfServicerStatusChangeRecord();
|
|
|
corpKfServicerStatusChangeRecord.setOpenKfId(openKfId);
|
|
corpKfServicerStatusChangeRecord.setOpenKfId(openKfId);
|
|
|
corpKfServicerStatusChangeRecord.setServicerUserid(servicerUserId);
|
|
corpKfServicerStatusChangeRecord.setServicerUserid(servicerUserId);
|