|
|
@@ -687,9 +687,17 @@ public class CorpServiceImpl implements CorpService {
|
|
|
satisfaction = 3;
|
|
|
}
|
|
|
if (satisfaction != null) {
|
|
|
- corpKfServicerSessionRecordMapper.update(null, Wrappers.lambdaUpdate(CorpKfServicerSessionRecord.class)
|
|
|
- .set(CorpKfServicerSessionRecord::getSatisfaction, satisfaction)
|
|
|
- .eq(CorpKfServicerSessionRecord::getMsgid, msgid));
|
|
|
+ CorpKfServicerSessionRecord corpKfServicerSessionRecord = corpKfServicerSessionRecordMapper.selectOne(Wrappers.lambdaQuery(CorpKfServicerSessionRecord.class)
|
|
|
+ .eq(CorpKfServicerSessionRecord::getMsgid, msgid)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (corpKfServicerSessionRecord != null) {
|
|
|
+ corpKfServicerSessionRecord.setSatisfaction(satisfaction);
|
|
|
+ corpKfServicerSessionRecordMapper.updateById(corpKfServicerSessionRecord);
|
|
|
+ //设置会话id
|
|
|
+ corpKfAccountSessionChatMapper.update(null, Wrappers.lambdaUpdate(CorpKfAccountSessionChat.class)
|
|
|
+ .set(CorpKfAccountSessionChat::getSessionId, corpKfServicerSessionRecord.getId())
|
|
|
+ .eq(CorpKfAccountSessionChat::getMsgid, item.getMsgId()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -787,10 +795,9 @@ public class CorpServiceImpl implements CorpService {
|
|
|
//同步这一次接待记录
|
|
|
if (serviceState == 3) {
|
|
|
corpKfAccountSessionChatMapper.update(null, Wrappers.lambdaUpdate(CorpKfAccountSessionChat.class)
|
|
|
- .set(CorpKfAccountSessionChat::getSessionId, msgid)
|
|
|
+ .set(CorpKfAccountSessionChat::getSessionId, corpKfServicerSessionRecord.getId())
|
|
|
.eq(CorpKfAccountSessionChat::getOpenKfId, openKfId)
|
|
|
.eq(CorpKfAccountSessionChat::getExternalUserid, externalUserId)
|
|
|
- .le(CorpKfAccountSessionChat::getSendDate, sendTime)
|
|
|
.isNull(CorpKfAccountSessionChat::getSessionId));
|
|
|
}
|
|
|
}
|
|
|
@@ -920,6 +927,12 @@ public class CorpServiceImpl implements CorpService {
|
|
|
* 新增记录
|
|
|
*/
|
|
|
public void saveChatMsg(CorpKfAccountSessionChat chat) {
|
|
|
+ CorpKfServicerSessionRecord corpKfServicerSessionRecord = corpKfServicerSessionRecordMapper.selectOne(Wrappers.lambdaQuery(CorpKfServicerSessionRecord.class)
|
|
|
+ .eq(CorpKfServicerSessionRecord::getOpenKfId, chat.getOpenKfId())
|
|
|
+ .eq(CorpKfServicerSessionRecord::getExternalUserid, chat.getExternalUserid())
|
|
|
+ .eq(CorpKfServicerSessionRecord::getServiceState, 0)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (corpKfServicerSessionRecord != null) chat.setSessionId(corpKfServicerSessionRecord.getId());
|
|
|
corpKfAccountSessionChatMapper.insert(chat);
|
|
|
}
|
|
|
|