Commit 4a3bdac5d40800155468e743658af7d6bc4e50eb
1 parent
69622222
feature(*): 考评报表修改
考评报表修改
Showing
3 changed files
with
23 additions
and
259 deletions
fw-morax-domain/src/main/java/cn/fw/morax/domain/db/salary/ReportSalaryDim.java
@@ -93,7 +93,7 @@ public class ReportSalaryDim extends BaseEntity<ReportSalaryDim, Long> { | @@ -93,7 +93,7 @@ public class ReportSalaryDim extends BaseEntity<ReportSalaryDim, Long> { | ||
93 | private StarLevelEnum starLevel; | 93 | private StarLevelEnum starLevel; |
94 | 94 | ||
95 | /** | 95 | /** |
96 | - * 总薪酬 = actRevenueTotalMoney(总收入合计) - actDeductTotalMoney(总扣除合计) | 96 | + * 总薪酬 |
97 | */ | 97 | */ |
98 | private BigDecimal totalReward; | 98 | private BigDecimal totalReward; |
99 | 99 | ||
@@ -102,64 +102,4 @@ public class ReportSalaryDim extends BaseEntity<ReportSalaryDim, Long> { | @@ -102,64 +102,4 @@ public class ReportSalaryDim extends BaseEntity<ReportSalaryDim, Long> { | ||
102 | */ | 102 | */ |
103 | private BigDecimal kpiScoreRatio; | 103 | private BigDecimal kpiScoreRatio; |
104 | 104 | ||
105 | - /** | ||
106 | - * 总收入合计 | ||
107 | - */ | ||
108 | - private BigDecimal actRevenueTotalMoney; | ||
109 | - | ||
110 | - /** | ||
111 | - * 总绩效提成 | ||
112 | - */ | ||
113 | - private BigDecimal actKpiMoney; | ||
114 | - | ||
115 | - /** | ||
116 | - * 总内部奖励 | ||
117 | - */ | ||
118 | - private BigDecimal actAwardMoney; | ||
119 | - | ||
120 | - /** | ||
121 | - * 总福利补贴 | ||
122 | - */ | ||
123 | - private BigDecimal actSubsidyMoney; | ||
124 | - | ||
125 | - /** | ||
126 | - * 总试用期工资 | ||
127 | - */ | ||
128 | - private BigDecimal actProbationMoney; | ||
129 | - | ||
130 | - /** | ||
131 | - * 总岗位最低补偿 | ||
132 | - */ | ||
133 | - private BigDecimal actJobCompensateMoney; | ||
134 | - | ||
135 | - /** | ||
136 | - * 总考评奖励 | ||
137 | - */ | ||
138 | - private BigDecimal actEvalAwardMoney; | ||
139 | - | ||
140 | - /** | ||
141 | - * 总扣除合计 | ||
142 | - */ | ||
143 | - private BigDecimal actDeductTotalMoney; | ||
144 | - | ||
145 | - /** | ||
146 | - * 总内部罚款扣除 | ||
147 | - */ | ||
148 | - private BigDecimal actPenaltyMoney; | ||
149 | - | ||
150 | - /** | ||
151 | - * 总社保扣除 | ||
152 | - */ | ||
153 | - private BigDecimal actNecessaryMoney; | ||
154 | - | ||
155 | - /** | ||
156 | - * 总个税扣除 | ||
157 | - */ | ||
158 | - private BigDecimal actPersonTaxMoney; | ||
159 | - | ||
160 | - /** | ||
161 | - * 总公积金扣除 | ||
162 | - */ | ||
163 | - private BigDecimal actAccumulationFundMoney; | ||
164 | - | ||
165 | } | 105 | } |
fw-morax-domain/src/main/java/cn/fw/morax/domain/enums/EvalUseTargetEnum.java
@@ -16,7 +16,7 @@ public enum EvalUseTargetEnum implements IEnum<Integer> { | @@ -16,7 +16,7 @@ public enum EvalUseTargetEnum implements IEnum<Integer> { | ||
16 | */ | 16 | */ |
17 | NO(1, "无目标"), | 17 | NO(1, "无目标"), |
18 | FIRST_TARGET(2, "第一目标"), | 18 | FIRST_TARGET(2, "第一目标"), |
19 | - EXTRA_TARGET(3, "额外目标值"), | 19 | + EXTRA_TARGET(2, "额外目标值"), |
20 | ; | 20 | ; |
21 | 21 | ||
22 | /** | 22 | /** |
fw-morax-server/src/main/java/cn/fw/morax/server/task/SalaryReportTask.java
@@ -6,7 +6,7 @@ import cn.fw.morax.common.constant.TimeTaskConstant; | @@ -6,7 +6,7 @@ import cn.fw.morax.common.constant.TimeTaskConstant; | ||
6 | import cn.fw.morax.common.utils.DateUtil; | 6 | import cn.fw.morax.common.utils.DateUtil; |
7 | import cn.fw.morax.common.utils.PublicUtil; | 7 | import cn.fw.morax.common.utils.PublicUtil; |
8 | import cn.fw.morax.domain.bo.salary.SalaryGroupProjectBO; | 8 | import cn.fw.morax.domain.bo.salary.SalaryGroupProjectBO; |
9 | -import cn.fw.morax.domain.db.kpi.IndicatorUserValue; | 9 | +import cn.fw.morax.domain.db.kpi.*; |
10 | import cn.fw.morax.domain.db.salary.*; | 10 | import cn.fw.morax.domain.db.salary.*; |
11 | import cn.fw.morax.domain.enums.*; | 11 | import cn.fw.morax.domain.enums.*; |
12 | import cn.fw.morax.domain.vo.salary.SalaryGroupProjectParamVO; | 12 | import cn.fw.morax.domain.vo.salary.SalaryGroupProjectParamVO; |
@@ -49,8 +49,6 @@ import java.util.*; | @@ -49,8 +49,6 @@ import java.util.*; | ||
49 | import java.util.concurrent.atomic.AtomicInteger; | 49 | import java.util.concurrent.atomic.AtomicInteger; |
50 | import java.util.concurrent.locks.Lock; | 50 | import java.util.concurrent.locks.Lock; |
51 | import java.util.function.Function; | 51 | import java.util.function.Function; |
52 | -import java.util.function.Predicate; | ||
53 | -import java.util.function.ToDoubleFunction; | ||
54 | import java.util.stream.Collectors; | 52 | import java.util.stream.Collectors; |
55 | 53 | ||
56 | /** | 54 | /** |
@@ -88,7 +86,6 @@ public class SalaryReportTask { | @@ -88,7 +86,6 @@ public class SalaryReportTask { | ||
88 | private final CommonService commonService; | 86 | private final CommonService commonService; |
89 | private final EhrRpcService ehrRpcService; | 87 | private final EhrRpcService ehrRpcService; |
90 | private final OopRpcService oopRpcService; | 88 | private final OopRpcService oopRpcService; |
91 | - private final SalaryPoolDetailService salaryPoolDetailService; | ||
92 | 89 | ||
93 | 90 | ||
94 | @Value("${special-indicator-code.car-series}") | 91 | @Value("${special-indicator-code.car-series}") |
@@ -226,12 +223,10 @@ public class SalaryReportTask { | @@ -226,12 +223,10 @@ public class SalaryReportTask { | ||
226 | List<SalaryPool> pools, | 223 | List<SalaryPool> pools, |
227 | Long reportSalaryId) { | 224 | Long reportSalaryId) { |
228 | MultiKeyMap<Long, BigDecimal> userSalaryMap = this.getUserIndicatorHitMap(salaryGroupProjects, date, pools); | 225 | MultiKeyMap<Long, BigDecimal> userSalaryMap = this.getUserIndicatorHitMap(salaryGroupProjects, date, pools); |
229 | - Map<Long, List<SalaryPoolDetail>> salaryPoolDetailMap = this.getSalaryPoolDetailMap(date, pools); | ||
230 | List<ReportSalaryDimValue> reportSalaryValues = new ArrayList<>(); | 226 | List<ReportSalaryDimValue> reportSalaryValues = new ArrayList<>(); |
231 | //人的维度为基础,计算各个指标信息对应的数据 | 227 | //人的维度为基础,计算各个指标信息对应的数据 |
232 | for (SalaryPool pool : pools) { | 228 | for (SalaryPool pool : pools) { |
233 | - List<SalaryPoolDetail> salaryPoolIdDetails = Optional.ofNullable(salaryPoolDetailMap.get(pool.getId())).orElse(Collections.emptyList()); | ||
234 | - ReportSalaryDim reportSalaryDim = saveStaffDim(pool, date, reportSalaryId,salaryPoolIdDetails); | 229 | + ReportSalaryDim reportSalaryDim = saveStaffDim(pool, date, reportSalaryId); |
235 | userDims.add(reportSalaryDim); | 230 | userDims.add(reportSalaryDim); |
236 | final Long userId = pool.getUserId(); | 231 | final Long userId = pool.getUserId(); |
237 | final Long reportSalaryDimId = reportSalaryDim.getId(); | 232 | final Long reportSalaryDimId = reportSalaryDim.getId(); |
@@ -291,7 +286,9 @@ public class SalaryReportTask { | @@ -291,7 +286,9 @@ public class SalaryReportTask { | ||
291 | if (PublicUtil.isEmpty(shopDimReportIds)) { | 286 | if (PublicUtil.isEmpty(shopDimReportIds)) { |
292 | continue; | 287 | continue; |
293 | } | 288 | } |
294 | - final Long shopReportSalaryDimId = this.saveShopDimDB(shopId, shopMap, date, reportSalaryId, userDims, shopDimReportIds); | 289 | + BigDecimal averageSalary = calcAverageTotalSalary(userDims, shopDimReportIds); |
290 | + BigDecimal kpiScoreRatio = calcAverageKpiScoreRatio(userDims, shopDimReportIds); | ||
291 | + final Long shopReportSalaryDimId = this.saveShopDimDB(shopId, shopMap, date, reportSalaryId, averageSalary, kpiScoreRatio); | ||
295 | 292 | ||
296 | for (SalaryGroupProjectBO salaryGroupProject : salaryGroupProjects) { | 293 | for (SalaryGroupProjectBO salaryGroupProject : salaryGroupProjects) { |
297 | BigDecimal value = calcAverageValue(userSalaryValues, shopDimReportIds, salaryGroupProject.getId().toString()); | 294 | BigDecimal value = calcAverageValue(userSalaryValues, shopDimReportIds, salaryGroupProject.getId().toString()); |
@@ -344,9 +341,9 @@ public class SalaryReportTask { | @@ -344,9 +341,9 @@ public class SalaryReportTask { | ||
344 | if (PublicUtil.isEmpty(managerStaffDimReportIds)) { | 341 | if (PublicUtil.isEmpty(managerStaffDimReportIds)) { |
345 | continue; | 342 | continue; |
346 | } | 343 | } |
347 | - //BigDecimal kpiScoreRatio = calcAverageKpiScoreRatio(userDims, managerStaffDimReportIds); | ||
348 | - //BigDecimal averageSalary = calcAverageTotalSalary(userDims, managerStaffDimReportIds); | ||
349 | - final Long reportSalaryDimId = this.saveManagerDimDB(manager, date, reportSalaryId, managerMap,manageStaffIds,managerStaffDimReportIds,userDims); | 344 | + BigDecimal kpiScoreRatio = calcAverageKpiScoreRatio(userDims, managerStaffDimReportIds); |
345 | + BigDecimal averageSalary = calcAverageTotalSalary(userDims, managerStaffDimReportIds); | ||
346 | + final Long reportSalaryDimId = this.saveManagerDimDB(manager, date, reportSalaryId, managerMap, averageSalary, kpiScoreRatio, manageStaffIds); | ||
350 | for (SalaryGroupProjectBO salaryGroupProject : salaryGroupProjects) { | 347 | for (SalaryGroupProjectBO salaryGroupProject : salaryGroupProjects) { |
351 | BigDecimal value = calcAverageValue(userSalaryValues, managerStaffDimReportIds, salaryGroupProject.getId().toString()); | 348 | BigDecimal value = calcAverageValue(userSalaryValues, managerStaffDimReportIds, salaryGroupProject.getId().toString()); |
352 | childReportSalaryDimValues.add(this.convertProjectValueDB(salaryGroupProject, value)); | 349 | childReportSalaryDimValues.add(this.convertProjectValueDB(salaryGroupProject, value)); |
@@ -374,44 +371,6 @@ public class SalaryReportTask { | @@ -374,44 +371,6 @@ public class SalaryReportTask { | ||
374 | return staffInfos.stream().collect(Collectors.toMap(StaffBaseInfoDTO::getId, Function.identity(), (v1, v2) -> v1)); | 371 | return staffInfos.stream().collect(Collectors.toMap(StaffBaseInfoDTO::getId, Function.identity(), (v1, v2) -> v1)); |
375 | } | 372 | } |
376 | 373 | ||
377 | - /** | ||
378 | - * 抽象处理平均值计算 | ||
379 | - * @param data | ||
380 | - * @param predicate | ||
381 | - * @param field | ||
382 | - * @return | ||
383 | - */ | ||
384 | - private <T> BigDecimal calcAverage(final Collection<T> data,Predicate<T> predicate, final ToDoubleFunction<T> field) { | ||
385 | - if (CollectionUtils.isEmpty(data)) { | ||
386 | - return BigDecimal.ZERO; | ||
387 | - } | ||
388 | - Double averageRatioDouble = data.stream() | ||
389 | - .filter(predicate) | ||
390 | - .mapToDouble(field) | ||
391 | - .average() | ||
392 | - .orElse(0); | ||
393 | - return BigDecimal.valueOf(averageRatioDouble); | ||
394 | - } | ||
395 | - | ||
396 | - /** | ||
397 | - * 抽象处理平均值计算 | ||
398 | - * @param data | ||
399 | - * @param field | ||
400 | - * @return | ||
401 | - * @param <T> | ||
402 | - */ | ||
403 | - private <T> BigDecimal calcAverage(final Collection<T> data, final ToDoubleFunction<T> field) { | ||
404 | - if (CollectionUtils.isEmpty(data)) { | ||
405 | - return BigDecimal.ZERO; | ||
406 | - } | ||
407 | - Double averageRatioDouble = data.stream() | ||
408 | - .mapToDouble(field) | ||
409 | - .average() | ||
410 | - .orElse(0); | ||
411 | - return BigDecimal.valueOf(averageRatioDouble); | ||
412 | - } | ||
413 | - | ||
414 | - | ||
415 | public BigDecimal calcAverageTotalSalary(List<ReportSalaryDim> dims, Set<Long> ReportDimIds) { | 374 | public BigDecimal calcAverageTotalSalary(List<ReportSalaryDim> dims, Set<Long> ReportDimIds) { |
416 | Double averageRatioDouble = dims.stream() | 375 | Double averageRatioDouble = dims.stream() |
417 | .filter(user -> ReportDimIds.contains(user.getId())) | 376 | .filter(user -> ReportDimIds.contains(user.getId())) |
@@ -439,12 +398,8 @@ public class SalaryReportTask { | @@ -439,12 +398,8 @@ public class SalaryReportTask { | ||
439 | return new BigDecimal(averageRatioDouble.toString()); | 398 | return new BigDecimal(averageRatioDouble.toString()); |
440 | } | 399 | } |
441 | 400 | ||
442 | - public Long saveShopDimDB(Long shopId, | ||
443 | - Map<Long, String> shopMap, | ||
444 | - LocalDate date, | ||
445 | - Long reportSalaryId, | ||
446 | - List<ReportSalaryDim> userDims, | ||
447 | - Set<Long> shopDimReportIds) { | 401 | + public Long saveShopDimDB(Long shopId, Map<Long, String> shopMap, |
402 | + LocalDate date, Long reportSalaryId, BigDecimal averageSalary, BigDecimal kpiScoreRatio) { | ||
448 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); | 403 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); |
449 | reportSalaryDim.setDimension(ReportDimensionEnum.SHOP); | 404 | reportSalaryDim.setDimension(ReportDimensionEnum.SHOP); |
450 | reportSalaryDim.setReferId(shopId); | 405 | reportSalaryDim.setReferId(shopId); |
@@ -452,118 +407,24 @@ public class SalaryReportTask { | @@ -452,118 +407,24 @@ public class SalaryReportTask { | ||
452 | reportSalaryDim.setShopName(shopMap.get(shopId)); | 407 | reportSalaryDim.setShopName(shopMap.get(shopId)); |
453 | reportSalaryDim.setDataDate(date); | 408 | reportSalaryDim.setDataDate(date); |
454 | reportSalaryDim.setReportSalaryId(reportSalaryId); | 409 | reportSalaryDim.setReportSalaryId(reportSalaryId); |
455 | - //计算平均值薪酬的额外项 | ||
456 | - extCalcAverage(userDims, shopDimReportIds, reportSalaryDim); | 410 | + reportSalaryDim.setTotalReward(averageSalary); |
411 | + reportSalaryDim.setKpiScoreRatio(kpiScoreRatio); | ||
457 | reportSalaryDimService.save(reportSalaryDim); | 412 | reportSalaryDimService.save(reportSalaryDim); |
458 | return reportSalaryDim.getId(); | 413 | return reportSalaryDim.getId(); |
459 | } | 414 | } |
460 | - | ||
461 | - /** | ||
462 | - * 计算平均值薪酬的额外项 | ||
463 | - * @param userDims | ||
464 | - * @param shopDimReportIds | ||
465 | - * @param reportSalaryDim | ||
466 | - */ | ||
467 | - private void extCalcAverage(List<ReportSalaryDim> userDims, Set<Long> shopDimReportIds, ReportSalaryDim reportSalaryDim) { | ||
468 | - List<ReportSalaryDim> filterUserDims = userDims.stream().filter(e -> shopDimReportIds.contains(e.getId())).collect(Collectors.toList()); | ||
469 | - //绩效得分率(N) | ||
470 | - reportSalaryDim.setKpiScoreRatio(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getKpiScoreRatio()).orElse(BigDecimal.ZERO).doubleValue())); | ||
471 | - //收入-平均值 | ||
472 | - reportSalaryDim.setActKpiMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActKpiMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
473 | - reportSalaryDim.setActAwardMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActAwardMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
474 | - reportSalaryDim.setActSubsidyMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActSubsidyMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
475 | - reportSalaryDim.setActProbationMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActProbationMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
476 | - reportSalaryDim.setActJobCompensateMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActJobCompensateMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
477 | - reportSalaryDim.setActEvalAwardMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActEvalAwardMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
478 | - //总收入合计平均值 | ||
479 | - reportSalaryDim.setActRevenueTotalMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActRevenueTotalMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
480 | - //reportSalaryDim.setActRevenueTotalMoney( | ||
481 | - // reportSalaryDim.getActKpiMoney() | ||
482 | - // .add(reportSalaryDim.getActAwardMoney()) | ||
483 | - // .add(reportSalaryDim.getActSubsidyMoney()) | ||
484 | - // .add(reportSalaryDim.getActProbationMoney()) | ||
485 | - // .add(reportSalaryDim.getActJobCompensateMonry()) | ||
486 | - // .add(reportSalaryDim.getActEvalAwardMoney()) | ||
487 | - //); | ||
488 | - //扣除-平均值 | ||
489 | - reportSalaryDim.setActPenaltyMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActPenaltyMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
490 | - reportSalaryDim.setActNecessaryMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActNecessaryMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
491 | - reportSalaryDim.setActPersonTaxMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActPersonTaxMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
492 | - reportSalaryDim.setActAccumulationFundMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActAccumulationFundMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
493 | - //总扣除合计平均值 | ||
494 | - reportSalaryDim.setActDeductTotalMoney(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getActDeductTotalMoney()).orElse(BigDecimal.ZERO).doubleValue())); | ||
495 | - //reportSalaryDim.setActDeductTotalMoney( | ||
496 | - // reportSalaryDim.getActPenaltyMoney() | ||
497 | - // .add(reportSalaryDim.getActNecessaryMoney()) | ||
498 | - // .add(reportSalaryDim.getActPersonTaxMoney()) | ||
499 | - // .add(reportSalaryDim.getActAccumulationFundMoney()) | ||
500 | - //); | ||
501 | - //总薪酬平均值 = 总收入合计 - 总扣除合计 or 直接取平均值 | ||
502 | - reportSalaryDim.setTotalReward(calcAverage(filterUserDims, e -> Optional.ofNullable(e.getTotalReward()).orElse(BigDecimal.ZERO).doubleValue())); | ||
503 | - //reportSalaryDim.setTotalReward( | ||
504 | - // reportSalaryDim.getActRevenueTotalMoney() | ||
505 | - // .subtract(reportSalaryDim.getActDeductTotalMoney())); | ||
506 | - } | ||
507 | - | ||
508 | - /** | ||
509 | - * 计算人员的 | ||
510 | - * 增加 薪资类型相关项目处理 ++ | ||
511 | - * @param salaryPoolDetails | ||
512 | - * @param reportSalaryDim | ||
513 | - */ | ||
514 | - private void extCaleUserMoney(List<SalaryPoolDetail> salaryPoolDetails, ReportSalaryDim reportSalaryDim) { | ||
515 | - //额外计算项++ | ||
516 | - Map<SalaryTypeEnum, List<SalaryPoolDetail>> salaryTypeEnumListMap = salaryPoolDetails | ||
517 | - .stream() | ||
518 | - .collect(Collectors.groupingBy(SalaryPoolDetail::getType)); | ||
519 | - //收入 | ||
520 | - reportSalaryDim.setActKpiMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.ROYALTIES)); | ||
521 | - reportSalaryDim.setActAwardMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.AWARD)); | ||
522 | - reportSalaryDim.setActSubsidyMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.SUBSIDY)); | ||
523 | - reportSalaryDim.setActProbationMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.PROBATION)); | ||
524 | - reportSalaryDim.setActJobCompensateMoney(BigDecimal.ZERO); | ||
525 | - reportSalaryDim.setActEvalAwardMoney(BigDecimal.ZERO); | ||
526 | - //总收入合计 | ||
527 | - reportSalaryDim.setActRevenueTotalMoney( | ||
528 | - reportSalaryDim.getActKpiMoney() | ||
529 | - .add(reportSalaryDim.getActAwardMoney()) | ||
530 | - .add(reportSalaryDim.getActSubsidyMoney()) | ||
531 | - .add(reportSalaryDim.getActProbationMoney()) | ||
532 | - .add(reportSalaryDim.getActJobCompensateMoney()) | ||
533 | - .add(reportSalaryDim.getActEvalAwardMoney()) | ||
534 | - ); | ||
535 | - //扣除 | ||
536 | - reportSalaryDim.setActPenaltyMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.PENALTY)); | ||
537 | - reportSalaryDim.setActNecessaryMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.NECESSARY)); | ||
538 | - reportSalaryDim.setActPersonTaxMoney(getSalaryTypeEnumMoney(salaryTypeEnumListMap,SalaryTypeEnum.PERSON_TAX)); | ||
539 | - reportSalaryDim.setActAccumulationFundMoney(BigDecimal.ZERO); | ||
540 | - //总扣除合计 | ||
541 | - reportSalaryDim.setActDeductTotalMoney( | ||
542 | - reportSalaryDim.getActPenaltyMoney() | ||
543 | - .add(reportSalaryDim.getActNecessaryMoney()) | ||
544 | - .add(reportSalaryDim.getActPersonTaxMoney()) | ||
545 | - .add(reportSalaryDim.getActAccumulationFundMoney()) | ||
546 | - ); | ||
547 | - //总薪酬 = 总收入合计 - 总扣除合计 | ||
548 | - reportSalaryDim.setTotalReward( | ||
549 | - reportSalaryDim.getActRevenueTotalMoney() | ||
550 | - .subtract(reportSalaryDim.getActDeductTotalMoney())); | ||
551 | - } | ||
552 | - | ||
553 | - | ||
554 | public Long saveManagerDimDB(ManagerDTO manager, | 415 | public Long saveManagerDimDB(ManagerDTO manager, |
555 | LocalDate date, | 416 | LocalDate date, |
556 | Long reportSalaryId, | 417 | Long reportSalaryId, |
557 | Map<Long, StaffBaseInfoDTO> managerMap, | 418 | Map<Long, StaffBaseInfoDTO> managerMap, |
558 | - List<Long> manageStaffIds, | ||
559 | - Set<Long> managerStaffDimReportIds, | ||
560 | - List<ReportSalaryDim> userDims) { | 419 | + BigDecimal averageSalary, |
420 | + BigDecimal kpiScoreRatio, | ||
421 | + List<Long> manageStaffIds) { | ||
561 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); | 422 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); |
562 | reportSalaryDim.setDimension(ReportDimensionEnum.MANAGER); | 423 | reportSalaryDim.setDimension(ReportDimensionEnum.MANAGER); |
563 | reportSalaryDim.setUserId(manager.getStaffId()); | 424 | reportSalaryDim.setUserId(manager.getStaffId()); |
564 | reportSalaryDim.setUserName(manager.getStaffName()); | 425 | reportSalaryDim.setUserName(manager.getStaffName()); |
565 | - //计算平均值薪酬的额外项 | ||
566 | - extCalcAverage(userDims, managerStaffDimReportIds, reportSalaryDim); | 426 | + reportSalaryDim.setTotalReward(averageSalary); |
427 | + reportSalaryDim.setKpiScoreRatio(kpiScoreRatio); | ||
567 | reportSalaryDim.setDataDate(date); | 428 | reportSalaryDim.setDataDate(date); |
568 | reportSalaryDim.setReportSalaryId(reportSalaryId); | 429 | reportSalaryDim.setReportSalaryId(reportSalaryId); |
569 | if (managerMap.containsKey(manager.getStaffId())) { | 430 | if (managerMap.containsKey(manager.getStaffId())) { |
@@ -689,25 +550,7 @@ public class SalaryReportTask { | @@ -689,25 +550,7 @@ public class SalaryReportTask { | ||
689 | return userGroupIndicatorHitMap; | 550 | return userGroupIndicatorHitMap; |
690 | } | 551 | } |
691 | 552 | ||
692 | - /** | ||
693 | - * 这个薪酬详情每天6:00 会计算完成,cn.fw.morax.server.task.SalaryCalcTask#cacheCalculableKpiGroup() | ||
694 | - * @param date | ||
695 | - * @param pools | ||
696 | - * @return <薪酬池id: 薪酬池详情list> | ||
697 | - */ | ||
698 | - private Map<Long, List<SalaryPoolDetail>> getSalaryPoolDetailMap(LocalDate date, List<SalaryPool> pools) { | ||
699 | - if (CollectionUtils.isEmpty(pools)){ | ||
700 | - return Collections.emptyMap(); | ||
701 | - } | ||
702 | - List<SalaryPoolDetail> salaryPoolDetailList = salaryPoolDetailService.list(Wrappers.<SalaryPoolDetail>lambdaQuery() | ||
703 | - .in(SalaryPoolDetail::getSalaryPoolId, pools.stream().map(SalaryPool::getId).collect(Collectors.toSet())) | ||
704 | - .eq(SalaryPoolDetail::getSalaryDate, date) | ||
705 | - .eq(SalaryPoolDetail::getYn, Boolean.TRUE)); | ||
706 | - if (CollectionUtils.isEmpty(salaryPoolDetailList)){ | ||
707 | - return Collections.emptyMap(); | ||
708 | - } | ||
709 | - return salaryPoolDetailList.stream().collect(Collectors.groupingBy(SalaryPoolDetail::getSalaryPoolId)); | ||
710 | - } | 553 | + |
711 | 554 | ||
712 | public Map<Long, SalaryGroupProjectTargetHitLog> queryUserTargetValue(Long referId, Long userId, LocalDate dataDate) { | 555 | public Map<Long, SalaryGroupProjectTargetHitLog> queryUserTargetValue(Long referId, Long userId, LocalDate dataDate) { |
713 | List<SalaryGroupProjectTargetHitLog> targetHitLogs = salaryGroupProjectTargetHitLogService.list(Wrappers.<SalaryGroupProjectTargetHitLog>lambdaQuery() | 556 | List<SalaryGroupProjectTargetHitLog> targetHitLogs = salaryGroupProjectTargetHitLogService.list(Wrappers.<SalaryGroupProjectTargetHitLog>lambdaQuery() |
@@ -858,8 +701,7 @@ public class SalaryReportTask { | @@ -858,8 +701,7 @@ public class SalaryReportTask { | ||
858 | projectBO.setCodeType(codeType); | 701 | projectBO.setCodeType(codeType); |
859 | break; | 702 | break; |
860 | } | 703 | } |
861 | - case FIXATION: | ||
862 | - case CAR_SERIES: { | 704 | + case FIXATION: CAR_SERIES: { |
863 | projectBO.setCode(project.getCommissionCode()); | 705 | projectBO.setCode(project.getCommissionCode()); |
864 | projectBO.setCodeType(IndicatorCodeTypeEnum.COMBINE_INDICATOR); | 706 | projectBO.setCodeType(IndicatorCodeTypeEnum.COMBINE_INDICATOR); |
865 | break; | 707 | break; |
@@ -879,7 +721,7 @@ public class SalaryReportTask { | @@ -879,7 +721,7 @@ public class SalaryReportTask { | ||
879 | return projects; | 721 | return projects; |
880 | } | 722 | } |
881 | 723 | ||
882 | - public ReportSalaryDim saveStaffDim(SalaryPool pool, LocalDate date, Long reportSalaryRankId,List<SalaryPoolDetail> salaryPoolDetails){ | 724 | + public ReportSalaryDim saveStaffDim(SalaryPool pool, LocalDate date, Long reportSalaryRankId){ |
883 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); | 725 | ReportSalaryDim reportSalaryDim = new ReportSalaryDim(); |
884 | reportSalaryDim.setDimension(ReportDimensionEnum.STAFF); | 726 | reportSalaryDim.setDimension(ReportDimensionEnum.STAFF); |
885 | reportSalaryDim.setReferId(pool.getUserId()); | 727 | reportSalaryDim.setReferId(pool.getUserId()); |
@@ -893,32 +735,14 @@ public class SalaryReportTask { | @@ -893,32 +735,14 @@ public class SalaryReportTask { | ||
893 | reportSalaryDim.setDataDate(date); | 735 | reportSalaryDim.setDataDate(date); |
894 | reportSalaryDim.setReportSalaryId(reportSalaryRankId); | 736 | reportSalaryDim.setReportSalaryId(reportSalaryRankId); |
895 | reportSalaryDim.setStarLevel(pool.getStarLevel()); | 737 | reportSalaryDim.setStarLevel(pool.getStarLevel()); |
738 | + reportSalaryDim.setTotalReward(pool.getReward()); | ||
896 | // KpiPool kpiPool = kpiPoolCommonService.queryPool(pool); | 739 | // KpiPool kpiPool = kpiPoolCommonService.queryPool(pool); |
897 | // if (PublicUtil.isNotEmpty(kpiPool)) { | 740 | // if (PublicUtil.isNotEmpty(kpiPool)) { |
898 | // BigDecimal kpiScoreRatio = Optional.ofNullable(kpiPool.getKpiScoreRatio()).orElse(BigDecimal.ZERO); | 741 | // BigDecimal kpiScoreRatio = Optional.ofNullable(kpiPool.getKpiScoreRatio()).orElse(BigDecimal.ZERO); |
899 | // reportSalaryDim.setKpiScoreRatio(kpiScoreRatio.multiply(Constant.ONE_HUNDRED)); | 742 | // reportSalaryDim.setKpiScoreRatio(kpiScoreRatio.multiply(Constant.ONE_HUNDRED)); |
900 | // } | 743 | // } |
901 | - //薪资类型相关项目处理 | ||
902 | - extCaleUserMoney(salaryPoolDetails, reportSalaryDim); | ||
903 | reportSalaryDimService.save(reportSalaryDim); | 744 | reportSalaryDimService.save(reportSalaryDim); |
904 | return reportSalaryDim; | 745 | return reportSalaryDim; |
905 | } | 746 | } |
906 | 747 | ||
907 | - /** | ||
908 | - * 获取 SalaryTypeEnum 对应的薪酬总值 | ||
909 | - * @param salaryTypeEnumListMap | ||
910 | - * @param salaryTypeEnum | ||
911 | - * @return | ||
912 | - */ | ||
913 | - private BigDecimal getSalaryTypeEnumMoney(Map<SalaryTypeEnum, List<SalaryPoolDetail>> salaryTypeEnumListMap,SalaryTypeEnum salaryTypeEnum){ | ||
914 | - if (CollectionUtils.isEmpty(salaryTypeEnumListMap)){ | ||
915 | - return BigDecimal.ZERO; | ||
916 | - } | ||
917 | - List<SalaryPoolDetail> list = salaryTypeEnumListMap.get(salaryTypeEnum); | ||
918 | - if (CollectionUtils.isEmpty(list)){ | ||
919 | - return BigDecimal.ZERO; | ||
920 | - } | ||
921 | - return list.stream().filter(Objects::nonNull).map(SalaryPoolDetail::getSalaryAmount).reduce(BigDecimal.ZERO, BigDecimal::add); | ||
922 | - } | ||
923 | - | ||
924 | } | 748 | } |