Commit 2199a536 by 墨竹

feat:修改传参

parent 1bdd2c46
...@@ -34,13 +34,13 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO; ...@@ -34,13 +34,13 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -494,8 +494,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -494,8 +494,12 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
jsonObject.put("suiteId", wxSuiteid); jsonObject.put("suiteId", wxSuiteid);
jsonObject.put("wxUserId", wxUserId); jsonObject.put("wxUserId", wxUserId);
jsonObject.put("externalUserId", externalUserId); jsonObject.put("externalUserId", externalUserId);
jsonObject.put("needSetTags", StringUtils.join(needSetTags, ",")); if (CollectionUtils.isNotEmpty(needSetTags)) {
jsonObject.put("needDelTags", StringUtils.join(needDelTags, ",")); jsonObject.put("needSetTags", StringUtils.join(needSetTags, ","));
}
if (CollectionUtils.isNotEmpty(needDelTags)) {
jsonObject.put("needDelTags", StringUtils.join(needDelTags, ","));
}
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
clientInstance.sendMessage("qywxMarkTagMq", jsonObject.toJSONString()); clientInstance.sendMessage("qywxMarkTagMq", jsonObject.toJSONString());
...@@ -931,7 +935,15 @@ public class QywxTagApiServiceImpl implements QywxTagApiService { ...@@ -931,7 +935,15 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.error("企微打标签超过最大次数,key:{}", key); logger.error("企微打标签超过最大次数,key:{}", key);
return; return;
} }
QywxResponseDTO responseDTO = qywxUserApiService.markTag(corpid, suiteId, wxUserId, externalUserId, Arrays.asList(needSetTags.split(",")), Arrays.asList(needDelTags.split(","))); List<String> needSetTagList = new ArrayList<>();
List<String> needDelTagList = new ArrayList<>();
if (StringUtils.isNotBlank(needSetTags)) {
needSetTagList = Arrays.asList(needSetTags.split(","));
}
if (StringUtils.isNotBlank(needDelTags)) {
needDelTagList = Arrays.asList(needDelTags.split(","));
}
QywxResponseDTO responseDTO = qywxUserApiService.markTag(corpid, suiteId, wxUserId, externalUserId, needSetTagList, needDelTagList);
logger.info("操作返回:{}", JSONObject.toJSONString(responseDTO)); logger.info("操作返回:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) { if (responseDTO.getErrcode() != 0) {
logger.info("权限不对,重试三次:{},{}", wxUserId, externalUserId); logger.info("权限不对,重试三次:{},{}", wxUserId, externalUserId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment