From b2a5e4be739b232876b87e65ed70fa5186943d1e Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期三, 09 三月 2022 09:29:35 +0800
Subject: [PATCH] Merge branch 'dev' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into dev

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java |  435 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 427 insertions(+), 8 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
index becd68d..c2a1199 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -3,7 +3,7 @@
 import static java.util.Objects.isNull;
 import static java.util.Objects.nonNull;
 
-import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.Date;
@@ -14,43 +14,71 @@
 
 import javax.annotation.Resource;
 
-import com.panzhihua.common.model.dtos.property.CommonPage;
-import com.panzhihua.common.model.vos.community.bigscreen.*;
-import com.panzhihua.common.utlis.DateUtils;
-import com.panzhihua.service_community.dao.*;
+import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
+import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenAlarmStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO;
+import com.panzhihua.common.model.vos.community.bigscreen.VolunteerOrgRelationVO;
+import com.panzhihua.common.model.vos.grid.EventVO;
+import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO;
+import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO;
+import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.panzhihua.common.model.dtos.PageBaseDTO;
 import com.panzhihua.common.model.dtos.community.convenient.PagePopularMerchantDTO;
+import com.panzhihua.common.model.dtos.property.CommonPage;
 import com.panzhihua.common.model.vos.R;
-import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
+import com.panzhihua.common.model.vos.community.ComActDynVO;
+import com.panzhihua.common.model.vos.community.ComActFourMemberVO;
+import com.panzhihua.common.model.vos.community.ComSwPatrolRecordVO;
 import com.panzhihua.common.model.vos.community.StatisticsCommVO;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityLine;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCommunityStatisticsVO;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenDynStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenEasyPhotoStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenFmsStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenFourMemberStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkBaseInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkProjectTypeInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkSocialOrgInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHmkSocialWorkerInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenMerchantStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenMicroWishStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenNeighborStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.BigScreenPartyBuildIngStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenQuestionnaireStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenResidentActStatisticsInfo;
 import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerActStatisticsInfo;
+import com.panzhihua.common.model.vos.community.bigscreen.FourMemberOrgRelationVO;
 import com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO;
 import com.panzhihua.common.model.vos.community.bigscreen.ResidentAutonomyStatisticsVO;
 import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO;
+import com.panzhihua.common.model.vos.community.fms.ComFmsTeamVO;
 import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO;
 import com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO;
 import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO;
+import com.panzhihua.common.utlis.DateUtils;
 import com.panzhihua.service_community.dao.ComActActivityDAO;
 import com.panzhihua.service_community.dao.ComActCommitteeDao;
 import com.panzhihua.service_community.dao.ComActDiscussDAO;
 import com.panzhihua.service_community.dao.ComActDynDAO;
 import com.panzhihua.service_community.dao.ComActEasyPhotoDAO;
+import com.panzhihua.service_community.dao.ComActFourMemberDao;
 import com.panzhihua.service_community.dao.ComActMicroWishDAO;
 import com.panzhihua.service_community.dao.ComActNeighborCircleDAO;
 import com.panzhihua.service_community.dao.ComActQuestnaireDAO;
+import com.panzhihua.service_community.dao.ComActSocialOrgDao;
+import com.panzhihua.service_community.dao.ComActSocialProjectDao;
+import com.panzhihua.service_community.dao.ComActSocialWorkerDao;
 import com.panzhihua.service_community.dao.ComActWarehouseDonatesDao;
+import com.panzhihua.service_community.dao.ComFmsServiceDAO;
 import com.panzhihua.service_community.dao.ComMngPopulationDAO;
 import com.panzhihua.service_community.dao.ComPropertyDao;
 import com.panzhihua.service_community.dao.ConvenientMerchantDAO;
@@ -115,7 +143,12 @@
 
     @Resource
     private ComActSocialWorkerDao comActSocialWorkerDao;
-
+    @Resource
+    private ComActFourMemberDao comActFourMemberDao;
+    @Resource
+    private ComFmsServiceDAO comFmsServiceDAO;
+    @Resource
+    private ComMngVolunteerMngDAO comMngVolunteerMngDAO;
 
     /**
      * 大数据分析平台-居民自治
@@ -564,6 +597,11 @@
      */
     @Override
     public R indexVolunteerAct(Long communityId) {
+        BigScreenVolunteerActStatisticsInfo statisticsInfo = getBigScreenVolunteerActStatisticsInfo(communityId);
+        return R.ok(statisticsInfo);
+    }
+
+    private BigScreenVolunteerActStatisticsInfo getBigScreenVolunteerActStatisticsInfo(Long communityId) {
         BigScreenVolunteerActStatisticsInfo statisticsInfo = new BigScreenVolunteerActStatisticsInfo();
         List<StatisticsCommVO> actCircleData = comActActivityDAO.getIndexResidentActBaseData(communityId, false);
         statisticsInfo.setActCircleData(actCircleData);
@@ -588,7 +626,7 @@
             actTotalPolylineData.add(temp);
         });
         statisticsInfo.setActTotalPolylineData(actTotalPolylineData);
-        return R.ok(statisticsInfo);
+        return statisticsInfo;
     }
 
     /**
@@ -747,6 +785,387 @@
         return R.ok(comActSocialProjectDao.selectType(name,null));
     }
 
+    /**
+     * 金沙定制页面-党建引领基础数据
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getPartyBuildIngBaseData(Long communityId) {
+        //基础统计数据查询
+        BigScreenPartyBuildIngStatisticsInfo statisticsInfo = comActDynDAO.getPartyBuildIngBaseData(communityId);
+        statisticsInfo.setAqxTotal(statisticsInfo.getJmxcTotal() + statisticsInfo.getShjdTotal() + statisticsInfo.getXqxcTotal());
+        statisticsInfo.setZyxHelpTotal(statisticsInfo.getZyxServiceTotal());
+        statisticsInfo.setZyfwTotal(statisticsInfo.getZyxServiceTotal());
+        //随手拍治安防控记录列表
+        List<ComActEasyPhotoVO> zafkList = comActEasyPhotoDAO.getPartyBuildIngRecord(communityId, pageSize);
+        statisticsInfo.setZafkList(zafkList);
+        //居民宣传记录列表
+        List<ComActDynVO> JMXCList = comActDynDAO.getPartyBuildIngDynRecord(communityId, pageSize);
+        statisticsInfo.setJmxcList(JMXCList);
+        //商户监督记录列表
+
+        //辖区巡查记录列表
+        List<ComSwPatrolRecordVO> XQXCList = comActDynDAO.getPartyBuildIngPatrolRecord(communityId, pageSize);
+        StringBuilder sb = new StringBuilder();
+        XQXCList.forEach(e -> {
+            String personName = e.getPersonName();
+            if (StringUtils.isNotBlank(personName)) {
+                String[] split = personName.split(",");
+                for (int i = 0;i < split.length;i++) {
+                    sb.append(split[i].substring(0, 1).concat(split[i].substring(1).replaceAll("\\S", "*")));
+                    if (i != split.length - 1) {
+                        sb.append(",");
+                    }
+                }
+                e.setPersonName(sb.toString());
+                sb.delete(0, sb.length());
+            }
+        });
+        statisticsInfo.setXqxcList(XQXCList);
+        return R.ok(statisticsInfo);
+    }
+
+    /**
+     * 党员活动展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pagePartyBuildIngAct(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        return R.ok(comActDynDAO.pagePartyBuildIngAct(page, pageBaseDTO));
+    }
+
+    /**
+     * 议事投票展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pagePartyBuildIngDiscuss(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        return R.ok(comActDynDAO.pagePartyBuildIngDiscuss(page, pageBaseDTO));
+    }
+
+    /**
+     * 金沙定制页面-四长四员
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getFourMemberBaseData(Long communityId) {
+        //基础统计数据查询
+        BigScreenFourMemberStatisticsInfo statisticsInfo = comActFourMemberDao.getFourMemberBaseData(communityId);
+        //四长四员楼栋组织关系
+        List<ComActFourMemberVO> members = comActFourMemberDao.getFourMembers(communityId);
+        List<FourMemberOrgRelationVO> relations = new ArrayList<>();
+        if (!members.isEmpty()) {
+            members.forEach(e -> e.setJurisdictionContent(e.getJurisdictionContent().replaceAll("\\[|\"|]", "")));
+            Map<String, List<ComActFourMemberVO>> collect = members.stream().collect(Collectors.groupingBy(ComActFourMemberVO::getJurisdictionContent));
+            for (Map.Entry<String, List<ComActFourMemberVO>> entry : collect.entrySet()) {
+                FourMemberOrgRelationVO relationVO = new FourMemberOrgRelationVO();
+                relationVO.setRelation(entry.getKey());
+                relationVO.setMembers(entry.getValue());
+                relations.add(relationVO);
+            }
+        }
+        statisticsInfo.setFourMemberOrgList(relations);
+        //新增解决问题数
+        List<StatisticsCommVO> jjwtAddPolylineData = comActFourMemberDao.retrieveJJWTAddPolylineData(communityId);
+        statisticsInfo.setJjwtAddPolylineData(jjwtAddPolylineData);
+        //累计解决问题数
+        List<StatisticsCommVO> jjwtTotalPolylineData = new ArrayList<>();
+        jjwtAddPolylineData.forEach(e -> {
+            StatisticsCommVO temp = comActFourMemberDao.retrieveJJWTTotalPolylineData(communityId, e.getFiled());
+            temp.setFiled(e.getFiled());
+            jjwtTotalPolylineData.add(temp);
+        });
+        statisticsInfo.setJjwtTotalPolylineData(jjwtTotalPolylineData);
+        return R.ok(statisticsInfo);
+    }
+
+    /**
+     * 杨家坪定制页面-五微服务
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getFmsBaseData(Long communityId) {
+        BigScreenFmsStatisticsInfo statisticsInfo = comFmsServiceDAO.getFmsBaseData(communityId);
+        //团队类型占比圆形图
+        List<ComFmsTeamVO> preTeamTypeCircleData = comFmsServiceDAO.retrieveTeamTypeCircleData(communityId);
+        List<StatisticsCommVO> teamTypeCircleData = new ArrayList<>();
+        if (!preTeamTypeCircleData.isEmpty()) {
+            Integer teamCount = preTeamTypeCircleData.size();
+            Map<String, List<ComFmsTeamVO>> collect = preTeamTypeCircleData.stream().collect(Collectors.groupingBy(ComFmsTeamVO::getTeamTypeName));
+            for (Map.Entry<String, List<ComFmsTeamVO>> entry : collect.entrySet()) {
+                StatisticsCommVO temp = new StatisticsCommVO();
+                int size = entry.getValue().size();
+                temp.setFiled(entry.getKey());
+                temp.setNum(size);
+                temp.setPercent(new BigDecimal(size/teamCount).setScale(2));
+                teamTypeCircleData.add(temp);
+            }
+        }
+        statisticsInfo.setTeamTypeCircleData(teamTypeCircleData);
+        //微服务新增折线数据
+        List<StatisticsCommVO> serviceAddPolylineData = comFmsServiceDAO.retrieveServiceAddPolylineData(communityId);
+        statisticsInfo.setServiceAddPolylineData(serviceAddPolylineData);
+        //微服务累计折线数据
+        List<StatisticsCommVO> serviceTotalPolylineData = new ArrayList<>();
+        serviceAddPolylineData.forEach(e -> {
+            StatisticsCommVO temp = comFmsServiceDAO.retrieveServiceTotalPolylineData(communityId, e.getFiled());
+            temp.setFiled(e.getFiled());
+            serviceTotalPolylineData.add(temp);
+        });
+        statisticsInfo.setServiceTotalPolylineData(serviceTotalPolylineData);
+        //微调节矛盾类型占比圆形图
+        List<EventVO> preAdjustCircleData = comFmsServiceDAO.retrieveAdjustCircleData(communityId);
+        List<StatisticsCommVO> adjustCircleData = new ArrayList<>();
+        if (!preAdjustCircleData.isEmpty()) {
+            Integer adjustCount = preAdjustCircleData.size();
+            Map<String, List<EventVO>> collect = preAdjustCircleData.stream().collect(Collectors.groupingBy(EventVO::getEventClazz));
+            for (Map.Entry<String, List<EventVO>> entry : collect.entrySet()) {
+                StatisticsCommVO temp = new StatisticsCommVO();
+                int size = entry.getValue().size();
+                temp.setFiled(entry.getKey());
+                temp.setNum(size);
+                temp.setPercent(new BigDecimal(size/adjustCount).setScale(2));
+                adjustCircleData.add(temp);
+            }
+        }
+        statisticsInfo.setAdjustCircleData(adjustCircleData);
+        //新增解决矛盾折线数据
+        List<StatisticsCommVO> adjustAddPolylineData = comFmsServiceDAO.retrieveAdjustAddPolylineData(communityId);
+        statisticsInfo.setAdjustAddPolylineData(adjustAddPolylineData);
+        //累计解决矛盾折线数据
+        List<StatisticsCommVO> adjustTotalPolylineData = new ArrayList<>();
+        adjustAddPolylineData.forEach(e -> {
+            StatisticsCommVO temp = comFmsServiceDAO.retrieveAdjustTotalPolylineData(communityId, e.getFiled());
+            temp.setFiled(e.getFiled());
+            adjustTotalPolylineData.add(temp);
+        });
+        statisticsInfo.setAdjustTotalPolylineData(adjustTotalPolylineData);
+        //微防控防控类型占比圆形图
+        List<EventVO> preControlCircleData = comFmsServiceDAO.retrieveControlCircleData(communityId);
+        List<StatisticsCommVO> controlCircleData = new ArrayList<>();
+        if (!preControlCircleData.isEmpty()) {
+            Integer controlCount = preControlCircleData.size();
+            Map<String, List<EventVO>> collect = preControlCircleData.stream().collect(Collectors.groupingBy(EventVO::getEventClazz));
+            for (Map.Entry<String, List<EventVO>> entry : collect.entrySet()) {
+                StatisticsCommVO temp = new StatisticsCommVO();
+                int size = entry.getValue().size();
+                temp.setFiled(entry.getKey());
+                temp.setNum(size);
+                temp.setPercent(new BigDecimal(size/controlCount).setScale(2));
+                controlCircleData.add(temp);
+            }
+        }
+        statisticsInfo.setControlCircleData(controlCircleData);
+        return R.ok(statisticsInfo);
+    }
+
+    /**
+     * 杨家坪定制页面-微团队展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pageFmsTeam(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        return R.ok(comFmsServiceDAO.pageFmsTeam(page, pageBaseDTO));
+    }
+
+    /**
+     * 杨家坪定制页面-居家养老基础数据
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getAlarmBaseData(Long communityId) {
+        BigScreenAlarmStatisticsInfo statisticsInfo = comPropertyDao.getAlarmBaseData(communityId);
+        //异常报警新增折线数据
+        List<StatisticsCommVO> abnormalAddPolylineData = comPropertyDao.retrieveAbnormalAddPolylineData(communityId);
+        statisticsInfo.setAbnormalAddPolylineData(abnormalAddPolylineData);
+        //异常报警累计折线数据
+        List<StatisticsCommVO> abnormalTotalPolylineData = new ArrayList<>();
+        abnormalAddPolylineData.forEach(e -> {
+            StatisticsCommVO temp = comPropertyDao.retrieveAbnormalTotalPolylineData(communityId, e.getFiled());
+            temp.setFiled(e.getFiled());
+            abnormalTotalPolylineData.add(temp);
+        });
+        statisticsInfo.setAbnormalTotalPolylineData(abnormalTotalPolylineData);
+        //一键求助服务新增折线数据
+        List<StatisticsCommVO> serviceAddPolylineData = comPropertyDao.retrieveServiceAddPolylineData(communityId);
+        statisticsInfo.setServiceAddPolylineData(serviceAddPolylineData);
+        //一键求助服务累计折线数据
+        List<StatisticsCommVO> serviceTotalPolylineData = new ArrayList<>();
+        serviceAddPolylineData.forEach(e -> {
+            StatisticsCommVO temp = comPropertyDao.retrieveServiceTotalPolylineData(communityId, e.getFiled());
+            temp.setFiled(e.getFiled());
+            serviceTotalPolylineData.add(temp);
+        });
+        statisticsInfo.setServiceTotalPolylineData(serviceTotalPolylineData);
+        return R.ok(statisticsInfo);
+    }
+
+    /**
+     * 杨家坪定制页面-报警记录展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pageAlarmRecord(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        Integer param3 = pageBaseDTO.getParam3();
+        Long communityId = pageBaseDTO.getCommunityId();
+        IPage<ComPropertyAlarmVO> abnormalList = null;
+        switch (param3) {
+            case 1:
+                //待处理异常展示列表
+                abnormalList = comPropertyDao.getAbnormalList(page,2, 0, communityId);
+                break;
+            case 2:
+                //已处理异常展示列表
+                abnormalList = comPropertyDao.getAbnormalList(page,2, 1, communityId);
+                break;
+            case 3:
+                //待服务展示列表
+                abnormalList = comPropertyDao.getAbnormalList(page,1, 0, communityId);
+                break;
+            case 4:
+                //已服务展示列表
+                abnormalList = comPropertyDao.getAbnormalList(page,1, 1, communityId);
+                break;
+            default:
+                break;
+        }
+        return R.ok(abnormalList);
+    }
+
+    /**
+     * 杨家坪定制页面-报警设备点位图
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getAlarmPointMap(Long communityId) {
+        List<ComPropertyEquipmentVO> list = comPropertyDao.getAlarmPointMapData(communityId);
+        List<EquipmentPointMapDataVO> pointMapDataList = new ArrayList<>();
+        if (!list.isEmpty()) {
+            Map<String, List<ComPropertyEquipmentVO>> collect = list.stream().collect(Collectors.groupingBy(e -> "[" + e.getLatitude() + "," + e.getLongitude() + "]"));
+            for (Map.Entry<String, List<ComPropertyEquipmentVO>> entry : collect.entrySet()) {
+                EquipmentPointMapDataVO pointMapDataVO = new EquipmentPointMapDataVO();
+                List<ComPropertyEquipmentVO> value = entry.getValue();
+                pointMapDataVO.setPosition(entry.getKey());
+                List<ComPropertyEquipmentVO> sortedList = value.stream()
+                        .sorted(Comparator.comparing(ComPropertyEquipmentVO::getEquipmentStatus)).collect(Collectors.toList());
+                pointMapDataVO.setEquipments(sortedList);
+                pointMapDataVO.setEquipmentNum(value.size());
+                boolean isRed = value.stream().anyMatch(e -> e.getEquipmentStatus().equals(1));
+                boolean isYellow = value.stream().anyMatch(e -> e.getEquipmentStatus().equals(2));
+                pointMapDataVO.setPointColor(isRed ? 1 : (isYellow ? 2 : 3));
+                pointMapDataList.add(pointMapDataVO);
+            }
+        }
+        return R.ok(pointMapDataList);
+    }
+
+    /**
+     * 杨家坪定制页面-志愿服务
+     * @param communityId
+     * @return
+     */
+    @Override
+    public R getVolunteerBaseData(Long communityId) {
+        BigScreenVolunteerStatisticsInfo statisticsInfo = comMngVolunteerMngDAO.getVolunteerBaseData(communityId);
+        BigScreenVolunteerActStatisticsInfo info = getBigScreenVolunteerActStatisticsInfo(communityId);
+        BeanUtils.copyProperties(info, statisticsInfo);
+        //志愿者统计-组织人数直方图
+        statisticsInfo.setVolunteerOrgHistogram(comMngVolunteerMngDAO.retrieveVolunteerOrgHistogram(communityId));
+        //志愿者服务类型占比圆形图
+        List<ComMngVolunteerMngVO> preVolunteerServiceTypeCircleData = comMngVolunteerMngDAO.retrieveVolunteerServiceTypeCircleData(communityId);
+        List<StatisticsCommVO> volunteerServiceTypeCircleData = new ArrayList<>();
+        if (!preVolunteerServiceTypeCircleData.isEmpty()) {
+            Integer count = preVolunteerServiceTypeCircleData.size();
+            Map<String, List<ComMngVolunteerMngVO>> collect = preVolunteerServiceTypeCircleData.stream().collect(Collectors.groupingBy(ComMngVolunteerMngVO::getServiceTypeName));
+            for (Map.Entry<String, List<ComMngVolunteerMngVO>> entry : collect.entrySet()) {
+                StatisticsCommVO temp = new StatisticsCommVO();
+                int size = entry.getValue().size();
+                temp.setFiled(entry.getKey());
+                temp.setNum(size);
+                temp.setPercent(new BigDecimal(size/count).setScale(2));
+                volunteerServiceTypeCircleData.add(temp);
+            }
+        }
+        statisticsInfo.setVolunteerServiceTypeCircleData(volunteerServiceTypeCircleData);
+        //志愿者年龄段占比圆形图
+        List<StatisticsCommVO> volunteerAgeCircleData = comMngVolunteerMngDAO.retrieveVolunteerAgeCircleData(communityId);
+        int sum = volunteerAgeCircleData.stream().mapToInt(StatisticsCommVO::getNum).sum();
+        volunteerAgeCircleData.forEach(e -> {
+            if (sum != 0) {
+                e.setPercent(new BigDecimal(e.getNum()/sum).setScale(2));
+            } else {
+                e.setPercent(new BigDecimal(0));
+            }
+        });
+        statisticsInfo.setVolunteerAgeCircleData(volunteerAgeCircleData);
+        //志愿者技能占比圆形图
+        List<ComMngVolunteerMngVO> preVolunteerSkillCircleData = comMngVolunteerMngDAO.retrieveVolunteerSkillCircleData(communityId);
+        List<StatisticsCommVO> volunteerSkillCircleData = new ArrayList<>();
+        if (!preVolunteerSkillCircleData.isEmpty()) {
+            Integer count = preVolunteerSkillCircleData.size();
+            Map<String, List<ComMngVolunteerMngVO>> collect = preVolunteerSkillCircleData.stream().collect(Collectors.groupingBy(ComMngVolunteerMngVO::getSkillName));
+            for (Map.Entry<String, List<ComMngVolunteerMngVO>> entry : collect.entrySet()) {
+                StatisticsCommVO temp = new StatisticsCommVO();
+                int size = entry.getValue().size();
+                temp.setFiled(entry.getKey());
+                temp.setNum(size);
+                temp.setPercent(new BigDecimal(size/count).setScale(2));
+                volunteerSkillCircleData.add(temp);
+            }
+        }
+        statisticsInfo.setVolunteerSkillCircleData(volunteerSkillCircleData);
+        //志愿者组织数据
+        List<VolunteerOrgRelationVO> volunteerOrgRelationList = new ArrayList<>();
+        List<ComMngVolunteerMngVO> volunteerData = comMngVolunteerMngDAO.selectVolunteerByCommunityId(communityId);
+        if (!volunteerData.isEmpty()) {
+            Map<String, List<ComMngVolunteerMngVO>> collect = volunteerData.stream().collect(Collectors.groupingBy(ComMngVolunteerMngVO::getOrgName));
+            for (Map.Entry<String, List<ComMngVolunteerMngVO>> entry : collect.entrySet()) {
+                VolunteerOrgRelationVO relationVO = new VolunteerOrgRelationVO();
+                relationVO.setOrg(entry.getKey());
+                relationVO.setOrgPersonNum(entry.getValue().size());
+                relationVO.setVolunteers(entry.getValue());
+                volunteerOrgRelationList.add(relationVO);
+            }
+        }
+        statisticsInfo.setVolunteerOrgRelationList(volunteerOrgRelationList);
+        return R.ok(statisticsInfo);
+    }
+
+    /**
+     * 金沙定制页面-志愿线展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pagePartyBuildIngMicroWish(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        return R.ok(comActMicroWishDAO.pagePartyBuildIngMicroWish(page, pageBaseDTO));
+    }
+
+    /**
+     * 金沙定制页面-四长四员解决问题展示列表
+     * @param pageBaseDTO
+     * @return
+     */
+    @Override
+    public R pageFourMemberResolve(PageBaseDTO pageBaseDTO) {
+        Page page = retrievePage(pageBaseDTO);
+        return R.ok(comActMicroWishDAO.pageFourMemberResolve(page, pageBaseDTO));
+    }
+
     private Page retrievePage(PageBaseDTO pageBaseDTO) {
         Long pageNum = pageBaseDTO.getPageNum();
         Long size = pageBaseDTO.getPageSize();

--
Gitblit v1.7.1