mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 03:30:06 +08:00
crm:code review 客户画像
This commit is contained in:
parent
9ea43ce55a
commit
05af77b786
@ -40,21 +40,22 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
||||
|
||||
@Override
|
||||
public List<CrmStatisticCustomerAreaRespVO> getCustomerSummaryByArea(CrmStatisticsPortraitReqVO reqVO) {
|
||||
// 1.1 获得用户编号数组
|
||||
// 1. 获得用户编号数组
|
||||
List<Long> userIds = getUserIds(reqVO);
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
reqVO.setUserIds(userIds);
|
||||
// 1.2 获取客户地区统计数据
|
||||
|
||||
// 2. 获取客户地区统计数据
|
||||
List<CrmStatisticCustomerAreaRespVO> list = portraitMapper.selectSummaryListGroupByAreaId(reqVO);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 2. 拼接数据
|
||||
// 3. 拼接数据
|
||||
List<Area> areaList = AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area);
|
||||
areaList.add(new Area().setId(null).setName("未知"));
|
||||
areaList.add(new Area().setId(null).setName("未知")); // TODO @puhui999:是不是 65 find 的逻辑改下;不用 findAndThen,直接从 areaMap 拿;拿到就设置,不拿到就设置 null 和 未知;这样,58 本行可以删除掉完事了;这样代码更简单和一致
|
||||
Map<Integer, Area> areaMap = convertMap(areaList, Area::getId);
|
||||
return convertList(list, item -> {
|
||||
Integer parentId = AreaUtils.getParentIdByType(item.getAreaId(), AreaTypeEnum.PROVINCE);
|
||||
@ -76,11 +77,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
||||
reqVO.setUserIds(userIds);
|
||||
|
||||
// 2. 获取客户行业统计数据
|
||||
List<CrmStatisticCustomerIndustryRespVO> industryRespVOList = portraitMapper.selectCustomerIndustryListGroupByIndustryId(reqVO);
|
||||
if (CollUtil.isEmpty(industryRespVOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return industryRespVOList;
|
||||
return portraitMapper.selectCustomerIndustryListGroupByIndustryId(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -93,11 +90,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
||||
reqVO.setUserIds(userIds);
|
||||
|
||||
// 2. 获取客户行业统计数据
|
||||
List<CrmStatisticCustomerSourceRespVO> sourceRespVOList = portraitMapper.selectCustomerSourceListGroupBySource(reqVO);
|
||||
if (CollUtil.isEmpty(sourceRespVOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return sourceRespVOList;
|
||||
return portraitMapper.selectCustomerSourceListGroupBySource(reqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -110,11 +103,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
||||
reqVO.setUserIds(userIds);
|
||||
|
||||
// 2. 获取客户级别统计数据
|
||||
List<CrmStatisticCustomerLevelRespVO> levelRespVOList = portraitMapper.selectCustomerLevelListGroupByLevel(reqVO);
|
||||
if (CollUtil.isEmpty(levelRespVOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return levelRespVOList;
|
||||
return portraitMapper.selectCustomerLevelListGroupByLevel(reqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user