4 Commits 5e363432e2 ... bbb73a9ada

Author SHA1 Message Date
  zwj bbb73a9ada Merge remote-tracking branch 'origin/master' 10 months ago
  zwj dcaa10aab7 审核成功时修改步骤 10 months ago
  zwj 869c5fe050 考核规则审核 10 months ago
  zwj cc44b013af 岗位报告审核 10 months ago

+ 84 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostAssessmentRulesController.java

@@ -4,6 +4,14 @@ import java.math.BigDecimal;
4 4
 import java.util.Date;
5 5
 import java.util.List;
6 6
 import javax.servlet.http.HttpServletResponse;
7
+
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;
12
+import com.ruoyi.system.domain.SysPost;
13
+import com.ruoyi.system.service.ISysDeptService;
14
+import com.ruoyi.system.service.ISysPostService;
7 15
 import org.springframework.security.access.prepost.PreAuthorize;
8 16
 import org.springframework.beans.factory.annotation.Autowired;
9 17
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,6 +49,13 @@ public class PostAssessmentRulesController extends BaseController
41 49
     @Autowired
42 50
     private IPostAssessmentRulesService postAssessmentRulesService;
43 51
 
52
+    @Autowired
53
+    private ISysDeptService sysDeptService;
54
+
55
+    @Autowired
56
+    private ISysPostService sysPostService;
57
+
58
+
44 59
     /**
45 60
      * 查询考核规则列表
46 61
      */
@@ -167,6 +182,75 @@ public class PostAssessmentRulesController extends BaseController
167 182
     @Log(title = "考核规则审核", businessType = BusinessType.UPDATE)
168 183
     @PutMapping("/statusApprove")
169 184
     public AjaxResult statusApprove(Long id, Integer status, String statusReason) {
185
+
186
+        // 判断审核的权限
187
+        LoginUser loginUser = SecurityUtils.getLoginUser();
188
+        // 当前登录用户的部门id 查询岗位id是否在内
189
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
190
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
191
+            return error("审核权限有误,请联系管理员!");
192
+        }
193
+        // 判断岗位是否在权限范围内
194
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
195
+        if (sysPost.getPostLevel() != 1) {
196
+            return error("审核权限有误,请联系管理员!");
197
+        }
198
+
199
+        return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
200
+    }
201
+
202
+
203
+
204
+    @ApiOperation("考核规则审核-职能")
205
+    @ApiImplicitParams({
206
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Long", dataTypeClass = Long.class),
207
+            @ApiImplicitParam(name = "status", value = "状态:3-通过;4-驳回;", dataType = "Integer", dataTypeClass = Integer.class),
208
+            @ApiImplicitParam(name = "reason", value = "未通过理由", dataType = "String", dataTypeClass = String.class),
209
+    })
210
+    @Log(title = "考核规则审核-职能", businessType = BusinessType.UPDATE)
211
+    @PutMapping("/statusFunctions")
212
+    public AjaxResult statusFunctions(Long id, Integer status, String statusReason) {
213
+
214
+        // 判断审核的权限
215
+        LoginUser loginUser = SecurityUtils.getLoginUser();
216
+        // 当前登录用户的部门id 查询岗位id是否在内
217
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
218
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
219
+            return error("审核权限有误,请联系管理员!");
220
+        }
221
+        // 判断岗位是否在权限范围内
222
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
223
+        if (sysPost.getPostLevel() != 1) {
224
+            return error("审核权限有误,请联系管理员!");
225
+        }
226
+
227
+        return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
228
+    }
229
+
230
+
231
+    @ApiOperation("考核规则审核-生产")
232
+    @ApiImplicitParams({
233
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Long", dataTypeClass = Long.class),
234
+            @ApiImplicitParam(name = "status", value = "状态:3-通过;4-驳回;", dataType = "Integer", dataTypeClass = Integer.class),
235
+            @ApiImplicitParam(name = "reason", value = "未通过理由", dataType = "String", dataTypeClass = String.class),
236
+    })
237
+    @Log(title = "考核规则审核-生产", businessType = BusinessType.UPDATE)
238
+    @PutMapping("/statusProduction")
239
+    public AjaxResult statusProduction(Long id, Integer status, String statusReason) {
240
+
241
+        // 判断审核的权限
242
+        LoginUser loginUser = SecurityUtils.getLoginUser();
243
+        // 当前登录用户的部门id 查询岗位id是否在内
244
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
245
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
246
+            return error("审核权限有误,请联系管理员!");
247
+        }
248
+        // 判断岗位是否在权限范围内
249
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
250
+        if (sysPost.getPostLevel() != 1) {
251
+            return error("审核权限有误,请联系管理员!");
252
+        }
253
+
170 254
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
171 255
     }
172 256
 }

+ 28 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedReportController.java

@@ -3,6 +3,14 @@ package com.ruoyi.postCheck.controller;
3 3
 import java.util.Date;
4 4
 import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6
+
7
+import com.ruoyi.common.core.domain.entity.SysDept;
8
+import com.ruoyi.common.core.domain.model.LoginUser;
9
+import com.ruoyi.common.enums.DeptCode;
10
+import com.ruoyi.common.utils.SecurityUtils;
11
+import com.ruoyi.system.domain.SysPost;
12
+import com.ruoyi.system.service.ISysDeptService;
13
+import com.ruoyi.system.service.ISysPostService;
6 14
 import org.springframework.security.access.prepost.PreAuthorize;
7 15
 import org.springframework.beans.factory.annotation.Autowired;
8 16
 import org.springframework.web.bind.annotation.GetMapping;
@@ -40,6 +48,13 @@ public class PostCheckedReportController extends BaseController
40 48
     @Autowired
41 49
     private IPostCheckedReportService postCheckedReportService;
42 50
 
51
+    @Autowired
52
+    private ISysDeptService sysDeptService;
53
+
54
+    @Autowired
55
+    private ISysPostService sysPostService;
56
+
57
+
43 58
     /**
44 59
      * 查询岗检报告管理列表
45 60
      */
@@ -211,6 +226,19 @@ public class PostCheckedReportController extends BaseController
211 226
     @Log(title = "岗检报告审核", businessType = BusinessType.UPDATE)
212 227
     @PutMapping("/statusApprove")
213 228
     public AjaxResult statusApprove(Long id, Integer status, String statusReason) {
229
+
230
+        // 判断审核的权限
231
+        LoginUser loginUser = SecurityUtils.getLoginUser();
232
+        // 当前登录用户的部门id 查询岗位id是否在内
233
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
234
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
235
+            return error("审核权限有误,请联系管理员!");
236
+        }
237
+        // 判断岗位是否在权限范围内
238
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
239
+        if (sysPost.getPostLevel() != 1) {
240
+            return error("审核权限有误,请联系管理员!");
241
+        }
214 242
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
215 243
     }
216 244
 

+ 7 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostAssessmentRulesServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.List;
5 5
 
6 6
 import com.ruoyi.common.constant.PostAssessmentRulesEnum;
7 7
 import com.ruoyi.common.constant.PostCheckedReportEnum;
8
+import com.ruoyi.common.core.domain.entity.SysUser;
9
+import com.ruoyi.common.core.domain.model.LoginUser;
8 10
 import com.ruoyi.common.utils.DateUtils;
9 11
 import com.ruoyi.common.utils.SecurityUtils;
10 12
 import com.ruoyi.postCheck.domain.PostCheckedReport;
@@ -133,12 +135,16 @@ public class PostAssessmentRulesServiceImpl extends ServiceImpl<PostAssessmentRu
133 135
         if (status == PostCheckedReportEnum.STATUS_BACK.getValue() && StringUtils.isBlank(statusReason)) {
134 136
             return 0;
135 137
         }
136
-
138
+        LoginUser loginUser = SecurityUtils.getLoginUser();
139
+        SysUser sysUser = loginUser.getUser();
137 140
         PostAssessmentRules data = new PostAssessmentRules();
138 141
         data.setId(id);
139 142
         data.setStatus(status);
140 143
         data.setStatusApproveTime(new Date());
141 144
         data.setStatusReason(statusReason);
145
+        data.setStatusByUserId(sysUser.getUserId());
146
+        data.setStatusByUserName(sysUser.getUserName());
147
+        data.setStatusApproveTime(DateUtils.getNowDate());
142 148
         return postAssessmentRulesMapper.updatePostAssessmentRules(data);
143 149
     }
144 150
 }

+ 6 - 8
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedReportServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.List;
5 5
 
6 6
 import com.ruoyi.common.constant.PostCheckedProblemEnum;
7 7
 import com.ruoyi.common.constant.PostCheckedReportEnum;
8
+import com.ruoyi.common.core.domain.entity.SysUser;
9
+import com.ruoyi.common.core.domain.model.LoginUser;
8 10
 import com.ruoyi.common.utils.DateUtils;
9 11
 import com.ruoyi.common.utils.SecurityUtils;
10 12
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
@@ -135,17 +137,13 @@ public class PostCheckedReportServiceImpl extends ServiceImpl<PostCheckedReportM
135 137
         if (status == PostCheckedReportEnum.STATUS_BACK.getValue() && StringUtils.isBlank(statusReason)) {
136 138
             return 0;
137 139
         }
138
-
139
-        //TODO 权限判断
140
-        //1、内控法务部审核->部门下的3个经理级别的岗位(部门经理(1个)、部门副经理(2个)、党总支部副书记(1个))下面的人员(4个人):
141
-        //
142
-        //
143
-        //
144
-
145
-
140
+        LoginUser loginUser = SecurityUtils.getLoginUser();
141
+        SysUser sysUser = loginUser.getUser();
146 142
         PostCheckedReport data = new PostCheckedReport();
147 143
         data.setId(id);
148 144
         data.setStatus(status);
145
+        data.setStatusByUserId(sysUser.getUserId());
146
+        data.setStatusByUserName(sysUser.getUserName());
149 147
         data.setStatusApproveTime(new Date());
150 148
         data.setStatusReason(statusReason);
151 149
         return postCheckedReportMapper.updatePostCheckedReport(data);

+ 3 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostProgrammeServiceImpl.java

@@ -173,7 +173,9 @@ public class PostProgrammeServiceImpl extends ServiceImpl<PostProgrammeMapper, P
173 173
         data.setStatusIcfa(statusIcfa);
174 174
         data.setReasonIcfa(reasonIcfa);
175 175
         data.setStatus(statusIcfa);//最终审核结果
176
-        data.setStep(PostProgrammeEnum.STEP_ICFA.getValue());
176
+        if (statusIcfa == PostProgrammeEnum.STATUS_ICFA_PASS.getValue()) {
177
+            data.setStep(PostProgrammeEnum.STEP_ICFA.getValue());
178
+        }
177 179
         data.setStatusIcfaUserId(SecurityUtils.getUserId());
178 180
         data.setDateIcfa(DateUtils.getNowDate());
179 181
         return postProgrammeMapper.updatePostProgramme(data);