zoujiajian 1 tahun lalu
induk
melakukan
809ece5120

+ 3 - 4
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpServiceImpl.java

@@ -725,6 +725,7 @@ public class CorpServiceImpl implements CorpService {
 			corpKfServicerSessionRecordMapper.insert(newSession);
 			//等待用户删除
 			delQueueUser(openKfId, externalUserId, sendDate);
+			syncUserChatSession(newSession.getId(), externalUserId);
 		}
 		//2-转接会话
 		if (changeType == 2) {
@@ -813,7 +814,7 @@ public class CorpServiceImpl implements CorpService {
 		ServiceStateResponse serviceStateResponse = wxCorpOps.getCorpKfSessionStatus(corpId, openKfId, externalUserid);
 		Integer state = serviceStateResponse.getService_state();
 		//0.未处理 1.人工智能接待 可调用api发送消息
-		if (state == null || state != 0 || state != 1) {
+		if (state == null && state != 0 && state != 1) {
 			log.info("目前openKfId:{}用户eid:{}会话处于状态中state:{},无法发送消息", openKfId, externalUserid, state);
 			return;
 		}
@@ -857,12 +858,10 @@ public class CorpServiceImpl implements CorpService {
 		List<CorpKfServicerResp.CorpKfServicer> servicerList = corpKfServicerResp.getServicerList();
 		//目前值班客服id
 		List<String> corpKfServiceIds = new ArrayList<>();
-		servicerList.stream().filter(servicer -> {
+		servicerList.forEach(servicer -> {
 			if (servicer.getUserid() != null && servicer.getStatus() == 0 && dutyFollowIds.contains(servicer.getUserid())) {
 				corpKfServiceIds.add(servicer.getUserid());
-				return true;
 			}
-			return false;
 		});
 		//客服是否已经开始值班
 		//没有值班人员

+ 3 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/WxCorpOpsImpl.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.corp.impl;
 
 import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
@@ -998,6 +999,7 @@ public class WxCorpOpsImpl implements WxCorpOps {
 	public void sendSatisfactionMsg(String msgid, String openKfId, String externalUserId, String msgCode) throws Exception {
 		String url = "https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg_on_event?access_token=" + getAccessToken(yhlXWxCorpConfig.getCorpId());
 		CorpKfSatisfactionMsg corpKfSatisfactionMsg = Jsons.parseObject(String.format(SATISFACTION, msgid, msgid, msgid), CorpKfSatisfactionMsg.class);
+		corpKfSatisfactionMsg.setMsgid(RandomUtil.randomString(16));
 		corpKfSatisfactionMsg.setTouser(externalUserId);
 		corpKfSatisfactionMsg.setOpen_kfid(openKfId);
 		corpKfSatisfactionMsg.setCode(msgCode);
@@ -1016,6 +1018,7 @@ public class WxCorpOpsImpl implements WxCorpOps {
 		if (resp.getErrcode() != 0) {
 			throw BusinessRuntimeException.getInstance("满意度调查内容错误: " + resp.getErrmsg());
 		}
+		log.info("发送满意度调查返回:{}", resp.getErrmsg());
 	}
 
 	@Override

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/wxkf/CorpKfMsgController.java

@@ -57,6 +57,7 @@ public class CorpKfMsgController {
 				.last("limit 1"));
 		if (corpKfUser == null) {
 			try {
+				corpKfUser = new CorpKfUser();
 				BeanUtil.copyProperties(corpKfUserInfo, corpKfUser);
 				corpKfUserMapper.insert(corpKfUser);
 			} catch (Exception e) {