|
|
@ -180,26 +180,23 @@ public class PropertyManagementServiceImpl implements PropertyManagementService |
|
|
|
* @param name 物业名称 |
|
|
|
* @param contactName 物业联系人 |
|
|
|
* @param contactMobile 联系电话 |
|
|
|
* @param queryType 列表查询:page-query;导出:export |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name, String contactName, String contactMobile, String queryType) { |
|
|
|
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name, String contactName, String contactMobile) { |
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId()); |
|
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
|
List<IcPropertyManagementDTO> list = icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(), name, contactName, contactMobile,staffInfoCacheResult.getAgencyId()); |
|
|
|
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list); |
|
|
|
// 导出时需要导出关联的小区名称
|
|
|
|
if ("export".equals(queryType)) { |
|
|
|
pageInfo.getList().forEach(result -> { |
|
|
|
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(result.getId()); |
|
|
|
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(result.getId(),staffInfoCacheResult.getAgencyId()); |
|
|
|
List<String> neighborHoodNames = neighborHoodList.stream() |
|
|
|
.map(IcNeighborHoodDTO::getNeighborHoodName) |
|
|
|
.distinct().collect(Collectors.toList()); |
|
|
|
result.setNeighborHoodNames(CollectionUtils.isNotEmpty(neighborHoodList) ? StringUtils.join(neighborHoodNames, StrConstant.COMMA_ZH) : StrConstant.EPMETY_STR); |
|
|
|
result.setNeighborHoodList(neighborHoodList); |
|
|
|
}); |
|
|
|
} |
|
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
|
} |
|
|
|
|
|
|
@ -211,12 +208,13 @@ public class PropertyManagementServiceImpl implements PropertyManagementService |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public IcPropertyManagementDTO getDetail(String id) { |
|
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult= CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId()); |
|
|
|
IcPropertyManagementEntity icPropertyManagementEntity = icPropertyManagementDao.selectById(id); |
|
|
|
if (null == icPropertyManagementEntity) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
IcPropertyManagementDTO resultDto = ConvertUtils.sourceToTarget(icPropertyManagementEntity, IcPropertyManagementDTO.class); |
|
|
|
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(id); |
|
|
|
List<IcNeighborHoodDTO> neighborHoodList = icNeighborHoodPropertyDao.getNeighborHoodList(id,staffInfoCacheResult.getAgencyId()); |
|
|
|
List<String> neighborHoodNames = neighborHoodList.stream() |
|
|
|
.map(IcNeighborHoodDTO::getNeighborHoodName) |
|
|
|
.distinct().collect(Collectors.toList()); |
|
|
|