|
|
@@ -7,7 +7,6 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
-import com.cyksj.common.util.ListsUtil;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.common.util.Xmls;
|
|
|
import com.cyksj.common.util.corp.WxCryptUtil;
|
|
|
@@ -201,6 +200,10 @@ public class CorpServiceImpl implements CorpService {
|
|
|
e.printStackTrace();
|
|
|
return;
|
|
|
}
|
|
|
+ if (!userInfo.getDepartment().contains(2)) {
|
|
|
+ System.out.println("不是客服");
|
|
|
+ return;
|
|
|
+ }
|
|
|
CorpFollow corpFollow = new CorpFollow();
|
|
|
BeanUtil.copyProperties(userInfo, corpFollow);
|
|
|
CorpFollow follow = corpFollowMapper.selectOne(Wrappers.lambdaQuery(CorpFollow.class).eq(CorpFollow::getUserid, corpFollow.getUserid()).eq(CorpFollow::getWxCorpId, wxCorpId));
|
|
|
@@ -211,42 +214,6 @@ public class CorpServiceImpl implements CorpService {
|
|
|
corpFollow.setId(follow.getId());
|
|
|
corpFollowMapper.updateById(corpFollow);
|
|
|
}
|
|
|
-
|
|
|
- List<String> externalList = null;
|
|
|
- try {
|
|
|
- externalList = wxCorpOps.listExternalContacts(corpId, userId);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return;
|
|
|
- }
|
|
|
- if (externalList.size() > 1000) {
|
|
|
- List<List<String>> lists = ListsUtil.averageAssign(externalList, 5);
|
|
|
- for (List<String> list : lists) {
|
|
|
- THREAD_POOL.execute(() -> {
|
|
|
- for (String externalUserid : list) {
|
|
|
- try {
|
|
|
- CorpXmlMessage message = new CorpXmlMessage();
|
|
|
- message.setToUserName(corpId);
|
|
|
- message.setExternalUserId(externalUserid);
|
|
|
- corpEventActionService.addExternalContact(message, null);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- for (String externalUserid : externalList) {
|
|
|
- try {
|
|
|
- CorpXmlMessage message = new CorpXmlMessage();
|
|
|
- message.setToUserName(corpId);
|
|
|
- message.setExternalUserId(externalUserid);
|
|
|
- corpEventActionService.addExternalContact(message, null);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
});
|
|
|
}
|
|
|
return "";
|