puhanshu
2021-12-30 a7002e25ec105e5f73c27f91944f1c0b4991c355
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -1,11 +1,13 @@
package com.panzhihua.service_grid.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.community.screen.event.EventComprehensiveGovernanceStatisticsVO;
import com.panzhihua.common.model.vos.community.StatisticsCommVO;
import com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO;
import org.springframework.beans.BeanUtils;
@@ -2697,6 +2699,20 @@
        statisticsVO.setDrawEventPopulationTotalVO(drawEventPopulationTotalVO);
        statisticsVO.setAgeGroupStatistics(ageGroupStatistics);
        statisticsVO.generateStatisticsData();
        List<StatisticsCommVO> eventTypeCircleDrawData = new ArrayList<>();
        if (!eventResultList.isEmpty()) {
            Map<Integer, List<EventGridIncidentStatisticsVO>> collect = eventResultList.stream().collect(Collectors.groupingBy(EventGridIncidentStatisticsVO::getType));
            for (Map.Entry<Integer, List<EventGridIncidentStatisticsVO>> entry : collect.entrySet()) {
                StatisticsCommVO temp = new StatisticsCommVO();
                int size = entry.getValue().size();
                Integer eventTotal = statisticsVO.getEventTotal();
                temp.setFiled(entry.getKey().toString());
                temp.setNum(size);
                temp.setPercent(new BigDecimal(size/eventTotal).setScale(2));
                eventTypeCircleDrawData.add(temp);
            }
        }
        statisticsVO.setEventTypeCircleDrawData(eventTypeCircleDrawData);
        return R.ok(statisticsVO);
    }
@@ -2820,4 +2836,15 @@
        statisticsVO.setDrawEventPopulationTotalVO(populationTotalVO);
        return R.ok(statisticsVO);
    }
    /**
     * 西区大数据分析平台-综合治理栏
     * @return
     */
    @Override
    public R getComprehensiveGovernanceStatics() {
        EventComprehensiveGovernanceStatisticsVO governanceStatisticsVO = this.baseMapper.selectComprehensiveGovernanceStatics();
        governanceStatisticsVO.generateGovernanceTotal();
        return R.ok(governanceStatisticsVO);
    }
}