|
|
|
@@ -167,7 +167,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { |
|
|
|
|
|
|
|
//按type 替换 |
|
|
|
private List<WxTags> assign(WxCUserBasicInfo user, List<EnumTag> enumTags, EnumTagType type){ |
|
|
|
logger.info("-----" + enumTags.toString()); |
|
|
|
|
|
|
|
if(user == null){ |
|
|
|
return null; |
|
|
|
} |
|
|
|
@@ -186,22 +186,21 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { |
|
|
|
}else{ |
|
|
|
tagIdList = JSON.parseArray(tags, Long.class); |
|
|
|
} |
|
|
|
logger.info("-----" + tagIdList.toString()); |
|
|
|
|
|
|
|
Iterator<Long> it = tagIdList.iterator(); |
|
|
|
while(it.hasNext()){ |
|
|
|
Long id = it.next(); |
|
|
|
if(null != id && null != EnumTag.getEnum(id) && EnumTag.getEnum(id).getCode() == type.getCode()){ |
|
|
|
if(null != id && null != EnumTag.getEnum(id) && EnumTag.getEnum(id).getType().equals(type)){ |
|
|
|
it.remove(); |
|
|
|
logger.info("-----id remove" + id); |
|
|
|
} |
|
|
|
} |
|
|
|
logger.info("-----" + tagIdList.toString()); |
|
|
|
|
|
|
|
if(enumTags != null && enumTags.size() > 0){ |
|
|
|
for (EnumTag enumTag:enumTags) { |
|
|
|
tagIdList.add(enumTag.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
logger.info("-----" + tagIdList.toString()); |
|
|
|
|
|
|
|
record.setTags(JSON.toJSONString(tagIdList)); |
|
|
|
saveOrUpdate(record); |
|
|
|
|
|
|
|
|