Commit 852163d1 authored by 赵啸非's avatar 赵啸非

添加分类查询返回组

parent 6b8b178e
...@@ -572,12 +572,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -572,12 +572,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
List<SiteEntity> list = new ArrayList<>(); List<SiteEntity> list = new ArrayList<>();
for (AreaEntity areaEntity : areaEntities) { for (AreaEntity areaEntity : areaEntities) {
List<SiteEntity> siteEntityList = this.find(new SiteQuery().areaCode(areaEntity.getAreaCode())); List<SiteEntity> siteEntityList = this.find(new SiteQuery().areaCode(areaEntity.getAreaCode()));
if (!ObjectUtils.isEmpty(siteEntityList)) { if (!ObjectUtils.isEmpty(siteEntityList)) {
list.addAll(siteEntityList); list.addAll(siteEntityList);
} }
} }
list.stream().forEach(item -> {
AreaEntity areaEntity = areaService.getCache(item.getAreaCode());
if (!ObjectUtils.isEmpty(areaEntity)) {
item.setAreaLevel(areaEntity.getAreaLevel());
} else {
item.setAreaLevel(0);
}
});
return Rest.ok(list); return Rest.ok(list);
} }
...@@ -865,7 +873,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -865,7 +873,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
String matchCode = "511530000000".replaceAll("(0)+$", ""); String matchCode = "511530000000".replaceAll("(0)+$", "");
System.out.println(matchCode); System.out.println(matchCode);
matchCode=StrUtil.padAfter(matchCode,7,"0"); matchCode = StrUtil.padAfter(matchCode, 7, "0");
System.out.println(matchCode); System.out.println(matchCode);
......
...@@ -132,7 +132,7 @@ Content-Type: application/json ...@@ -132,7 +132,7 @@ Content-Type: application/json
POST {{baseUrl}}/site/getFlatSitesGroupByAreaCode POST {{baseUrl}}/site/getFlatSitesGroupByAreaCode
Content-Type: application/json Content-Type: application/json
{"areaName":"象鼻街道"} {}
###站点区域分组列表 ###站点区域分组列表
POST {{baseUrl}}/site/getSitesGroupByAreaLevel POST {{baseUrl}}/site/getSitesGroupByAreaLevel
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment