Parcourir la source

计算月度绩效

lamphua il y a 2 jours
Parent
révision
782a86a589

+ 10
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcPerformanceStaffController.java Voir le fichier

@@ -55,6 +55,15 @@ public class CmcPerformanceStaffController extends BaseController
55 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 68
      * 导出cmc员工绩效列表
60 69
      */
@@ -109,7 +118,7 @@ public class CmcPerformanceStaffController extends BaseController
109 118
                     staff.setPerformanceStaffId(performanceStaffList.get(0).getPerformanceStaffId());
110 119
                     staff.setContent(performanceStaff.getContent());
111 120
                     staff.setPrice(performanceStaff.getPrice());
112
-                    staff.setPerformance(performanceStaff.getPerformance());
121
+                    staff.setProducePerformance(performanceStaff.getProducePerformance());
113 122
                     staff.setCoefficient(performanceStaff.getCoefficient());
114 123
                     staff.setScaleGrade(performanceStaff.getScaleGrade());
115 124
                     staff.setUnit(performanceStaff.getUnit());

+ 25
- 11
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcPerformanceStaff.java Voir le fichier

@@ -20,7 +20,7 @@ public class CmcPerformanceStaff extends BaseEntity
20 20
     private static final long serialVersionUID = 1L;
21 21
 
22 22
     /** 员工绩效id */
23
-    private Long performanceStaffId;
23
+    private Integer performanceStaffId;
24 24
 
25 25
     /** 绩效审批id */
26 26
     private String performanceId;
@@ -65,9 +65,13 @@ public class CmcPerformanceStaff extends BaseEntity
65 65
     @Excel(name = "系数")
66 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 77
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -82,12 +86,12 @@ public class CmcPerformanceStaff extends BaseEntity
82 86
 
83 87
     private CmcProject project;
84 88
 
85
-    public void setPerformanceStaffId(Long performanceStaffId) 
89
+    public void setPerformanceStaffId(Integer performanceStaffId)
86 90
     {
87 91
         this.performanceStaffId = performanceStaffId;
88 92
     }
89 93
 
90
-    public Long getPerformanceStaffId() 
94
+    public Integer getPerformanceStaffId()
91 95
     {
92 96
         return performanceStaffId;
93 97
     }
@@ -211,14 +215,23 @@ public class CmcPerformanceStaff extends BaseEntity
211 215
     {
212 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 236
     public void setPrice(BigDecimal price)
224 237
     {
@@ -262,7 +275,8 @@ public class CmcPerformanceStaff extends BaseEntity
262 275
             .append("unit", getUnit())
263 276
             .append("price", getPrice())
264 277
             .append("coefficient", getCoefficient())
265
-            .append("performance", getPerformance())
278
+            .append("producePerformance", getProducePerformance())
279
+            .append("managePerformance", getManagePerformance())
266 280
             .append("performanceMonth", getPerformanceMonth())
267 281
             .append("remark", getRemark())
268 282
             .toString();

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcPerformanceStaffMapper.java Voir le fichier

@@ -27,6 +27,15 @@ public interface CmcPerformanceStaffMapper
27 27
      */
28 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 40
      * 新增cmc员工绩效
32 41
      * 

+ 9
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcPerformanceStaffService.java Voir le fichier

@@ -27,6 +27,15 @@ public interface ICmcPerformanceStaffService
27 27
      */
28 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 40
      * 新增cmc员工绩效
32 41
      * 

+ 13
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcPerformanceStaffServiceImpl.java Voir le fichier

@@ -43,6 +43,19 @@ public class CmcPerformanceStaffServiceImpl implements ICmcPerformanceStaffServi
43 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 60
      * 新增cmc员工绩效
48 61
      * 

+ 47
- 7
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcPerformanceStaffMapper.xml Voir le fichier

@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
18 18
         <result property="unit"    column="unit"    />
19 19
         <result property="price"    column="price"    />
20 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 23
         <result property="performanceMonth"    column="performance_month"    />
23 24
         <result property="remark"    column="remark"    />
24 25
         <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
@@ -38,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
38 39
 
39 40
     <sql id="selectCmcPerformanceStaffVo">
40 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 43
         left join cmc_project as p on p.project_id = ps.project_id
43 44
         left join sys_user as u on u.user_id = ps.user_id
44 45
     </sql>
@@ -55,11 +56,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
55 56
             <if test="workload != null "> and ps.workload = #{workload}</if>
56 57
             <if test="unit != null  and unit != ''"> and ps.unit = #{unit}</if>
57 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 60
             <if test="performanceMonth != null "> and Month(ps.performance_month) = Month(#{performanceMonth})</if>
60 61
         </where>
61 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 103
     <select id="selectCmcPerformanceStaffByPerformanceStaffId" parameterType="Long" resultMap="CmcPerformanceStaffResult">
64 104
         <include refid="selectCmcPerformanceStaffVo"/>
65 105
         where performance_staff_id = #{performanceStaffId}
@@ -78,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
78 118
             <if test="unit != null">unit,</if>
79 119
             <if test="price != null">price,</if>
80 120
             <if test="coefficient != null">coefficient,</if>
81
-            <if test="performance != null">performance,</if>
121
+            <if test="producePerformance != null">produce_performance,</if>
82 122
             <if test="performanceMonth != null">performance_month,</if>
83 123
             <if test="remark != null">remark,</if>
84 124
          </trim>
@@ -93,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
93 133
             <if test="unit != null">#{unit},</if>
94 134
             <if test="price != null">#{price},</if>
95 135
             <if test="coefficient != null">#{coefficient},</if>
96
-            <if test="performance != null">#{performance},</if>
136
+            <if test="producePerformance != null">#{produce_performance},</if>
97 137
             <if test="performanceMonth != null">#{performanceMonth},</if>
98 138
             <if test="remark != null">#{remark},</if>
99 139
          </trim>
@@ -112,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
112 152
             <if test="unit != null">unit = #{unit},</if>
113 153
             <if test="price != null">price = #{price},</if>
114 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 156
             <if test="performanceMonth != null">performance_month = #{performanceMonth},</if>
117 157
             <if test="remark != null">remark = #{remark},</if>
118 158
         </trim>

+ 3
- 1
oa-back/sql/sq.sql Voir le fichier

@@ -1,6 +1,7 @@
1 1
 DROP TABLE IF EXISTS `cmc_performance_staff`;
2 2
 CREATE TABLE `cmc_performance_staff`  (
3 3
   `performance_staff_id` int NOT NULL AUTO_INCREMENT COMMENT '员工绩效id',
4
+  `performance_id` char(19)DEFAULT NULL COMMENT '绩效审批id',
4 5
   `project_id` char(19)DEFAULT NULL COMMENT '项目id',
5 6
   `user_id` bigint NULL COMMENT '员工id',
6 7
   `work_type` char(2)DEFAULT NULL COMMENT '作业类别',
@@ -10,7 +11,8 @@ CREATE TABLE `cmc_performance_staff`  (
10 11
   `unit` varchar(10)DEFAULT NULL COMMENT '单位',
11 12
   `price` decimal(10, 2)NULL COMMENT '单价',
12 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 16
   `performance_month` date NULL COMMENT '月份',
15 17
   `remark` varchar(255)DEFAULT NULL COMMENT '备注',
16 18
   PRIMARY KEY (`performance_staff_id`) USING BTREE

+ 15
- 0
oa-ui/src/api/oa/performance/performanceStaff.js Voir le fichier

@@ -1,3 +1,9 @@
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 7
 import request from '@/utils/request'
2 8
 
3 9
 // 查询cmc员工绩效列表
@@ -42,3 +48,12 @@ export function delPerformanceStaff(performanceStaffId) {
42 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
+}

Loading…
Annuler
Enregistrer