|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.service.corp.kf.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
@@ -260,7 +261,7 @@ public class CorpKfServiceImpl implements CorpKfService {
|
|
|
* 转接客服
|
|
|
*/
|
|
|
@Override
|
|
|
- public void transCustomer(String followId, String toFollowId) throws Exception {
|
|
|
+ public void transCustomer(String followId, String toFollowId, Integer transNum, List<String> transUserIds) throws Exception {
|
|
|
List<CorpKfAccountFollow> corpKfAccountFollows = corpKfAccountFollowMapper.selectList(Wrappers.lambdaQuery(CorpKfAccountFollow.class)
|
|
|
.apply(" and JSON_CONTAINS(user_id_list,'\"%s\"')", followId));
|
|
|
List<String> openKfIds = new ArrayList<>();
|
|
|
@@ -275,8 +276,9 @@ public class CorpKfServiceImpl implements CorpKfService {
|
|
|
}
|
|
|
}
|
|
|
List<CorpKfServicerSessionRecord> corpKfServicerSessionRecords = corpKfServicerSessionRecordMapper.selectList(Wrappers.lambdaQuery(CorpKfServicerSessionRecord.class)
|
|
|
- .eq(CorpKfServicerSessionRecord::getServiceState, 0));
|
|
|
-
|
|
|
+ .eq(CorpKfServicerSessionRecord::getServiceState, 0)
|
|
|
+ .apply(transNum != null, String.format("order by rand() limit %s", transNum))
|
|
|
+ .in(CollUtil.isNotEmpty(transUserIds), CorpKfServicerSessionRecord::getExternalUserid, transUserIds));
|
|
|
String corpId = yhlxWxCorpConfig.getCorpId();
|
|
|
//添加对应客服
|
|
|
for (String openKfId : openKfIds) {
|