Переглянути джерело

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

lamphua 1 день тому
джерело
коміт
244fcbd7a4

+ 3
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcPerformanceStaffController.java Переглянути файл

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

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcPerformanceStaff.java Переглянути файл

22
     /** 员工绩效id */
22
     /** 员工绩效id */
23
     private Long performanceStaffId;
23
     private Long performanceStaffId;
24
 
24
 
25
+    /** 绩效审批id */
26
+    private String performanceId;
27
+
25
     /** 项目id */
28
     /** 项目id */
26
     private String projectId;
29
     private String projectId;
27
     @Excel(name = "项目编号")
30
     @Excel(name = "项目编号")
88
     {
91
     {
89
         return performanceStaffId;
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
     public void setProjectId(String projectId) 
103
     public void setProjectId(String projectId) 
92
     {
104
     {
93
         this.projectId = projectId;
105
         this.projectId = projectId;
240
     public String toString() {
252
     public String toString() {
241
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
253
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
242
             .append("performanceStaffId", getPerformanceStaffId())
254
             .append("performanceStaffId", getPerformanceStaffId())
255
+            .append("performanceId", getPerformanceId())
243
             .append("projectId", getProjectId())
256
             .append("projectId", getProjectId())
244
             .append("userId", getUserId())
257
             .append("userId", getUserId())
245
             .append("workType", getWorkType())
258
             .append("workType", getWorkType())

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcPerformanceStaffMapper.xml Переглянути файл

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

Завантаження…
Відмінити
Зберегти