Browse Source

【基础信息】搜索人名

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
3eb2d28cc1
  1. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  3. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
  5. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  6. 26
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -522,4 +522,7 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/building/buildinglistbyids")
Result<List<BuildingResultDTO>> buildingListByIds(@RequestBody List<String> buildingIdList);
@PostMapping("/gov/org/icneighborhood/getlistbyids")
Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -320,6 +320,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "buildingListByIds", buildingIdList);
}
@Override
public Result<List<IcNeighborHoodDTO>> getListByIds(List<String> ids) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getListByIds", ids);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

@ -95,4 +95,16 @@ public class IcNeighborHoodController {
return new Result<List<OptionResultDTO>>().ok(icNeighborHoodService.getNeighborHoodOptions(dto.getAgencyId(), dto.getGridId()));
}
/**
* @Description 通过ID查询小区信息
* @Param ids
* @Return {@link Result< List< IcNeighborHoodDTO>>}
* @Author zhaoqifeng
* @Date 2021/11/8 10:46
*/
@PostMapping("getlistbyids")
public Result<List<IcNeighborHoodDTO>> getListByIds(@RequestBody List<String> ids) {
return new Result<List<IcNeighborHoodDTO>>().ok(icNeighborHoodService.getListByIds(ids));
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java

@ -103,4 +103,13 @@ public interface IcNeighborHoodService extends BaseService<IcNeighborHoodEntity>
* @Date 2021/10/26 14:32
*/
List<OptionResultDTO> getNeighborHoodOptions(String agencyId, String gridId);
/**
* @Description 通过ID查询小区信息
* @Param ids
* @Return {@link List< IcNeighborHoodDTO>}
* @Author zhaoqifeng
* @Date 2021/11/8 10:45
*/
List<IcNeighborHoodDTO> getListByIds(List<String> ids);
}

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -134,4 +134,23 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
}).collect(Collectors.toList());
}
/**
* @param ids
* @Description 通过ID查询小区信息
* @Param ids
* @Return {@link List< IcNeighborHoodDTO>}
* @Author zhaoqifeng
* @Date 2021/11/8 10:45
*/
@Override
public List<IcNeighborHoodDTO> getListByIds(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
return Collections.emptyList();
}
LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.in(IcNeighborHoodEntity::getId, ids);
List<IcNeighborHoodEntity> list = baseDao.selectList(wrapper);
return ConvertUtils.sourceToTarget(list, IcNeighborHoodDTO.class);
}
}

26
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -43,6 +43,7 @@ import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
@ -545,11 +546,32 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
PageInfo<SearchByNameResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), staffInfo.getAgencyId(), no));
List<SearchByNameResultDTO> result = pageInfo.getList();
// 查询小区,楼号,网格
// TODO
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
// 查询小区,楼号,网格
Result<List<AllGridsByUserIdResultDTO>> gridResult = govOrgOpenFeignClient.getGridListByGridIds(result.stream().map(SearchByNameResultDTO::getGridId).collect(Collectors.toList()));
if (!gridResult.success()) {
throw new RenException(gridResult.getCode(),gridResult.getMsg());
}
Map<String, String> gridMap = gridResult.getData().stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName));
Result<List<IcNeighborHoodDTO>> neighborHoodResult = govOrgOpenFeignClient.getListByIds(result.stream().map(SearchByNameResultDTO::getNeighborHoodId).collect(Collectors.toList()));
if (!neighborHoodResult.success()) {
throw new RenException(neighborHoodResult.getCode(),neighborHoodResult.getMsg());
}
Map<String, String> neighborHoodMap = neighborHoodResult.getData().stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName));
Result<List<BuildingResultDTO>> buildResult = govOrgOpenFeignClient.buildingListByIds(result.stream().map(SearchByNameResultDTO::getBuildId).collect(Collectors.toList()));
if (!buildResult.success()) {
throw new RenException(buildResult.getCode(),buildResult.getMsg());
}
Map<String, String> buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName));
result.forEach(item -> {
item.setGridName(gridMap.get(item.getGridId()));
item.setNeighborHoodName(neighborHoodMap.get(item.getNeighborHoodId()));
item.setBuildNum(buildMap.get(item.getBuildId()));
});
return result;
}

Loading…
Cancel
Save