Commit 0c113c08b3d4fe2c31ce51d26574541503dafb3d

Authored by “wangming”
1 parent 4d585887

refactor: 优化健康师工资计算服务

- 更新健康师工资输出DTO字段
- 优化工资计算服务逻辑
- 完善工资额外计算服务功能
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqSalary/HealthCoachSalaryOutput.cs
@@ -151,5 +151,35 @@ namespace NCC.Extend.Entitys.Dto.LqSalary @@ -151,5 +151,35 @@ namespace NCC.Extend.Entitys.Dto.LqSalary
151 /// 升单业绩提成 151 /// 升单业绩提成
152 /// </summary> 152 /// </summary>
153 public decimal UpgradeCommission { get; set; } 153 public decimal UpgradeCommission { get; set; }
  154 +
  155 + /// <summary>
  156 + /// 新客业绩
  157 + /// </summary>
  158 + public decimal NewCustomerPerformance { get; set; }
  159 +
  160 + /// <summary>
  161 + /// 新客转化率
  162 + /// </summary>
  163 + public decimal NewCustomerConversionRate { get; set; }
  164 +
  165 + /// <summary>
  166 + /// 新客提点
  167 + /// </summary>
  168 + public decimal NewCustomerPoint { get; set; }
  169 +
  170 + /// <summary>
  171 + /// 升单人头数
  172 + /// </summary>
  173 + public decimal UpgradeCustomerCount { get; set; }
  174 +
  175 + /// <summary>
  176 + /// 升单业绩
  177 + /// </summary>
  178 + public decimal UpgradePerformance { get; set; }
  179 +
  180 + /// <summary>
  181 + /// 升单提点
  182 + /// </summary>
  183 + public decimal UpgradePoint { get; set; }
154 } 184 }
155 } 185 }
netcore/src/Modularity/Extend/NCC.Extend/LqSalaryExtraCalculationService.cs
@@ -456,13 +456,13 @@ namespace NCC.Extend @@ -456,13 +456,13 @@ namespace NCC.Extend
456 { 456 {
457 // 生成金额 457 // 生成金额
458 // 基础业绩奖励和合作业绩奖励:0-20000之间 458 // 基础业绩奖励和合作业绩奖励:0-20000之间
459 - var baseRewardPerformance = (decimal)(random.NextDouble() * 20000);  
460 - var cooperationRewardPerformance = (decimal)(random.NextDouble() * 20000); 459 + var baseRewardPerformance = (decimal)(random.NextDouble() * 10000);
  460 + var cooperationRewardPerformance = (decimal)(random.NextDouble() * 10000);
461 // 其他金额字段:10000-30000之间 461 // 其他金额字段:10000-30000之间
462 - var newCustomerPerformance = (decimal)(random.NextDouble() * 20000 + 10000);  
463 - var upgradePerformance = (decimal)(random.NextDouble() * 20000 + 10000);  
464 - var otherPerformanceAdd = (decimal)(random.NextDouble() * 20000 + 10000);  
465 - var otherPerformanceSubtract = (decimal)(random.NextDouble() * 20000 + 10000); 462 + var newCustomerPerformance = (decimal)(random.NextDouble() * 10000);
  463 + var upgradePerformance = (decimal)(random.NextDouble() * 10000);
  464 + var otherPerformanceAdd = (decimal)(random.NextDouble() * 10000);
  465 + var otherPerformanceSubtract = (decimal)(random.NextDouble() * 10000);
466 466
467 // 生成转化率(0-60%之间,转换为0-0.6) 467 // 生成转化率(0-60%之间,转换为0-0.6)
468 var newCustomerConversionRate = (decimal)(random.NextDouble() * 0.6); 468 var newCustomerConversionRate = (decimal)(random.NextDouble() * 0.6);
netcore/src/Modularity/Extend/NCC.Extend/LqSalaryService.cs
@@ -110,7 +110,13 @@ namespace NCC.Extend @@ -110,7 +110,13 @@ namespace NCC.Extend
110 ActualBasePerformance = x.ActualBasePerformance, 110 ActualBasePerformance = x.ActualBasePerformance,
111 ActualCooperationPerformance = x.ActualCooperationPerformance, 111 ActualCooperationPerformance = x.ActualCooperationPerformance,
112 NewCustomerCommission = x.NewCustomerPerformanceCommission, 112 NewCustomerCommission = x.NewCustomerPerformanceCommission,
113 - UpgradeCommission = x.UpgradePerformanceCommission 113 + UpgradeCommission = x.UpgradePerformanceCommission,
  114 + NewCustomerPerformance = x.NewCustomerPerformance,
  115 + NewCustomerConversionRate = x.NewCustomerConversionRate,
  116 + NewCustomerPoint = x.NewCustomerPoint,
  117 + UpgradeCustomerCount = x.UpgradeCustomerCount,
  118 + UpgradePerformance = x.UpgradePerformance,
  119 + UpgradePoint = x.UpgradePoint
114 }) 120 })
115 .ToPagedListAsync(input.currentPage, input.pageSize); 121 .ToPagedListAsync(input.currentPage, input.pageSize);
116 122
@@ -367,6 +373,8 @@ namespace NCC.Extend @@ -367,6 +373,8 @@ namespace NCC.Extend
367 salary.OtherPerformanceSubtract = extraData.OtherPerformanceSubtract; 373 salary.OtherPerformanceSubtract = extraData.OtherPerformanceSubtract;
368 salary.UpgradeCustomerCount = extraData.UpgradeCustomerCount; 374 salary.UpgradeCustomerCount = extraData.UpgradeCustomerCount;
369 salary.NewCustomerConversionRate = extraData.NewCustomerConversionRate; 375 salary.NewCustomerConversionRate = extraData.NewCustomerConversionRate;
  376 + salary.NewCustomerPerformance = extraData.NewCustomerPerformance;
  377 + salary.UpgradePerformance = extraData.UpgradePerformance;
370 } 378 }
371 379
372 // 2.1.2 计算实际基础业绩和实际合作业绩 380 // 2.1.2 计算实际基础业绩和实际合作业绩
@@ -493,6 +501,15 @@ namespace NCC.Extend @@ -493,6 +501,15 @@ namespace NCC.Extend
493 } 501 }
494 } 502 }
495 503
  504 + // 补充处理:对于没有战队ID的(个人,或被剔除的),战队业绩等于个人总业绩
  505 + foreach (var salary in employeeStats.Values)
  506 + {
  507 + if (string.IsNullOrEmpty(salary.GoldTriangleId))
  508 + {
  509 + salary.TeamPerformance = salary.TotalPerformance;
  510 + }
  511 + }
  512 +
496 // 4. 计算薪资 (底薪 & 提成) 513 // 4. 计算薪资 (底薪 & 提成)
497 foreach (var salary in employeeStats.Values) 514 foreach (var salary in employeeStats.Values)
498 { 515 {
@@ -504,13 +521,15 @@ namespace NCC.Extend @@ -504,13 +521,15 @@ namespace NCC.Extend
504 salary.HealthCoachBaseSalary = CalculateBaseSalary(salary.Consumption, salary.ProjectCount, isNewStore); 521 salary.HealthCoachBaseSalary = CalculateBaseSalary(salary.Consumption, salary.ProjectCount, isNewStore);
505 522
506 // 4.2 提成计算 523 // 4.2 提成计算
507 - // 单人业绩 <= 6000 无提成 524 + // 业绩门槛: 个人总业绩 <= 6000 无提成
508 if (salary.TotalPerformance <= 6000) 525 if (salary.TotalPerformance <= 6000)
509 { 526 {
510 salary.TotalCommission = 0; 527 salary.TotalCommission = 0;
511 salary.BasePerformanceCommission = 0; 528 salary.BasePerformanceCommission = 0;
512 salary.CooperationPerformanceCommission = 0; 529 salary.CooperationPerformanceCommission = 0;
513 salary.ConsultantCommission = 0; 530 salary.ConsultantCommission = 0;
  531 + salary.NewCustomerPerformanceCommission = 0;
  532 + salary.UpgradePerformanceCommission = 0;
514 } 533 }
515 else 534 else
516 { 535 {