|
|
@@ -938,6 +938,9 @@ public class CorpServiceImpl implements CorpService {
|
|
|
//发送进入等待池消息
|
|
|
sendCorpKfTextTips(corpId, externalUserid, openKfId, corpKfAccountSessionConfig.getNoDutyTips());
|
|
|
moveWaitingQueue(corpId, openKfId, externalUserid);
|
|
|
+ if (redisService.hasKey(RedisService.key.CORP_KF_SEESION_ASSIGN_KEY.getName())) {
|
|
|
+ redisService.del(RedisService.key.CORP_KF_SEESION_ASSIGN_KEY.getName());
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
//获取接待人员列表
|
|
|
@@ -958,6 +961,9 @@ public class CorpServiceImpl implements CorpService {
|
|
|
sendCorpKfTextTips(corpId, externalUserid, openKfId, dynamicQueueTipsGroupsMsg);
|
|
|
//接入等待池
|
|
|
moveWaitingQueue(corpId, openKfId, externalUserid);
|
|
|
+ if (redisService.hasKey(RedisService.key.CORP_KF_SEESION_ASSIGN_KEY.getName())) {
|
|
|
+ redisService.del(RedisService.key.CORP_KF_SEESION_ASSIGN_KEY.getName());
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
//如果目前有排队的用户 后续进入会话的用户排队
|
|
|
@@ -1013,8 +1019,24 @@ public class CorpServiceImpl implements CorpService {
|
|
|
moveWaitingQueue(corpId, openKfId, externalUserid);
|
|
|
return;
|
|
|
}
|
|
|
- //选择第一个分配接待
|
|
|
- CorpKfServicerDto corpKfServicerDto = filterKfCs.get(0);
|
|
|
+ //接待客服
|
|
|
+ CorpKfServicerDto corpKfServicerDto = null;
|
|
|
+ Integer assignType = corpKfAccountSessionConfig.getAssignType();
|
|
|
+ if (assignType != null && assignType == 1) {
|
|
|
+ //轮流分配
|
|
|
+ Long incr = redisService.incr(RedisService.key.CORP_KF_SEESION_ASSIGN_KEY.getName(), 1l);
|
|
|
+ int index = incr.intValue() % corpKfServiceIds.size();
|
|
|
+ Optional<CorpKfServicerDto> first = filterKfCs.stream().filter(f -> f.getServicerUserid().equals(corpKfServiceIds.get(index))).findFirst();
|
|
|
+ if (first.isPresent()) {
|
|
|
+ corpKfServicerDto = first.get();
|
|
|
+ log.info("目前轮流接待的客服为:{}", corpKfServicerDto.getServicerUserid());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //未找到可轮流接待的客服
|
|
|
+ if (corpKfServicerDto == null) {
|
|
|
+ //选择第一个分配接待
|
|
|
+ corpKfServicerDto = filterKfCs.get(0);
|
|
|
+ }
|
|
|
//变更会话状态
|
|
|
transCorpKfSessionToServicer(corpId, openKfId, null, corpKfServicerDto.getServicerUserid(), externalUserid, null, 3, sendDate, msgid);
|
|
|
}
|