mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-02-01 19:24:57 +08:00
crm:code review 客户画像
This commit is contained in:
parent
9ea43ce55a
commit
05af77b786
@ -40,21 +40,22 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CrmStatisticCustomerAreaRespVO> getCustomerSummaryByArea(CrmStatisticsPortraitReqVO reqVO) {
|
public List<CrmStatisticCustomerAreaRespVO> getCustomerSummaryByArea(CrmStatisticsPortraitReqVO reqVO) {
|
||||||
// 1.1 获得用户编号数组
|
// 1. 获得用户编号数组
|
||||||
List<Long> userIds = getUserIds(reqVO);
|
List<Long> userIds = getUserIds(reqVO);
|
||||||
if (CollUtil.isEmpty(userIds)) {
|
if (CollUtil.isEmpty(userIds)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
reqVO.setUserIds(userIds);
|
reqVO.setUserIds(userIds);
|
||||||
// 1.2 获取客户地区统计数据
|
|
||||||
|
// 2. 获取客户地区统计数据
|
||||||
List<CrmStatisticCustomerAreaRespVO> list = portraitMapper.selectSummaryListGroupByAreaId(reqVO);
|
List<CrmStatisticCustomerAreaRespVO> list = portraitMapper.selectSummaryListGroupByAreaId(reqVO);
|
||||||
if (CollUtil.isEmpty(list)) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 拼接数据
|
// 3. 拼接数据
|
||||||
List<Area> areaList = AreaUtils.getByType(AreaTypeEnum.PROVINCE, area -> area);
|
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);
|
Map<Integer, Area> areaMap = convertMap(areaList, Area::getId);
|
||||||
return convertList(list, item -> {
|
return convertList(list, item -> {
|
||||||
Integer parentId = AreaUtils.getParentIdByType(item.getAreaId(), AreaTypeEnum.PROVINCE);
|
Integer parentId = AreaUtils.getParentIdByType(item.getAreaId(), AreaTypeEnum.PROVINCE);
|
||||||
@ -76,11 +77,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
|||||||
reqVO.setUserIds(userIds);
|
reqVO.setUserIds(userIds);
|
||||||
|
|
||||||
// 2. 获取客户行业统计数据
|
// 2. 获取客户行业统计数据
|
||||||
List<CrmStatisticCustomerIndustryRespVO> industryRespVOList = portraitMapper.selectCustomerIndustryListGroupByIndustryId(reqVO);
|
return portraitMapper.selectCustomerIndustryListGroupByIndustryId(reqVO);
|
||||||
if (CollUtil.isEmpty(industryRespVOList)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return industryRespVOList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -93,11 +90,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
|||||||
reqVO.setUserIds(userIds);
|
reqVO.setUserIds(userIds);
|
||||||
|
|
||||||
// 2. 获取客户行业统计数据
|
// 2. 获取客户行业统计数据
|
||||||
List<CrmStatisticCustomerSourceRespVO> sourceRespVOList = portraitMapper.selectCustomerSourceListGroupBySource(reqVO);
|
return portraitMapper.selectCustomerSourceListGroupBySource(reqVO);
|
||||||
if (CollUtil.isEmpty(sourceRespVOList)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return sourceRespVOList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -110,11 +103,7 @@ public class CrmStatisticsPortraitServiceImpl implements CrmStatisticsPortraitSe
|
|||||||
reqVO.setUserIds(userIds);
|
reqVO.setUserIds(userIds);
|
||||||
|
|
||||||
// 2. 获取客户级别统计数据
|
// 2. 获取客户级别统计数据
|
||||||
List<CrmStatisticCustomerLevelRespVO> levelRespVOList = portraitMapper.selectCustomerLevelListGroupByLevel(reqVO);
|
return portraitMapper.selectCustomerLevelListGroupByLevel(reqVO);
|
||||||
if (CollUtil.isEmpty(levelRespVOList)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
return levelRespVOList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user