chenshudong il y a 1 mois
Parent
commit
aa8e838d6b

+ 0 - 13
airport-personnel/src/main/java/com/sundot/airport/personnel/domain/PersonnelMonthlyAssessmentIndicatorDetail.java

@@ -87,10 +87,6 @@ public class PersonnelMonthlyAssessmentIndicatorDetail extends BaseEntity {
87 87
     @Excel(name = "奖罚类型")
88 88
     private String rewardPunishmentType;
89 89
 
90
-    /** 检查部门类型 */
91
-    @Excel(name = "检查部门类型")
92
-    private String qcDeptType;
93
-
94 90
     /** 发生次数 */
95 91
     @Excel(name = "发生次数")
96 92
     private Integer occurCount;
@@ -235,14 +231,6 @@ public class PersonnelMonthlyAssessmentIndicatorDetail extends BaseEntity {
235 231
         return rewardPunishmentType;
236 232
     }
237 233
 
238
-    public void setQcDeptType(String qcDeptType) {
239
-        this.qcDeptType = qcDeptType;
240
-    }
241
-
242
-    public String getQcDeptType() {
243
-        return qcDeptType;
244
-    }
245
-
246 234
     public void setOccurCount(Integer occurCount) {
247 235
         this.occurCount = occurCount;
248 236
     }
@@ -299,7 +287,6 @@ public class PersonnelMonthlyAssessmentIndicatorDetail extends BaseEntity {
299 287
                 .append("unit", getUnit())
300 288
                 .append("leaveType", getLeaveType())
301 289
                 .append("rewardPunishmentType", getRewardPunishmentType())
302
-                .append("qcDeptType", getQcDeptType())
303 290
                 .append("occurCount", getOccurCount())
304 291
                 .append("scoreResult", getScoreResult())
305 292
                 .append("amountResult", getAmountResult())

+ 26 - 0
airport-personnel/src/main/java/com/sundot/airport/personnel/domain/PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail.java

@@ -38,6 +38,14 @@ public class PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail extends B
38 38
     @Excel(name = "来源ID")
39 39
     private Long sourceId;
40 40
 
41
+    /** 检查部门类型 */
42
+    @Excel(name = "检查部门类型")
43
+    private String qcDeptType;
44
+
45
+    /** 分值 */
46
+    @Excel(name = "分值")
47
+    private BigDecimal score;
48
+
41 49
     /** 奖罚类型 */
42 50
     @Excel(name = "奖罚类型")
43 51
     private String rewardPunishmentType;
@@ -90,6 +98,22 @@ public class PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail extends B
90 98
         return sourceId;
91 99
     }
92 100
 
101
+    public String getQcDeptType() {
102
+        return qcDeptType;
103
+    }
104
+
105
+    public void setQcDeptType(String qcDeptType) {
106
+        this.qcDeptType = qcDeptType;
107
+    }
108
+
109
+    public BigDecimal getScore() {
110
+        return score;
111
+    }
112
+
113
+    public void setScore(BigDecimal score) {
114
+        this.score = score;
115
+    }
116
+
93 117
     public void setRewardPunishmentType(String rewardPunishmentType) {
94 118
         this.rewardPunishmentType = rewardPunishmentType;
95 119
     }
@@ -127,6 +151,8 @@ public class PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetail extends B
127 151
                 .append("id", getId())
128 152
                 .append("sourceType", getSourceType())
129 153
                 .append("sourceId", getSourceId())
154
+                .append("qcDeptType", getQcDeptType())
155
+                .append("score", getScore())
130 156
                 .append("rewardPunishmentType", getRewardPunishmentType())
131 157
                 .append("rewardPunishmentDetail", getRewardPunishmentDetail())
132 158
                 .append("amount", getAmount())

+ 46 - 6
airport-personnel/src/main/java/com/sundot/airport/personnel/service/impl/PersonnelNonCadreMonthlyAssessmentServiceImpl.java

@@ -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
         // 分管员工数量+扣分平均值

+ 0 - 6
airport-personnel/src/main/resources/mapper/personnel/PersonnelMonthlyAssessmentIndicatorDetailMapper.xml

@@ -26,7 +26,6 @@
26 26
         <result property="unit" column="unit"/>
27 27
         <result property="leaveType" column="leave_type"/>
28 28
         <result property="rewardPunishmentType" column="reward_punishment_type"/>
29
-        <result property="qcDeptType" column="qc_dept_type"/>
30 29
         <result property="occurCount" column="occur_count"/>
31 30
         <result property="scoreResult" column="score_result"/>
32 31
         <result property="amountResult" column="amount_result"/>
@@ -54,7 +53,6 @@
54 53
                unit,
55 54
                leave_type,
56 55
                reward_punishment_type,
57
-               qc_dept_type,
58 56
                occur_count,
59 57
                score_result,
60 58
                amount_result
@@ -90,7 +88,6 @@
90 88
             <if test="rewardPunishmentType != null  and rewardPunishmentType != ''">and reward_punishment_type =
91 89
                 #{rewardPunishmentType}
92 90
             </if>
93
-            <if test="qcDeptType != null  and qcDeptType != ''">and qc_dept_type = #{qcDeptType}</if>
94 91
             <if test="occurCount != null ">and occur_count = #{occurCount}</if>
95 92
             <if test="scoreResult != null ">and score_result = #{scoreResult}</if>
96 93
             <if test="amountResult != null ">and amount_result = #{amountResult}</if>
@@ -128,7 +125,6 @@
128 125
             <if test="unit != null">unit,</if>
129 126
             <if test="leaveType != null">leave_type,</if>
130 127
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">reward_punishment_type,</if>
131
-            <if test="qcDeptType != null and qcDeptType != ''">qc_dept_type,</if>
132 128
             <if test="occurCount != null">occur_count,</if>
133 129
             <if test="scoreResult != null">score_result,</if>
134 130
             <if test="amountResult != null">amount_result,</if>
@@ -154,7 +150,6 @@
154 150
             <if test="unit != null">#{unit},</if>
155 151
             <if test="leaveType != null">#{leaveType},</if>
156 152
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">#{rewardPunishmentType},</if>
157
-            <if test="qcDeptType != null and qcDeptType != ''">#{qcDeptType},</if>
158 153
             <if test="occurCount != null">#{occurCount},</if>
159 154
             <if test="scoreResult != null">#{scoreResult},</if>
160 155
             <if test="amountResult != null">#{amountResult},</if>
@@ -187,7 +182,6 @@
187 182
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">reward_punishment_type =
188 183
                 #{rewardPunishmentType},
189 184
             </if>
190
-            <if test="qcDeptType != null and qcDeptType != ''">qc_dept_type = #{qcDeptType},</if>
191 185
             <if test="occurCount != null">occur_count = #{occurCount},</if>
192 186
             <if test="scoreResult != null">score_result = #{scoreResult},</if>
193 187
             <if test="amountResult != null">amount_result = #{amountResult},</if>

+ 16 - 0
airport-personnel/src/main/resources/mapper/personnel/PersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailMapper.xml

@@ -16,6 +16,8 @@
16 16
         <result property="id" column="id"/>
17 17
         <result property="sourceType" column="source_type"/>
18 18
         <result property="sourceId" column="source_id"/>
19
+        <result property="qcDeptType" column="qc_dept_type"/>
20
+        <result property="score" column="score"/>
19 21
         <result property="rewardPunishmentType" column="reward_punishment_type"/>
20 22
         <result property="rewardPunishmentDetail" column="reward_punishment_detail"/>
21 23
         <result property="amount" column="amount"/>
@@ -32,6 +34,8 @@
32 34
                id,
33 35
                source_type,
34 36
                source_id,
37
+               qc_dept_type,
38
+               score,
35 39
                reward_punishment_type,
36 40
                reward_punishment_detail,
37 41
                amount
@@ -47,6 +51,10 @@
47 51
             <if test="revision != null ">and revision = #{revision}</if>
48 52
             <if test="sourceType != null  and sourceType != ''">and source_type = #{sourceType}</if>
49 53
             <if test="sourceId != null ">and source_id = #{sourceId}</if>
54
+            <if test="qcDeptType != null  and qcDeptType != ''">and qc_dept_type =
55
+                #{qcDeptType}
56
+            </if>
57
+            <if test="score != null ">and score = #{score}</if>
50 58
             <if test="rewardPunishmentType != null  and rewardPunishmentType != ''">and reward_punishment_type =
51 59
                 #{rewardPunishmentType}
52 60
             </if>
@@ -78,6 +86,8 @@
78 86
             <if test="remark != null">remark,</if>
79 87
             <if test="sourceType != null and sourceType != ''">source_type,</if>
80 88
             <if test="sourceId != null">source_id,</if>
89
+            <if test="qcDeptType != null and qcDeptType != ''">qc_dept_type,</if>
90
+            <if test="score != null">score,</if>
81 91
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">reward_punishment_type,</if>
82 92
             <if test="rewardPunishmentDetail != null and rewardPunishmentDetail != ''">reward_punishment_detail,</if>
83 93
             <if test="amount != null">amount,</if>
@@ -92,6 +102,8 @@
92 102
             <if test="remark != null">#{remark},</if>
93 103
             <if test="sourceType != null and sourceType != ''">#{sourceType},</if>
94 104
             <if test="sourceId != null">#{sourceId},</if>
105
+            <if test="qcDeptType != null and qcDeptType != ''">#{qcDeptType},</if>
106
+            <if test="score != null">#{score},</if>
95 107
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">#{rewardPunishmentType},</if>
96 108
             <if test="rewardPunishmentDetail != null and rewardPunishmentDetail != ''">#{rewardPunishmentDetail},</if>
97 109
             <if test="amount != null">#{amount},</if>
@@ -111,6 +123,10 @@
111 123
             <if test="remark != null">remark = #{remark},</if>
112 124
             <if test="sourceType != null and sourceType != ''">source_type = #{sourceType},</if>
113 125
             <if test="sourceId != null">source_id = #{sourceId},</if>
126
+            <if test="qcDeptType != null and qcDeptType != ''">qc_dept_type =
127
+                #{qcDeptType},
128
+            </if>
129
+            <if test="score != null">score = #{score},</if>
114 130
             <if test="rewardPunishmentType != null and rewardPunishmentType != ''">reward_punishment_type =
115 131
                 #{rewardPunishmentType},
116 132
             </if>