|
|
@ -1842,19 +1842,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
|
formDTO.setOrgType("agency"); |
|
|
|
} |
|
|
|
//获取无效组织网格Id列表
|
|
|
|
if("agency".equals(formDTO.getOrgType())){ |
|
|
|
//查询组织数据时排除掉当前组织及下级无效组织列表
|
|
|
|
Result<DelAgencyGridIdResultDTO> result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); |
|
|
|
if (!result.success()) { |
|
|
|
throw new EpmetException(String.format("获取当前组织及下级已删除组织、网格列表失败,组织Id->%s", formDTO.getUserId())); |
|
|
|
} |
|
|
|
formDTO.setAgencyIdList(result.getData().getAgencyIdList()); |
|
|
|
formDTO.setGridIdList(result.getData().getGridIdList()); |
|
|
|
} |
|
|
|
|
|
|
|
//2.根据入参值查询对应的房屋统计数据
|
|
|
|
List<UserChartResultDTO> list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType()); |
|
|
|
List<UserChartResultDTO> list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getAgencyIdList(), formDTO.getGridIdList()); |
|
|
|
//3.汇总数据
|
|
|
|
AtomicInteger userTotal = new AtomicInteger(); |
|
|
|
AtomicInteger czUserTotal = new AtomicInteger(); |
|
|
|
AtomicInteger ldUserTotal = new AtomicInteger(); |
|
|
|
list.forEach(l -> { |
|
|
|
userTotal.addAndGet(l.getNum()); |
|
|
|
if ("0".equals(l.getIsFloating())) { |
|
|
|
resultDTO.setCzUserTotal(l.getNum()); |
|
|
|
czUserTotal.addAndGet(l.getNum()); |
|
|
|
} else { |
|
|
|
resultDTO.setLdUserTotal(l.getNum()); |
|
|
|
ldUserTotal.addAndGet(l.getNum()); |
|
|
|
} |
|
|
|
}); |
|
|
|
resultDTO.setUserTotal(userTotal.get()); |
|
|
|
resultDTO.setCzUserTotal(czUserTotal.get()); |
|
|
|
resultDTO.setLdUserTotal(ldUserTotal.get()); |
|
|
|
resultDTO.setCzUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getCzUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzUserTotal() / (float) resultDTO.getUserTotal()) * 100))); |
|
|
|
resultDTO.setLdUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getLdUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getLdUserTotal() / (float) resultDTO.getUserTotal()) * 100))); |
|
|
|
resultDTO.setOrgId(formDTO.getOrgId()); |
|
|
|