zwj 10 månader sedan
förälder
incheckning
0b4a6ab25d

+ 36 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/PostLevelEnum.java

@@ -0,0 +1,36 @@
1
+package com.ruoyi.common.constant;
2
+
3
+/**
4
+ * @author zwj
5
+ * @date 2024-01-10 09:29
6
+ */
7
+public enum PostLevelEnum {
8
+
9
+    //   //岗位级别:0-不设置;1-经理;
10
+    DEFAULT("不设置", 0),
11
+    SET_MANAGER("经理;", 1);
12
+
13
+    private String name;
14
+    private Integer value;
15
+
16
+    PostLevelEnum(String name, Integer value) {
17
+        this.name = name;
18
+        this.value = value;
19
+    }
20
+
21
+    public String getName() {
22
+        return name;
23
+    }
24
+
25
+    public void setName(String name) {
26
+        this.name = name;
27
+    }
28
+
29
+    public Integer getValue() {
30
+        return value;
31
+    }
32
+
33
+    public void setValue(Integer value) {
34
+        this.value = value;
35
+    }
36
+}

+ 2 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.List;
4 4
 import java.util.stream.Collectors;
5 5
 
6 6
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
7
+import com.ruoyi.common.constant.PostLevelEnum;
7 8
 import com.ruoyi.common.exception.base.BaseException;
8 9
 import com.ruoyi.common.utils.SecurityUtils;
9 10
 import com.ruoyi.system.domain.UserPostAuthority;
@@ -190,11 +191,9 @@ public class SysPostServiceImpl implements ISysPostService {
190 191
      */
191 192
     @Override
192 193
     public boolean userHaveAuthority(Long deptId) {
193
-        Integer postLevel = 1;//岗位级别:0-不设置;1-经理;
194 194
         Long userId = SecurityUtils.getUserId();
195
-
196 195
         // 判断岗位是否在权限范围内
197
-        List<UserPostAuthority> userPostAuthorityList = userPostAuthorityList(deptId, postLevel);
196
+        List<UserPostAuthority> userPostAuthorityList = userPostAuthorityList(deptId, PostLevelEnum.SET_MANAGER.getValue());
198 197
         if (CollectionUtils.isEmpty(userPostAuthorityList)) {
199 198
             return false;
200 199
         }