From 656991809fae8929dc5125fc6e8232e3e86d4644 Mon Sep 17 00:00:00 2001 From: “wangming” <“wangming@antissoft.com”> Date: Wed, 29 Oct 2025 10:47:26 +0800 Subject: [PATCH] feat: 在GetStorePerformanceComparison中新增消耗业绩统计 --- antis-ncc-admin/.env.development | 4 ++-- netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReport/StorePerformanceComparisonOutput.cs | 5 +++++ netcore/src/Modularity/Extend/NCC.Extend/LqReportService.cs | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/antis-ncc-admin/.env.development b/antis-ncc-admin/.env.development index 4c02e12..e9a4583 100644 --- a/antis-ncc-admin/.env.development +++ b/antis-ncc-admin/.env.development @@ -2,6 +2,6 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true # VUE_APP_BASE_API = 'https://erp.lvqianmeiye.com' -VUE_APP_BASE_API = 'http://erp_test.lvqianmeiye.com' -# VUE_APP_BASE_API = 'http://localhost:2011' +# VUE_APP_BASE_API = 'http://erp_test.lvqianmeiye.com' +VUE_APP_BASE_API = 'http://localhost:2011' VUE_APP_BASE_WSS = 'ws://192.168.110.45:2011/websocket' diff --git a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReport/StorePerformanceComparisonOutput.cs b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReport/StorePerformanceComparisonOutput.cs index c6c17bb..1bd9983 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReport/StorePerformanceComparisonOutput.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqReport/StorePerformanceComparisonOutput.cs @@ -39,5 +39,10 @@ namespace NCC.Extend.Entitys.Dto.LqReport /// 是否达标(实际业绩 >= 目标业绩) /// public bool IsTargetAchieved { get; set; } + + /// + /// 实际消耗业绩 + /// + public decimal ActualConsumePerformance { get; set; } } } diff --git a/netcore/src/Modularity/Extend/NCC.Extend/LqReportService.cs b/netcore/src/Modularity/Extend/NCC.Extend/LqReportService.cs index ba5ec9e..c3c4cad 100644 --- a/netcore/src/Modularity/Extend/NCC.Extend/LqReportService.cs +++ b/netcore/src/Modularity/Extend/NCC.Extend/LqReportService.cs @@ -1047,6 +1047,7 @@ namespace NCC.Extend /// - StoreName: 门店名称 /// - TargetPerformance: 目标业绩(来自门店资料表xsyj字段) /// - ActualPerformance: 实际开单业绩(统计期间内的开单业绩总和) + /// - ActualConsumePerformance: 实际消耗业绩(统计期间内的消耗业绩总和) /// - CompletionRate: 完成率(实际业绩/目标业绩 × 100%) /// - Difference: 差额(实际业绩-目标业绩) /// - IsTargetAchieved: 是否达标(实际业绩 >= 目标业绩) @@ -1071,21 +1072,27 @@ namespace NCC.Extend md.F_Id as store_id, md.dm as store_name, COALESCE(CAST(md.xsyj AS DECIMAL(18,2)), 0) as target_performance, - COALESCE(SUM(CAST(kd.sfyj AS DECIMAL(18,2))), 0) as actual_performance + COALESCE(SUM(CAST(kd.sfyj AS DECIMAL(18,2))), 0) as actual_performance, + COALESCE(SUM(CAST(xh.xfje AS DECIMAL(18,2))), 0) as actual_consume_performance FROM lq_mdxx md LEFT JOIN lq_kd_kdjlb kd ON md.F_Id = kd.djmd AND kd.F_IsEffective = 1 AND kd.kdrq >= @startTime - AND kd.kdrq <= @endTime"; + AND kd.kdrq <= @endTime + LEFT JOIN lq_xh_hyhk xh ON md.F_Id = xh.md + AND xh.F_IsEffective = 1 + AND xh.hksj >= @startTime + AND xh.hksj <= @endTime"; object parameters; if (input.StoreIds != null && input.StoreIds.Any()) { - sql += " AND md.F_Id IN @storeIds"; + sql += " WHERE md.F_Id IN @storeIds"; parameters = new { startTime, endTime, storeIds = input.StoreIds }; } else { + sql += " WHERE 1=1"; parameters = new { startTime, endTime }; } @@ -1101,6 +1108,7 @@ namespace NCC.Extend var storeName = item.store_name?.ToString(); var targetPerformance = Convert.ToDecimal(item.target_performance ?? 0); var actualPerformance = Convert.ToDecimal(item.actual_performance ?? 0); + var actualConsumePerformance = Convert.ToDecimal(item.actual_consume_performance ?? 0); // 计算完成率 var completionRate = targetPerformance > 0 @@ -1119,6 +1127,7 @@ namespace NCC.Extend StoreName = storeName, TargetPerformance = targetPerformance, ActualPerformance = actualPerformance, + ActualConsumePerformance = actualConsumePerformance, CompletionRate = completionRate, Difference = difference, IsTargetAchieved = isTargetAchieved -- libgit2 0.21.4