浏览代码

员工绩效表增加绩效审批id

lamphua 1 天前
父节点
当前提交
244fcbd7a4

+ 3
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcPerformanceStaffController.java 查看文件

@@ -80,7 +80,7 @@ public class CmcPerformanceStaffController extends BaseController
80 80
      * 上传员工绩效excel文件
81 81
      */
82 82
     @PostMapping("/uploadSheet")
83
-    public AjaxResult uploadPerformanceStaffSheet(MultipartFile file) throws Exception {
83
+    public AjaxResult uploadPerformanceStaffSheet(MultipartFile file, String performanceId) throws Exception {
84 84
         if (file.isEmpty()) {
85 85
             return AjaxResult.error("文件内容为空!");
86 86
         }
@@ -88,6 +88,7 @@ public class CmcPerformanceStaffController extends BaseController
88 88
             ExcelUtil<CmcPerformanceStaff> util = new ExcelUtil<CmcPerformanceStaff>(CmcPerformanceStaff.class);
89 89
             List<CmcPerformanceStaff> performanceStaffList = util.importExcel(file.getInputStream());
90 90
             for (CmcPerformanceStaff performanceStaff : performanceStaffList) {
91
+                performanceStaff.setPerformanceId(performanceId);
91 92
                 performanceStaff.setUserId(userService.selectUserByNickName(performanceStaff.getNickName()).getUserId());
92 93
                 CmcProject cmcProject = new CmcProject();
93 94
                 cmcProject.setProjectNumber(performanceStaff.getProjectNumber());
@@ -98,6 +99,7 @@ public class CmcPerformanceStaffController extends BaseController
98 99
                     performanceStaff.setProjectId("0");
99 100
                 CmcPerformanceStaff staff = new CmcPerformanceStaff();
100 101
                 staff.setUserId(performanceStaff.getUserId());
102
+                staff.setPerformanceId(performanceStaff.getPerformanceId());
101 103
                 staff.setProjectId(performanceStaff.getProjectId());
102 104
                 staff.setWorkType(performanceStaff.getWorkType());
103 105
                 staff.setContent(performanceStaff.getContent());

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcPerformanceStaff.java 查看文件

@@ -22,6 +22,9 @@ public class CmcPerformanceStaff extends BaseEntity
22 22
     /** 员工绩效id */
23 23
     private Long performanceStaffId;
24 24
 
25
+    /** 绩效审批id */
26
+    private String performanceId;
27
+
25 28
     /** 项目id */
26 29
     private String projectId;
27 30
     @Excel(name = "项目编号")
@@ -88,6 +91,15 @@ public class CmcPerformanceStaff extends BaseEntity
88 91
     {
89 92
         return performanceStaffId;
90 93
     }
94
+    public void setPerformanceId(String performanceId)
95
+    {
96
+        this.performanceId = performanceId;
97
+    }
98
+
99
+    public String getPerformanceId()
100
+    {
101
+        return performanceId;
102
+    }
91 103
     public void setProjectId(String projectId) 
92 104
     {
93 105
         this.projectId = projectId;
@@ -240,6 +252,7 @@ public class CmcPerformanceStaff extends BaseEntity
240 252
     public String toString() {
241 253
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
242 254
             .append("performanceStaffId", getPerformanceStaffId())
255
+            .append("performanceId", getPerformanceId())
243 256
             .append("projectId", getProjectId())
244 257
             .append("userId", getUserId())
245 258
             .append("workType", getWorkType())

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcPerformanceStaffMapper.xml 查看文件

@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
6 6
     
7 7
     <resultMap type="CmcPerformanceStaff" id="CmcPerformanceStaffResult">
8 8
         <result property="performanceStaffId"    column="performance_staff_id"    />
9
+        <result property="performanceId"    column="performance_id"    />
9 10
         <result property="projectId"    column="project_id"    />
10 11
         <result property="projectNumber"    column="project_number"    />
11 12
         <result property="userId"    column="user_id"    />
@@ -36,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
36 37
     </resultMap>
37 38
 
38 39
     <sql id="selectCmcPerformanceStaffVo">
39
-        select ps.performance_staff_id, ps.project_id, p.project_number, p.project_name, ps.user_id, u.nick_name, ps.work_type, ps.content, ps.scale_grade, ps.workload, ps.unit, ps.price,
40
+        select ps.performance_staff_id, ps.performance_id, ps.project_id, p.project_number, p.project_name, ps.user_id, u.nick_name, ps.work_type, ps.content, ps.scale_grade, ps.workload, ps.unit, ps.price,
40 41
                ps.coefficient, ps.performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
41 42
         left join cmc_project as p on p.project_id = ps.project_id
42 43
         left join sys_user as u on u.user_id = ps.user_id
@@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
45 46
     <select id="selectCmcPerformanceStaffList" parameterType="CmcPerformanceStaff" resultMap="CmcPerformanceStaffResult">
46 47
         <include refid="selectCmcPerformanceStaffVo"/>
47 48
         <where>  
49
+            <if test="performanceId != null  and performanceId != ''"> and ps.performance_id = #{performanceId}</if>
48 50
             <if test="projectId != null  and projectId != ''"> and ps.project_id = #{projectId}</if>
49 51
             <if test="userId != null "> and ps.user_id = #{userId}</if>
50 52
             <if test="workType != null  and workType != ''"> and ps.work_type = #{workType}</if>
@@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
66 68
     <insert id="insertCmcPerformanceStaff" parameterType="CmcPerformanceStaff" useGeneratedKeys="true" keyProperty="performanceStaffId">
67 69
         insert into cmc_performance_staff
68 70
         <trim prefix="(" suffix=")" suffixOverrides=",">
71
+            <if test="performanceId != null">performance_id,</if>
69 72
             <if test="projectId != null">project_id,</if>
70 73
             <if test="userId != null">user_id,</if>
71 74
             <if test="workType != null">work_type,</if>
@@ -80,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
80 83
             <if test="remark != null">remark,</if>
81 84
          </trim>
82 85
         <trim prefix="values (" suffix=")" suffixOverrides=",">
86
+            <if test="performanceId != null">#{performanceId},</if>
83 87
             <if test="projectId != null">#{projectId},</if>
84 88
             <if test="userId != null">#{userId},</if>
85 89
             <if test="workType != null">#{workType},</if>
@@ -98,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
98 102
     <update id="updateCmcPerformanceStaff" parameterType="CmcPerformanceStaff">
99 103
         update cmc_performance_staff
100 104
         <trim prefix="SET" suffixOverrides=",">
105
+            <if test="performanceId != null">performance_id = #{performanceId},</if>
101 106
             <if test="projectId != null">project_id = #{projectId},</if>
102 107
             <if test="userId != null">user_id = #{userId},</if>
103 108
             <if test="workType != null">work_type = #{workType},</if>

正在加载...
取消
保存