|
|
@@ -844,6 +844,19 @@ public class CorpServiceImpl implements CorpService {
|
|
|
private void transCorpKfSessionToServicer(String corpId, String openKfId, String oldServicerUserId, String userid, String externalUserId, Integer changeType, Integer serviceState, Date sendTime, String msgid) throws Exception {
|
|
|
//调用微信客服接口 变更会话状态
|
|
|
try {
|
|
|
+ //非转接会话
|
|
|
+ if (changeType == null) {
|
|
|
+ String sessionKey = RedisService.key.CORP_KF_SESSION_KEY.getNameFormat(openKfId, externalUserId);
|
|
|
+ if (!redisService.setNx(sessionKey, externalUserId, RedisService.key.CORP_KF_SESSION_KEY.getTimeout())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ServiceStateResponse corpKfSessionStatus = wxCorpOps.getCorpKfSessionStatus(corpId, openKfId, externalUserId);
|
|
|
+ Integer state = corpKfSessionStatus.getService_state();
|
|
|
+ //serviceState 0未处理 1由智能助手接待 2待接入池排队中 3由人工接待 4 已结束/未开始
|
|
|
+ if (state != 0 && state != 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
wxCorpOps.transCorpKfSessionToServicer(corpId, openKfId, userid, externalUserId, serviceState);
|
|
|
//记录接待人员会话
|
|
|
CorpKfServicerSessionRecord corpKfServicerSessionRecord = new CorpKfServicerSessionRecord();
|