|
|
@@ -127,6 +127,9 @@ public class CorpServiceImpl implements CorpService {
|
|
|
@Autowired
|
|
|
private CorpKfUserMapper corpKfUserMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CorpKfServicerStatusChangeRecordMapper corpKfServicerStatusChangeRecordMapper;
|
|
|
+
|
|
|
@PostConstruct
|
|
|
private void init() {
|
|
|
corpMessageRouter = new CorpMessageRouter(this)
|
|
|
@@ -585,6 +588,10 @@ public class CorpServiceImpl implements CorpService {
|
|
|
//进入会话事件
|
|
|
enterSessionEvent(corpKfAccount, corpKfAccountSessionConfig, corpId, item);
|
|
|
}
|
|
|
+ //接待人员接待状态变更事件
|
|
|
+ if (item.getEvent().getEventType().equals("servicer_status_change")) {
|
|
|
+ recordCorpKfServicerState(openKfId, item);
|
|
|
+ }
|
|
|
//会话变更事件
|
|
|
if (item.getEvent().getEventType().equals("session_status_change")) {
|
|
|
//会话更变事件
|
|
|
@@ -1168,4 +1175,27 @@ public class CorpServiceImpl implements CorpService {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 接待人员接待状态变更记录
|
|
|
+ */
|
|
|
+ private void recordCorpKfServicerState(String openKfId, WxCpKfMsgListResp.WxCpKfMsgItem item) {
|
|
|
+ String servicerUserId = item.getServicerUserId();
|
|
|
+ //状态类型。1-接待中 2-停止接待
|
|
|
+ Integer status = item.getStatus();
|
|
|
+ //0:停止接待,1:暂时挂起
|
|
|
+ Integer stopType = item.getStopType();
|
|
|
+ CorpKfServicerStatusChangeRecord corpKfServicerStatusChangeRecord = new CorpKfServicerStatusChangeRecord();
|
|
|
+ corpKfServicerStatusChangeRecord.setOpenKfId(openKfId);
|
|
|
+ corpKfServicerStatusChangeRecord.setServicerUserid(servicerUserId);
|
|
|
+ //客服状态 0接待中 1.停止接待 2.暂时挂起
|
|
|
+ Integer state = 0;
|
|
|
+ if (status == 2) {
|
|
|
+ if (stopType == 0) {
|
|
|
+ state = 1;
|
|
|
+ } else state = 2;
|
|
|
+ }
|
|
|
+ corpKfServicerStatusChangeRecord.setState(state);
|
|
|
+ corpKfServicerStatusChangeRecordMapper.insert(corpKfServicerStatusChangeRecord);
|
|
|
+ }
|
|
|
}
|