Commit 6d3a7ba565864259a18a7876c9d1cd65c5748cb7
1 parent
843b670967
Exists in
master
and in
1 other branch
add extends BaseModel
Showing 2 changed files with 31 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
6d3a7ba
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
234 | 234 | Users users = usersService.getUsers(loginState.getId()); |
235 | 235 | |
236 | - List<Integer> areaId = autoMatchFacade.matchOrgId(loginState.getId()); | |
236 | + List<Integer> areaId = autoMatchFacade.matchAreaOrgId(loginState.getId()); | |
237 | 237 | List<Object> data = new ArrayList<>(); |
238 | 238 | List<Organization> organizations = new ArrayList<>(); |
239 | 239 | PageInfo pageInfo = new PageInfo(0,0,0,1); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
View file @
6d3a7ba
... | ... | @@ -76,8 +76,37 @@ |
76 | 76 | } |
77 | 77 | return null; |
78 | 78 | } |
79 | + | |
80 | + public List<Integer> matchAreaOrgId(int userId){ | |
81 | + UsersQuery usersQuery = new UsersQuery(); | |
82 | + usersQuery.setId(userId); | |
83 | + | |
84 | + usersQuery.setYn(1); | |
85 | + List<Users> list = usersService.queryUsers(usersQuery); | |
86 | + List<Integer> data = new ArrayList<>(); | |
87 | + if (CollectionUtils.isNotEmpty(list)) { | |
88 | + | |
89 | + /**/ //用户角色 | |
90 | + if (UserTypeEnum.NORMAL_USER.getId().equals(list.get(0).getType())||UserTypeEnum.PLATFORM_ADMIN.getId().equals(list.get(0).getType())) { | |
91 | + List<Organization> list2 = accessPermissionFacade.getOrganization(accessPermissionFacade.findAccessPerminssionByUserId(list.get(0).getId())); | |
92 | + if(CollectionUtils.isNotEmpty(list2)){ | |
93 | + for(Organization organization:list2){ | |
94 | + data.add(organization.getId()); | |
95 | + } | |
96 | + } | |
97 | + if (!data.contains(list.get(0).getOrgId())) { | |
98 | + data.add(list.get(0).getOrgId()); | |
99 | + } | |
100 | + } else if(UserTypeEnum.SUPPER_ADMIN.getId().equals(list.get(0).getType())) { | |
101 | + return null; | |
102 | + } | |
103 | + return data; | |
104 | + } | |
105 | + return null; | |
106 | + } | |
107 | + | |
79 | 108 | public String getHospitalId(Integer userId){ |
80 | - List<Integer> list = matchOrgId(userId); | |
109 | + List<Integer> list = matchAreaOrgId(userId); | |
81 | 110 | if(null==list||CollectionUtils.isEmpty(list)){ |
82 | 111 | return null; |
83 | 112 | } |