Commit f780e8710ea302465df629ad7cb999e5d6f74e75
1 parent
379046918a
Exists in
master
and in
1 other branch
platform permission
add return pageinfo
Showing 2 changed files with 20 additions and 2 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
View file @
f780e87
... | ... | @@ -86,6 +86,20 @@ |
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | + //查询小区根据ID | |
90 | + public CommunityConfig getCommunityById(String id) { | |
91 | + MongoCondition mongoCondition = MongoCondition.newInstance(); | |
92 | + mongoCondition.andCondition(new MongoCondition("yn", YnEnums.YES.getId(), MongoOper.IS).and("type", 1, MongoOper.IS).and("id", id, MongoOper.IS)); | |
93 | + MongoQuery mongoQuery = mongoCondition.toMongoQuery(); | |
94 | + List<CommunityConfig> communityConfigs = communityConfigDao.queryArea(mongoQuery); | |
95 | + | |
96 | + if(communityConfigs.size() > 0) { | |
97 | + return communityConfigs.get(0); | |
98 | + } | |
99 | + return null; | |
100 | + } | |
101 | + | |
102 | + | |
89 | 103 | //查询区域根据PID |
90 | 104 | public List<CommunityConfig> queryAreaByParentId(String pid) { |
91 | 105 | if(null == pid) return null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
View file @
f780e87
... | ... | @@ -55,9 +55,13 @@ |
55 | 55 | for(String tmp : communityConfigRequest.getNames()) { |
56 | 56 | names += ", " + tmp; |
57 | 57 | } |
58 | - CommunityConfig communityConfig = new CommunityConfig(); | |
58 | + | |
59 | + | |
60 | + CommunityConfig communityConfig = communityConfigService.getCommunityById(communityConfigRequest.getId()); | |
61 | + if(null == communityConfig) return null; | |
62 | + | |
59 | 63 | communityConfig.setId(communityConfigRequest.getId()); |
60 | - communityConfig.setGxxq(names.substring(1, names.length())); | |
64 | + communityConfig.setGxxq(communityConfig.getGxxq() + ", " + names.substring(1, names.length())); | |
61 | 65 | |
62 | 66 | communityConfigService.updateArea(communityConfig); |
63 | 67 |