Commit 25ab25d3089794b5577042030fe15dd2b2a6c094

Authored by “wangming”
1 parent bcdc9e9a

fix: 修改项目数统计逻辑,使用项目次数总和而非去重

- GetBillingProjectCount改为统计开单项目次数总和
- GetConsumeProjectCount改为统计消耗项目次数总和
- 使用F_ProjectNumber字段求和而非项目编号去重
- 更新注释说明项目数为项目次数总和
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqStatistics/EmployeePerformanceStatisticsOutput.cs
... ... @@ -71,12 +71,12 @@ namespace NCC.Extend.Entitys.Dto.LqStatistics
71 71 public int PersonCount { get; set; }
72 72  
73 73 /// <summary>
74   - /// 开单项目数
  74 + /// 开单项目数(项目次数总和)
75 75 /// </summary>
76 76 public int BillingProjectCount { get; set; }
77 77  
78 78 /// <summary>
79   - /// 消耗项目数
  79 + /// 消耗项目数(项目次数总和)
80 80 /// </summary>
81 81 public int ConsumeProjectCount { get; set; }
82 82 }
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqStatisticsService.cs
... ... @@ -3411,10 +3411,10 @@ namespace NCC.Extend.LqStatistics
3411 3411 /// - AppointmentCount: 预约人数
3412 3412 /// - BillingCount: 开单数量
3413 3413 /// - BillingAmount: 开单金额
3414   - /// - BillingProjectCount: 开单项目数
  3414 + /// - BillingProjectCount: 开单项目数(项目次数总和)
3415 3415 /// - ConsumeCount: 消耗数量
3416 3416 /// - ConsumeAmount: 消耗金额
3417   - /// - ConsumeProjectCount: 消耗项目数
  3417 + /// - ConsumeProjectCount: 消耗项目数(项目次数总和)
3418 3418 /// - RefundCount: 退卡数量
3419 3419 /// - RefundAmount: 退卡金额
3420 3420 /// - HeadCount: 人头(月度去重客户数)
... ... @@ -3636,12 +3636,12 @@ namespace NCC.Extend.LqStatistics
3636 3636 }
3637 3637  
3638 3638 /// <summary>
3639   - /// 统计开单项目数
  3639 + /// 统计开单项目数(项目次数总和)
3640 3640 /// </summary>
3641 3641 private async Task<int> GetBillingProjectCount(string userId, string month)
3642 3642 {
3643 3643 var sql = $@"
3644   - SELECT COUNT(DISTINCT pxmx.px) as Count
  3644 + SELECT COALESCE(SUM(pxmx.F_ProjectNumber), 0) as Count
3645 3645 FROM lq_kd_jksyj jksyj
3646 3646 INNER JOIN lq_kd_pxmx pxmx ON jksyj.F_kdpxid = pxmx.F_Id
3647 3647 WHERE jksyj.jkszh = '{userId}'
... ... @@ -3653,12 +3653,12 @@ namespace NCC.Extend.LqStatistics
3653 3653 }
3654 3654  
3655 3655 /// <summary>
3656   - /// 统计消耗项目数
  3656 + /// 统计消耗项目数(项目次数总和)
3657 3657 /// </summary>
3658 3658 private async Task<int> GetConsumeProjectCount(string userId, string month)
3659 3659 {
3660 3660 var sql = $@"
3661   - SELECT COUNT(DISTINCT pxmx.px) as Count
  3661 + SELECT COALESCE(SUM(pxmx.F_ProjectNumber), 0) as Count
3662 3662 FROM lq_xh_jksyj jksyj
3663 3663 INNER JOIN lq_xh_hyhk hyhk ON jksyj.glkdbh = hyhk.F_Id
3664 3664 INNER JOIN lq_xh_pxmx pxmx ON pxmx.F_ConsumeInfoId = hyhk.F_Id
... ...