客户画像,标签增加过滤功能

1 parent 95b7fd86
...@@ -10,6 +10,7 @@ import com.google.common.collect.Lists; ...@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.enums.TrajectorySceneType; import com.linkwechat.common.enums.TrajectorySceneType;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.DateUtils; import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.common.utils.SecurityUtils; import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.StringUtils; import com.linkwechat.common.utils.StringUtils;
...@@ -77,6 +78,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -77,6 +78,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Autowired @Autowired
private IWeCustomerTrajectoryService iWeCustomerTrajectoryService; private IWeCustomerTrajectoryService iWeCustomerTrajectoryService;
@Autowired
private IWeTagService iWeTagService;
// /** // /**
...@@ -293,6 +297,18 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -293,6 +297,18 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
if(CollectionUtil.isNotEmpty(addTag)){ if(CollectionUtil.isNotEmpty(addTag)){
//校验是否有标签在库里不存在 //校验是否有标签在库里不存在
List<WeTag> weTagList = iWeTagService.list(
new LambdaQueryWrapper<WeTag>()
.in(WeTag::getTagId, addTag.stream().map(WeTag::getTagId).collect(Collectors.toList()))
);
if(CollectionUtil.isNotEmpty(weTagList)){
if(addTag.size()!=weTagList.size()){
new WeComException("部门标签不存在");
}
}else{
new WeComException("部门标签不存在");
}
CutomerTagEdit cutomerTagEdit = CutomerTagEdit.builder() CutomerTagEdit cutomerTagEdit = CutomerTagEdit.builder()
......
...@@ -477,7 +477,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -477,7 +477,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP_CONCAT(wt.`tag_id`) as tagIds GROUP_CONCAT(wt.`tag_id`) as tagIds
FROM FROM
we_customer wc we_customer wc
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.user_id = wc.first_user_id LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.user_id = wc.first_user_id AND wfcrf.del_flag=0
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
WHERE wc.external_userid=#{externalUserid} and wc.first_user_id=#{userid} WHERE wc.external_userid=#{externalUserid} and wc.first_user_id=#{userid}
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!