Commit 361f64034fa7cc9b8be11fea912f20111bcc58a9
1 parent
15247f0544
Exists in
master
and in
6 other branches
逗号改括号
Showing 2 changed files with 4 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java
View file @
361f640
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | |
33 | 33 | @RequestMapping(value = "/get/area/id", method = RequestMethod.GET) |
34 | 34 | @ResponseBody |
35 | - public BaseResponse getAreaId(@RequestParam String provinceName, @RequestParam String cityName, String areaName) { | |
35 | + public BaseResponse getAreaId(@RequestParam String provinceName, String cityName, String areaName) { | |
36 | 36 | return areaCountFacade.getAreaId(provinceName, cityName, areaName); |
37 | 37 | } |
38 | 38 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java
View file @
361f640
... | ... | @@ -873,6 +873,9 @@ |
873 | 873 | public BaseResponse getAreaId(String provinceName, String cityName, String areaName) { |
874 | 874 | BasicConfig province = mongoTemplate.findOne(Query.query(Criteria.where("name").is(provinceName).and("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd")), BasicConfig.class); |
875 | 875 | if (province != null) { |
876 | + if(StringUtils.isEmpty(cityName)) { | |
877 | + return RespBuilder.buildSuccess(province.getId()); | |
878 | + } | |
876 | 879 | List<BasicConfig> citys = mongoTemplate.find(Query.query(Criteria.where("parentId").is(province.getId()).and("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd")), BasicConfig.class); |
877 | 880 | for (BasicConfig city : citys) { |
878 | 881 | if (cityName.equals(city.getName())) { |