فهرست منبع

fix 兜底结束会话

zoujiajian 1 سال پیش
والد
کامیت
6ff3431d19
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 10 0
      netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpServiceImpl.java

+ 10 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpServiceImpl.java

@@ -906,6 +906,16 @@ public class CorpServiceImpl implements CorpService {
 		if (state != 0 && state != 1) {
 			return;
 		}
+		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) {
+			log.info("存在未结束的会话:{}", externalUserid);
+			corpKfServicerSessionRecord.setServiceState(1);
+			corpKfServicerSessionRecordMapper.updateById(corpKfServicerSessionRecord);
+		}
 		//当前时间段值班客服
 		Set<String> dutyFollowIds = getDutyFollowIds(openKfId);
 		//非值班