Commit 4a878cf610adffa6646c3f54d54bb8a8f4cdda39
1 parent
7db3bcb642
Exists in
master
and in
8 other branches
platform permission
add return pageinfo
Showing 4 changed files with 52 additions and 2 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
- platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationLevelEnum.java
- platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationTypeEnum.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
View file @
4a878cf
... | ... | @@ -20,6 +20,34 @@ |
20 | 20 | private Date created; |
21 | 21 | private String shortCode; |
22 | 22 | |
23 | + private String levelStr; | |
24 | + private String typeStr; | |
25 | + | |
26 | + public String getShortCode() { | |
27 | + return shortCode; | |
28 | + } | |
29 | + | |
30 | + public String getLevelStr() { | |
31 | + return levelStr; | |
32 | + } | |
33 | + | |
34 | + public void setLevelStr(String levelStr) { | |
35 | + this.levelStr = levelStr; | |
36 | + } | |
37 | + | |
38 | + public String getTypeStr() { | |
39 | + return typeStr; | |
40 | + } | |
41 | + | |
42 | + public void setTypeStr(String typeStr) { | |
43 | + this.typeStr = typeStr; | |
44 | + } | |
45 | + | |
46 | + public void setShortCode(String shortCode) { | |
47 | + this.shortCode = shortCode; | |
48 | + } | |
49 | + | |
50 | + | |
23 | 51 | public Integer getId() { |
24 | 52 | return id; |
25 | 53 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationLevelEnum.java
View file @
4a878cf
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import java.util.HashMap; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 机构级别 |
5 | 7 | * Created by Zhang.Rui on 2016/4/7. |
... | ... | @@ -34,5 +36,13 @@ |
34 | 36 | this.text = text; |
35 | 37 | } |
36 | 38 | |
39 | + public static String getById(int id) { | |
40 | + for (OrganizationLevelEnum e : OrganizationLevelEnum.values()) { | |
41 | + if(e.getId().equals(id)) { | |
42 | + return e.getText(); | |
43 | + } | |
44 | + } | |
45 | + return null; | |
46 | + } | |
37 | 47 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationTypeEnum.java
View file @
4a878cf
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
4a878cf
... | ... | @@ -5,6 +5,8 @@ |
5 | 5 | import com.lyms.platform.common.base.BaseController; |
6 | 6 | import com.lyms.platform.common.base.LoginContext; |
7 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
8 | +import com.lyms.platform.common.enums.OrganizationLevelEnum; | |
9 | +import com.lyms.platform.common.enums.OrganizationTypeEnum; | |
8 | 10 | import com.lyms.platform.common.enums.YnEnums; |
9 | 11 | import com.lyms.platform.common.utils.ResultUtils; |
10 | 12 | import com.lyms.platform.operate.web.result.FrontEndResult; |
... | ... | @@ -219,8 +221,10 @@ |
219 | 221 | |
220 | 222 | List<Organization> organizations = organizationService.queryOrganization(organizationQuery); |
221 | 223 | |
222 | - | |
223 | - | |
224 | + for(Organization organization : organizations) { | |
225 | + organization.setTypeStr(OrganizationLevelEnum.getById(organization.getLevel())); | |
226 | + organization.setLevelStr(OrganizationTypeEnum.getById(organization.getType())); | |
227 | + } | |
224 | 228 | |
225 | 229 | FrontEndResult frontEndResult = new FrontEndResult(); |
226 | 230 | frontEndResult.setData(organizations); |