|
@@ -656,23 +656,28 @@ public class CorpServiceImpl implements CorpService {
|
|
|
corpKfAccountSessionChat.setSendTime(sendTime);
|
|
corpKfAccountSessionChat.setSendTime(sendTime);
|
|
|
corpKfAccountSessionChat.setSendDate(DateTime.of(sendTime * 1000));
|
|
corpKfAccountSessionChat.setSendDate(DateTime.of(sendTime * 1000));
|
|
|
if (saveChatMsg(corpKfAccountSessionChat)) {
|
|
if (saveChatMsg(corpKfAccountSessionChat)) {
|
|
|
- if (StrUtil.isNotEmpty(externalUserId)) {
|
|
|
|
|
- //会话状态为待处理 则分配接待人员
|
|
|
|
|
- assignKfSession(corpId, openKfId, externalUserId, corpKfAccountSessionConfig, corpKfAccountSessionChat.getSendDate(), msgId);
|
|
|
|
|
|
|
+ //非同步满意度 继续创建新会话
|
|
|
|
|
+ if (!syncSessionSatisfaction(item)) {
|
|
|
|
|
+ if (StrUtil.isNotEmpty(externalUserId)) {
|
|
|
|
|
+ //会话状态为待处理 则分配接待人员
|
|
|
|
|
+ assignKfSession(corpId, openKfId, externalUserId, corpKfAccountSessionConfig, corpKfAccountSessionChat.getSendDate(), msgId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- syncSessionSatisfaction(item);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void syncSessionSatisfaction(WxCpKfMsgListResp.WxCpKfMsgItem item) throws Exception {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 是否同步满意度
|
|
|
|
|
+ */
|
|
|
|
|
+ private Boolean syncSessionSatisfaction(WxCpKfMsgListResp.WxCpKfMsgItem item) throws Exception {
|
|
|
Integer satisfaction = null;
|
|
Integer satisfaction = null;
|
|
|
WxCorpTextMsg text = item.getText();
|
|
WxCorpTextMsg text = item.getText();
|
|
|
//自定义菜单id
|
|
//自定义菜单id
|
|
|
if (text != null && text.getMenu_id() != null) {
|
|
if (text != null && text.getMenu_id() != null) {
|
|
|
String[] split = text.getMenu_id().split("-");
|
|
String[] split = text.getMenu_id().split("-");
|
|
|
if (split.length < 2) {
|
|
if (split.length < 2) {
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
String menuId = split[0];
|
|
String menuId = split[0];
|
|
|
String msgid = split[1];
|
|
String msgid = split[1];
|
|
@@ -700,8 +705,10 @@ public class CorpServiceImpl implements CorpService {
|
|
|
.set(CorpKfAccountSessionChat::getSessionId, corpKfServicerSessionRecord.getId())
|
|
.set(CorpKfAccountSessionChat::getSessionId, corpKfServicerSessionRecord.getId())
|
|
|
.eq(CorpKfAccountSessionChat::getMsgid, item.getMsgId()));
|
|
.eq(CorpKfAccountSessionChat::getMsgid, item.getMsgId()));
|
|
|
}
|
|
}
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void sessionStatusChange(String corpId, String openKfId, WxCpKfMsgListResp.WxCpKfMsgItem wxCpKfMsgItem, CorpKfAccountSessionConfig corpKfAccountSessionConfig) throws Exception {
|
|
private void sessionStatusChange(String corpId, String openKfId, WxCpKfMsgListResp.WxCpKfMsgItem wxCpKfMsgItem, CorpKfAccountSessionConfig corpKfAccountSessionConfig) throws Exception {
|