Commit 12ebbc5ebfb418bb51901a24503a24b440d5119d
1 parent
82367bfec8
Exists in
master
and in
1 other branch
bug fix
Showing 2 changed files with 21 additions and 15 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
View file @
12ebbc5
... | ... | @@ -36,13 +36,15 @@ |
36 | 36 | @Override |
37 | 37 | public Organization getOrganization(Integer id) { |
38 | 38 | Organization organization = organizationMapper.getOrganization(id); |
39 | - //设置机构类型 0 公司 1 医院 | |
40 | - if(null != organization.getType() && | |
41 | - (organization.getType().equals(OrganizationTypeEnum.NY.getId()) || organization.getType().equals(OrganizationTypeEnum.FB.getId()) || | |
42 | - organization.getType().equals(OrganizationTypeEnum.TY.getId())|| organization.getType().equals(OrganizationTypeEnum.JMQY.getId()))) { | |
43 | - organization.setOrgType(1); | |
44 | - } else { | |
45 | - organization.setOrgType(0); | |
39 | + if(null != organization) { | |
40 | + //设置机构类型 0 公司 1 医院 | |
41 | + if( null != organization.getType() && | |
42 | + (organization.getType().equals(OrganizationTypeEnum.NY.getId()) || organization.getType().equals(OrganizationTypeEnum.FB.getId()) || | |
43 | + organization.getType().equals(OrganizationTypeEnum.TY.getId())|| organization.getType().equals(OrganizationTypeEnum.JMQY.getId()))) { | |
44 | + organization.setOrgType(1); | |
45 | + } else { | |
46 | + organization.setOrgType(0); | |
47 | + } | |
46 | 48 | } |
47 | 49 | return organization; |
48 | 50 | } |
... | ... | @@ -60,13 +62,15 @@ |
60 | 62 | List<Organization> organizations = organizationMapper.queryOrganization(query); |
61 | 63 | if(CollectionUtils.isNotEmpty(organizations)) { |
62 | 64 | for(Organization organization : organizations) { |
63 | - //设置机构类型 0 公司 1 医院 | |
64 | - if(null != organization.getType() && | |
65 | - (organization.getType().equals(OrganizationTypeEnum.NY.getId()) || organization.getType().equals(OrganizationTypeEnum.FB.getId()) || | |
66 | - organization.getType().equals(OrganizationTypeEnum.TY.getId())|| organization.getType().equals(OrganizationTypeEnum.JMQY.getId()))) { | |
67 | - organization.setOrgType(1); | |
68 | - } else { | |
69 | - organization.setOrgType(0); | |
65 | + if(null != organization) { | |
66 | + //设置机构类型 0 公司 1 医院 | |
67 | + if( null != organization.getType() && | |
68 | + (organization.getType().equals(OrganizationTypeEnum.NY.getId()) || organization.getType().equals(OrganizationTypeEnum.FB.getId()) || | |
69 | + organization.getType().equals(OrganizationTypeEnum.TY.getId())|| organization.getType().equals(OrganizationTypeEnum.JMQY.getId()))) { | |
70 | + organization.setOrgType(1); | |
71 | + } else { | |
72 | + organization.setOrgType(0); | |
73 | + } | |
70 | 74 | } |
71 | 75 | } |
72 | 76 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
View file @
12ebbc5
... | ... | @@ -191,6 +191,8 @@ |
191 | 191 | page = page == null ? 1 : page; |
192 | 192 | |
193 | 193 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
194 | + Users users = usersService.getUsers(loginState.getId()); | |
195 | + | |
194 | 196 | DepartmentsQuery departmentsQuery = new DepartmentsQuery(); |
195 | 197 | departmentsQuery.setNeed("true"); |
196 | 198 | departmentsQuery.setSort("id desc"); |
... | ... | @@ -200,7 +202,7 @@ |
200 | 202 | departmentsQuery.setOrgId(orgId); |
201 | 203 | } else if (CollectionUtils.isNotEmpty(orgId1)){ |
202 | 204 | departmentsQuery.setOrgList(orgId1); |
203 | - } else { | |
205 | + } else if(!new Integer(2).equals(users.getType())){ //不是超级管理员 | |
204 | 206 | FrontEndResult frontEndResult = new FrontEndResult(); |
205 | 207 | frontEndResult.setPageInfo(departmentsQuery.getPageInfo()); |
206 | 208 | frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); |