Commit 4c90d48151f319c9e7444e05bfa10a97c0a2f91e
1 parent
474c7e9524
Exists in
master
and in
1 other branch
platform permission
add return pageinfo
Showing 3 changed files with 17 additions and 10 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/CommunityQuery.java
View file @
4c90d48
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | */ |
8 | 8 | public class CommunityQuery extends BaseQuery { |
9 | 9 | private String keyword; |
10 | - private String id; | |
10 | + private Integer id; | |
11 | 11 | private String level; |
12 | 12 | |
13 | 13 | public String getLevel() { |
14 | 14 | |
... | ... | @@ -18,11 +18,11 @@ |
18 | 18 | this.level = level; |
19 | 19 | } |
20 | 20 | |
21 | - public String getId() { | |
21 | + public Integer getId() { | |
22 | 22 | return id; |
23 | 23 | } |
24 | 24 | |
25 | - public void setId(String id) { | |
25 | + public void setId(Integer id) { | |
26 | 26 | this.id = id; |
27 | 27 | } |
28 | 28 |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
View file @
4c90d48
... | ... | @@ -47,11 +47,11 @@ |
47 | 47 | } |
48 | 48 | mongoCondition.and("yn", YnEnums.YES.getId(), MongoOper.IS); |
49 | 49 | if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("3")) { |
50 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("areaId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
50 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("areaId", communityQuery.getId(), MongoOper.IS)); | |
51 | 51 | } else if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("2")) { |
52 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("cityId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
52 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("cityId", communityQuery.getId(), MongoOper.IS)); | |
53 | 53 | } else if(null != communityQuery.getLevel() && communityQuery.getLevel().equals("1")) { |
54 | - mongoCondition = mongoCondition.andCondition(new MongoCondition("provinceId", Integer.parseInt(communityQuery.getId()), MongoOper.IS)); | |
54 | + mongoCondition = mongoCondition.andCondition(new MongoCondition("provinceId", communityQuery.getId(), MongoOper.IS)); | |
55 | 55 | } |
56 | 56 | MongoQuery mongoQuery = mongoCondition.toMongoQuery(); |
57 | 57 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
View file @
4c90d48
... | ... | @@ -99,11 +99,18 @@ |
99 | 99 | @TokenRequired |
100 | 100 | public FrontEndResult queryCommunity(CommunityQuery communityQuery) { |
101 | 101 | List<CommunityConfig> communityConfigList = communityConfigService.queryCommunity(communityQuery); |
102 | - Regions regions = regionsService.getRegions(Integer.valueOf(communityQuery.getId())); | |
103 | - if(null == regions) { | |
104 | - return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); | |
102 | + Regions regions = null; | |
103 | + if(null != communityQuery.getId()) { | |
104 | + regions = regionsService.getRegions(Integer.valueOf(communityQuery.getId())); | |
105 | + | |
106 | + if(null == regions) { | |
107 | + return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); | |
108 | + } | |
109 | + | |
110 | + communityQuery.setLevel(String.valueOf(regions.getLevel())); | |
105 | 111 | } |
106 | - communityQuery.setLevel(String.valueOf(regions.getLevel())); | |
112 | + | |
113 | + | |
107 | 114 | if(null != communityConfigList) { |
108 | 115 | return FrontEndResult.ini().setData(communityConfigList).setPageInfo(communityQuery.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("查询成功"); |
109 | 116 | } |