Преглед изворни кода

Merge remote-tracking branch 'origin/master'

csg6 пре 10 месеци
родитељ
комит
4d7506bcf6

+ 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
     }

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

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

+ 13 - 10
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostProgrammeController.java

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