소스 검색

用户历史表添加状态字段

lamphua 1 개월 전
부모
커밋
086e9f5714

+ 2
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 파일 보기

@@ -359,7 +359,7 @@ public class SysUserController extends BaseController
359 359
         CmcUserHistory cmcUserHistory = new CmcUserHistory();
360 360
         SysUser sysUser = userService.selectUserById(user.getUserId());
361 361
         cmcUserHistory.setUserId(user.getUserId());
362
-        cmcUserHistory.setDeptId(user.getDeptId());
362
+        cmcUserHistory.setDeptId(sysUser.getDeptId());
363 363
         cmcUserHistory.setTitles(sysUser.getTitles());
364 364
         cmcUserHistory.setCertificates(sysUser.getCertificates());
365 365
         cmcUserHistory.setEngineerLevel(sysUser.getEngineerLevel());
@@ -378,6 +378,7 @@ public class SysUserController extends BaseController
378 378
         cmcUserHistory.setRoleIds(StringUtils.join(roleService.selectRoleListByUserId(user.getUserId()),","));
379 379
         cmcUserHistory.setPostIds(StringUtils.join(postService.selectPostListByUserId(user.getUserId()),","));
380 380
         cmcUserHistory.setUpdateTime(DateUtils.getNowDate());
381
+        cmcUserHistory.setStatus(sysUser.getStatus());
381 382
         cmcUserHistoryService.insertCmcUserHistory(cmcUserHistory);
382 383
         userService.checkUserAllowed(user);
383 384
         userService.checkUserDataScope(user.getUserId());

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcUserHistory.java 파일 보기

@@ -84,6 +84,10 @@ public class CmcUserHistory extends BaseEntity
84 84
     @Excel(name = "合同期满", width = 30, dateFormat = "yyyy-MM-dd")
85 85
     private Date contractExpire;
86 86
 
87
+    /** 状态 */
88
+    @Excel(name = "状态")
89
+    private String status;
90
+
87 91
     /** 角色组 */
88 92
     private String roleIds;
89 93
 
@@ -259,6 +263,15 @@ public class CmcUserHistory extends BaseEntity
259 263
     {
260 264
         this.postIds = postIds;
261 265
     }
266
+    public String getStatus()
267
+    {
268
+        return status;
269
+    }
270
+
271
+    public void setStatus(String status)
272
+    {
273
+        this.status = status;
274
+    }
262 275
 
263 276
     @Override
264 277
     public String toString() {

+ 5
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcUserHistoryMapper.xml 파일 보기

@@ -25,11 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
25 25
         <result property="degree"    column="degree"    />
26 26
         <result property="contractSign"    column="contract_sign"    />
27 27
         <result property="contractExpire"    column="contract_expire"    />
28
+        <result property="status"    column="status"    />
28 29
     </resultMap>
29 30
 
30 31
     <sql id="selectCmcUserHistoryVo">
31 32
         select history_id, user_id, dept_id, titles, certificates, roleIds, postIds, pm_level, engineer_level, post_level, salary_level, operator_level, update_time, update_reason,
32
-            political_affiliation, graduate_school, major, degree, contract_sign, contract_expire from cmc_user_history
33
+            political_affiliation, graduate_school, major, degree, contract_sign, contract_expire, status from cmc_user_history
33 34
     </sql>
34 35
 
35 36
     <select id="selectCmcUserHistoryList" parameterType="CmcUserHistory" resultMap="CmcUserHistoryResult">
@@ -74,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
74 75
             <if test="degree != null">degree,</if>
75 76
             <if test="contractSign != null">contract_sign,</if>
76 77
             <if test="contractExpire != null">contract_expire,</if>
78
+            <if test="status != null">status,</if>
77 79
          </trim>
78 80
         <trim prefix="values (" suffix=")" suffixOverrides=",">
79 81
             <if test="userId != null">#{userId},</if>
@@ -95,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
95 97
             <if test="degree != null">#{degree},</if>
96 98
             <if test="contractSign != null">#{contractSign},</if>
97 99
             <if test="contractExpire != null">#{contractExpire},</if>
100
+            <if test="status != null">#{status},</if>
98 101
          </trim>
99 102
     </insert>
100 103
 
@@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
120 123
             <if test="degree != null">#{degree},</if>
121 124
             <if test="contractSign != null">#{contractSign},</if>
122 125
             <if test="contractExpire != null">#{contractExpire},</if>
126
+            <if test="status != null">#{status},</if>
123 127
         </trim>
124 128
         where history_id  = #{historyId}
125 129
     </update>

Loading…
취소
저장