Commit b79763afe72c21dbff9ad76674999ef268645d79

Authored by “wangming”
1 parent 61ae65fc

fix: 修正店助主任底薪来源描述及优化查询条件

- 更新店助主任底薪的来源描述,确保准确性。
- 优化数据库查询条件,合并条件以提高可读性和性能。
- 在多个SQL文件中添加空行以提升可读性。
netcore/src/Modularity/Extend/NCC.Extend/LqShareStatisticsStoreService.cs
... ... @@ -399,8 +399,7 @@ namespace NCC.Extend
399 399  
400 400 // 2. 店助底薪和提成
401 401 var assistantSalary = await _db.Queryable<LqAssistantSalaryStatisticsEntity>()
402   - .Where(x => x.StoreId == entity.StoreId && x.StatisticsMonth == statisticsMonth
403   - && x.Position == "店助")
  402 + .Where(x => x.StoreId == entity.StoreId && x.StatisticsMonth == statisticsMonth && x.Position == "店助")
404 403 .Select(x => new
405 404 {
406 405 BaseSalary = SqlFunc.AggregateSum(x.BaseSalary),
... ... @@ -416,12 +415,14 @@ namespace NCC.Extend
416 415 entity.SalaryHeadcountReward = assistantSalary?.HeadcountReward ?? 0;
417 416  
418 417 // 3. 店助主任底薪和提成
419   - var directorSalary = await _db.Queryable<LqDirectorSalaryStatisticsEntity>()
420   - .Where(x => x.StoreId == entity.StoreId && x.StatisticsMonth == statisticsMonth)
  418 + var directorSalary = await _db.Queryable<LqAssistantSalaryStatisticsEntity>()
  419 + .Where(x => x.StoreId == entity.StoreId && x.StatisticsMonth == statisticsMonth && x.Position == "店助主任")
421 420 .Select(x => new
422 421 {
423   - BaseSalary = SqlFunc.AggregateSum(x.ActualBaseSalary),
424   - Commission = SqlFunc.AggregateSum(x.TotalCommissionAmount)
  422 + BaseSalary = SqlFunc.AggregateSum(x.BaseSalary),
  423 + Commission = SqlFunc.AggregateSum(x.CommissionAmount),
  424 + PhoneCustody = SqlFunc.AggregateSum(x.PhoneManagementFee),
  425 + HeadcountReward = SqlFunc.AggregateSum(x.Stage1Reward + x.Stage2Reward)
425 426 })
426 427 .FirstAsync();
427 428  
... ...
sql/排查生美业绩统计差异-简化版.sql
... ... @@ -119,3 +119,4 @@ ORDER BY 生美业绩 DESC;
119 119  
120 120  
121 121  
  122 +
... ...
sql/排查生美业绩统计差异详细.sql
... ... @@ -171,3 +171,4 @@ HAVING COUNT(*) &gt; 1;
171 171  
172 172  
173 173  
  174 +
... ...
sql/检查生美业绩统计差异.sql
... ... @@ -141,3 +141,4 @@ ORDER BY 生美业绩 DESC;
141 141  
142 142  
143 143  
  144 +
... ...
test_tianwang_api.py
... ... @@ -74,3 +74,4 @@ print(f&quot;\n教育一部+教育二部合计 BillingPerformance: {total2}&quot;)
74 74  
75 75  
76 76  
  77 +
... ...
门店股份统计说明.md
... ... @@ -104,7 +104,7 @@
104 104 ### 4.1 人工工资-底薪 (base_salary)
105 105 * **人工工资-健康师底薪**: 来源于 `lq_salary_statistics.F_ActualBaseSalary`。
106 106 * **人工工资-店助底薪**: 来源于 `lq_assistant_salary_statistics.F_ActualBaseSalary` (岗位为“店助”)。
107   -* **人工工资-店助主任底薪**: 来源于 `lq_director_salary_statistics.F_ActualBaseSalary` (岗位为“主任”)。
  107 +* **人工工资-店助主任底薪**: 来源于 `lq_director_salary_statistics.F_ActualBaseSalary` (岗位为“店助主任”)。
108 108 * **人工工资-店长底薪**: 来源于 `lq_store_manager_salary_statistics.F_ActualBaseSalary`。
109 109 * **人工工资-总经理/经理底薪**: 来源于事业部总经理/经理工资表 `F_ActualBaseSalary` (按门店平均分摊 - 底薪固定4000,按管理门店数平均)。
110 110  
... ...