Browse Source

岗位bug

zwj 10 months ago
parent
commit
34c9be4d70

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

@@ -195,8 +195,7 @@ public class PostAssessmentRulesController extends BaseController
195
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
195
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
196
         }
196
         }
197
         // 判断岗位是否在权限范围内
197
         // 判断岗位是否在权限范围内
198
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
199
-        if (sysPost.getPostLevel() != 1) {
198
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
200
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
199
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
201
         }
200
         }
202
 
201
 
@@ -227,8 +226,7 @@ public class PostAssessmentRulesController extends BaseController
227
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
226
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
228
         }
227
         }
229
         // 判断岗位是否在权限范围内
228
         // 判断岗位是否在权限范围内
230
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
231
-        if (sysPost.getPostLevel() != 1) {
229
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
232
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
230
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
233
         }
231
         }
234
 
232
 
@@ -258,11 +256,9 @@ public class PostAssessmentRulesController extends BaseController
258
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
256
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
259
         }
257
         }
260
         // 判断岗位是否在权限范围内
258
         // 判断岗位是否在权限范围内
261
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
262
-        if (sysPost.getPostLevel() != 1) {
259
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
263
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
260
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
264
         }
261
         }
265
-
266
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
262
         return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
267
     }
263
     }
268
 }
264
 }

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

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
10
 import com.ruoyi.common.enums.DeptCode;
10
 import com.ruoyi.common.enums.DeptCode;
11
 import com.ruoyi.common.utils.SecurityUtils;
11
 import com.ruoyi.common.utils.SecurityUtils;
12
 import com.ruoyi.system.domain.SysPost;
12
 import com.ruoyi.system.domain.SysPost;
13
+import com.ruoyi.system.domain.UserPostAuthority;
13
 import com.ruoyi.system.service.ISysDeptService;
14
 import com.ruoyi.system.service.ISysDeptService;
14
 import com.ruoyi.system.service.ISysPostService;
15
 import com.ruoyi.system.service.ISysPostService;
15
 import org.springframework.security.access.prepost.PreAuthorize;
16
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -240,8 +241,7 @@ public class PostCheckedReportController extends BaseController
240
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
241
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
241
         }
242
         }
242
         // 判断岗位是否在权限范围内
243
         // 判断岗位是否在权限范围内
243
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
244
-        if (sysPost.getPostLevel() != 1) {
244
+        if (!sysPostService.userHaveAuthority(sysDept.getDeptId())) {
245
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
245
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
246
         }
246
         }
247
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
247
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));

+ 2 - 4
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostPlanController.java

@@ -237,8 +237,7 @@ public class PostPlanController extends BaseController {
237
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
237
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
238
         }
238
         }
239
         // 判断岗位是否在权限范围内
239
         // 判断岗位是否在权限范围内
240
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
241
-        if (sysPost.getPostLevel() != 1) {
240
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
242
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
241
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
243
         }
242
         }
244
 
243
 
@@ -281,8 +280,7 @@ public class PostPlanController extends BaseController {
281
         }
280
         }
282
 
281
 
283
         // 判断岗位是否在权限范围内
282
         // 判断岗位是否在权限范围内
284
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
285
-        if (sysPost.getPostLevel() != 1) {
283
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
286
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
284
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
287
         }
285
         }
288
 
286
 

+ 2 - 6
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostProgrammeController.java

@@ -222,10 +222,7 @@ public class PostProgrammeController extends BaseController {
222
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {
222
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {
223
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
223
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
224
         }
224
         }
225
-
226
-        // 判断岗位是否在权限范围内
227
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
228
-        if (sysPost.getPostLevel() != 1) {
225
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
229
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
226
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
230
         }
227
         }
231
         return toAjax(postProgrammeService.approveHr(id, statusHr, reasonHr));
228
         return toAjax(postProgrammeService.approveHr(id, statusHr, reasonHr));
@@ -264,8 +261,7 @@ public class PostProgrammeController extends BaseController {
264
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
261
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
265
         }
262
         }
266
         // 判断岗位是否在权限范围内
263
         // 判断岗位是否在权限范围内
267
-        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
268
-        if (sysPost.getPostLevel() != 1) {
264
+        if (!sysPostService.userHaveAuthority(loginUser.getDeptId())) {
269
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
265
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
270
         }
266
         }
271
         return toAjax(postProgrammeService.approveIcfa(id, statusIcfa, reasonIcfa));
267
         return toAjax(postProgrammeService.approveIcfa(id, statusIcfa, reasonIcfa));

+ 0 - 8
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java

@@ -99,13 +99,5 @@ public interface SysPostMapper {
99
      */
99
      */
100
     public SysPost checkPostCodeUnique(String postCode);
100
     public SysPost checkPostCodeUnique(String postCode);
101
 
101
 
102
-    /**
103
-     * 根据部门查询岗位
104
-     *
105
-     * @param deptId
106
-     * @return
107
-     */
108
-    public SysPost selectPostByDeptId(Long deptId);
109
-
110
     List<UserPostAuthority> userPostAuthorityList(@Param("deptId") Long deptId, @Param("postLevel") Integer postLevel);
102
     List<UserPostAuthority> userPostAuthorityList(@Param("deptId") Long deptId, @Param("postLevel") Integer postLevel);
111
 }
103
 }

+ 0 - 6
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java

@@ -99,12 +99,6 @@ public interface ISysPostService
99
      */
99
      */
100
     public int updatePost(SysPost post);
100
     public int updatePost(SysPost post);
101
 
101
 
102
-    /**
103
-     * 根据部门查询岗位
104
-     * @param deptId
105
-     * @return
106
-     */
107
-    public SysPost selectPostByDeptId(Long deptId);
108
 
102
 
109
     /**
103
     /**
110
      * 查询部门经理级别岗位下的人员列表
104
      * 查询部门经理级别岗位下的人员列表

+ 0 - 10
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java

@@ -168,16 +168,6 @@ public class SysPostServiceImpl implements ISysPostService {
168
         return postMapper.updatePost(post);
168
         return postMapper.updatePost(post);
169
     }
169
     }
170
 
170
 
171
-    /**
172
-     * 根据部门查询岗位
173
-     *
174
-     * @param deptId
175
-     * @return
176
-     */
177
-    @Override
178
-    public SysPost selectPostByDeptId(Long deptId) {
179
-        return postMapper.selectPostByDeptId(deptId);
180
-    }
181
 
171
 
182
     /**
172
     /**
183
      * 查询部门经理级别岗位下的人员列表
173
      * 查询部门经理级别岗位下的人员列表

+ 0 - 6
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -131,12 +131,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
131
  	</delete>
131
  	</delete>
132
 
132
 
133
 
133
 
134
-	<select id="selectPostByDeptId" parameterType="Long" resultMap="SysPostResult">
135
-		<include refid="selectPostVo"/>
136
-		where p.dept_id = #{deptId}
137
-	</select>
138
-
139
-
140
 	<select id="userPostAuthorityList"  resultType="UserPostAuthority">
134
 	<select id="userPostAuthorityList"  resultType="UserPostAuthority">
141
 		SELECT
135
 		SELECT
142
 			su."user_id" as userId,
136
 			su."user_id" as userId,