chenshudong 1 місяць тому
батько
коміт
f60987ee06

+ 20 - 5
airport-personnel/src/main/java/com/sundot/airport/personnel/service/impl/PersonnelNonCadreMonthlyAssessmentServiceImpl.java

@@ -37,8 +37,10 @@ import com.sundot.airport.personnel.domain.PersonnelMonthlyAssessmentIndicatorDe
37
 import com.sundot.airport.personnel.domain.PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail;
37
 import com.sundot.airport.personnel.domain.PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail;
38
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorDetailService;
38
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorDetailService;
39
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
39
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
40
+import com.sundot.airport.system.domain.BasePerformanceIndicator;
40
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
41
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
41
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
42
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
43
+import com.sundot.airport.system.service.IBasePerformanceIndicatorService;
42
 import com.sundot.airport.system.service.ISysDeptService;
44
 import com.sundot.airport.system.service.ISysDeptService;
43
 import com.sundot.airport.system.service.ISysUserService;
45
 import com.sundot.airport.system.service.ISysUserService;
44
 import org.springframework.beans.factory.annotation.Autowired;
46
 import org.springframework.beans.factory.annotation.Autowired;
@@ -71,6 +73,8 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
71
     @Autowired
73
     @Autowired
72
     private IBasePerformanceIndicatorCategoryService basePerformanceIndicatorCategoryService;
74
     private IBasePerformanceIndicatorCategoryService basePerformanceIndicatorCategoryService;
73
     @Autowired
75
     @Autowired
76
+    private IBasePerformanceIndicatorService basePerformanceIndicatorService;
77
+    @Autowired
74
     private ISysUserService sysUserService;
78
     private ISysUserService sysUserService;
75
     @Autowired
79
     @Autowired
76
     private ISysDeptService sysDeptService;
80
     private ISysDeptService sysDeptService;
@@ -291,7 +295,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
291
         // 红线指标
295
         // 红线指标
292
         BasePerformanceIndicatorCategory redLineIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("红线指标", item.getName())).findFirst().orElse(null);
296
         BasePerformanceIndicatorCategory redLineIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("红线指标", item.getName())).findFirst().orElse(null);
293
         List<BasePerformanceIndicatorCategory> redLineIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) redLineIndexCategory.getChildren();
297
         List<BasePerformanceIndicatorCategory> redLineIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) redLineIndexCategory.getChildren();
294
-        List<String> redLineIndexCategoryCodeList = redLineIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList());
298
+        List<String> redLineIndexCategoryCodeList = getIndicatorCodeList(redLineIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList()));
295
         List<PersonnelMonthlyAssessmentIndicatorDetail> redLineIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> redLineIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
299
         List<PersonnelMonthlyAssessmentIndicatorDetail> redLineIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> redLineIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
296
         Integer redLineIndexTriggerCount = redLineIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getOccurCount).filter(ObjUtil::isNotNull).reduce(0, Integer::sum);
300
         Integer redLineIndexTriggerCount = redLineIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getOccurCount).filter(ObjUtil::isNotNull).reduce(0, Integer::sum);
297
         result.setRedLineIndexTriggerCount(redLineIndexTriggerCount);
301
         result.setRedLineIndexTriggerCount(redLineIndexTriggerCount);
@@ -299,7 +303,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
299
         // 核心指标
303
         // 核心指标
300
         BasePerformanceIndicatorCategory coreIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("核心指标", item.getName())).findFirst().orElse(null);
304
         BasePerformanceIndicatorCategory coreIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("核心指标", item.getName())).findFirst().orElse(null);
301
         List<BasePerformanceIndicatorCategory> coreIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) coreIndexCategory.getChildren();
305
         List<BasePerformanceIndicatorCategory> coreIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) coreIndexCategory.getChildren();
302
-        List<String> coreIndexCategoryCodeList = coreIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList());
306
+        List<String> coreIndexCategoryCodeList = getIndicatorCodeList(coreIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList()));
303
         List<PersonnelMonthlyAssessmentIndicatorDetail> coreIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> coreIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
307
         List<PersonnelMonthlyAssessmentIndicatorDetail> coreIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> coreIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
304
         BigDecimal coreIndexScore = coreIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
308
         BigDecimal coreIndexScore = coreIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
305
         result.setCoreIndexScore(coreIndexScore);
309
         result.setCoreIndexScore(coreIndexScore);
@@ -307,14 +311,14 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
307
         // 其他指标
311
         // 其他指标
308
         BasePerformanceIndicatorCategory otherIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("其他指标", item.getName())).findFirst().orElse(null);
312
         BasePerformanceIndicatorCategory otherIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("其他指标", item.getName())).findFirst().orElse(null);
309
         List<BasePerformanceIndicatorCategory> otherIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) otherIndexCategory.getChildren();
313
         List<BasePerformanceIndicatorCategory> otherIndexCategoryChildren = (List<BasePerformanceIndicatorCategory>) otherIndexCategory.getChildren();
310
-        List<String> otherIndexCategoryCodeList = otherIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList());
314
+        List<String> otherIndexCategoryCodeList = getIndicatorCodeList(otherIndexCategoryChildren.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList()));
311
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> otherIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
315
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> otherIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
312
         BigDecimal otherIndexScore = otherIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
316
         BigDecimal otherIndexScore = otherIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
313
         result.setOtherIndexScore(otherIndexScore);
317
         result.setOtherIndexScore(otherIndexScore);
314
         result.setOtherIndexAccordList(otherIndexAccordList);
318
         result.setOtherIndexAccordList(otherIndexAccordList);
315
         // 其他指标-安全
319
         // 其他指标-安全
316
         List<BasePerformanceIndicatorCategory> otherIndexSafetyCategory = otherIndexCategoryChildren.stream().filter(item -> StrUtil.equals("安全", item.getName())).collect(Collectors.toList());
320
         List<BasePerformanceIndicatorCategory> otherIndexSafetyCategory = otherIndexCategoryChildren.stream().filter(item -> StrUtil.equals("安全", item.getName())).collect(Collectors.toList());
317
-        List<String> otherIndexSafetyCategoryCodeList = otherIndexSafetyCategory.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList());
321
+        List<String> otherIndexSafetyCategoryCodeList = getIndicatorCodeList(otherIndexSafetyCategory.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList()));
318
         // 其他指标-安全-仅含SOC/站品控检查扣分
322
         // 其他指标-安全-仅含SOC/站品控检查扣分
319
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexWithSocStationQcAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
323
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexWithSocStationQcAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
320
                 .filter(item -> otherIndexSafetyCategoryCodeList.contains(item.getIndicatorCode()))
324
                 .filter(item -> otherIndexSafetyCategoryCodeList.contains(item.getIndicatorCode()))
@@ -361,7 +365,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
361
         result.setOtherIndexSafetyScoreWithoutSocStationQcAccordList(otherIndexWithoutSocStationQcAccordList);
365
         result.setOtherIndexSafetyScoreWithoutSocStationQcAccordList(otherIndexWithoutSocStationQcAccordList);
362
         // 其他指标-非安全
366
         // 其他指标-非安全
363
         List<BasePerformanceIndicatorCategory> otherIndexNonSafetyCategory = otherIndexCategoryChildren.stream().filter(item -> !StrUtil.equals("安全", item.getName())).collect(Collectors.toList());
367
         List<BasePerformanceIndicatorCategory> otherIndexNonSafetyCategory = otherIndexCategoryChildren.stream().filter(item -> !StrUtil.equals("安全", item.getName())).collect(Collectors.toList());
364
-        List<String> otherIndexNonSafetyCategoryCodeList = otherIndexNonSafetyCategory.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList());
368
+        List<String> otherIndexNonSafetyCategoryCodeList = getIndicatorCodeList(otherIndexNonSafetyCategory.stream().map(BasePerformanceIndicatorCategory::getCode).collect(Collectors.toList()));
365
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexNonSafetyAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
369
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexNonSafetyAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
366
                 .filter(item -> otherIndexNonSafetyCategoryCodeList.contains(item.getIndicatorCode()))
370
                 .filter(item -> otherIndexNonSafetyCategoryCodeList.contains(item.getIndicatorCode()))
367
                 .filter(item -> StrUtil.equals(BasePerformanceIndicatorRewardPunishmentTypeTypeEnum.PUNISHMENT.getCode(), item.getRewardPunishmentType()))
371
                 .filter(item -> StrUtil.equals(BasePerformanceIndicatorRewardPunishmentTypeTypeEnum.PUNISHMENT.getCode(), item.getRewardPunishmentType()))
@@ -451,6 +455,17 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
451
     }
455
     }
452
 
456
 
453
     /**
457
     /**
458
+     * 获取指标编码列表
459
+     *
460
+     * @param categoryCodeList
461
+     * @return
462
+     */
463
+    private List<String> getIndicatorCodeList(List<String> categoryCodeList) {
464
+        List<BasePerformanceIndicator> indicatorList = basePerformanceIndicatorService.selectBasePerformanceIndicatorListByCategoryCodeList(categoryCodeList);
465
+        return indicatorList.stream().map(BasePerformanceIndicator::getCode).collect(Collectors.toList());
466
+    }
467
+
468
+    /**
454
      * 安检员考核
469
      * 安检员考核
455
      *
470
      *
456
      * @param result
471
      * @param result