From 3447cc7ba6af05b181a293e838525096f6c05405 Mon Sep 17 00:00:00 2001 From: "rui.zhang" Date: Mon, 9 May 2016 09:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20bug=20fix=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E6=9C=BA=E6=9E=84=E5=88=86=E9=A1=B5?= =?UTF-8?q?=20=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/OrganizationController.java | 50 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java index d48032b..bb73597 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java @@ -224,7 +224,8 @@ public class OrganizationController extends BaseController { @TokenRequired public FrontEndResult getOrganization(HttpServletRequest request, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "limit", required = false) Integer limit, - @RequestParam(value = "keyword", required = false) String keyword) { + @RequestParam(value = "keyword", required = false) String keyword, + @RequestParam(value = "areaId", required = false) String aId) { LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); List areaId = autoMatchFacade.matchOrgId(loginState.getId()); @@ -240,6 +241,29 @@ public class OrganizationController extends BaseController { organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); } + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId); + if(null != basicConfig) { + if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) { + organizationQuery.setProvinceId(aId); + } else { + BasicConfig p1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); + if (p1 != null && SystemConfig.CHINA_BASIC_ID.equals(p1.getParentId())) { + organizationQuery.setCityId(aId); + } else { + BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId()); + if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) { + organizationQuery.setAreaId(aId); + } else { +// BasicConfig p3 = basicConfigService.getOneBasicConfigById(p1.getParentId()); +// if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p3.getParentId())) { + organizationQuery.setStreetId(aId); +// } + } + } + } + } + + organizationQuery.setYn(YnEnums.YES.getId()); organizationQuery.setIdList(areaId); organizationQuery.setKeyword(keyword); @@ -267,6 +291,30 @@ public class OrganizationController extends BaseController { organizationQuery.setLimit(limit); organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); } + + + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId); + if(null != basicConfig) { + if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) { + organizationQuery.setProvinceId(aId); + } else { + BasicConfig p1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); + if (p1 != null && SystemConfig.CHINA_BASIC_ID.equals(p1.getParentId())) { + organizationQuery.setCityId(aId); + } else { + BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId()); + if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) { + organizationQuery.setAreaId(aId); + } else { +// BasicConfig p3 = basicConfigService.getOneBasicConfigById(p1.getParentId()); +// if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p3.getParentId())) { + organizationQuery.setStreetId(aId); +// } + } + } + } + } + organizationQuery.setYn(YnEnums.YES.getId()); organizations = organizationService.queryOrganization(organizationQuery); pageInfo = organizationQuery.getPageInfo(); -- 1.8.3.1