Browse Source

/sso 根据地区码获取相关网格列表;获取用户最近访问的网格。

dev
wangchao 5 years ago
parent
commit
882af3333e
  1. 13
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java
  2. 10
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java
  3. 43
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  4. 12
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java
  5. 9
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java
  6. 26
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

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

@ -79,6 +79,19 @@ public class StrangerResiGuideController {
}
/**
* @Description H5版 自动/选定定位获取地附近网格列表
* @param customerGridListFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CustomerGridForStrangerResultDTO>>
* @author wangc
* @date 2021.01.18 16:39
*/
@PostMapping("sso/publiclocationgridlist")
Result<List<CustomerGridForStrangerResultDTO>> locationGridList(@RequestBody CustomerGridListFormDTO customerGridListFormDTO){
ValidatorUtils.validateEntity(customerGridListFormDTO);
return strangerAccessRecordService.listCustomerGridH5(customerGridListFormDTO);
}
/**
* @Description 陌生访客手动选定位置获取附近网格数据
* @Param CustomerGridListFormDTO

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

@ -120,4 +120,14 @@ public interface StrangerAccessRecordService extends BaseService<StrangerAccessR
* @Description 单客户-陌生人根据地区编码查询附近网格列表
**/
Result<List<PublicCustomerGridForStrangerResultDTO>> thirdCustomerGridList(PublicCustomerGridListFormDTO formDTO);
/**
* @Description H5版 自动/选定定位获取地附近网格列表
* @param customerGridListFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CustomerGridForStrangerResultDTO>>
* @author wangc
* @date 2021.01.18 16:39
*/
Result<List<CustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO);
}

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

@ -31,6 +31,7 @@ import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OperCustomizeFeignClient;
import com.epmet.service.StrangerAccessRecordService;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -303,6 +304,48 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
}
/**
* @Description H5版 自动/选定定位获取地附近网格列表
* @param customerGridListFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CustomerGridForStrangerResultDTO>>
* @author wangc
* @date 2021.01.18 16:39
*/
@Override
public Result<List<CustomerGridForStrangerResultDTO>> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO) {
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());
Result<List<CustomerGridForStrangerResultDTO>> queryResult =
govOrgFeignClient
.queryGridListByAreaCode(listCustomerGridFormDTO);
//Feign调用成功
if (queryResult.success()) {
List<CustomerGridForStrangerResultDTO> queryList = queryResult.getData();
if (null != queryResult && queryList.size() > 0) {
StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity();
strangerTrance.setLocationAreaCode(listCustomerGridFormDTO.getAreaCode());
strangerTrance.setIsAuthorized(customerGridListFormDTO.getIsAuthorized());
strangerTrance.setGridNumber(queryList.size());
strangerTrance.setVisitTime(new Date());
strangerTrance.setProvince(customerGridListFormDTO.getProvince());
strangerTrance.setCity(customerGridListFormDTO.getCity());
strangerTrance.setArea(customerGridListFormDTO.getArea());
insert(strangerTrance);
}
}
return queryResult;
}
/**
* @Description 获取客户信息
* @param appId

12
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java

@ -63,4 +63,16 @@ public class ResiMineGridController {
return new Result<LatestGridInfoResultDTO>().ok(resiMineGridService.latestGridInfo(formDTO));
}
/**
* @return com.epmet.resi.mine.dto.result.LatestGridInfoResultDTO
* @param tokenDto
* @Author yinzuomei
* @Description 获取用户最近访问网格
* @Date 2020/3/24 11:10
**/
@GetMapping("sso/latestgridinfo")
public Result<LatestGridInfoResultDTO> latestGridInfo(@LoginUser TokenDto tokenDto){
LatestGridInfoResultDTO latestGridInfoResultDTO=resiMineGridService.getLatestGridInfoH5(tokenDto);
return new Result<LatestGridInfoResultDTO>().ok(latestGridInfoResultDTO);
}
}

9
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java

@ -39,4 +39,13 @@ public interface ResiMineGridService {
* @Date 2020/8/3
**/
LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO);
/**
* H5版本 - 获取用户最近访问网格
*
* @Author
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.mine.dto.result.LatestGridInfoResultDTO>
*/
LatestGridInfoResultDTO getLatestGridInfoH5(TokenDto tokenDto);
}

26
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

@ -138,4 +138,30 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
return userResult.getData();
}
/**
* @Description H5版本 - 获取用户最近访问网格
* @param tokenDto
* @return com.epmet.dto.result.LatestGridInfoResultDTO
* @author wangc
* @date 2021.01.18 17:22
*/
@Override
public LatestGridInfoResultDTO getLatestGridInfoH5(TokenDto tokenDto) {
if (null == tokenDto || StringUtils.isBlank(tokenDto.getUserId())) {
logger.error(String.format("居民端获取用户最近访问的网格失败:tokenDto is null or userId is null"));
throw new RenException(ModuleConstant.USER_NOT_NULL);
}
if(!AppClientConstant.APP_RESI.equals(tokenDto.getApp())){
logger.error(String.format("居民端获取用户最近访问的网格失败,userId:%s,错误提示:%s",tokenDto.getUserId(),ModuleConstant.FOR_RESI_CALL));
throw new RenException(ModuleConstant.FOR_RESI_CALL);
}
logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(tokenDto)));
Result<LatestGridInfoResultDTO> userResult=epmetUserFeignClient.getLatestGridInfoByUserId(tokenDto.getUserId());
if(userResult.success()&&null!=userResult.getData()){
return userResult.getData();
}
logger.warn(String.format("居民端获取用户最近访问网格失败,调用epmet-user-server服务返回%s",JSON.toJSONString(userResult)));
return null ;
}
}

Loading…
Cancel
Save