Browse Source

国家创建银行角色报错

lfy 1 week ago
parent
commit
4c19376b2d

+ 16 - 14
delivery-module-system/delivery-module-system-biz/src/main/java/com/unis/module/system/controller/admin/user/UserController.java

@@ -83,23 +83,25 @@ public class UserController {
83 83
         if (ObjectUtils.isEmpty(loginUser)) {
84 84
             throw exception(ERROR, "不存在用户信息");
85 85
         }
86
-        String roles = loginUser.getInfo().get("roleIds");
87
-        if (ObjectUtils.isEmpty(roles)) {
88
-            throw exception(ERROR, "当前用户不存在角色信息");
89
-        }
90
-        if (roles.contains("[") && roles.contains("]")) {
91
-            String roleIdsReal = roles.substring(1, roles.length() - 1);
92
-            String[] items = roleIdsReal.split(",");
93
-            List<String> roleIdList = Arrays.asList(items);
94
-            if (roleIdList.contains(RoleIdEnum.BANK_ADMIN.getRoleId())) {
95
-                String bankType = loginUser.getInfo().get("bankType");
96
-                if (StringUtils.isBlank(bankType)) {
97
-                    throw exception(ERROR, "当前银行用户不存在银行信息");
86
+        String areaLevel = loginUser.getInfo().get("areaLevel");
87
+        if (!ObjectUtil.isEmpty(areaLevel)) {
88
+            String roles = loginUser.getInfo().get("roleIds");
89
+            if (ObjectUtils.isEmpty(roles)) {
90
+                throw exception(ERROR, "当前用户不存在角色信息");
91
+            }
92
+            if (roles.contains("[") && roles.contains("]")) {
93
+                String roleIdsReal = roles.substring(1, roles.length() - 1);
94
+                String[] items = roleIdsReal.split(",");
95
+                List<String> roleIdList = Arrays.asList(items);
96
+                if (roleIdList.contains(RoleIdEnum.BANK_ADMIN.getRoleId())) {
97
+                    String bankType = loginUser.getInfo().get("bankType");
98
+                    if (StringUtils.isBlank(bankType)) {
99
+                        throw exception(ERROR, "当前银行用户不存在银行信息");
100
+                    }
101
+                    reqVO.setBankType(bankType);
98 102
                 }
99
-                reqVO.setBankType(bankType);
100 103
             }
101 104
         }
102
-        String areaLevel = loginUser.getInfo().get("areaLevel");
103 105
         // 国家交易中心创建银行角色
104 106
         if ("0".equals(areaLevel) || ObjectUtil.isEmpty(areaLevel)) {
105 107
             if (roleIds.contains(Long.valueOf(RoleIdEnum.BANK_ADMIN.getRoleId()))){