|
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -70,33 +71,25 @@ public class WxFansTagController {
|
|
|
List<WxUserTag> tagList = userTagService.tagGet();
|
|
|
List<String> tagNameList = tagService.queryAll(appid).stream().map(EsTagInfo::getTagName).collect(Collectors.toList());
|
|
|
|
|
|
- new
|
|
|
for (WxUserTag wxUserTag : tagList) {
|
|
|
String tagName = wxUserTag.getName();
|
|
|
if(tagNameList.contains(tagName)){
|
|
|
tagNameList.remove(tagName);
|
|
|
}else {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- for (WxUserTag wxUserTag : tagList) {
|
|
|
- QueryWrapper wrapper = new QueryWrapper();
|
|
|
- wrapper.eq("tagValue", wxUserTag.getId().toString());
|
|
|
- List<EsTagInfo> tags = tagService.list(wrapper);
|
|
|
- if (tags == null || tags.size() == 0) {
|
|
|
EsTagInfo tag = new EsTagInfo();
|
|
|
tag.setTagValue(wxUserTag.getId().toString());
|
|
|
tag.setTagName(wxUserTag.getName());
|
|
|
tag.setAppId(appid);
|
|
|
-
|
|
|
tagService.save(tag);
|
|
|
}
|
|
|
}
|
|
|
- ResultInfo body = tagService.queryTagList(data);
|
|
|
|
|
|
+ // 本地有但微信方没有,删除本地的标签
|
|
|
+ for (String tagName : tagNameList) {
|
|
|
+ tagService.delete(appid, tagName);
|
|
|
+ }
|
|
|
+
|
|
|
+ ResultInfo body = tagService.queryTagList(data);
|
|
|
return ResultUtil.createSuccess(200, body);
|
|
|
} catch (WxErrorException e) {
|
|
|
e.printStackTrace();
|