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