puhanshu
2022-01-14 51ee3c4db2eb49062d3236bf44f95dc22f8f6ac9
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -135,7 +135,7 @@
        List<StatisticsCommVO> microWishRealizePercent = comActMicroWishDAO.selectRealizePercent(communityId);
        statisticsVO.setMicroWishRealizePercent(microWishRealizePercent);
        //微心愿图片
        List<String> microWishImages = comActMicroWishDAO.getPassedAllImages(communityId, pageSize);
        List<String> microWishImages = comActMicroWishDAO.getPassedAllImages(communityId, 20);
        statisticsVO.setMicroWishImages(microWishImages);
        //议事投票类型占比
@@ -149,7 +149,7 @@
        statisticsVO.setVoteTitles(voteTitles);
        //邻里圈图片
        List<String> neighborImages = comActNeighborCircleDAO.getAllImages(communityId, pageSize);
        List<String> neighborImages = comActNeighborCircleDAO.getAllImages(communityId, 20);
        statisticsVO.setNeighborImages(neighborImages);
        //邻里圈文本内容
        List<String> neighborContents = comActNeighborCircleDAO.getContents(communityId, pageSize);
@@ -195,18 +195,39 @@
        List<String> warehouseLoveTransfer = comActWarehouseDonatesDao.getWarehouseLoveTransfer(communityId, pageSize);
        statisticsVO.setWarehouseLoveTransfer(warehouseLoveTransfer);
        //捐赠图片
        List<String> warehouseImages = comActWarehouseDonatesDao.getWarehouseImages(communityId, pageSize);
        List<String> warehouseImages = comActWarehouseDonatesDao.getWarehouseImages(communityId, 20);
        statisticsVO.setWarehouseImages(warehouseImages);
        //居民活动柱状统计
        List<StatisticsCommVO> residentActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, true);
        //居民活动新增数据
        List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, true);
        for (int i = 1; i <= currentMon; i++) {
            String temp;
            if (i > 9) {
                temp = "" + i;
            } else {
                temp = "0" + i;
            }
            boolean isExist = actAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) &&
                    e.getFiled().endsWith(temp));
            if (!isExist) {
                StatisticsCommVO other = new StatisticsCommVO();
                other.setFiled(temp);
                other.setNum(0);
                actAddPolylineData.add(other);
            }
        }
        actAddPolylineData = actAddPolylineData.stream().filter(e -> nonNull(e.getFiled()))
                .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList());
        //居民活动发布总数
        int residentActTotalCount = 0;
        if (!residentActHistogram.isEmpty()) {
            residentActTotalCount = residentActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum();
        }
        statisticsVO.setResidentActTotalCount(residentActTotalCount);
        statisticsVO.setResidentActHistogram(residentActHistogram);
//        statisticsVO.setResidentActHistogram(residentActHistogram);
        statisticsVO.setResidentActHistogram(actAddPolylineData);
        //业主委员会党员占比
        List<StatisticsCommVO> committeePartyPercent = comActCommitteeDao.selectCommitteePartyPercent(communityId);
        statisticsVO.setCommitteePartyPercent(committeePartyPercent);
@@ -539,7 +560,7 @@
        statisticsInfo.setNeighborCircleData(neighborCircleData);
        if (!neighborCircleData.isEmpty()) {
            statisticsInfo.setPublishContentNum(neighborCircleData.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum());
            statisticsInfo.setPublishTopicNum(neighborCircleData.size());
            statisticsInfo.setPublishTopicNum(neighborCircleData.stream().filter(e -> !"无话题".equals(e.getFiled())).collect(Collectors.toList()).size());
        }
        //邻里圈新增折线数据
        Date nowDate = new Date();