Commit c4ce9068f9457b30131c860c0906cb55dc133bf0

Authored by YunaiV
1 parent ee40b530

crm:code review 公海客户分析

yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java
@@ -250,10 +250,9 @@ public class LocalDateTimeUtils { @@ -250,10 +250,9 @@ public class LocalDateTimeUtils {
250 case DateIntervalEnum.QUARTER: 250 case DateIntervalEnum.QUARTER:
251 while (startTime.isBefore(endTime)) { 251 while (startTime.isBefore(endTime)) {
252 int quarterOfYear = getQuarterOfYear(startTime); 252 int quarterOfYear = getQuarterOfYear(startTime);
253 - LocalDateTime quarterEnd =  
254 - quarterOfYear == 4  
255 - ? startTime.with(TemporalAdjusters.lastDayOfYear()).plusDays(1).minusNanos(1)  
256 - : startTime.withMonth(quarterOfYear * 3 + 1).withDayOfMonth(1).minusNanos(1); 253 + LocalDateTime quarterEnd = quarterOfYear == 4
  254 + ? startTime.with(TemporalAdjusters.lastDayOfYear()).plusDays(1).minusNanos(1)
  255 + : startTime.withMonth(quarterOfYear * 3 + 1).withDayOfMonth(1).minusNanos(1);
257 timeRanges.add(new LocalDateTime[]{startTime, quarterEnd}); 256 timeRanges.add(new LocalDateTime[]{startTime, quarterEnd});
258 startTime = quarterEnd.plusNanos(1); 257 startTime = quarterEnd.plusNanos(1);
259 } 258 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/statistics/CrmStatisticsCustomerController.http
@@ -9,7 +9,6 @@ GET {{baseUrl}}/crm/statistics-customer/get-customer-summary-by-user?deptId=100& @@ -9,7 +9,6 @@ GET {{baseUrl}}/crm/statistics-customer/get-customer-summary-by-user?deptId=100&
9 Authorization: Bearer {{token}} 9 Authorization: Bearer {{token}}
10 tenant-id: {{adminTenentId}} 10 tenant-id: {{adminTenentId}}
11 11
12 -  
13 # == 2. 客户跟进次数分析 == 12 # == 2. 客户跟进次数分析 ==
14 ### 2.1 客户跟进次数分析(按日期) 13 ### 2.1 客户跟进次数分析(按日期)
15 GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-date?deptId=100&interval=2&times[0]=2024-01-01 00:00:00&times[1]=2024-01-29 23:59:59 14 GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-date?deptId=100&interval=2&times[0]=2024-01-01 00:00:00&times[1]=2024-01-29 23:59:59
@@ -21,14 +20,12 @@ GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-user?deptId=100 @@ -21,14 +20,12 @@ GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-user?deptId=100
21 Authorization: Bearer {{token}} 20 Authorization: Bearer {{token}}
22 tenant-id: {{adminTenentId}} 21 tenant-id: {{adminTenentId}}
23 22
24 -  
25 # == 3. 客户跟进方式分析 == 23 # == 3. 客户跟进方式分析 ==
26 ### 3.1 客户跟进方式分析 24 ### 3.1 客户跟进方式分析
27 GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-type?deptId=100&interval=2&times[0]=2023-01-01 00:00:00&times[1]=2024-12-12 23:59:59 25 GET {{baseUrl}}/crm/statistics-customer/get-follow-up-summary-by-type?deptId=100&interval=2&times[0]=2023-01-01 00:00:00&times[1]=2024-12-12 23:59:59
28 Authorization: Bearer {{token}} 26 Authorization: Bearer {{token}}
29 tenant-id: {{adminTenentId}} 27 tenant-id: {{adminTenentId}}
30 28
31 -  
32 # == 4. 客户成交周期 == 29 # == 4. 客户成交周期 ==
33 ### 4.1 合同摘要信息(客户转化率页面) 30 ### 4.1 合同摘要信息(客户转化率页面)
34 GET {{baseUrl}}/crm/statistics-customer/get-contract-summary?deptId=100&interval=2&times[0]=2023-01-01 00:00:00&times[1]=2024-12-12 23:59:59 31 GET {{baseUrl}}/crm/statistics-customer/get-contract-summary?deptId=100&interval=2&times[0]=2023-01-01 00:00:00&times[1]=2024-12-12 23:59:59
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/statistics/CrmStatisticsCustomerController.java
@@ -69,14 +69,14 @@ public class CrmStatisticsCustomerController { @@ -69,14 +69,14 @@ public class CrmStatisticsCustomerController {
69 } 69 }
70 70
71 @GetMapping("/get-pool-summary-by-date") 71 @GetMapping("/get-pool-summary-by-date")
72 - @Operation(summary = "获取客户成交周期(按日期)") 72 + @Operation(summary = "获取公海客户分析(按日期)")
73 @PreAuthorize("@ss.hasPermission('crm:statistics-customer:query')") 73 @PreAuthorize("@ss.hasPermission('crm:statistics-customer:query')")
74 public CommonResult<List<CrmStatisticsPoolSummaryByDateRespVO>> getPoolSummaryByDate(@Valid CrmStatisticsCustomerReqVO reqVO) { 74 public CommonResult<List<CrmStatisticsPoolSummaryByDateRespVO>> getPoolSummaryByDate(@Valid CrmStatisticsCustomerReqVO reqVO) {
75 return success(customerService.getPoolSummaryByDate(reqVO)); 75 return success(customerService.getPoolSummaryByDate(reqVO));
76 } 76 }
77 77
78 @GetMapping("/get-pool-summary-by-user") 78 @GetMapping("/get-pool-summary-by-user")
79 - @Operation(summary = "获取客户成交周期(按用户)") 79 + @Operation(summary = "获取公海客户分析(按用户)")
80 @PreAuthorize("@ss.hasPermission('crm:statistics-customer:query')") 80 @PreAuthorize("@ss.hasPermission('crm:statistics-customer:query')")
81 public CommonResult<List<CrmStatisticsPoolSummaryByUserRespVO>> getPoolSummaryByUser(@Valid CrmStatisticsCustomerReqVO reqVO) { 81 public CommonResult<List<CrmStatisticsPoolSummaryByUserRespVO>> getPoolSummaryByUser(@Valid CrmStatisticsCustomerReqVO reqVO) {
82 return success(customerService.getPoolSummaryByUser(reqVO)); 82 return success(customerService.getPoolSummaryByUser(reqVO));
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/statistics/CrmStatisticsCustomerMapper.java
@@ -138,7 +138,6 @@ public interface CrmStatisticsCustomerMapper { @@ -138,7 +138,6 @@ public interface CrmStatisticsCustomerMapper {
138 return voList; 138 return voList;
139 } 139 }
140 140
141 -  
142 /** 141 /**
143 * 公海领取客户数(按日期) 142 * 公海领取客户数(按日期)
144 * 143 *
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/statistics/CrmStatisticsCustomerMapper.xml
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 GROUP BY time 16 GROUP BY time
17 </select> 17 </select>
18 18
  19 + <!-- TODO 芋艿:应该不用过滤时间 -->
19 <select id="selectCustomerDealCountGroupByDate" 20 <select id="selectCustomerDealCountGroupByDate"
20 resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.customer.CrmStatisticsCustomerSummaryByDateRespVO"> 21 resultType="cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.customer.CrmStatisticsCustomerSummaryByDateRespVO">
21 SELECT DATE_FORMAT(customer.create_time, '%Y-%m-%d') AS time, 22 SELECT DATE_FORMAT(customer.create_time, '%Y-%m-%d') AS time,