|
|
@@ -7,6 +7,7 @@ import java.util.Collections;
|
|
7
|
7
|
import java.util.List;
|
|
8
|
8
|
import java.util.Map;
|
|
9
|
9
|
import java.util.stream.Collectors;
|
|
|
10
|
+import java.util.stream.Stream;
|
|
10
|
11
|
|
|
11
|
12
|
import cn.hutool.core.collection.CollUtil;
|
|
12
|
13
|
import cn.hutool.core.util.ObjUtil;
|
|
|
@@ -297,19 +298,45 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
|
|
297
|
298
|
// 其他指标-安全-仅含SOC/站品控检查扣分
|
|
298
|
299
|
List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexWithSocStationQcAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
|
|
299
|
300
|
.filter(item -> otherIndexSafetyCategoryCodeList.contains(item.getIndicatorCode()))
|
|
300
|
|
- .filter(item -> StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getIndicatorCode()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getIndicatorCode()))
|
|
301
|
301
|
.filter(item -> StrUtil.equals(BasePerformanceIndicatorRewardPunishmentTypeTypeEnum.PUNISHMENT.getCode(), item.getRewardPunishmentType()))
|
|
302
|
302
|
.collect(Collectors.toList());
|
|
303
|
|
- BigDecimal otherIndexSafetyScoreWithSocStationQcDeduction = otherIndexWithSocStationQcAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
303
|
+ otherIndexWithSocStationQcAccordList = otherIndexWithSocStationQcAccordList.stream()
|
|
|
304
|
+ .peek(personnelMonthlyAssessmentIndicatorDetail -> {
|
|
|
305
|
+ List<PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail> filteredItemList = personnelMonthlyAssessmentIndicatorDetail.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream()
|
|
|
306
|
+ .filter(item -> StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getQcDeptType()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getQcDeptType()))
|
|
|
307
|
+ .collect(Collectors.toList());
|
|
|
308
|
+ personnelMonthlyAssessmentIndicatorDetail.setPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList(filteredItemList);
|
|
|
309
|
+ })
|
|
|
310
|
+ .filter(item -> CollUtil.isNotEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()))
|
|
|
311
|
+ .collect(Collectors.toList());
|
|
|
312
|
+ BigDecimal otherIndexSafetyScoreWithSocStationQcDeduction = CollUtil.isEmpty(otherIndexWithSocStationQcAccordList) ? BigDecimal.ZERO :
|
|
|
313
|
+ otherIndexWithSocStationQcAccordList.stream()
|
|
|
314
|
+ .flatMap(item -> CollUtil.isEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()) ? Stream.empty() : item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream())
|
|
|
315
|
+ .map(PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail::getScore)
|
|
|
316
|
+ .filter(ObjUtil::isNotNull)
|
|
|
317
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
304
|
318
|
result.setOtherIndexSafetyScoreWithSocStationQcDeduction(otherIndexSafetyScoreWithSocStationQcDeduction);
|
|
305
|
319
|
result.setOtherIndexSafetyScoreWithSocStationQcAccordList(otherIndexWithSocStationQcAccordList);
|
|
306
|
320
|
// 其他指标-安全-不仅含SOC/站品控检查扣分
|
|
307
|
321
|
List<PersonnelMonthlyAssessmentIndicatorDetail> otherIndexWithoutSocStationQcAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
|
|
308
|
322
|
.filter(item -> otherIndexSafetyCategoryCodeList.contains(item.getIndicatorCode()))
|
|
309
|
|
- .filter(item -> !(StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getIndicatorCode()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getIndicatorCode())))
|
|
310
|
323
|
.filter(item -> StrUtil.equals(BasePerformanceIndicatorRewardPunishmentTypeTypeEnum.PUNISHMENT.getCode(), item.getRewardPunishmentType()))
|
|
311
|
324
|
.collect(Collectors.toList());
|
|
312
|
|
- BigDecimal otherIndexSafetyScoreWithoutSocStationQcDeduction = otherIndexWithoutSocStationQcAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
325
|
+ otherIndexWithoutSocStationQcAccordList = otherIndexWithoutSocStationQcAccordList.stream()
|
|
|
326
|
+ .peek(personnelMonthlyAssessmentIndicatorDetail -> {
|
|
|
327
|
+ List<PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail> filteredItemList = personnelMonthlyAssessmentIndicatorDetail.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream()
|
|
|
328
|
+ .filter(item -> !(StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getQcDeptType()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getQcDeptType())))
|
|
|
329
|
+ .collect(Collectors.toList());
|
|
|
330
|
+ personnelMonthlyAssessmentIndicatorDetail.setPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList(filteredItemList);
|
|
|
331
|
+ })
|
|
|
332
|
+ .filter(item -> CollUtil.isNotEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()))
|
|
|
333
|
+ .collect(Collectors.toList());
|
|
|
334
|
+ BigDecimal otherIndexSafetyScoreWithoutSocStationQcDeduction = CollUtil.isEmpty(otherIndexWithoutSocStationQcAccordList) ? BigDecimal.ZERO :
|
|
|
335
|
+ otherIndexWithoutSocStationQcAccordList.stream()
|
|
|
336
|
+ .flatMap(item -> CollUtil.isEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()) ? Stream.empty() : item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream())
|
|
|
337
|
+ .map(PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail::getScore)
|
|
|
338
|
+ .filter(ObjUtil::isNotNull)
|
|
|
339
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
313
|
340
|
result.setOtherIndexSafetyScoreWithoutSocStationQcDeduction(otherIndexSafetyScoreWithoutSocStationQcDeduction);
|
|
314
|
341
|
result.setOtherIndexSafetyScoreWithoutSocStationQcAccordList(otherIndexWithoutSocStationQcAccordList);
|
|
315
|
342
|
// 其他指标-非安全
|
|
|
@@ -331,10 +358,23 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
|
|
331
|
358
|
socStationQcInvolvedCoreSafetyCodeList.addAll(otherIndexSafetyCategoryCodeList);
|
|
332
|
359
|
List<PersonnelMonthlyAssessmentIndicatorDetail> socStationQcInvolvedCoreSafetyAccordList = result.getPersonnelMonthlyAssessmentIndicatorDetailList().stream()
|
|
333
|
360
|
.filter(item -> socStationQcInvolvedCoreSafetyCodeList.contains(item.getIndicatorCode()))
|
|
334
|
|
- .filter(item -> !(StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getIndicatorCode()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getIndicatorCode())))
|
|
335
|
361
|
.filter(item -> StrUtil.equals(BasePerformanceIndicatorRewardPunishmentTypeTypeEnum.PUNISHMENT.getCode(), item.getRewardPunishmentType()))
|
|
336
|
362
|
.collect(Collectors.toList());
|
|
337
|
|
- BigDecimal socStationQcInvolvedCoreSafetyDeduction = socStationQcInvolvedCoreSafetyAccordList.stream().map(PersonnelMonthlyAssessmentIndicatorDetail::getScoreResult).filter(ObjUtil::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
363
|
+ socStationQcInvolvedCoreSafetyAccordList = socStationQcInvolvedCoreSafetyAccordList.stream()
|
|
|
364
|
+ .peek(personnelMonthlyAssessmentIndicatorDetail -> {
|
|
|
365
|
+ List<PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail> filteredItemList = personnelMonthlyAssessmentIndicatorDetail.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream()
|
|
|
366
|
+ .filter(item -> !(StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.SOC.getCode(), item.getQcDeptType()) || StrUtil.equals(BasePerformanceIndicatorQcDeptTypeEnum.STATION_QC.getCode(), item.getQcDeptType())))
|
|
|
367
|
+ .collect(Collectors.toList());
|
|
|
368
|
+ personnelMonthlyAssessmentIndicatorDetail.setPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList(filteredItemList);
|
|
|
369
|
+ })
|
|
|
370
|
+ .filter(item -> CollUtil.isNotEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()))
|
|
|
371
|
+ .collect(Collectors.toList());
|
|
|
372
|
+ BigDecimal socStationQcInvolvedCoreSafetyDeduction = CollUtil.isEmpty(socStationQcInvolvedCoreSafetyAccordList) ? BigDecimal.ZERO :
|
|
|
373
|
+ socStationQcInvolvedCoreSafetyAccordList.stream()
|
|
|
374
|
+ .flatMap(item -> CollUtil.isEmpty(item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList()) ? Stream.empty() : item.getPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailList().stream())
|
|
|
375
|
+ .map(PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail::getScore)
|
|
|
376
|
+ .filter(ObjUtil::isNotNull)
|
|
|
377
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
338
|
378
|
result.setSocStationQcInvolvedCoreSafetyDeduction(socStationQcInvolvedCoreSafetyDeduction);
|
|
339
|
379
|
result.setSocStationQcInvolvedCoreSafetyAccordList(socStationQcInvolvedCoreSafetyAccordList);
|
|
340
|
380
|
// 分管员工数量+扣分平均值
|