|
|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.app.service;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
@@ -29,10 +30,19 @@ import com.fs.company.vo.SendMsgVo;
|
|
|
import com.fs.course.config.WxConfig;
|
|
|
import com.fs.crm.domain.CrmCustomer;
|
|
|
import com.fs.crm.service.ICrmCustomerService;
|
|
|
+import com.fs.qw.domain.QwExternalContact;
|
|
|
+import com.fs.qw.domain.QwUser;
|
|
|
+import com.fs.qw.mapper.QwExternalContactMapper;
|
|
|
+import com.fs.qw.mapper.QwUserMapper;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.wxcid.dto.friend.AddContactParam;
|
|
|
import com.fs.wxcid.service.FriendService;
|
|
|
import com.fs.wxcid.vo.AddContactVo;
|
|
|
+import com.fs.wxwork.dto.WxAddSearchDTO;
|
|
|
+import com.fs.wxwork.dto.WxSearchContactDTO;
|
|
|
+import com.fs.wxwork.dto.WxSearchContactResp;
|
|
|
+import com.fs.wxwork.dto.WxWorkResponseDTO;
|
|
|
+import com.fs.wxwork.service.WxWorkService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.redisson.api.RLock;
|
|
|
@@ -89,13 +99,16 @@ public class WxTaskService {
|
|
|
new ThreadPoolExecutor.CallerRunsPolicy()
|
|
|
);
|
|
|
private final RedisKeyScanner redisKeyScanner;
|
|
|
+ private final QwUserMapper qwUserMapper;
|
|
|
+ private final WxWorkService wxWorkService;
|
|
|
+ private final QwExternalContactMapper qwExternalContactMapper;
|
|
|
|
|
|
public void addWx(List<Long> accountIdList) {
|
|
|
log.info("==========执行加微信任务开始==========");
|
|
|
String json = sysConfigService.selectConfigByKey("wx.config");
|
|
|
WxConfig config = JSONUtil.toBean(json, WxConfig.class);
|
|
|
// 需要添加微信的列表
|
|
|
- List<CompanyWxClient> list = companyWxClientService.getAddWxList(accountIdList);
|
|
|
+ List<CompanyWxClient> list = companyWxClientService.getAddWxList(accountIdList,1);
|
|
|
//排除掉没到达加微步骤的人
|
|
|
List<CompanyVoiceRoboticCallees> exList = companyVoiceRoboticCalleesMapper.selectExcludeList(list);
|
|
|
List<CompanyVoiceRoboticCallees> collect =
|
|
|
@@ -839,4 +852,381 @@ public class WxTaskService {
|
|
|
log.info("===========工作流延时任务扫描结束===========");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 企微加微信任务
|
|
|
+ *
|
|
|
+ * @param accountIdList 企微成员id
|
|
|
+ */
|
|
|
+ public void qwAddWx(List<Long> accountIdList) {
|
|
|
+ log.info("==========执行企微申请加个微任务开始==========");
|
|
|
+ try {
|
|
|
+ // 获取需要添加微信的企微客户列表
|
|
|
+ List<CompanyWxClient> clientList = getFilteredClientList(accountIdList);
|
|
|
+ if (clientList.isEmpty()) {
|
|
|
+ log.info("没有符合条件的客户需要添加微信");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取CompanyWxClient信息
|
|
|
+ Map<Long, CompanyWxClient> clientMap = PubFun.listToMapByGroupObject(clientList, CompanyWxClient::getAccountId);
|
|
|
+ // 获取实际企微用户信息
|
|
|
+ List<QwUser> qwUserList = qwUserMapper.selectBatchIds(clientMap.keySet()).stream()
|
|
|
+ .filter(this::isValidQwUser)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ log.info("需要企微添加的账号数量:{}", qwUserList.size());
|
|
|
+ if (qwUserList.isEmpty()) return;
|
|
|
+
|
|
|
+ // 处理加微逻辑
|
|
|
+ List<CompanyWxClient> upClientList = processQwAddWx(qwUserList, clientMap);
|
|
|
+
|
|
|
+ // 批量更新客户状态
|
|
|
+ if (!upClientList.isEmpty()) {
|
|
|
+ companyWxClientService.updateBatchById(upClientList);
|
|
|
+ log.info("成功更新{}个客户的加微状态", upClientList.size());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("企微加微信任务执行异常", e);
|
|
|
+ }
|
|
|
+ log.info("==========执行企微申请加个微任务结束==========");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企微加微结果处理
|
|
|
+ */
|
|
|
+ public void qwAddWxResult(List<Long> accountIdList) {
|
|
|
+ log.info("==========执行企微申请加个微结果查询任务开始==========");
|
|
|
+ try {
|
|
|
+ //is_add = 2,状态为加微中且是企微类型
|
|
|
+ List<CompanyWxClient> clients = companyWxClientService.getQwAddWxList(accountIdList, 2);
|
|
|
+ log.info("需要查询企微加个微结果的数量:{}", clients.size());
|
|
|
+
|
|
|
+ if (clients.isEmpty()) return;
|
|
|
+
|
|
|
+ // 处理每个客户的加微结果
|
|
|
+ List<CompanyWxClient> upClientList = new ArrayList<>();
|
|
|
+ clients.parallelStream().forEach(client -> {
|
|
|
+ try {
|
|
|
+ processSingleClientResult(client, upClientList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("处理客户{}加微结果异常", client.getId(), e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 批量更新和后续处理
|
|
|
+ if (!upClientList.isEmpty()) {
|
|
|
+ batchUpdateClients(upClientList);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("企微加微结果处理异常", e);
|
|
|
+ }
|
|
|
+ log.info("==========执行企微申请加个微结果查询任务结束==========");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取过滤后的企微客户列表
|
|
|
+ */
|
|
|
+ private List<CompanyWxClient> getFilteredClientList(List<Long> accountIdList) {
|
|
|
+ List<CompanyWxClient> list = companyWxClientService.getAddWxList(accountIdList, 2);
|
|
|
+
|
|
|
+ // 排除掉没到达加微步骤的人
|
|
|
+ List<CompanyVoiceRoboticCallees> excludeList = companyVoiceRoboticCalleesMapper.selectExcludeList(list);
|
|
|
+ Set<String> excludeKeys = excludeList.stream()
|
|
|
+ .filter(e -> !Constants.QW_ADD_WX.equals(getNextTaskOptimized(e.getTaskFlow(), e.getRunTaskFlow())))
|
|
|
+ .map(callee -> callee.getRoboticId() + "_" + callee.getUserId())
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+ return list.stream()
|
|
|
+ .filter(client -> !excludeKeys.contains(client.getRoboticId() + "_" + client.getCustomerId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证企微用户有效性
|
|
|
+ */
|
|
|
+ private boolean isValidQwUser(QwUser qwUser) {
|
|
|
+ if (StringUtils.isBlank(qwUser.getUid()) || qwUser.getServerId() == null) {
|
|
|
+ log.info("企微账号{}的uid或serverId为空,跳过执行", qwUser.getQwUserName());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理企微加微逻辑
|
|
|
+ */
|
|
|
+ private List<CompanyWxClient> processQwAddWx(List<QwUser> qwUserList, Map<Long, CompanyWxClient> clientMap) {
|
|
|
+ List<CompanyWxClient> upClientList = Collections.synchronizedList(new ArrayList<>());
|
|
|
+
|
|
|
+ qwUserList.parallelStream().forEach(qwUser -> {
|
|
|
+ try {
|
|
|
+ processSingleQwUser(qwUser, clientMap, upClientList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("处理企微用户{}异常", qwUser.getId(), e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return upClientList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理单个企微用户
|
|
|
+ */
|
|
|
+ private void processSingleQwUser(QwUser qwUser, Map<Long, CompanyWxClient> clientMap,
|
|
|
+ List<CompanyWxClient> upClientList) {
|
|
|
+ CompanyWxClient client = clientMap.get(qwUser.getId());
|
|
|
+ if (client == null) {
|
|
|
+ log.error("当前账号暂无需要添加微信:{}-{}", qwUser.getId(), qwUser.getQwUserName());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(client.getCustomerId());
|
|
|
+ if (crmCustomer == null || StringUtils.isBlank(crmCustomer.getMobile())) {
|
|
|
+ log.info("查询客户{}手机号为空,跳过执行", crmCustomer == null ? "" : crmCustomer.getCustomerName());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String task = redisCache.getCacheObject(Constants.TASK_ID + client.getRoboticId());
|
|
|
+ log.info("ROBOTIC-ID:{},CLIENT-ID:{},当前任务执行状态:{}",
|
|
|
+ client.getRoboticId(), client.getId(), task);
|
|
|
+
|
|
|
+ if (!StringUtils.isNotEmpty(task) || !Constants.QW_ADD_WX.equals(task)) {
|
|
|
+ log.error("ROBOTIC-ID:{},当前任务没有执行加微任务", client.getRoboticId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 开始申请加微
|
|
|
+ WxWorkResponseDTO<String> resp = qwAddWxInvokeIpad(crmCustomer.getMobile(), qwUser.getUid(), qwUser.getServerId());
|
|
|
+ //处理申请加微结果
|
|
|
+ handleAddWxResult(resp, client, qwUser, crmCustomer, upClientList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 企微加个微调用ipad端
|
|
|
+ * @param mobile 手机号
|
|
|
+ * @param qwUid 企微uid
|
|
|
+ * @param serverId 服务器id
|
|
|
+ * @return String 结果
|
|
|
+ */
|
|
|
+ private WxWorkResponseDTO<String> qwAddWxInvokeIpad(String mobile, String qwUid, Long serverId) {
|
|
|
+ if (StringUtils.isBlank(mobile) || StringUtils.isBlank(qwUid) || serverId == null) {
|
|
|
+ log.warn("参数校验失败: mobile={}, qwUid={}, serverId={}", mobile, qwUid, serverId);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ WxAddSearchDTO wxAddSearchDTO = new WxAddSearchDTO();
|
|
|
+ wxAddSearchDTO.setUuid(qwUid);
|
|
|
+ wxAddSearchDTO.setPhone(mobile);
|
|
|
+ wxAddSearchDTO.setVid(null);
|
|
|
+ wxAddSearchDTO.setOptionid(null);
|
|
|
+ wxAddSearchDTO.setContent(null);
|
|
|
+ wxAddSearchDTO.setTicket(null);
|
|
|
+
|
|
|
+ WxWorkResponseDTO<String> response = wxWorkService.addSearch(wxAddSearchDTO, serverId);
|
|
|
+ log.debug("企微加微接口调用结果: errcode={}, errmsg={}",
|
|
|
+ response != null ? response.getErrcode() : "null",
|
|
|
+ response != null ? response.getErrmsg() : "null");
|
|
|
+
|
|
|
+ return response;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("企微加个微请求接口异常: mobile={}, qwUid={}, serverId={}", mobile, qwUid, serverId, e);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理加微结果
|
|
|
+ */
|
|
|
+ private void handleAddWxResult(WxWorkResponseDTO<String> resp, CompanyWxClient client,
|
|
|
+ QwUser qwUser, CrmCustomer crmCustomer,
|
|
|
+ List<CompanyWxClient> upClientList) {
|
|
|
+ JSONObject runParam = new JSONObject();
|
|
|
+ runParam.put("qwId", qwUser.getId());
|
|
|
+ runParam.put("mobile", crmCustomer.getMobile());
|
|
|
+ runParam.put("qwUid", qwUser.getUid());
|
|
|
+ runParam.put("clientId", client.getId());
|
|
|
+
|
|
|
+ CompanyVoiceRoboticCallLogAddwx addLog = CompanyVoiceRoboticCallLogAddwx.initCallLog(
|
|
|
+ runParam.toJSONString(), client.getId(), client.getRoboticId(), qwUser.getId(), qwUser.getCompanyId());
|
|
|
+
|
|
|
+ if (resp != null && resp.getErrcode() == 0) {
|
|
|
+ // 加微消息已发送成功
|
|
|
+ client.setIsAdd(2);
|
|
|
+ client.setAddTime(LocalDateTime.now());
|
|
|
+ upClientList.add(client);
|
|
|
+ addLog.setStatus(1);
|
|
|
+ addLog.setResult(JSON.toJSONString(resp));
|
|
|
+ addLog.setIsWeCom(2);
|
|
|
+ log.info("ROBOTIC-ID:{},加微成功", client.getRoboticId());
|
|
|
+ } else {
|
|
|
+ // 加微消息发送失败,补偿重试
|
|
|
+ handleFailedAddWxWithRetry(client, upClientList);
|
|
|
+ }
|
|
|
+
|
|
|
+ asyncSaveCompanyVoiceRoboticCallLog(addLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理单个客户加微结果
|
|
|
+ */
|
|
|
+ private void processSingleClientResult(CompanyWxClient client, List<CompanyWxClient> upClientList) {
|
|
|
+ if (StringUtils.isBlank(client.getPhone())) {
|
|
|
+ handleFailedAddWx(client, upClientList, "无电话号码");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询外部联系人表是否有数据
|
|
|
+ QwExternalContact qwExternalContact = qwExternalContactMapper.queryQwUserIdIsAddContact(
|
|
|
+ client.getAccountId(), client.getPhone(), 2);
|
|
|
+
|
|
|
+ if (qwExternalContact != null && qwExternalContact.getId() > 0) {
|
|
|
+ handleSuccessfulAddWx(client, upClientList);
|
|
|
+ } else {
|
|
|
+ handleFailedAddWxWithRetry(client, upClientList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理加微成功的情况
|
|
|
+ */
|
|
|
+ private void handleSuccessfulAddWx(CompanyWxClient client, List<CompanyWxClient> upClientList) {
|
|
|
+ // 更新记录状态
|
|
|
+ companyVoiceRoboticCallLogAddwxService.lambdaUpdate()
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getRoboticId, client.getRoboticId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getWxClientId, client.getId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getWxAccountId, client.getAccountId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getIsWeCom, 2)
|
|
|
+ .set(CompanyVoiceRoboticCallLogAddwx::getStatus, 2)
|
|
|
+ .update();
|
|
|
+
|
|
|
+ client.setIsAdd(1);
|
|
|
+ client.setAddTime(LocalDateTime.now());
|
|
|
+ upClientList.add(client);
|
|
|
+ redisCache.deleteObject("qwAddWx_" + client.getId());
|
|
|
+ log.info("ROBOTIC-ID:{},加微成功:{}", client.getRoboticId(), client.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理加微失败的情况
|
|
|
+ */
|
|
|
+ private void handleFailedAddWx(CompanyWxClient client, List<CompanyWxClient> upClientList, String reason) {
|
|
|
+ log.error("ROBOTIC-ID:{},{}加微失败:{}", client.getRoboticId(), reason, client.getId());
|
|
|
+ client.setIsAdd(3);
|
|
|
+ client.setUpdateTime(new Date());
|
|
|
+ upClientList.add(client);
|
|
|
+
|
|
|
+ // 更新记录
|
|
|
+ companyVoiceRoboticCallLogAddwxService.lambdaUpdate()
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getRoboticId, client.getRoboticId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getWxClientId, client.getId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getWxAccountId, client.getAccountId())
|
|
|
+ .eq(CompanyVoiceRoboticCallLogAddwx::getIsWeCom, 2)
|
|
|
+ .set(CompanyVoiceRoboticCallLogAddwx::getStatus, 3)
|
|
|
+ .set(CompanyVoiceRoboticCallLogAddwx::getResult, reason)
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理加微失败并重试计数
|
|
|
+ */
|
|
|
+ private void handleFailedAddWxWithRetry(CompanyWxClient client, List<CompanyWxClient> upClientList) {
|
|
|
+ log.error("ROBOTIC-ID:{},加微失败:{}", client.getRoboticId(), client.getId());
|
|
|
+ String failCountStr = redisCache.getCacheObject("qwAddWx_" + client.getId());
|
|
|
+ int failCount = 1;
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(failCountStr)) {
|
|
|
+ failCount += Integer.parseInt(failCountStr);
|
|
|
+ if (failCount >= 60 * 24) { // 超过一天
|
|
|
+ handleFailedAddWx(client, upClientList, "超过最大重试次数");
|
|
|
+ } else {
|
|
|
+ redisCache.setCacheObject("qwAddWx_" + client.getId(), String.valueOf(failCount));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ redisCache.setCacheObject("qwAddWx_" + client.getId(), String.valueOf(failCount), 25, TimeUnit.HOURS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量更新客户和相关数据
|
|
|
+ */
|
|
|
+ private void batchUpdateClients(List<CompanyWxClient> upClientList) {
|
|
|
+ companyWxClientService.updateBatchById(upClientList);
|
|
|
+
|
|
|
+ // 从 upClientList 中筛选出 isAdd=1即加微成功的数据
|
|
|
+ List<CompanyWxClient> successClients = upClientList.stream()
|
|
|
+ .filter(client -> client.getIsAdd() != null && client.getIsAdd() == 1)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 根据加微成功的用户,判定是否加入延时执行下一步任务
|
|
|
+ Set<Long> roboticIdSet = successClients.stream()
|
|
|
+ .map(CompanyWxClient::getRoboticId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ Set<Long> userIdSet = successClients.stream()
|
|
|
+ .map(CompanyWxClient::getCustomerId)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+
|
|
|
+ // 获取任务和callees数据
|
|
|
+ List<CompanyVoiceRobotic> robotList = companyVoiceRoboticMapper.selectBatchIds(roboticIdSet);
|
|
|
+ Map<Long, CompanyVoiceRobotic> roboticsMap = robotList.stream()
|
|
|
+ .collect(Collectors.toMap(CompanyVoiceRobotic::getId, Function.identity(), (a, b) -> a));
|
|
|
+
|
|
|
+ List<CompanyVoiceRoboticCallees> calleesList = companyVoiceRoboticCalleesMapper
|
|
|
+ .selectCalleesListByRoboticIdsAndUserIds(userIdSet, roboticIdSet);
|
|
|
+ Map<String, CompanyVoiceRoboticCallees> calleesMap = calleesList.stream()
|
|
|
+ .collect(Collectors.toMap(e -> e.getUserId() + "-" + e.getRoboticId(), Function.identity(), (a, b) -> a));
|
|
|
+
|
|
|
+ // 设置延时任务
|
|
|
+ setupDelayTasks(successClients, roboticsMap, calleesMap);
|
|
|
+
|
|
|
+ // 更新任务流程状态
|
|
|
+ updateTaskFlows(calleesList, roboticIdSet);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置延时任务
|
|
|
+ */
|
|
|
+ private void setupDelayTasks(List<CompanyWxClient> upClientList,
|
|
|
+ Map<Long, CompanyVoiceRobotic> roboticsMap,
|
|
|
+ Map<String, CompanyVoiceRoboticCallees> calleesMap) {
|
|
|
+ upClientList.forEach(client -> {
|
|
|
+ CompanyVoiceRobotic robotic = roboticsMap.get(client.getRoboticId());
|
|
|
+ if (robotic == null) {
|
|
|
+ log.error("ROBOTIC-ID:{},CLIENT-ID:{},没有找到任务", client.getRoboticId(), client.getId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ CompanyVoiceRoboticCallees callee = calleesMap.get(client.getCustomerId() + "-" + client.getRoboticId());
|
|
|
+ if (callee == null) {
|
|
|
+ log.error("ROBOTIC-ID:{},CLIENT-ID:{},没有找到任务", client.getRoboticId(), client.getId());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer addWxTime = robotic.getAddWxTime();
|
|
|
+ if (addWxTime != null) {
|
|
|
+ long endTime = System.currentTimeMillis() + addWxTime * 60 * 1000;
|
|
|
+ String key = Constants.CID_NEXT_TASK_ID + callee.getRoboticId() + ":" + callee.getId();
|
|
|
+ redisCache.setCacheObject(key, String.valueOf(endTime));
|
|
|
+ } else {
|
|
|
+ log.error("ROBOTIC-ID:{},CLIENT-ID:{},没有设置加微后置等待时间", client.getRoboticId(), client.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新任务流程状态
|
|
|
+ */
|
|
|
+ private void updateTaskFlows(List<CompanyVoiceRoboticCallees> calleesList, Set<Long> roboticIdSet) {
|
|
|
+ calleesList.forEach(callee ->
|
|
|
+ callee.setRunTaskFlow(
|
|
|
+ StringUtils.isBlank(callee.getRunTaskFlow()) ?
|
|
|
+ Constants.QW_ADD_WX : callee.getRunTaskFlow() + "," + Constants.QW_ADD_WX
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ companyVoiceRoboticCalleesServiceImpl.updateBatchById(calleesList);
|
|
|
+ companyVoiceRoboticServiceImpl.finishAddWxByCallees(roboticIdSet);
|
|
|
+ }
|
|
|
+
|
|
|
}
|