浏览代码

计算月度绩效

lamphua 2 天前
父节点
当前提交
782a86a589

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

55
         return getDataTable(list);
55
         return getDataTable(list);
56
     }
56
     }
57
 
57
 
58
+    /**
59
+     * 获取cmc员工绩效详细信息
60
+     */
61
+    @GetMapping(value = "/monthPerformance")
62
+    public AjaxResult getMonthPerformanceList(String performanceId, String deptId)
63
+    {
64
+        return success(cmcPerformanceStaffService.selectMonthPerformanceList(performanceId, deptId));
65
+    }
66
+
58
     /**
67
     /**
59
      * 导出cmc员工绩效列表
68
      * 导出cmc员工绩效列表
60
      */
69
      */
109
                     staff.setPerformanceStaffId(performanceStaffList.get(0).getPerformanceStaffId());
118
                     staff.setPerformanceStaffId(performanceStaffList.get(0).getPerformanceStaffId());
110
                     staff.setContent(performanceStaff.getContent());
119
                     staff.setContent(performanceStaff.getContent());
111
                     staff.setPrice(performanceStaff.getPrice());
120
                     staff.setPrice(performanceStaff.getPrice());
112
-                    staff.setPerformance(performanceStaff.getPerformance());
121
+                    staff.setProducePerformance(performanceStaff.getProducePerformance());
113
                     staff.setCoefficient(performanceStaff.getCoefficient());
122
                     staff.setCoefficient(performanceStaff.getCoefficient());
114
                     staff.setScaleGrade(performanceStaff.getScaleGrade());
123
                     staff.setScaleGrade(performanceStaff.getScaleGrade());
115
                     staff.setUnit(performanceStaff.getUnit());
124
                     staff.setUnit(performanceStaff.getUnit());

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

20
     private static final long serialVersionUID = 1L;
20
     private static final long serialVersionUID = 1L;
21
 
21
 
22
     /** 员工绩效id */
22
     /** 员工绩效id */
23
-    private Long performanceStaffId;
23
+    private Integer performanceStaffId;
24
 
24
 
25
     /** 绩效审批id */
25
     /** 绩效审批id */
26
     private String performanceId;
26
     private String performanceId;
65
     @Excel(name = "系数")
65
     @Excel(name = "系数")
66
     private Double coefficient;
66
     private Double coefficient;
67
 
67
 
68
-    /** 绩效 */
69
-    @Excel(name = "绩效")
70
-    private BigDecimal performance;
68
+    /** 生产绩效 */
69
+    @Excel(name = "生产绩效")
70
+    private BigDecimal producePerformance;
71
+
72
+    /** 管理绩效 */
73
+    @Excel(name = "管理绩效")
74
+    private BigDecimal managePerformance;
71
 
75
 
72
     /** 月份 */
76
     /** 月份 */
73
     @JsonFormat(pattern = "yyyy-MM-dd")
77
     @JsonFormat(pattern = "yyyy-MM-dd")
82
 
86
 
83
     private CmcProject project;
87
     private CmcProject project;
84
 
88
 
85
-    public void setPerformanceStaffId(Long performanceStaffId) 
89
+    public void setPerformanceStaffId(Integer performanceStaffId)
86
     {
90
     {
87
         this.performanceStaffId = performanceStaffId;
91
         this.performanceStaffId = performanceStaffId;
88
     }
92
     }
89
 
93
 
90
-    public Long getPerformanceStaffId() 
94
+    public Integer getPerformanceStaffId()
91
     {
95
     {
92
         return performanceStaffId;
96
         return performanceStaffId;
93
     }
97
     }
211
     {
215
     {
212
         return coefficient;
216
         return coefficient;
213
     }
217
     }
214
-    public void setPerformance(BigDecimal performance)
218
+    public void setProducePerformance(BigDecimal producePerformance)
219
+    {
220
+        this.producePerformance = producePerformance;
221
+    }
222
+
223
+    public BigDecimal getProducePerformance()
224
+    {
225
+        return producePerformance;
226
+    }
227
+    public void setManagePerformance(BigDecimal managePerformance)
215
     {
228
     {
216
-        this.performance = performance;
229
+        this.managePerformance = managePerformance;
217
     }
230
     }
218
 
231
 
219
-    public BigDecimal getPerformance()
232
+    public BigDecimal getManagePerformance()
220
     {
233
     {
221
-        return performance;
234
+        return managePerformance;
222
     }
235
     }
223
     public void setPrice(BigDecimal price)
236
     public void setPrice(BigDecimal price)
224
     {
237
     {
262
             .append("unit", getUnit())
275
             .append("unit", getUnit())
263
             .append("price", getPrice())
276
             .append("price", getPrice())
264
             .append("coefficient", getCoefficient())
277
             .append("coefficient", getCoefficient())
265
-            .append("performance", getPerformance())
278
+            .append("producePerformance", getProducePerformance())
279
+            .append("managePerformance", getManagePerformance())
266
             .append("performanceMonth", getPerformanceMonth())
280
             .append("performanceMonth", getPerformanceMonth())
267
             .append("remark", getRemark())
281
             .append("remark", getRemark())
268
             .toString();
282
             .toString();

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcPerformanceStaffMapper.java 查看文件

27
      */
27
      */
28
     public List<CmcPerformanceStaff> selectCmcPerformanceStaffList(CmcPerformanceStaff cmcPerformanceStaff);
28
     public List<CmcPerformanceStaff> selectCmcPerformanceStaffList(CmcPerformanceStaff cmcPerformanceStaff);
29
 
29
 
30
+    /**
31
+     * 查询cmc员工月度绩效列表
32
+     *
33
+     * @param performanceId 绩效审批id
34
+     * @param deptId 部门id
35
+     * @return cmc员工绩效集合
36
+     */
37
+    public List<CmcPerformanceStaff> selectMonthPerformanceList(String performanceId, String deptId);
38
+
30
     /**
39
     /**
31
      * 新增cmc员工绩效
40
      * 新增cmc员工绩效
32
      * 
41
      * 

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcPerformanceStaffService.java 查看文件

27
      */
27
      */
28
     public List<CmcPerformanceStaff> selectCmcPerformanceStaffList(CmcPerformanceStaff cmcPerformanceStaff);
28
     public List<CmcPerformanceStaff> selectCmcPerformanceStaffList(CmcPerformanceStaff cmcPerformanceStaff);
29
 
29
 
30
+    /**
31
+     * 查询cmc员工月度绩效列表
32
+     *
33
+     * @param performanceId 绩效审批id
34
+     * @param deptId 部门id
35
+     * @return cmc员工绩效集合
36
+     */
37
+    public List<CmcPerformanceStaff> selectMonthPerformanceList(String performanceId, String deptId);
38
+
30
     /**
39
     /**
31
      * 新增cmc员工绩效
40
      * 新增cmc员工绩效
32
      * 
41
      * 

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcPerformanceStaffServiceImpl.java 查看文件

43
         return cmcPerformanceStaffMapper.selectCmcPerformanceStaffList(cmcPerformanceStaff);
43
         return cmcPerformanceStaffMapper.selectCmcPerformanceStaffList(cmcPerformanceStaff);
44
     }
44
     }
45
 
45
 
46
+    /**
47
+     * 查询cmc员工月度绩效列表
48
+     *
49
+     * @param performanceId 绩效审批id
50
+     * @param deptId 部门id
51
+     * @return cmc员工绩效集合
52
+     */
53
+    @Override
54
+    public List<CmcPerformanceStaff> selectMonthPerformanceList(String performanceId, String deptId)
55
+    {
56
+        return cmcPerformanceStaffMapper.selectMonthPerformanceList(performanceId, deptId);
57
+    }
58
+
46
     /**
59
     /**
47
      * 新增cmc员工绩效
60
      * 新增cmc员工绩效
48
      * 
61
      * 

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

18
         <result property="unit"    column="unit"    />
18
         <result property="unit"    column="unit"    />
19
         <result property="price"    column="price"    />
19
         <result property="price"    column="price"    />
20
         <result property="coefficient"    column="coefficient"    />
20
         <result property="coefficient"    column="coefficient"    />
21
-        <result property="performance"    column="performance"    />
21
+        <result property="producePerformance"    column="produce_performance"    />
22
+        <result property="managePerformance"    column="manage_performance"    />
22
         <result property="performanceMonth"    column="performance_month"    />
23
         <result property="performanceMonth"    column="performance_month"    />
23
         <result property="remark"    column="remark"    />
24
         <result property="remark"    column="remark"    />
24
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
25
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
38
 
39
 
39
     <sql id="selectCmcPerformanceStaffVo">
40
     <sql id="selectCmcPerformanceStaffVo">
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,
41
         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,
41
-               ps.coefficient, ps.performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
42
+               ps.coefficient, ps.produce_performance, ps.manage_performance, ps.performance_month, ps.remark from cmc_performance_staff as ps
42
         left join cmc_project as p on p.project_id = ps.project_id
43
         left join cmc_project as p on p.project_id = ps.project_id
43
         left join sys_user as u on u.user_id = ps.user_id
44
         left join sys_user as u on u.user_id = ps.user_id
44
     </sql>
45
     </sql>
55
             <if test="workload != null "> and ps.workload = #{workload}</if>
56
             <if test="workload != null "> and ps.workload = #{workload}</if>
56
             <if test="unit != null  and unit != ''"> and ps.unit = #{unit}</if>
57
             <if test="unit != null  and unit != ''"> and ps.unit = #{unit}</if>
57
             <if test="coefficient != null "> and ps.coefficient = #{coefficient}</if>
58
             <if test="coefficient != null "> and ps.coefficient = #{coefficient}</if>
58
-            <if test="performance != null "> and ps.performance = #{performance}</if>
59
+            <if test="producePerformance != null "> and ps.produce_performance = #{producePerformance}</if>
59
             <if test="performanceMonth != null "> and Month(ps.performance_month) = Month(#{performanceMonth})</if>
60
             <if test="performanceMonth != null "> and Month(ps.performance_month) = Month(#{performanceMonth})</if>
60
         </where>
61
         </where>
61
     </select>
62
     </select>
62
-    
63
+
64
+    <select id="selectMonthPerformanceList" parameterType="String" resultMap="CmcPerformanceStaffResult">
65
+        select avg(t1.produce_performance) * 1.6 as manage_performance, t2.produce_performance, t2.user_id, t2.performance_month
66
+        from
67
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
68
+        left join sys_user as u on u.user_id = ps.user_id
69
+        left join sys_user_post as up on u.user_id = up.user_id
70
+        left join sys_post as p on p.post_id = up.post_id
71
+        where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
72
+        group by user_id) as t1,
73
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
74
+        left join sys_user as u on u.user_id = ps.user_id
75
+        left join sys_user_post as up on u.user_id = up.user_id
76
+        left join sys_post as p on p.post_id = up.post_id
77
+        where p.post_name = '主任' and ps.performance_id = '1' and u.dept_id = 111
78
+        group by user_id) as t2
79
+        union all
80
+        select avg(t1.produce_performance) * 1.2 as manage_performance, t2.produce_performance, t2.user_id, t2.performance_month
81
+        from
82
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
83
+        left join sys_user as u on u.user_id = ps.user_id
84
+        left join sys_user_post as up on u.user_id = up.user_id
85
+        left join sys_post as p on p.post_id = up.post_id
86
+        where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
87
+        group by user_id) as t1,
88
+        (select sum(ps.produce_performance) as produce_performance, u.nick_name, p.post_name, ps.user_id, ps.performance_month from cmc_performance_staff as ps
89
+        left join sys_user as u on u.user_id = ps.user_id
90
+        left join sys_user_post as up on u.user_id = up.user_id
91
+        left join sys_post as p on p.post_id = up.post_id
92
+        where p.post_name = '副主任' and ps.performance_id = '1' and u.dept_id = 111
93
+        group by user_id) as t2
94
+        union all
95
+        select ps.produce_performance * 0 as manage_performance, sum(ps.produce_performance) as produce_performance, ps.user_id, ps.performance_month from cmc_performance_staff as ps
96
+        left join sys_user as u on u.user_id = ps.user_id
97
+        left join sys_user_post as up on u.user_id = up.user_id
98
+        left join sys_post as p on p.post_id = up.post_id
99
+        where p.post_name != '主任' and p.post_name != '副主任' and ps.performance_id = #{param1} and u.dept_id = #{param2}
100
+        group by user_id
101
+    </select>
102
+
63
     <select id="selectCmcPerformanceStaffByPerformanceStaffId" parameterType="Long" resultMap="CmcPerformanceStaffResult">
103
     <select id="selectCmcPerformanceStaffByPerformanceStaffId" parameterType="Long" resultMap="CmcPerformanceStaffResult">
64
         <include refid="selectCmcPerformanceStaffVo"/>
104
         <include refid="selectCmcPerformanceStaffVo"/>
65
         where performance_staff_id = #{performanceStaffId}
105
         where performance_staff_id = #{performanceStaffId}
78
             <if test="unit != null">unit,</if>
118
             <if test="unit != null">unit,</if>
79
             <if test="price != null">price,</if>
119
             <if test="price != null">price,</if>
80
             <if test="coefficient != null">coefficient,</if>
120
             <if test="coefficient != null">coefficient,</if>
81
-            <if test="performance != null">performance,</if>
121
+            <if test="producePerformance != null">produce_performance,</if>
82
             <if test="performanceMonth != null">performance_month,</if>
122
             <if test="performanceMonth != null">performance_month,</if>
83
             <if test="remark != null">remark,</if>
123
             <if test="remark != null">remark,</if>
84
          </trim>
124
          </trim>
93
             <if test="unit != null">#{unit},</if>
133
             <if test="unit != null">#{unit},</if>
94
             <if test="price != null">#{price},</if>
134
             <if test="price != null">#{price},</if>
95
             <if test="coefficient != null">#{coefficient},</if>
135
             <if test="coefficient != null">#{coefficient},</if>
96
-            <if test="performance != null">#{performance},</if>
136
+            <if test="producePerformance != null">#{produce_performance},</if>
97
             <if test="performanceMonth != null">#{performanceMonth},</if>
137
             <if test="performanceMonth != null">#{performanceMonth},</if>
98
             <if test="remark != null">#{remark},</if>
138
             <if test="remark != null">#{remark},</if>
99
          </trim>
139
          </trim>
112
             <if test="unit != null">unit = #{unit},</if>
152
             <if test="unit != null">unit = #{unit},</if>
113
             <if test="price != null">price = #{price},</if>
153
             <if test="price != null">price = #{price},</if>
114
             <if test="coefficient != null">coefficient = #{coefficient},</if>
154
             <if test="coefficient != null">coefficient = #{coefficient},</if>
115
-            <if test="performance != null">performance = #{performance},</if>
155
+            <if test="producePerformance != null">produce_performance = #{producePerformance},</if>
116
             <if test="performanceMonth != null">performance_month = #{performanceMonth},</if>
156
             <if test="performanceMonth != null">performance_month = #{performanceMonth},</if>
117
             <if test="remark != null">remark = #{remark},</if>
157
             <if test="remark != null">remark = #{remark},</if>
118
         </trim>
158
         </trim>

+ 3
- 1
oa-back/sql/sq.sql 查看文件

1
 DROP TABLE IF EXISTS `cmc_performance_staff`;
1
 DROP TABLE IF EXISTS `cmc_performance_staff`;
2
 CREATE TABLE `cmc_performance_staff`  (
2
 CREATE TABLE `cmc_performance_staff`  (
3
   `performance_staff_id` int NOT NULL AUTO_INCREMENT COMMENT '员工绩效id',
3
   `performance_staff_id` int NOT NULL AUTO_INCREMENT COMMENT '员工绩效id',
4
+  `performance_id` char(19)DEFAULT NULL COMMENT '绩效审批id',
4
   `project_id` char(19)DEFAULT NULL COMMENT '项目id',
5
   `project_id` char(19)DEFAULT NULL COMMENT '项目id',
5
   `user_id` bigint NULL COMMENT '员工id',
6
   `user_id` bigint NULL COMMENT '员工id',
6
   `work_type` char(2)DEFAULT NULL COMMENT '作业类别',
7
   `work_type` char(2)DEFAULT NULL COMMENT '作业类别',
10
   `unit` varchar(10)DEFAULT NULL COMMENT '单位',
11
   `unit` varchar(10)DEFAULT NULL COMMENT '单位',
11
   `price` decimal(10, 2)NULL COMMENT '单价',
12
   `price` decimal(10, 2)NULL COMMENT '单价',
12
   `coefficient` double NULL COMMENT '系数',
13
   `coefficient` double NULL COMMENT '系数',
13
-  `performance` decimal(10, 2)NULL COMMENT '绩效',
14
+  `manage_performance` decimal(10, 2)NULL COMMENT '管理绩效',
15
+  `produce_performance` decimal(10, 2)NULL COMMENT '生产绩效',
14
   `performance_month` date NULL COMMENT '月份',
16
   `performance_month` date NULL COMMENT '月份',
15
   `remark` varchar(255)DEFAULT NULL COMMENT '备注',
17
   `remark` varchar(255)DEFAULT NULL COMMENT '备注',
16
   PRIMARY KEY (`performance_staff_id`) USING BTREE
18
   PRIMARY KEY (`performance_staff_id`) USING BTREE

+ 15
- 0
oa-ui/src/api/oa/performance/performanceStaff.js 查看文件

1
+/*
2
+ * @Author: wrh
3
+ * @Date: 2025-06-05 11:11:47
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2025-06-05 17:14:54
6
+ */
1
 import request from '@/utils/request'
7
 import request from '@/utils/request'
2
 
8
 
3
 // 查询cmc员工绩效列表
9
 // 查询cmc员工绩效列表
42
     method: 'delete'
48
     method: 'delete'
43
   })
49
   })
44
 }
50
 }
51
+
52
+// 删除cmc员工绩效
53
+export function getMonthPerformanceList() {
54
+  return request({
55
+    url: '/oa/monthPerformance',
56
+    method: 'get',
57
+    params: query
58
+  })
59
+}

正在加载...
取消
保存