|
@@ -2284,8 +2284,22 @@ public class ReceptionController extends BaseController {
|
|
return AjaxResponse.fail(1, "区域为空");
|
|
return AjaxResponse.fail(1, "区域为空");
|
|
|
|
|
|
}
|
|
}
|
|
- //获取下级区域
|
|
|
|
- List<Area> areas = areaService.selectByParentId(topAreaId);
|
|
|
|
|
|
+
|
|
|
|
+ // 判断是否是村
|
|
|
|
+ Boolean isVillage = false;
|
|
|
|
+ Area topArea = areaService.selectByPrimaryKey(topAreaId);
|
|
|
|
+ if (Optional.ofNullable(topArea).map(Area::getRegionCode).filter(item -> item.length() == 12).isPresent()) {
|
|
|
|
+ isVillage = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取下级区域
|
|
|
|
+ List<Area> areas = new ArrayList<>();
|
|
|
|
+ if (!isVillage) {
|
|
|
|
+ areas = areaService.selectByParentId(topAreaId);
|
|
|
|
+ } else {
|
|
|
|
+ areas.add(topArea);
|
|
|
|
+ }
|
|
|
|
+
|
|
//数据及初始化
|
|
//数据及初始化
|
|
List<ReceptionApiDTO> result = new ArrayList<>();
|
|
List<ReceptionApiDTO> result = new ArrayList<>();
|
|
ReceptionApiDTO receptionApiDTO;
|
|
ReceptionApiDTO receptionApiDTO;
|