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