|
@@ -209,23 +209,18 @@ public class FireStatisticsServiceImpl implements FireStatisticsService {
|
|
|
|
|
|
@Override
|
|
|
public List<FireBubbleVO> getAvgAndSum(Date startTime, Date endTime,String fireType, String unitId) {
|
|
|
- List<FireBubbleVO> list = new ArrayList<>();
|
|
|
- List<String> lists = fireStatisticsMapper.getAddress().stream().filter(StringUtils::isNotBlank).filter(s -> !s.contains("派出所")).collect(Collectors.toList());
|
|
|
- lists.forEach(s -> {
|
|
|
- Map<String, Double> maps = fireStatisticsMapper.selectAvgAndSum(startTime, endTime, s, fireType, unitId);
|
|
|
+ List<FireBubbleVO> fireBubbleVOS = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> list = fireStatisticsMapper.selectAvgAndSum(startTime, endTime, null, fireType, unitId);
|
|
|
+ list = list.stream().filter(s -> s.get("region").toString().contains("派出所")).collect(Collectors.toList());
|
|
|
+ list.forEach(s -> {
|
|
|
FireBubbleVO fireBubbleVo = new FireBubbleVO();
|
|
|
- fireBubbleVo.setRegion(s);
|
|
|
- fireBubbleVo.setFireCount(fireStatisticsMapper.selectCount(startTime,endTime,null,fireType,unitId,s));
|
|
|
- if (null != maps){
|
|
|
- fireBubbleVo.setDeathToll(Optional.ofNullable(maps.get("deathPerson")).map(Double::intValue).orElse(0));
|
|
|
- fireBubbleVo.setFireArea(Optional.ofNullable(maps.get("fireArea")).filter(d -> 0.00 != d && d != 0).map(d -> Arith.div(d,1)).orElse(0.00));
|
|
|
- }else {
|
|
|
- fireBubbleVo.setDeathToll(0);
|
|
|
- fireBubbleVo.setFireArea(0.00);
|
|
|
- }
|
|
|
- list.add(fireBubbleVo);
|
|
|
+ fireBubbleVo.setRegion(s.get("region").toString());
|
|
|
+ fireBubbleVo.setFireCount(Integer.valueOf(s.get("fireCount").toString()));
|
|
|
+ fireBubbleVo.setDeathToll(Double.valueOf(s.get("deathPerson").toString()));
|
|
|
+ fireBubbleVo.setFireArea(Double.valueOf(s.get("fireArea").toString()));
|
|
|
+ fireBubbleVOS.add(fireBubbleVo);
|
|
|
});
|
|
|
- return list;
|
|
|
+ return fireBubbleVOS;
|
|
|
}
|
|
|
|
|
|
public FireStatisticsPO enhanceFireStatisticsPo(Map<String,String> map){FireStatisticsPO fireStatisticsPo = new FireStatisticsPO();
|