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 37
 import com.sundot.airport.personnel.domain.PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail;
38 38
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorDetailService;
39 39
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
40
+import com.sundot.airport.system.domain.BasePerformanceIndicator;
40 41
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
41 42
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
43
+import com.sundot.airport.system.service.IBasePerformanceIndicatorService;
42 44
 import com.sundot.airport.system.service.ISysDeptService;
43 45
 import com.sundot.airport.system.service.ISysUserService;
44 46
 import org.springframework.beans.factory.annotation.Autowired;
@@ -71,6 +73,8 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
71 73
     @Autowired
72 74
     private IBasePerformanceIndicatorCategoryService basePerformanceIndicatorCategoryService;
73 75
     @Autowired
76
+    private IBasePerformanceIndicatorService basePerformanceIndicatorService;
77
+    @Autowired
74 78
     private ISysUserService sysUserService;
75 79
     @Autowired
76 80
     private ISysDeptService sysDeptService;
@@ -291,7 +295,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
291 295
         // 红线指标
292 296
         BasePerformanceIndicatorCategory redLineIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("红线指标", item.getName())).findFirst().orElse(null);
293 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 299
         List<PersonnelMonthlyAssessmentIndicatorDetail> redLineIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> redLineIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
296 300
         Integer redLineIndexTriggerCount = redLineIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getOccurCount).filter(ObjUtil::isNotNull).reduce(0, Integer::sum);
297 301
         result.setRedLineIndexTriggerCount(redLineIndexTriggerCount);
@@ -299,7 +303,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
299 303
         // 核心指标
300 304
         BasePerformanceIndicatorCategory coreIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("核心指标", item.getName())).findFirst().orElse(null);
301 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 307
         List<PersonnelMonthlyAssessmentIndicatorDetail> coreIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> coreIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
304 308
         BigDecimal coreIndexScore = coreIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
305 309
         result.setCoreIndexScore(coreIndexScore);
@@ -307,14 +311,14 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
307 311
         // 其他指标
308 312
         BasePerformanceIndicatorCategory otherIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("其他指标", item.getName())).findFirst().orElse(null);
309 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 315
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream().filter(item -> otherIndexCategoryCodeList.contains(item.getIndicatorCode())).collect(Collectors.toList());
312 316
         BigDecimal otherIndexScore = otherIndexAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
313 317
         result.setOtherIndexScore(otherIndexScore);
314 318
         result.setOtherIndexAccordList(otherIndexAccordList);
315 319
         // 其他指标-安全
316 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 322
         // 其他指标-安全-仅含SOC/站品控检查扣分
319 323
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexWithSocStationQcAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
320 324
                 .filter(item -> otherIndexSafetyCategoryCodeList.contains(item.getIndicatorCode()))
@@ -361,7 +365,7 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
361 365
         result.setOtherIndexSafetyScoreWithoutSocStationQcAccordList(otherIndexWithoutSocStationQcAccordList);
362 366
         // 其他指标-非安全
363 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 369
         List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexNonSafetyAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
366 370
                 .filter(item -> otherIndexNonSafetyCategoryCodeList.contains(item.getIndicatorCode()))
367 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 471
      * @param result