Commit ee526b4c authored by suhuiguang's avatar suhuiguang

1.大屏地图图列统计接口开发空指针处理

parent e32d58f9
......@@ -231,6 +231,10 @@ public class DPStatisticsServiceImpl {
String orgCode = regionCodeOrgCodeMap.get(dpFilterParamDto.getCityCode());
if (orgCode == null) {
orgCode = commonMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode());
if (orgCode == null) {
result.put(DPMapStatisticsItemEnum.OPERATORS.getCode(), 0);
return;
}
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
}
Long num = userInfoMapper.countUserByPostAndAreaCode(orgCode, "6552");
......@@ -242,15 +246,19 @@ public class DPStatisticsServiceImpl {
if (orgCode == null) {
orgCode = commonMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode());
if (orgCode == null) {
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), 0);
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), 0);
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), 0);;
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), 0);
return;
}
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
}
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c->c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
}
private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, DPFilterParamDto dpFilterParamDto) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment