zwj месяцев назад: 10
Родитель
Сommit
702e119edb

+ 4 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/PostPlanEnum.java

@@ -16,6 +16,10 @@ public enum PostPlanEnum {
16 16
     STATUS_HR_PASS("通过;", 3),
17 17
     STATUS_HR_BACK("驳回;", 4),
18 18
 
19
+    // 流转步骤
20
+    STEP_HR("人力资源", 2),
21
+    STEP_ICFA("内控法务", 1),
22
+    STEP_SCHEME("方案入档",3),
19 23
 
20 24
     //status_icfa 2-内控法务部审批-状态:1-待审核;3-通过;4-驳回;
21 25
     STATUS_ICFA_WAIT("待审核", 1),

+ 7 - 6
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostAssessmentRulesController.java

@@ -5,6 +5,7 @@ import java.util.Date;
5 5
 import java.util.List;
6 6
 import javax.servlet.http.HttpServletResponse;
7 7
 
8
+import com.ruoyi.common.constant.HttpStatus;
8 9
 import com.ruoyi.common.core.domain.entity.SysDept;
9 10
 import com.ruoyi.common.core.domain.model.LoginUser;
10 11
 import com.ruoyi.common.enums.DeptCode;
@@ -188,12 +189,12 @@ public class PostAssessmentRulesController extends BaseController
188 189
         // 当前登录用户的部门id 查询岗位id是否在内
189 190
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
190 191
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
191
-            return error("审核权限有误,请联系管理员!");
192
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
192 193
         }
193 194
         // 判断岗位是否在权限范围内
194 195
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
195 196
         if (sysPost.getPostLevel() != 1) {
196
-            return error("审核权限有误,请联系管理员!");
197
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
197 198
         }
198 199
 
199 200
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
@@ -216,12 +217,12 @@ public class PostAssessmentRulesController extends BaseController
216 217
         // 当前登录用户的部门id 查询岗位id是否在内
217 218
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
218 219
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
219
-            return error("审核权限有误,请联系管理员!");
220
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
220 221
         }
221 222
         // 判断岗位是否在权限范围内
222 223
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
223 224
         if (sysPost.getPostLevel() != 1) {
224
-            return error("审核权限有误,请联系管理员!");
225
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
225 226
         }
226 227
 
227 228
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
@@ -243,12 +244,12 @@ public class PostAssessmentRulesController extends BaseController
243 244
         // 当前登录用户的部门id 查询岗位id是否在内
244 245
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
245 246
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
246
-            return error("审核权限有误,请联系管理员!");
247
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
247 248
         }
248 249
         // 判断岗位是否在权限范围内
249 250
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
250 251
         if (sysPost.getPostLevel() != 1) {
251
-            return error("审核权限有误,请联系管理员!");
252
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
252 253
         }
253 254
 
254 255
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));

+ 3 - 2
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedReportController.java

@@ -4,6 +4,7 @@ import java.util.Date;
4 4
 import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6 6
 
7
+import com.ruoyi.common.constant.HttpStatus;
7 8
 import com.ruoyi.common.core.domain.entity.SysDept;
8 9
 import com.ruoyi.common.core.domain.model.LoginUser;
9 10
 import com.ruoyi.common.enums.DeptCode;
@@ -232,12 +233,12 @@ public class PostCheckedReportController extends BaseController
232 233
         // 当前登录用户的部门id 查询岗位id是否在内
233 234
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
234 235
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
235
-            return error("审核权限有误,请联系管理员!");
236
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
236 237
         }
237 238
         // 判断岗位是否在权限范围内
238 239
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
239 240
         if (sysPost.getPostLevel() != 1) {
240
-            return error("审核权限有误,请联系管理员!");
241
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
241 242
         }
242 243
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
243 244
     }

+ 59 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostPlanController.java

@@ -4,8 +4,17 @@ import java.util.List;
4 4
 import javax.servlet.http.HttpServletResponse;
5 5
 
6 6
 import com.baomidou.mybatisplus.annotation.TableField;
7
+import com.ruoyi.common.constant.HttpStatus;
8
+import com.ruoyi.common.core.domain.entity.SysDept;
9
+import com.ruoyi.common.core.domain.model.LoginUser;
10
+import com.ruoyi.common.enums.DeptCode;
11
+import com.ruoyi.common.utils.SecurityUtils;
7 12
 import com.ruoyi.postCheck.domain.PostPlanCheckUser;
8 13
 import com.ruoyi.postCheck.domain.PostPlanInfo;
14
+import com.ruoyi.postCheck.domain.PostProgramme;
15
+import com.ruoyi.system.domain.SysPost;
16
+import com.ruoyi.system.service.ISysDeptService;
17
+import com.ruoyi.system.service.ISysPostService;
9 18
 import io.swagger.annotations.*;
10 19
 import org.springframework.security.access.prepost.PreAuthorize;
11 20
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +45,16 @@ import com.ruoyi.common.core.page.TableDataInfo;
36 45
 @RestController
37 46
 @RequestMapping("/postCheck/postPlan")
38 47
 public class PostPlanController extends BaseController {
48
+
39 49
     @Autowired
40 50
     private IPostPlanService postPlanService;
41 51
 
52
+    @Autowired
53
+    private ISysDeptService sysDeptService;
54
+
55
+    @Autowired
56
+    private ISysPostService sysPostService;
57
+
42 58
     /**
43 59
      * 查询岗检计划列表
44 60
      */
@@ -202,6 +218,25 @@ public class PostPlanController extends BaseController {
202 218
     @Log(title = "岗检计划审核-Icfa", businessType = BusinessType.UPDATE)
203 219
     @PutMapping("/approveIcfa")
204 220
     public AjaxResult approveIcfa(Long id, Integer statusIcfa, String reasonIcfa) {
221
+        // 判断当前状态
222
+        PostPlan postPlan = postPlanService.selectPostPlanById(id);
223
+        // 审核过得不在审核
224
+        if (postPlan.getStatusIcfa() == 3) {
225
+            return AjaxResult.error(HttpStatus.SUCCESS,"审核失败,请勿重复审核!");
226
+        }
227
+        // 判断审核的权限
228
+        LoginUser loginUser = SecurityUtils.getLoginUser();
229
+        // 当前登录用户的部门id 查询岗位id是否在内
230
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
231
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
232
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
233
+        }
234
+        // 判断岗位是否在权限范围内
235
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
236
+        if (sysPost.getPostLevel() != 1) {
237
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
238
+        }
239
+
205 240
         return toAjax(postPlanService.approveIcfa(id, statusIcfa, reasonIcfa));
206 241
     }
207 242
 
@@ -217,6 +252,30 @@ public class PostPlanController extends BaseController {
217 252
     @Log(title = "岗检计划审核-HR", businessType = BusinessType.UPDATE)
218 253
     @PutMapping("/approveHr")
219 254
     public AjaxResult approveHr(Long id, Integer statusHr, String reasonHr) {
255
+        // 判断当前状态
256
+        PostPlan postPlan = postPlanService.selectPostPlanById(id);
257
+        // 审核过得不在审核
258
+        if (postPlan.getStatusHr() == 3) {
259
+            return AjaxResult.error(HttpStatus.SUCCESS, "审核失败,请勿重复审核!");
260
+        }
261
+        // 判断顺序
262
+        if (postPlan.getStatusIcfa() != 3) {
263
+            return AjaxResult.error(HttpStatus.SUCCESS,"审核失败,审核流程有误!!");
264
+        }
265
+        // 判断审核的权限
266
+        LoginUser loginUser = SecurityUtils.getLoginUser();
267
+        // 当前登录用户的部门id 查询岗位id是否在内
268
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
269
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {
270
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
271
+        }
272
+
273
+        // 判断岗位是否在权限范围内
274
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
275
+        if (sysPost.getPostLevel() != 1) {
276
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
277
+        }
278
+
220 279
         return toAjax(postPlanService.approveHr(id, statusHr, reasonHr));
221 280
     }
222 281
 

+ 8 - 7
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostProgrammeController.java

@@ -5,6 +5,7 @@ import java.util.List;
5 5
 import java.util.Optional;
6 6
 import javax.servlet.http.HttpServletResponse;
7 7
 
8
+import com.ruoyi.common.constant.HttpStatus;
8 9
 import com.ruoyi.common.core.domain.entity.SysDept;
9 10
 import com.ruoyi.common.core.domain.model.LoginUser;
10 11
 import com.ruoyi.common.enums.DeptCode;
@@ -209,20 +210,20 @@ public class PostProgrammeController extends BaseController {
209 210
         // 审核过得不在审核
210 211
 
211 212
         if (postProgramme.getStatusHr() == 3) {
212
-            return error("审核失败,请勿重复审核!");
213
+            return AjaxResult.error(HttpStatus.SUCCESS, "审核失败,请勿重复审核!");
213 214
         }
214 215
         // 判断审核的权限
215 216
         LoginUser loginUser = SecurityUtils.getLoginUser();
216 217
         // 当前登录用户的部门id 查询岗位id是否在内
217 218
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
218 219
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {
219
-            return error("审核权限有误,请联系管理员!");
220
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
220 221
         }
221 222
 
222 223
         // 判断岗位是否在权限范围内
223 224
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
224 225
         if (sysPost.getPostLevel() != 1) {
225
-            return error("审核权限有误,请联系管理员!");
226
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
226 227
         }
227 228
         return toAjax(postProgrammeService.approveHr(id, statusHr, reasonHr));
228 229
     }
@@ -241,23 +242,23 @@ public class PostProgrammeController extends BaseController {
241 242
         PostProgramme postProgramme = postProgrammeService.selectPostProgrammeById(id);
242 243
         // 审核过得不在审核
243 244
         if (postProgramme.getStatusHr() != 3) {
244
-            return error("审核失败,审核流程有误!!");
245
+            return AjaxResult.error(HttpStatus.SUCCESS,"审核失败,审核流程有误!!");
245 246
         }
246 247
 
247 248
         if (postProgramme.getStatusIcfa() == 3) {
248
-            return error("审核失败,请勿重复审核!");
249
+            return AjaxResult.error(HttpStatus.SUCCESS,"审核失败,请勿重复审核!");
249 250
         }
250 251
         // 判断审核的权限
251 252
         LoginUser loginUser = SecurityUtils.getLoginUser();
252 253
         // 当前登录用户的部门id 查询岗位id是否在内
253 254
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
254 255
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
255
-            return error("审核权限有误,请联系管理员!");
256
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
256 257
         }
257 258
         // 判断岗位是否在权限范围内
258 259
         SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
259 260
         if (sysPost.getPostLevel() != 1) {
260
-            return error("审核权限有误,请联系管理员!");
261
+            return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
261 262
         }
262 263
 
263 264
         return toAjax(postProgrammeService.approveIcfa(id, statusIcfa, reasonIcfa));

+ 5 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/PostPlan.java

@@ -161,4 +161,9 @@ public class PostPlan extends BaseEntity {
161 161
     @TableField(exist = false)
162 162
     private String checkedPostNames;
163 163
 //    =======================页面显示值===============
164
+
165
+    @ApiModelProperty("步骤:0-初始状态;1-内控法务部;2-人力资源审核后;3-方案入档")
166
+    @TableField(value = "step")
167
+    private Integer step;
168
+
164 169
 }

+ 5 - 2
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostPlanServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7
 import com.ruoyi.common.constant.DeptConstants;
8 8
 import com.ruoyi.common.constant.PostPlanEnum;
9
+import com.ruoyi.common.constant.PostProgrammeEnum;
9 10
 import com.ruoyi.common.utils.SecurityUtils;
10 11
 import com.ruoyi.postCheck.domain.PostAssessmentRating;
11 12
 import com.ruoyi.postCheck.domain.PostPlan;
@@ -237,6 +238,7 @@ public class PostPlanServiceImpl extends ServiceImpl<PostPlanMapper, PostPlan> i
237 238
         data.setReasonIcfa(reasonIcfa);
238 239
 
239 240
         if (statusIcfa == PostPlanEnum.STATUS_ICFA_PASS.getValue()) {
241
+            data.setStep(PostPlanEnum.STEP_ICFA.getValue());
240 242
             data.setStatus(PostPlanEnum.STATUS_ING.getValue());//审核中
241 243
         } else {
242 244
             data.setStatus(PostPlanEnum.STATUS_BACK.getValue());//驳回
@@ -274,11 +276,12 @@ public class PostPlanServiceImpl extends ServiceImpl<PostPlanMapper, PostPlan> i
274 276
         data.setReasonHr(reasonHr);
275 277
 
276 278
         data.setStatus(statusHr);//最终审核结果
277
-        // 初始化岗检考核排名
278 279
 
279
-        if(statusHr==3){
280
+        if(statusHr==PostPlanEnum.STATUS_ICFA_PASS.getValue()){
281
+            data.setStep(PostPlanEnum.STEP_HR.getValue());
280 282
             // 如果审核通过开始初始化岗检排名表
281 283
             initializationPostAssessmentRating(id);
284
+
282 285
         }
283 286
         return postPlanMapper.updatePostPlan(data);
284 287
     }

+ 2 - 0
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostPlanMapper.xml

@@ -30,6 +30,7 @@
30 30
         <result property="statusUserId"    column="status_user_id"    />
31 31
         <result property="statusIcfaUserId"    column="status_icfa_user_id"    />
32 32
         <result property="statusHrUserId"    column="status_hr_user_id"    />
33
+        <result property="step"    column="step"    />
33 34
     </resultMap>
34 35
 
35 36
     <sql id="selectPostPlanVo">
@@ -182,6 +183,7 @@
182 183
             <if test="statusUserId != null">status_user_id = #{statusUserId},</if>
183 184
             <if test="statusIcfaUserId != null">status_icfa_user_id = #{statusIcfaUserId},</if>
184 185
             <if test="statusHrUserId != null">status_hr_user_id = #{statusHrUserId},</if>
186
+            <if test="step != null">step = #{step},</if>
185 187
         </trim>
186 188
         where id = #{id}
187 189
     </update>