|
@ -19,6 +19,9 @@ package com.epmet.controller; |
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
|
|
import com.epmet.commons.tools.enums.OrgLevelEnum; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
import java.util.Set; |
|
|
import java.util.Set; |
|
@ -564,4 +568,54 @@ public class CustomerAgencyController { |
|
|
return new Result<PageData<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto)); |
|
|
return new Result<PageData<CommunityListByAgencyIdResultDTO>>().ok(customerAgencyService.getCommunityList(dto)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 返回区县列表 |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("districtList") |
|
|
|
|
|
public Result<List<CustomerAgencyDTO>> districtList(@LoginUser TokenDto tokenDto){ |
|
|
|
|
|
Map<String, Object> params=new HashMap<>(); |
|
|
|
|
|
params.put("CUSTOMER_ID",tokenDto.getCustomerId()); |
|
|
|
|
|
params.put("LEVEL",OrgLevelEnum.DISTRICT.getCode()); |
|
|
|
|
|
params.put("PID",null); |
|
|
|
|
|
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 返回街道列表,必传区县 |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @param districtId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("streetList/{districtId}") |
|
|
|
|
|
public Result<List<CustomerAgencyDTO>> streetList(@LoginUser TokenDto tokenDto,@PathVariable("districtId")String districtId){ |
|
|
|
|
|
if(StringUtils.isBlank(districtId)){ |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"districtId为空","请先选择区县"); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, Object> params=new HashMap<>(); |
|
|
|
|
|
params.put("CUSTOMER_ID",tokenDto.getCustomerId()); |
|
|
|
|
|
params.put("LEVEL",OrgLevelEnum.STREET.getCode()); |
|
|
|
|
|
params.put("PID",districtId); |
|
|
|
|
|
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 返回社区列表,街道必传 |
|
|
|
|
|
* @param tokenDto |
|
|
|
|
|
* @param streetId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("communityList/{streetId}") |
|
|
|
|
|
public Result<List<CustomerAgencyDTO>> communityList(@LoginUser TokenDto tokenDto,@PathVariable("streetId")String streetId){ |
|
|
|
|
|
if(StringUtils.isBlank(streetId)){ |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"streetId为空","请先选择街道"); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, Object> params=new HashMap<>(); |
|
|
|
|
|
params.put("CUSTOMER_ID",tokenDto.getCustomerId()); |
|
|
|
|
|
params.put("LEVEL",OrgLevelEnum.COMMUNITY.getCode()); |
|
|
|
|
|
params.put("PID",streetId); |
|
|
|
|
|
return new Result<List<CustomerAgencyDTO>>().ok(customerAgencyService.list(params)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|