Commit 5159da30b4b5cf0fe290b8a1f411709ade6bcdd4

Authored by YunaiV
1 parent 0d1e2c60

crm:code review 员工客户分析

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/statistics/CrmStatisticsCustomerService.java
... ... @@ -77,7 +77,7 @@ public interface CrmStatisticsCustomerService {
77 77  
78 78 /**
79 79 * 客户成交周期(按日期)
80   - * <p>
  80 + *
81 81 * 成交周期的定义:客户 customer 在创建出来,到合同 contract 第一次成交的时间差
82 82 *
83 83 * @param reqVO 请求参数
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/statistics/CrmStatisticsCustomerServiceImpl.java
... ... @@ -310,8 +310,7 @@ public class CrmStatisticsCustomerServiceImpl implements CrmStatisticsCustomerSe
310 310 }
311 311  
312 312 // 3. 拼接数据
313   - Map<Integer, Area> areaMap = convertMap(AreaUtils.getByType(AreaTypeEnum.PROVINCE, Function.identity()),
314   - Area::getId);
  313 + Map<Integer, Area> areaMap = convertMap(AreaUtils.getByType(AreaTypeEnum.PROVINCE, Function.identity()), Area::getId);
315 314 return convertList(dealCycleByAreaList, vo -> {
316 315 if (vo.getAreaId() != null) {
317 316 Integer parentId = AreaUtils.getParentIdByType(vo.getAreaId(), AreaTypeEnum.PROVINCE);
... ... @@ -331,12 +330,8 @@ public class CrmStatisticsCustomerServiceImpl implements CrmStatisticsCustomerSe
331 330 reqVO.setUserIds(userIds);
332 331  
333 332 // 2. 获取客户产品统计数据
334   - List<CrmStatisticsCustomerDealCycleByProductRespVO> dealCycleByProductList = customerMapper.selectCustomerDealCycleGroupByProductId(reqVO);
335   - if (CollUtil.isEmpty(dealCycleByProductList)) {
336   - return Collections.emptyList();
337   - }
338   -
339   - return dealCycleByProductList;
  333 + // TODO @dhb52:未读取产品名
  334 + return customerMapper.selectCustomerDealCycleGroupByProductId(reqVO);
340 335 }
341 336  
342 337 /**
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/statistics/CrmStatisticsCustomerMapper.xml
... ... @@ -16,7 +16,6 @@
16 16 GROUP BY time
17 17 </select>
18 18  
19   - <!-- TODO 芋艿:应该不用过滤时间 -->
20 19 <select id="selectCustomerDealCountGroupByDate"
21 20 resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.customer.CrmStatisticsCustomerSummaryByDateRespVO">
22 21 SELECT DATE_FORMAT(customer.create_time, '%Y-%m-%d') AS time,
... ...