Browse Source

sso陌生人导览网格列表 增加customerId校验 从token中获取客户Id

dev_shibei_match
wangchao 5 years ago
parent
commit
182bfe798d
  1. 2
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
  2. 2
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
  3. 26
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

2
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java

@ -89,7 +89,7 @@ public class StrangerResiGuideController {
* @date 2021.01.18 16:39
*/
@PostMapping("sso/publiclocationgridlist")
Result<List<CustomerGridForStrangerResultDTO>> locationGridList(@LoginUser TokenDto dto,@RequestBody CustomerGridListFormDTO customerGridListFormDTO){
Result<List<PublicCustomerGridForStrangerResultDTO>> locationGridList(@LoginUser TokenDto dto,@RequestBody CustomerGridListFormDTO customerGridListFormDTO){
ValidatorUtils.validateEntity(customerGridListFormDTO);
if(null == dto || StringUtils.isEmpty(dto.getCustomerId())) throw new ValidateException("无法获取客户Id");
return strangerAccessRecordService.listCustomerGridH5(customerGridListFormDTO,dto.getCustomerId());

2
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java

@ -128,6 +128,6 @@ public interface StrangerAccessRecordService extends BaseService<StrangerAccessR
* @author wangc
* @date 2021.01.18 16:39
*/
Result<List<CustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId);
Result<List<PublicCustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId);
}

26
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

@ -312,26 +312,24 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
* @date 2021.01.18 16:39
*/
@Override
public Result<List<CustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId) {
ListCustomerGridFormDTO listCustomerGridFormDTO = new ListCustomerGridFormDTO();
listCustomerGridFormDTO.setAreaCode(StringUtils.isBlank(customerGridListFormDTO.getSelectedAreaCode()) ?
customerGridListFormDTO.getAreaCode() : customerGridListFormDTO.getSelectedAreaCode());
listCustomerGridFormDTO.setPageNo(null == customerGridListFormDTO.getPageNo() ? ModuleConstant.MIN_CURRENT_PAGE_NO : customerGridListFormDTO.getPageNo());
listCustomerGridFormDTO.setPageSize(customerGridListFormDTO.getPageSize());
listCustomerGridFormDTO.setCustomerId(customerId);
Result<List<CustomerGridForStrangerResultDTO>> queryResult =
public Result<List<PublicCustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId) {
ThirdCustomerGridListFormDTO gridParam = new ThirdCustomerGridListFormDTO();
gridParam.setAreaCode(StringUtils.isBlank(customerGridListFormDTO.getSelectedAreaCode()) ?
customerGridListFormDTO.getAreaCode() : customerGridListFormDTO.getSelectedAreaCode());
gridParam.setPageNo(null == customerGridListFormDTO.getPageNo() ? ModuleConstant.MIN_CURRENT_PAGE_NO : customerGridListFormDTO.getPageNo());
gridParam.setPageSize(customerGridListFormDTO.getPageSize());
gridParam.setCustomerId(customerId);
Result<List<PublicCustomerGridForStrangerResultDTO>> queryResult =
govOrgFeignClient
.queryGridListByAreaCode(listCustomerGridFormDTO);
.queryCustomerGridList(gridParam);
//Feign调用成功
if (queryResult.success()) {
List<CustomerGridForStrangerResultDTO> queryList = queryResult.getData();
List<PublicCustomerGridForStrangerResultDTO> queryList = queryResult.getData();
if (null != queryResult && queryList.size() > 0) {
StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity();
strangerTrance.setLocationAreaCode(listCustomerGridFormDTO.getAreaCode());
strangerTrance.setLocationAreaCode(gridParam.getAreaCode());
strangerTrance.setIsAuthorized(customerGridListFormDTO.getIsAuthorized());
strangerTrance.setGridNumber(queryList.size());
strangerTrance.setVisitTime(new Date());

Loading…
Cancel
Save