Commit 8cc717fd6772a7c9d1a0a9b5062d1a84f863bf55

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 1 changed file

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java View file @ 8cc717f
... ... @@ -230,7 +230,8 @@
230 230 @TokenRequired
231 231 public FrontEndResult getOrganization(HttpServletRequest request, @RequestParam(value = "page", required = false) Integer page,
232 232 @RequestParam(value = "limit", required = false) Integer limit,
233   - @RequestParam(value = "keyword", required = false) String keyword) {
  233 + @RequestParam(value = "keyword", required = false) String keyword,
  234 + @RequestParam(value = "areaId", required = false) String aId) {
234 235 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
235 236  
236 237 List<Integer> areaId = autoMatchFacade.matchOrgId(loginState.getId());
... ... @@ -246,6 +247,29 @@
246 247 organizationQuery.setSort("province_id desc,city_id desc,area_id desc");
247 248 }
248 249  
  250 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId);
  251 + if(null != basicConfig) {
  252 + if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) {
  253 + organizationQuery.setProvinceId(aId);
  254 + } else {
  255 + BasicConfig p1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId());
  256 + if (p1 != null && SystemConfig.CHINA_BASIC_ID.equals(p1.getParentId())) {
  257 + organizationQuery.setCityId(aId);
  258 + } else {
  259 + BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId());
  260 + if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) {
  261 + organizationQuery.setAreaId(aId);
  262 + } else {
  263 +// BasicConfig p3 = basicConfigService.getOneBasicConfigById(p1.getParentId());
  264 +// if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p3.getParentId())) {
  265 + organizationQuery.setStreetId(aId);
  266 +// }
  267 + }
  268 + }
  269 + }
  270 + }
  271 +
  272 +
249 273 organizationQuery.setYn(YnEnums.YES.getId());
250 274 organizationQuery.setIdList(areaId);
251 275 organizationQuery.setKeyword(keyword);
... ... @@ -273,6 +297,30 @@
273 297 organizationQuery.setLimit(limit);
274 298 organizationQuery.setSort("province_id desc,city_id desc,area_id desc");
275 299 }
  300 +
  301 +
  302 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId);
  303 + if(null != basicConfig) {
  304 + if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) {
  305 + organizationQuery.setProvinceId(aId);
  306 + } else {
  307 + BasicConfig p1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId());
  308 + if (p1 != null && SystemConfig.CHINA_BASIC_ID.equals(p1.getParentId())) {
  309 + organizationQuery.setCityId(aId);
  310 + } else {
  311 + BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId());
  312 + if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) {
  313 + organizationQuery.setAreaId(aId);
  314 + } else {
  315 +// BasicConfig p3 = basicConfigService.getOneBasicConfigById(p1.getParentId());
  316 +// if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p3.getParentId())) {
  317 + organizationQuery.setStreetId(aId);
  318 +// }
  319 + }
  320 + }
  321 + }
  322 + }
  323 +
276 324 organizationQuery.setYn(YnEnums.YES.getId());
277 325 organizations = organizationService.queryOrganization(organizationQuery);
278 326 pageInfo = organizationQuery.getPageInfo();