소스 검색

人事绩效

chenshudong 1 개월 전
부모
커밋
681b66e97e

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

@@ -44,6 +44,14 @@ public class PersonnelNonCadreMonthlyAssessment extends BaseEntity {
44 44
     @Excel(name = "用户名称")
45 45
     private String userName;
46 46
 
47
+    /** 大队ID */
48
+    @Excel(name = "大队ID")
49
+    private Long brigadeId;
50
+
51
+    /** 大队名称 */
52
+    @Excel(name = "大队名称")
53
+    private String brigadeName;
54
+
47 55
     /** 角色ID */
48 56
     @Excel(name = "角色ID")
49 57
     private Long roleId;
@@ -264,6 +272,22 @@ public class PersonnelNonCadreMonthlyAssessment extends BaseEntity {
264 272
         return userName;
265 273
     }
266 274
 
275
+    public Long getBrigadeId() {
276
+        return brigadeId;
277
+    }
278
+
279
+    public void setBrigadeId(Long brigadeId) {
280
+        this.brigadeId = brigadeId;
281
+    }
282
+
283
+    public String getBrigadeName() {
284
+        return brigadeName;
285
+    }
286
+
287
+    public void setBrigadeName(String brigadeName) {
288
+        this.brigadeName = brigadeName;
289
+    }
290
+
267 291
     public Long getRoleId() {
268 292
         return roleId;
269 293
     }
@@ -622,6 +646,8 @@ public class PersonnelNonCadreMonthlyAssessment extends BaseEntity {
622 646
                 .append("assessmentMonth", getAssessmentMonth())
623 647
                 .append("userId", getUserId())
624 648
                 .append("userName", getUserName())
649
+                .append("brigadeId", getBrigadeId())
650
+                .append("brigadeName", getBrigadeName())
625 651
                 .append("roleId", getRoleId())
626 652
                 .append("roleKey", getRoleKey())
627 653
                 .append("roleName", getRoleName())

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

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
4 4
 import java.math.RoundingMode;
5 5
 import java.util.ArrayList;
6 6
 import java.util.Collections;
7
+import java.util.HashMap;
7 8
 import java.util.List;
8 9
 import java.util.Map;
9 10
 import java.util.stream.Collectors;
@@ -14,6 +15,7 @@ import cn.hutool.core.util.ObjUtil;
14 15
 import cn.hutool.core.util.StrUtil;
15 16
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
16 17
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18
+import com.sundot.airport.common.core.domain.entity.SysDept;
17 19
 import com.sundot.airport.common.core.domain.entity.SysUser;
18 20
 import com.sundot.airport.common.dto.SysPersonnelUserConditionDto;
19 21
 import com.sundot.airport.common.dto.SysUserLeaderConditionDto;
@@ -24,6 +26,7 @@ import com.sundot.airport.common.enums.BasePerformanceIndicatorExemptionRuleEnum
24 26
 import com.sundot.airport.common.enums.BasePerformanceIndicatorLeaveTypeEnum;
25 27
 import com.sundot.airport.common.enums.BasePerformanceIndicatorQcDeptTypeEnum;
26 28
 import com.sundot.airport.common.enums.BasePerformanceIndicatorRewardPunishmentTypeTypeEnum;
29
+import com.sundot.airport.common.enums.DeptTypeEnum;
27 30
 import com.sundot.airport.common.enums.RoleTypeEnum;
28 31
 import com.sundot.airport.common.event.PersonnelEvent;
29 32
 import com.sundot.airport.common.exception.ServiceException;
@@ -36,6 +39,7 @@ import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicator
36 39
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
37 40
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
38 41
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
42
+import com.sundot.airport.system.service.ISysDeptService;
39 43
 import com.sundot.airport.system.service.ISysUserService;
40 44
 import org.springframework.beans.factory.annotation.Autowired;
41 45
 import org.springframework.context.ApplicationEventPublisher;
@@ -69,6 +73,8 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
69 73
     @Autowired
70 74
     private ISysUserService sysUserService;
71 75
     @Autowired
76
+    private ISysDeptService sysDeptService;
77
+    @Autowired
72 78
     private ApplicationEventPublisher eventPublisher;
73 79
 
74 80
     /**
@@ -267,6 +273,20 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
267 273
      */
268 274
     @Override
269 275
     public void doImprove(PersonnelNonCadreMonthlyAssessment result) {
276
+        // 大队
277
+        Map<Long, Long> userBrigadeIdMap = new HashMap<>();
278
+        SysDept brigadeQuery = new SysDept();
279
+        brigadeQuery.setDeptType(DeptTypeEnum.BRIGADE.getCode());
280
+        List<SysDept> brigadeList = sysDeptService.selectDeptInfoAll(brigadeQuery);
281
+        Map<Long, String> brigadeMap = brigadeList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
282
+        brigadeList.forEach(brigade -> {
283
+            List<SysUser> sysUserList = sysUserService.selectUserByDeptId(brigade.getDeptId());
284
+            sysUserList.forEach(sysUser -> {
285
+                userBrigadeIdMap.put(sysUser.getUserId(), brigade.getDeptId());
286
+            });
287
+        });
288
+        result.setBrigadeId(userBrigadeIdMap.get(result.getUserId()));
289
+        result.setBrigadeName(brigadeMap.get(result.getBrigadeId()));
270 290
         List<BasePerformanceIndicatorCategory> indicatorCategoryyList = basePerformanceIndicatorCategoryService.selectBasePerformanceIndicatorCategoryListTree(new BasePerformanceIndicatorCategory());
271 291
         // 红线指标
272 292
         BasePerformanceIndicatorCategory redLineIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("红线指标", item.getName())).findFirst().orElse(null);

+ 14 - 0
airport-personnel/src/main/resources/mapper/personnel/PersonnelNonCadreMonthlyAssessmentMapper.xml

@@ -16,6 +16,8 @@
16 16
         <result property="assessmentMonth" column="assessment_month"/>
17 17
         <result property="userId" column="user_id"/>
18 18
         <result property="userName" column="user_name"/>
19
+        <result property="brigadeId" column="brigade_id"/>
20
+        <result property="brigadeName" column="brigade_name"/>
19 21
         <result property="roleId" column="role_id"/>
20 22
         <result property="roleKey" column="role_key"/>
21 23
         <result property="roleName" column="role_name"/>
@@ -64,6 +66,8 @@
64 66
                assessment_month,
65 67
                user_id,
66 68
                user_name,
69
+               brigade_id,
70
+               brigade_name,
67 71
                role_id,
68 72
                role_key,
69 73
                role_name,
@@ -107,6 +111,10 @@
107 111
             <if test="assessmentMonth != null  and assessmentMonth != ''">and assessment_month = #{assessmentMonth}</if>
108 112
             <if test="userId != null ">and user_id = #{userId}</if>
109 113
             <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
114
+            <if test="brigadeId != null ">and brigade_id = #{brigadeId}</if>
115
+            <if test="brigadeName != null  and brigadeName != ''">and brigade_name like concat('%', #{brigadeName},
116
+                '%')
117
+            </if>
110 118
             <if test="roleId != null ">and role_id = #{roleId}</if>
111 119
             <if test="roleKey != null  and roleKey != ''">and role_key = #{roleKey}</if>
112 120
             <if test="roleName != null  and roleName != ''">and role_name like concat('%', #{roleName}, '%')</if>
@@ -198,6 +206,8 @@
198 206
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month,</if>
199 207
             <if test="userId != null">user_id,</if>
200 208
             <if test="userName != null and userName != ''">user_name,</if>
209
+            <if test="brigadeId != null">brigade_id,</if>
210
+            <if test="brigadeName != null and brigadeName != ''">brigade_name,</if>
201 211
             <if test="roleId != null">role_id,</if>
202 212
             <if test="roleKey != null and roleKey != ''">role_key,</if>
203 213
             <if test="roleName != null and roleName != ''">role_name,</if>
@@ -246,6 +256,8 @@
246 256
             <if test="assessmentMonth != null and assessmentMonth != ''">#{assessmentMonth},</if>
247 257
             <if test="userId != null">#{userId},</if>
248 258
             <if test="userName != null and userName != ''">#{userName},</if>
259
+            <if test="brigadeId != null">#{brigadeId},</if>
260
+            <if test="brigadeName != null and brigadeName != ''">#{brigadeName},</if>
249 261
             <if test="roleId != null">#{roleId},</if>
250 262
             <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
251 263
             <if test="roleName != null and roleName != ''">#{roleName},</if>
@@ -297,6 +309,8 @@
297 309
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month = #{assessmentMonth},</if>
298 310
             <if test="userId != null">user_id = #{userId},</if>
299 311
             <if test="userName != null and userName != ''">user_name = #{userName},</if>
312
+            <if test="brigadeId != null">brigade_id = #{brigadeId},</if>
313
+            <if test="brigadeName != null and brigadeName != ''">brigade_name = #{brigadeName},</if>
300 314
             <if test="roleId != null">role_id = #{roleId},</if>
301 315
             <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
302 316
             <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>