Browse Source

Merge branch 'bugfix/teamB_shuangshi'

feature/teamB_zz_wgh
YUJT 3 years ago
parent
commit
110ba8a10a
  1. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java
  2. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java

@ -16,7 +16,7 @@ public class BuildingListResultDTO implements Serializable {
private static final long serialVersionUID = -1423424057500044373L; private static final long serialVersionUID = -1423424057500044373L;
private String id; private String id;
private String name; private String name;
private Integer unitCoun = 0; private Integer unitCount = 0;
private Integer houseCount = 0; private Integer houseCount = 0;
private Integer personCount = 0; private Integer personCount = 0;
private Integer differHouseCount = 0; private Integer differHouseCount = 0;

40
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java

@ -58,11 +58,9 @@ public class HouseInformationServiceImpl implements HouseInformationService {
*/ */
@Override @Override
public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) { public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (StringUtils.isEmpty(formDTO.getCommunityId())) { if (StringUtils.isEmpty(formDTO.getCommunityId())) {
//获取工作人员所属组织 //获取工作人员所属组织
// CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) { if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败");
} }
@ -71,12 +69,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
String orgName; String orgName;
CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId()); CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId());
if (null == agency) { if (null == agency) {
agency = customerAgencyDao.selectById(staffInfo.getAgencyId()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在");
if (null == agency) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在");
} else {
formDTO.setCommunityId(staffInfo.getAgencyId());
}
} }
CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid()); CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid());
if (null == parentAgency) { if (null == parentAgency) {
@ -128,35 +121,6 @@ public class HouseInformationServiceImpl implements HouseInformationService {
} }
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
}); });
} else {
return deleteAfetrEmergency(formDTO);
}
return new PageData<>(list, pageInfo.getTotal());
}
private PageData<GridCountListResultDTO> deleteAfetrEmergency(HouseInformationFormDTO formDTO) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setCommunityId(staffInfo.getAgencyId());
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<GridCountListResultDTO> list = icNeighborHoodDao.getGridList(formDTO);
PageInfo<GridCountListResultDTO> pageInfo = new PageInfo<>(list);
if (CollectionUtils.isNotEmpty(list)) {
//获取录入人口数
IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
countFormDTO.setOrgType(NumConstant.ZERO_STR);
countFormDTO.setOrgId(formDTO.getCommunityId());
countFormDTO.setType(NumConstant.ONE_STR);
Map<String, Integer> map = getMapResult(countFormDTO);
list.forEach(item -> {
if (map.containsKey(item.getId())) {
item.setPersonCount(map.get(item.getId()));
}
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
});
} }
return new PageData<>(list, pageInfo.getTotal()); return new PageData<>(list, pageInfo.getTotal());
} }

Loading…
Cancel
Save