chenshudong 1 mese fa
parent
commit
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
     @Excel(name = "用户名称")
44
     @Excel(name = "用户名称")
45
     private String userName;
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
     /** 角色ID */
55
     /** 角色ID */
48
     @Excel(name = "角色ID")
56
     @Excel(name = "角色ID")
49
     private Long roleId;
57
     private Long roleId;
@@ -264,6 +272,22 @@ public class PersonnelNonCadreMonthlyAssessment extends BaseEntity {
264
         return userName;
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
     public Long getRoleId() {
291
     public Long getRoleId() {
268
         return roleId;
292
         return roleId;
269
     }
293
     }
@@ -622,6 +646,8 @@ public class PersonnelNonCadreMonthlyAssessment extends BaseEntity {
622
                 .append("assessmentMonth", getAssessmentMonth())
646
                 .append("assessmentMonth", getAssessmentMonth())
623
                 .append("userId", getUserId())
647
                 .append("userId", getUserId())
624
                 .append("userName", getUserName())
648
                 .append("userName", getUserName())
649
+                .append("brigadeId", getBrigadeId())
650
+                .append("brigadeName", getBrigadeName())
625
                 .append("roleId", getRoleId())
651
                 .append("roleId", getRoleId())
626
                 .append("roleKey", getRoleKey())
652
                 .append("roleKey", getRoleKey())
627
                 .append("roleName", getRoleName())
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
 import java.math.RoundingMode;
4
 import java.math.RoundingMode;
5
 import java.util.ArrayList;
5
 import java.util.ArrayList;
6
 import java.util.Collections;
6
 import java.util.Collections;
7
+import java.util.HashMap;
7
 import java.util.List;
8
 import java.util.List;
8
 import java.util.Map;
9
 import java.util.Map;
9
 import java.util.stream.Collectors;
10
 import java.util.stream.Collectors;
@@ -14,6 +15,7 @@ import cn.hutool.core.util.ObjUtil;
14
 import cn.hutool.core.util.StrUtil;
15
 import cn.hutool.core.util.StrUtil;
15
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
16
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
16
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
17
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18
+import com.sundot.airport.common.core.domain.entity.SysDept;
17
 import com.sundot.airport.common.core.domain.entity.SysUser;
19
 import com.sundot.airport.common.core.domain.entity.SysUser;
18
 import com.sundot.airport.common.dto.SysPersonnelUserConditionDto;
20
 import com.sundot.airport.common.dto.SysPersonnelUserConditionDto;
19
 import com.sundot.airport.common.dto.SysUserLeaderConditionDto;
21
 import com.sundot.airport.common.dto.SysUserLeaderConditionDto;
@@ -24,6 +26,7 @@ import com.sundot.airport.common.enums.BasePerformanceIndicatorExemptionRuleEnum
24
 import com.sundot.airport.common.enums.BasePerformanceIndicatorLeaveTypeEnum;
26
 import com.sundot.airport.common.enums.BasePerformanceIndicatorLeaveTypeEnum;
25
 import com.sundot.airport.common.enums.BasePerformanceIndicatorQcDeptTypeEnum;
27
 import com.sundot.airport.common.enums.BasePerformanceIndicatorQcDeptTypeEnum;
26
 import com.sundot.airport.common.enums.BasePerformanceIndicatorRewardPunishmentTypeTypeEnum;
28
 import com.sundot.airport.common.enums.BasePerformanceIndicatorRewardPunishmentTypeTypeEnum;
29
+import com.sundot.airport.common.enums.DeptTypeEnum;
27
 import com.sundot.airport.common.enums.RoleTypeEnum;
30
 import com.sundot.airport.common.enums.RoleTypeEnum;
28
 import com.sundot.airport.common.event.PersonnelEvent;
31
 import com.sundot.airport.common.event.PersonnelEvent;
29
 import com.sundot.airport.common.exception.ServiceException;
32
 import com.sundot.airport.common.exception.ServiceException;
@@ -36,6 +39,7 @@ import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicator
36
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
39
 import com.sundot.airport.personnel.service.IPersonnelMonthlyAssessmentIndicatorRewardPunishmentDetailService;
37
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
40
 import com.sundot.airport.system.domain.BasePerformanceIndicatorCategory;
38
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
41
 import com.sundot.airport.system.service.IBasePerformanceIndicatorCategoryService;
42
+import com.sundot.airport.system.service.ISysDeptService;
39
 import com.sundot.airport.system.service.ISysUserService;
43
 import com.sundot.airport.system.service.ISysUserService;
40
 import org.springframework.beans.factory.annotation.Autowired;
44
 import org.springframework.beans.factory.annotation.Autowired;
41
 import org.springframework.context.ApplicationEventPublisher;
45
 import org.springframework.context.ApplicationEventPublisher;
@@ -69,6 +73,8 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
69
     @Autowired
73
     @Autowired
70
     private ISysUserService sysUserService;
74
     private ISysUserService sysUserService;
71
     @Autowired
75
     @Autowired
76
+    private ISysDeptService sysDeptService;
77
+    @Autowired
72
     private ApplicationEventPublisher eventPublisher;
78
     private ApplicationEventPublisher eventPublisher;
73
 
79
 
74
     /**
80
     /**
@@ -267,6 +273,20 @@ public class PersonnelNonCadreMonthlyAssessmentServiceImpl extends ServiceImpl<P
267
      */
273
      */
268
     @Override
274
     @Override
269
     public void doImprove(PersonnelNonCadreMonthlyAssessment result) {
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
         List<BasePerformanceIndicatorCategory> indicatorCategoryyList = basePerformanceIndicatorCategoryService.selectBasePerformanceIndicatorCategoryListTree(new BasePerformanceIndicatorCategory());
290
         List<BasePerformanceIndicatorCategory> indicatorCategoryyList = basePerformanceIndicatorCategoryService.selectBasePerformanceIndicatorCategoryListTree(new BasePerformanceIndicatorCategory());
271
         // 红线指标
291
         // 红线指标
272
         BasePerformanceIndicatorCategory redLineIndexCategory = indicatorCategoryyList.stream().filter(item -> StrUtil.equals("红线指标", item.getName())).findFirst().orElse(null);
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
         <result property="assessmentMonth" column="assessment_month"/>
16
         <result property="assessmentMonth" column="assessment_month"/>
17
         <result property="userId" column="user_id"/>
17
         <result property="userId" column="user_id"/>
18
         <result property="userName" column="user_name"/>
18
         <result property="userName" column="user_name"/>
19
+        <result property="brigadeId" column="brigade_id"/>
20
+        <result property="brigadeName" column="brigade_name"/>
19
         <result property="roleId" column="role_id"/>
21
         <result property="roleId" column="role_id"/>
20
         <result property="roleKey" column="role_key"/>
22
         <result property="roleKey" column="role_key"/>
21
         <result property="roleName" column="role_name"/>
23
         <result property="roleName" column="role_name"/>
@@ -64,6 +66,8 @@
64
                assessment_month,
66
                assessment_month,
65
                user_id,
67
                user_id,
66
                user_name,
68
                user_name,
69
+               brigade_id,
70
+               brigade_name,
67
                role_id,
71
                role_id,
68
                role_key,
72
                role_key,
69
                role_name,
73
                role_name,
@@ -107,6 +111,10 @@
107
             <if test="assessmentMonth != null  and assessmentMonth != ''">and assessment_month = #{assessmentMonth}</if>
111
             <if test="assessmentMonth != null  and assessmentMonth != ''">and assessment_month = #{assessmentMonth}</if>
108
             <if test="userId != null ">and user_id = #{userId}</if>
112
             <if test="userId != null ">and user_id = #{userId}</if>
109
             <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
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
             <if test="roleId != null ">and role_id = #{roleId}</if>
118
             <if test="roleId != null ">and role_id = #{roleId}</if>
111
             <if test="roleKey != null  and roleKey != ''">and role_key = #{roleKey}</if>
119
             <if test="roleKey != null  and roleKey != ''">and role_key = #{roleKey}</if>
112
             <if test="roleName != null  and roleName != ''">and role_name like concat('%', #{roleName}, '%')</if>
120
             <if test="roleName != null  and roleName != ''">and role_name like concat('%', #{roleName}, '%')</if>
@@ -198,6 +206,8 @@
198
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month,</if>
206
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month,</if>
199
             <if test="userId != null">user_id,</if>
207
             <if test="userId != null">user_id,</if>
200
             <if test="userName != null and userName != ''">user_name,</if>
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
             <if test="roleId != null">role_id,</if>
211
             <if test="roleId != null">role_id,</if>
202
             <if test="roleKey != null and roleKey != ''">role_key,</if>
212
             <if test="roleKey != null and roleKey != ''">role_key,</if>
203
             <if test="roleName != null and roleName != ''">role_name,</if>
213
             <if test="roleName != null and roleName != ''">role_name,</if>
@@ -246,6 +256,8 @@
246
             <if test="assessmentMonth != null and assessmentMonth != ''">#{assessmentMonth},</if>
256
             <if test="assessmentMonth != null and assessmentMonth != ''">#{assessmentMonth},</if>
247
             <if test="userId != null">#{userId},</if>
257
             <if test="userId != null">#{userId},</if>
248
             <if test="userName != null and userName != ''">#{userName},</if>
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
             <if test="roleId != null">#{roleId},</if>
261
             <if test="roleId != null">#{roleId},</if>
250
             <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
262
             <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
251
             <if test="roleName != null and roleName != ''">#{roleName},</if>
263
             <if test="roleName != null and roleName != ''">#{roleName},</if>
@@ -297,6 +309,8 @@
297
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month = #{assessmentMonth},</if>
309
             <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month = #{assessmentMonth},</if>
298
             <if test="userId != null">user_id = #{userId},</if>
310
             <if test="userId != null">user_id = #{userId},</if>
299
             <if test="userName != null and userName != ''">user_name = #{userName},</if>
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
             <if test="roleId != null">role_id = #{roleId},</if>
314
             <if test="roleId != null">role_id = #{roleId},</if>
301
             <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
315
             <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
302
             <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
316
             <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>