|
|
@ -1925,21 +1925,43 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
|
|
|
|
@Override |
|
|
|
public EventRateResultDTO getEventRate(String orgId, String orgType) { |
|
|
|
return baseDao.getEventRate(getOrgPath(orgId, orgType)); |
|
|
|
EventRateResultDTO erDto = baseDao.getEventRate(getOrgPath(orgId, orgType));//事件总量和灯数量,占比
|
|
|
|
List<Map<String, Integer>> dataMap = baseDao.getAnalysis(getOrgPath(orgId, orgType));//按分类获取数量
|
|
|
|
Map<String, Integer> temp = new HashMap<>(); |
|
|
|
if (null != dataMap && dataMap.size() > 0) { |
|
|
|
for (Map<String, Integer> map : dataMap) { |
|
|
|
temp.put(String.valueOf(map.get("code")), Integer.valueOf(String.valueOf(map.get("total")))); |
|
|
|
} |
|
|
|
} |
|
|
|
Result<Map<String, String>> categoryMap = govIssueOpenFeignClient.getCategoryMap(EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
if (null != categoryMap && categoryMap.getData().size() > 0) { |
|
|
|
Map<String, String> map = categoryMap.getData(); |
|
|
|
List<EventRateResultDTO.Category> categoryList = new ArrayList<>(); |
|
|
|
map.keySet().forEach(key -> { |
|
|
|
EventRateResultDTO.Category category = new EventRateResultDTO.Category(); |
|
|
|
if (null != temp.get(key)) { |
|
|
|
category.setCode(key); |
|
|
|
category.setName(map.get(key)); |
|
|
|
category.setValue(Integer.valueOf(temp.get(key))); |
|
|
|
} else { |
|
|
|
category.setCode(key); |
|
|
|
category.setName(map.get(key)); |
|
|
|
category.setValue(0); |
|
|
|
} |
|
|
|
categoryList.add(category); |
|
|
|
}); |
|
|
|
erDto.setCategory(categoryList); |
|
|
|
} |
|
|
|
return erDto; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType) { |
|
|
|
EventAnalysisResultDTO dto = baseDao.getEventAnalysis(getOrgPath(orgId,orgType)); |
|
|
|
Result<Map<String, String>> categoryMap = govIssueOpenFeignClient.getCategoryMap(EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
if (null != categoryMap && categoryMap.getData().size() > 0) { |
|
|
|
List<Map<String,Integer>> dataMap = baseDao.getAnalysis(getOrgPath(orgId,orgType)); |
|
|
|
if (null != dataMap && dataMap.size() > 0) { |
|
|
|
Map<String, Integer> merged = new HashMap<>(); |
|
|
|
dataMap.forEach(merged::putAll); |
|
|
|
dto.setCategoryCount(merged); |
|
|
|
} |
|
|
|
} |
|
|
|
EventRateResultDTO erDto = baseDao.getEventRate(getOrgPath(orgId, orgType));//事件总量和灯数量,占比
|
|
|
|
EventAnalysisResultDTO dto = baseDao.getEventAnalysis(getOrgPath(orgId, orgType)); |
|
|
|
dto.setDaiChuLiRate(erDto.getHongDengRate() == null ? 0 : erDto.getHongDengRate()); |
|
|
|
dto.setChuLiZhongRate(erDto.getHuangDengRate() == null ? 0 : erDto.getHuangDengRate()); |
|
|
|
dto.setYiJieAnRate(erDto.getLanDengRate() == null ? 0 : erDto.getLanDengRate()); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|