Commit 6adc95fb by 潘诗林

fix:客户画像消费标签为空判断

1 parent 4931563a
......@@ -191,15 +191,13 @@ public class CustomerTagService {
result.setEmployeeName(info.getEmployeeName());
result.setCreatedBy(info.getCreatedBy());
result.setCreatedDate(info.getCreatedDate());
if (CollectionUtils.isEmpty(tagList)) {
return result;
Map<String, List<CustomerProfileRespDTO>> categoryMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(tagList)) {
// 按类别分组 (batchQueryProfile 已通过 SQL JOIN 返回了名称, 无需额外查询)
categoryMap =
tagList.stream().collect(Collectors.groupingBy(
p -> p.getCategoryCode() != null ? p.getCategoryCode() : ""));
}
// 按类别分组 (batchQueryProfile 已通过 SQL JOIN 返回了名称, 无需额外查询)
Map<String, List<CustomerProfileRespDTO>> categoryMap =
tagList.stream().collect(Collectors.groupingBy(
p -> p.getCategoryCode() != null ? p.getCategoryCode() : ""));
// 消费力标签
result.setConsumptionTag(buildCategoryGroup(
categoryMap.remove(CommonConstants.TAG_CATEGORY_CONSUMPTION),
......@@ -290,7 +288,7 @@ public class CustomerTagService {
private TagCategoryGroup buildCategoryGroup(List<CustomerProfileRespDTO> list,
boolean concatCategoryPath) {
TagCategoryGroup group = new TagCategoryGroup();
group.setCategoryName(list.isEmpty() ? "" :
group.setCategoryName(CollectionUtils.isEmpty(list) ? "" :
StringUtils.defaultIfBlank(list.get(0).getCategoryName(), ""));
if (CollectionUtils.isEmpty(list)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!