|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenResidentActStatisticsInfo; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerActStatisticsInfo; | 
|---|
|  |  |  | import com.panzhihua.service_community.dao.ComActActivityDAO; | 
|---|
|  |  |  | import com.panzhihua.service_community.dao.ComActCommitteeDao; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo; | 
|---|
|  |  |  | 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.ComActDynVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComActFourMemberVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; | 
|---|
|  |  |  | 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.BigScreenAlarmStatisticsInfo; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCommunityStatisticsVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo; | 
|---|
|  |  |  | 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.BigScreenFiveAssociationsStatisticsInfo; | 
|---|
|  |  |  | 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.BigScreenHatchStatisticsInfo; | 
|---|
|  |  |  | 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.BigScreenVolunteerStatisticsInfo; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO; | 
|---|
|  |  |  | 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.bigscreen.VolunteerOrgRelationVO; | 
|---|
|  |  |  | 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.model.vos.grid.EventVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.property.ComPropertyAlarmVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.property.ComPropertyEquipmentVO; | 
|---|
|  |  |  | 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.ComActDAO; | 
|---|
|  |  |  | 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.ComActEnterpriseDAO; | 
|---|
|  |  |  | 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.ComActSocialOrgHatchDAO; | 
|---|
|  |  |  | 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.ComMngVolunteerMngDAO; | 
|---|
|  |  |  | import com.panzhihua.service_community.dao.ComPropertyDao; | 
|---|
|  |  |  | import com.panzhihua.service_community.dao.ConvenientMerchantDAO; | 
|---|
|  |  |  | import com.panzhihua.service_community.model.dos.ComActDO; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.BigScreenStatisticsService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActCommitteeDao comActCommitteeDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActSocialProjectDao comActSocialProjectDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActSocialOrgDao comActSocialOrgDao; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActSocialWorkerDao comActSocialWorkerDao; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActFourMemberDao comActFourMemberDao; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComFmsServiceDAO comFmsServiceDAO; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngVolunteerMngDAO comMngVolunteerMngDAO; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActSocialOrgHatchDAO comActSocialOrgHatchDAO; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActDAO comActDAO; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComActEnterpriseDAO comActEnterpriseDAO; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 大数据分析平台-居民自治 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | 
|---|
|  |  |  | if (isNull(statisticsVO)) { | 
|---|
|  |  |  | statisticsVO = new ResidentAutonomyStatisticsVO(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<ComActEasyPhotoVO> easyPhotoVOList = comActEasyPhotoDAO.selectStatisticsList(communityId); | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoHistogram = comActEasyPhotoDAO.selectStatisticsList(communityId); | 
|---|
|  |  |  | //随手拍总数 | 
|---|
|  |  |  | Integer easyPhotoTotalCount = 0; | 
|---|
|  |  |  | //随手拍柱状统计 | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoHistogram = new ArrayList<>(); | 
|---|
|  |  |  | if (Objects.nonNull(easyPhotoVOList) && !easyPhotoVOList.isEmpty()) { | 
|---|
|  |  |  | Map<String, List<ComActEasyPhotoVO>> easyPhotoVOMap = easyPhotoVOList.stream().collect(Collectors.groupingBy(ComActEasyPhotoVO::getClassifyName)); | 
|---|
|  |  |  | for (Map.Entry<String, List<ComActEasyPhotoVO>> entry : easyPhotoVOMap.entrySet()) { | 
|---|
|  |  |  | StatisticsCommVO commVO = new StatisticsCommVO(); | 
|---|
|  |  |  | commVO.setFiled(entry.getKey()); | 
|---|
|  |  |  | commVO.setNum(entry.getValue().size()); | 
|---|
|  |  |  | easyPhotoHistogram.add(commVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | easyPhotoTotalCount = easyPhotoVOList.size(); | 
|---|
|  |  |  | if (Objects.nonNull(easyPhotoHistogram) && !easyPhotoHistogram.isEmpty()) { | 
|---|
|  |  |  | easyPhotoTotalCount = easyPhotoHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsVO.setEasyPhotoTotalCount(easyPhotoTotalCount); | 
|---|
|  |  |  | statisticsVO.setEasyPhotoHistogram(easyPhotoHistogram); | 
|---|
|  |  |  | 
|---|
|  |  |  | statisticsVO.setNeighborContents(neighborContents); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //报事报修新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> repairAddPolylineData = comPropertyDao.getRepairPolylineDate(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = repairAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | repairAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | repairAddPolylineData = repairAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsVO.setRepairAddPolylineData(repairAddPolylineData); | 
|---|
|  |  |  | //报事报修累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> repairTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | repairAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comPropertyDao.getRepairTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comPropertyDao.getRepairTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | repairTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //居民活动柱状统计 | 
|---|
|  |  |  | List<StatisticsCommVO> residentActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, true); | 
|---|
|  |  |  | //居民活动新增数据 | 
|---|
|  |  |  | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, true); | 
|---|
|  |  |  | //居民活动发布总数 | 
|---|
|  |  |  | int residentActTotalCount = 0; | 
|---|
|  |  |  | if (!residentActHistogram.isEmpty()) { | 
|---|
|  |  |  | residentActTotalCount = residentActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsVO.setResidentActTotalCount(residentActTotalCount); | 
|---|
|  |  |  | statisticsVO.setResidentActHistogram(residentActHistogram); | 
|---|
|  |  |  | statisticsVO.setResidentActHistogram(actAddPolylineData); | 
|---|
|  |  |  | //业主委员会党员占比 | 
|---|
|  |  |  | List<StatisticsCommVO> committeePartyPercent = comActCommitteeDao.selectCommitteePartyPercent(communityId); | 
|---|
|  |  |  | statisticsVO.setCommitteePartyPercent(committeePartyPercent); | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsVO.setVillageStatisticsList(villageStatisticsList); | 
|---|
|  |  |  | // 查询社区事件列表 | 
|---|
|  |  |  | List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId); | 
|---|
|  |  |  | statisticsVO.setGridIncidentList(gridIncidentList); | 
|---|
|  |  |  | //事件分析新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> eventAddPolylineData = comPropertyDao.getEventAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = eventAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | eventAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | eventAddPolylineData = eventAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsVO.setEventAddPolylineData(eventAddPolylineData); | 
|---|
|  |  |  | //事件分析累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> eventTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | eventAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comPropertyDao.getEventTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comPropertyDao.getEventTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | eventTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | //微心愿新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> microWishAddPolylineData = comActMicroWishDAO.getMicroWishAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = microWishAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | microWishAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | microWishAddPolylineData = microWishAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setMicroWishAddPolylineData(microWishAddPolylineData); | 
|---|
|  |  |  | //微心愿累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> microWishTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | microWishAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActMicroWishDAO.getMicroWishTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActMicroWishDAO.getMicroWishTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | microWishTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | //随手拍新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoAddPolylineData = comActEasyPhotoDAO.getEasyPhotoAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = easyPhotoAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | easyPhotoAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | easyPhotoAddPolylineData = easyPhotoAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setEasyPhotoAddPolylineData(easyPhotoAddPolylineData); | 
|---|
|  |  |  | //随手拍累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | easyPhotoAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActEasyPhotoDAO.getEasyPhotoTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActEasyPhotoDAO.getEasyPhotoTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | easyPhotoTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | public R indexQuestionnaire(Long communityId) { | 
|---|
|  |  |  | BigScreenQuestionnaireStatisticsInfo statisticsInfo = comActQuestnaireDAO.getIndexQuestionnaireBaseData(communityId); | 
|---|
|  |  |  | //社区问卷新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> questionnaireAddPolylineData = comActQuestnaireDAO.getQuestionnaireAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = questionnaireAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | questionnaireAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | questionnaireAddPolylineData = questionnaireAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setQuestionnaireAddPolylineData(questionnaireAddPolylineData); | 
|---|
|  |  |  | //社区问卷累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> questionnaireTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | questionnaireAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActQuestnaireDAO.getQuestionnaireTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActQuestnaireDAO.getQuestionnaireTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | questionnaireTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | statisticsInfo.setDynNum(dynCircleData.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //社区动态新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> dynAddPolylineData = comActDynDAO.getDynAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = dynAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | dynAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | dynAddPolylineData = dynAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setDynAddPolylineData(dynAddPolylineData); | 
|---|
|  |  |  | //社区动态累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> dynTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | dynAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActDynDAO.getDynTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActDynDAO.getDynTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | dynTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | statisticsInfo.setPublishTopicNum(neighborCircleData.stream().filter(e -> !"无话题".equals(e.getFiled())).collect(Collectors.toList()).size()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //邻里圈新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> neighborAddPolylineData = comActNeighborCircleDAO.getNeighborAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = neighborAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | neighborAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | neighborAddPolylineData = neighborAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setNeighborAddPolylineData(neighborAddPolylineData); | 
|---|
|  |  |  | //邻里圈累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> neighborTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | neighborAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActNeighborCircleDAO.getNeighborTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActNeighborCircleDAO.getNeighborTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | neighborTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | statisticsInfo.setServiceTypeNum(serviceTypeCircleData.size()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //服务次数(目前暂时使用浏览量)新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> serviceTimesAddPolylineData = convenientMerchantDAO.getServiceTimesAddPolylineData(communityId); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | for (int i = 1; i <= currentMon; i++) { | 
|---|
|  |  |  | String temp; | 
|---|
|  |  |  | if (i > 9) { | 
|---|
|  |  |  | temp = "" + i; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | temp = "0" + i; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | boolean isExist = serviceTimesAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && | 
|---|
|  |  |  | e.getFiled().endsWith(temp)); | 
|---|
|  |  |  | if (!isExist) { | 
|---|
|  |  |  | StatisticsCommVO other = new StatisticsCommVO(); | 
|---|
|  |  |  | other.setFiled(temp); | 
|---|
|  |  |  | other.setNum(0); | 
|---|
|  |  |  | serviceTimesAddPolylineData.add(other); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | serviceTimesAddPolylineData = serviceTimesAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) | 
|---|
|  |  |  | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); | 
|---|
|  |  |  | statisticsInfo.setServiceTimesAddPolylineData(serviceTimesAddPolylineData); | 
|---|
|  |  |  | //服务次数(目前暂时使用浏览量)累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> serviceTimesTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | serviceTimesAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = convenientMerchantDAO.getServiceTimesTotalPolylineDate(communityId, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = convenientMerchantDAO.getServiceTimesTotalPolylineDate(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | serviceTimesTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setPublishNum(publishNum); | 
|---|
|  |  |  | //居民活动新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, true); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | statisticsInfo.setActAddPolylineData(actAddPolylineData); | 
|---|
|  |  |  | //居民活动累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> actTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | actAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, true, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, true, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | actTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @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); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setPublishNum(publishNum); | 
|---|
|  |  |  | //志愿者活动新增折线数据 | 
|---|
|  |  |  | Date nowDate = new Date(); | 
|---|
|  |  |  | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, false); | 
|---|
|  |  |  | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | statisticsInfo.setActAddPolylineData(actAddPolylineData); | 
|---|
|  |  |  | //志愿者活动累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> actTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | String year = new SimpleDateFormat("yyyy").format(nowDate); | 
|---|
|  |  |  | actAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, false, year + e.getFiled()); | 
|---|
|  |  |  | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, false, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | actTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | statisticsInfo.setActTotalPolylineData(actTotalPolylineData); | 
|---|
|  |  |  | return R.ok(statisticsInfo); | 
|---|
|  |  |  | return statisticsInfo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | public R indexVolunteerActList(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActActivityDAO.indexActList(page, pageBaseDTO, false)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 清网治格-根据事件分类获取近1月的社区事件数据 | 
|---|
|  |  |  | * @param type | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R getEventList(Integer type, Long communityId) { | 
|---|
|  |  |  | // 查询社区事件列表 | 
|---|
|  |  |  | List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId); | 
|---|
|  |  |  | List<EventGridIncidentStatisticsVO> returnGridIncidentList = new ArrayList<>(); | 
|---|
|  |  |  | if (!gridIncidentList.isEmpty()) { | 
|---|
|  |  |  | gridIncidentList.forEach(e -> { | 
|---|
|  |  |  | if (e.getEventType().equals(2)) { | 
|---|
|  |  |  | String[] lngLatString = e.getLatLng().split(","); | 
|---|
|  |  |  | e.setLatLng(lngLatString[1] + "," + lngLatString[0]); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | returnGridIncidentList = gridIncidentList.stream().filter(e -> type.equals(e.getType())).collect(Collectors.toList()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(returnGridIncidentList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 清网治格-社区事件数据分页 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageEventList(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | IPage<EventGridIncidentStatisticsVO> iPage = comMngPopulationDAO.pageEventList(page, pageBaseDTO); | 
|---|
|  |  |  | List<EventGridIncidentStatisticsVO> gridIncidentList = iPage.getRecords(); | 
|---|
|  |  |  | if (!gridIncidentList.isEmpty()) { | 
|---|
|  |  |  | gridIncidentList.forEach(e -> { | 
|---|
|  |  |  | if (e.getEventType().equals(2)) { | 
|---|
|  |  |  | String[] lngLatString = e.getLatLng().split(","); | 
|---|
|  |  |  | e.setLatLng(lngLatString[1] + "," + lngLatString[0]); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(iPage); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R hmkBaseInfo(CommonPage commonPage) { | 
|---|
|  |  |  | BigScreenHmkBaseInfo bigScreenHmkBaseInfo=comActSocialProjectDao.selectIndexBaseInfo(); | 
|---|
|  |  |  | //项目数据 | 
|---|
|  |  |  | BigScreenHmkProjectInfo bigScreenHmkProjectInfo=comActSocialProjectDao.selectBaseInfo(commonPage.getCommunityId()); | 
|---|
|  |  |  | List<BigScreenHmkProjectTypeInfo> typeInfo=comActSocialProjectDao.selectType(null,commonPage.getCommunityId()); | 
|---|
|  |  |  | if(bigScreenHmkProjectInfo.getCount()>0){ | 
|---|
|  |  |  | typeInfo.forEach(bigScreenHmkProjectTypeInfo -> { | 
|---|
|  |  |  | bigScreenHmkProjectTypeInfo.setPercent(bigScreenHmkProjectTypeInfo.getCount()/bigScreenHmkProjectInfo.getCount()); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | bigScreenHmkProjectInfo.setTypeInfoList(typeInfo); | 
|---|
|  |  |  | //活动数据 | 
|---|
|  |  |  | Integer countAll=comActSocialProjectDao.selectActivity(0,commonPage.getCommunityId()); | 
|---|
|  |  |  | BigScreenHmkProjectTypeInfo jm=new BigScreenHmkProjectTypeInfo(); | 
|---|
|  |  |  | jm.setName("居民活动"); | 
|---|
|  |  |  | jm.setCount(comActSocialProjectDao.selectActivity(2,commonPage.getCommunityId())); | 
|---|
|  |  |  | if(countAll>0){ | 
|---|
|  |  |  | jm.setPercent(jm.getCount()/countAll); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigScreenHmkProjectTypeInfo zyz=new BigScreenHmkProjectTypeInfo(); | 
|---|
|  |  |  | zyz.setName("志愿者活动"); | 
|---|
|  |  |  | zyz.setCount(comActSocialProjectDao.selectActivity(1,commonPage.getCommunityId())); | 
|---|
|  |  |  | if(countAll>0){ | 
|---|
|  |  |  | zyz.setPercent(zyz.getCount()/countAll); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<BigScreenHmkProjectTypeInfo> activityList=new ArrayList<>(); | 
|---|
|  |  |  | activityList.add(jm); | 
|---|
|  |  |  | activityList.add(zyz); | 
|---|
|  |  |  | bigScreenHmkProjectInfo.setActivityTypeInfoList(activityList); | 
|---|
|  |  |  | //社会组织数据 | 
|---|
|  |  |  | BigScreenHmkSocialOrgInfo bigScreenHmkSocialOrgInfo=comActSocialOrgDao.selectInfo(commonPage.getCommunityId()); | 
|---|
|  |  |  | List<BigScreenHmkProjectTypeInfo> typeInfoList= comActSocialOrgDao.selectType(commonPage.getCommunityId()); | 
|---|
|  |  |  | if(bigScreenHmkSocialOrgInfo.getCount()>0){ | 
|---|
|  |  |  | typeInfoList.forEach(bigScreenHmkProjectTypeInfo -> { | 
|---|
|  |  |  | bigScreenHmkProjectTypeInfo.setPercent(bigScreenHmkProjectTypeInfo.getCount()/bigScreenHmkSocialOrgInfo.getCount()); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | bigScreenHmkSocialOrgInfo.setTypeInfoList(typeInfoList); | 
|---|
|  |  |  | bigScreenHmkBaseInfo.setBigScreenHmkSocialOrgInfo(bigScreenHmkSocialOrgInfo); | 
|---|
|  |  |  | //社工数据 | 
|---|
|  |  |  | BigScreenHmkSocialWorkerInfo bigScreenHmkSocialWorkerInfo=new BigScreenHmkSocialWorkerInfo(); | 
|---|
|  |  |  | List<BigScreenHmkProjectTypeInfo> socialWorkerList=new ArrayList<>(); | 
|---|
|  |  |  | Integer socialAll=comActSocialWorkerDao.selectType(0,commonPage.getCommunityId()); | 
|---|
|  |  |  | BigScreenHmkProjectTypeInfo ss=new BigScreenHmkProjectTypeInfo(); | 
|---|
|  |  |  | ss.setName("30岁以下"); | 
|---|
|  |  |  | ss.setCount(comActSocialWorkerDao.selectType(1,commonPage.getCommunityId())); | 
|---|
|  |  |  | if(socialAll>0){ | 
|---|
|  |  |  | ss.setPercent(ss.getCount()/socialAll); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigScreenHmkProjectTypeInfo wj=new BigScreenHmkProjectTypeInfo(); | 
|---|
|  |  |  | wj.setName("30-59岁"); | 
|---|
|  |  |  | wj.setCount(comActSocialWorkerDao.selectType(2,commonPage.getCommunityId())); | 
|---|
|  |  |  | if(socialAll>0){ | 
|---|
|  |  |  | wj.setPercent(wj.getCount()/socialAll); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | BigScreenHmkProjectTypeInfo ls=new BigScreenHmkProjectTypeInfo(); | 
|---|
|  |  |  | ls.setName("60岁以上"); | 
|---|
|  |  |  | ls.setCount(comActSocialWorkerDao.selectType(3,commonPage.getCommunityId())); | 
|---|
|  |  |  | if(socialAll>0){ | 
|---|
|  |  |  | ls.setPercent(ls.getCount()/socialAll); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | socialWorkerList.add(ss); | 
|---|
|  |  |  | socialWorkerList.add(wj); | 
|---|
|  |  |  | socialWorkerList.add(ls); | 
|---|
|  |  |  | bigScreenHmkSocialWorkerInfo.setSocialWorkerAge(socialWorkerList); | 
|---|
|  |  |  | List<BigScreenHmkProjectTypeInfo> socialWorkerSkill=comActSocialWorkerDao.selectSkillType(commonPage.getCommunityId()); | 
|---|
|  |  |  | if(socialAll>0){ | 
|---|
|  |  |  | socialWorkerSkill.forEach(bigScreenHmkProjectTypeInfo -> { | 
|---|
|  |  |  | bigScreenHmkProjectTypeInfo.setPercent(bigScreenHmkProjectTypeInfo.getCount()/socialAll); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | bigScreenHmkSocialWorkerInfo.setSocialWorkerSkill(socialWorkerSkill); | 
|---|
|  |  |  | bigScreenHmkBaseInfo.setBigScreenHmkSocialWorkerInfo(bigScreenHmkSocialWorkerInfo); | 
|---|
|  |  |  | bigScreenHmkBaseInfo.setBigScreenHmkProjectInfo(bigScreenHmkProjectInfo); | 
|---|
|  |  |  | return R.ok(bigScreenHmkBaseInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R partyProjectActivityLine() { | 
|---|
|  |  |  | List<BigScreenActivityLine> bigScreenActivityLines=this.getPastMonth(); | 
|---|
|  |  |  | bigScreenActivityLines.forEach(bigScreenActivityLine -> { | 
|---|
|  |  |  | BigScreenActivityLine bigScreenActivityLine1=comActSocialProjectDao.selectActivityCountMonth(bigScreenActivityLine.getX(),bigScreenActivityLine.getYear()); | 
|---|
|  |  |  | bigScreenActivityLine.setY(bigScreenActivityLine1.getY()); | 
|---|
|  |  |  | bigScreenActivityLine.setCountY(bigScreenActivityLine1.getCountY()); | 
|---|
|  |  |  | bigScreenActivityLine.setX(bigScreenActivityLine.getYear().substring(2,4)+"-"+bigScreenActivityLine.getX()); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok(bigScreenActivityLines); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R projectActivityProject(CommonPage commonPage) { | 
|---|
|  |  |  | return R.ok(comActActivityDAO.selectProjectActivity(new Page(commonPage.getPage(),commonPage.getSize()))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R projectType(String name) { | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | //新增院落议事数 | 
|---|
|  |  |  | List<StatisticsCommVO> ylysAddPolylineData = comActFourMemberDao.retrieveYLYSAddPolylineData(communityId); | 
|---|
|  |  |  | statisticsInfo.setYlysAddPolylineData(ylysAddPolylineData); | 
|---|
|  |  |  | //累计院落议事数 | 
|---|
|  |  |  | List<StatisticsCommVO> ylysTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | ylysAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActFourMemberDao.retrieveYLYSTotalPolylineData(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | ylysTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | statisticsInfo.setYlysTotalPolylineData(ylysTotalPolylineData); | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | .divide(new BigDecimal(teamCount), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | .divide(new BigDecimal(adjustCount), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | .divide(new BigDecimal(controlCount), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | .divide(new BigDecimal(count), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | 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()) | 
|---|
|  |  |  | .divide(new BigDecimal(sum), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | } 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) | 
|---|
|  |  |  | .divide(new BigDecimal(count), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | 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)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 金沙定制页面-四长四员院落议事展示列表 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageCourtyardDiscuss(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActDiscussDAO.pageCourtyardDiscuss(page, pageBaseDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 金沙定制页面-院落议事 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R getCourtyardBaseData(Long communityId) { | 
|---|
|  |  |  | BigScreenCourtyardStatisticsInfo statisticsInfo = comActDiscussDAO.getCourtyardBaseData(communityId); | 
|---|
|  |  |  | //新增院落议事数 | 
|---|
|  |  |  | List<StatisticsCommVO> discussAddPolylineData = comActFourMemberDao.retrieveYLYSAddPolylineData(communityId); | 
|---|
|  |  |  | statisticsInfo.setDiscussAddPolylineData(discussAddPolylineData); | 
|---|
|  |  |  | //累计院落议事数 | 
|---|
|  |  |  | List<StatisticsCommVO> discussTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | discussAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActFourMemberDao.retrieveYLYSTotalPolylineData(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | discussTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | statisticsInfo.setDiscussTotalPolylineData(discussTotalPolylineData); | 
|---|
|  |  |  | return R.ok(statisticsInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 孵化中心-基础数据 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R getHatchBaseData(Long communityId) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(communityId); | 
|---|
|  |  |  | BigScreenHatchStatisticsInfo statisticsInfo = comActSocialOrgHatchDAO.getHatchBaseData(communityId, comActDO.getStreetId()); | 
|---|
|  |  |  | //孵化进程占比圆形图数据 | 
|---|
|  |  |  | List<StatisticsCommVO> hatchScheduleCircleData = comActSocialOrgHatchDAO.getHatchScheduleCircleData(comActDO.getStreetId()); | 
|---|
|  |  |  | statisticsInfo.setHatchScheduleCircleData(hatchScheduleCircleData); | 
|---|
|  |  |  | //孵化状态占比柱形数据 | 
|---|
|  |  |  | List<StatisticsCommVO> hatchStatusColumnData = comActSocialOrgHatchDAO.getHatchStatusColumnData(comActDO.getStreetId()); | 
|---|
|  |  |  | statisticsInfo.setHatchStatusColumnData(hatchStatusColumnData); | 
|---|
|  |  |  | //街道组织占比柱形数据 | 
|---|
|  |  |  | List<StatisticsCommVO> streetOrgColumnData = comActSocialOrgHatchDAO.getStreetOrgColumnData(comActDO.getStreetId()); | 
|---|
|  |  |  | if (nonNull(streetOrgColumnData) && !streetOrgColumnData.isEmpty()) { | 
|---|
|  |  |  | streetOrgColumnData.forEach(e -> e.setStatisticsCommVOS(comActSocialOrgHatchDAO.getStreetOrgChildData(e.getFiled()))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setStreetOrgColumnData(streetOrgColumnData); | 
|---|
|  |  |  | return R.ok(statisticsInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 孵化中心-孵化成果展示列表 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageHatchResult(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(pageBaseDTO.getCommunityId()); | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActSocialOrgDao.pageHatchResult(page, pageBaseDTO, comActDO.getStreetId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 孵化中心-孵化进度展示列表 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageHatchSchedule(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(pageBaseDTO.getCommunityId()); | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActSocialOrgDao.pageHatchSchedule(page, pageBaseDTO, comActDO.getStreetId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 五社联动基础数据 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R getFiveAssociationsBaseData(Long communityId) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(communityId); | 
|---|
|  |  |  | BigScreenFiveAssociationsStatisticsInfo statisticsInfo = comActSocialProjectDao.getFiveAssociationsBaseData(communityId, comActDO.getStreetId()); | 
|---|
|  |  |  | //社区企业服务分类占比圆形图数据 | 
|---|
|  |  |  | Integer enterpriseNum = statisticsInfo.getEnterpriseNum(); | 
|---|
|  |  |  | List<StatisticsCommVO> enterpriseServiceTypeCircleData = comActEnterpriseDAO.getEnterpriseServiceTypeCircleData(communityId); | 
|---|
|  |  |  | if (nonNull(enterpriseServiceTypeCircleData) && !enterpriseServiceTypeCircleData.isEmpty() && enterpriseNum > 0) { | 
|---|
|  |  |  | enterpriseServiceTypeCircleData.forEach(e -> { | 
|---|
|  |  |  | e.setPercent(new BigDecimal(e.getNum()) | 
|---|
|  |  |  | .divide(new BigDecimal(enterpriseNum), 2, BigDecimal.ROUND_HALF_UP) | 
|---|
|  |  |  | .multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setEnterpriseServiceTypeCircleData(enterpriseServiceTypeCircleData); | 
|---|
|  |  |  | //社区工作者年龄段占比圆形图数据 | 
|---|
|  |  |  | List<StatisticsCommVO> socialWorkerAgeStageCircleData = comActEnterpriseDAO.getSocialWorkerAgeStageCircleData(communityId); | 
|---|
|  |  |  | Integer socialWorkerNum = statisticsInfo.getSocialWorkerNum(); | 
|---|
|  |  |  | if (nonNull(socialWorkerAgeStageCircleData) && !socialWorkerAgeStageCircleData.isEmpty() && socialWorkerNum > 0) { | 
|---|
|  |  |  | socialWorkerAgeStageCircleData.forEach(e -> { | 
|---|
|  |  |  | e.setPercent(new BigDecimal(e.getNum()) | 
|---|
|  |  |  | .divide(new BigDecimal(socialWorkerNum), 2, BigDecimal.ROUND_HALF_UP) | 
|---|
|  |  |  | .multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setSocialWorkerAgeStageCircleData(socialWorkerAgeStageCircleData); | 
|---|
|  |  |  | //社区工作者服务分类占比圆形图数据 | 
|---|
|  |  |  | List<StatisticsCommVO> socialWorkerServiceTypeCircleData = comActEnterpriseDAO.getSocialWorkerServiceTypeCircleData(communityId); | 
|---|
|  |  |  | if (nonNull(socialWorkerServiceTypeCircleData) && !socialWorkerServiceTypeCircleData.isEmpty() && socialWorkerNum > 0) { | 
|---|
|  |  |  | socialWorkerServiceTypeCircleData.forEach(e -> { | 
|---|
|  |  |  | e.setPercent(new BigDecimal(e.getNum()) | 
|---|
|  |  |  | .divide(new BigDecimal(socialWorkerNum), 2, BigDecimal.ROUND_HALF_UP) | 
|---|
|  |  |  | .multiply(new BigDecimal(100)).setScale(0)); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticsInfo.setSocialWorkerServiceTypeCircleData(socialWorkerServiceTypeCircleData); | 
|---|
|  |  |  | return R.ok(statisticsInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 五社联动项目展示列表 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageSocialProjectList(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(pageBaseDTO.getCommunityId()); | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActSocialProjectDao.pageSocialProjectList(page, pageBaseDTO, comActDO.getStreetId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 五社联动社会组织展示列表 | 
|---|
|  |  |  | * @param pageBaseDTO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R pageSocialOrgList(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | ComActDO comActDO = comActDAO.selectById(pageBaseDTO.getCommunityId()); | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActSocialOrgDao.pageSocialOrgList(page, pageBaseDTO, comActDO.getStreetId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 人大代表 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R dpcBase(Long communityId) { | 
|---|
|  |  |  | BigScreenDpcStatisticsInfo statisticsInfo = comActEasyPhotoDAO.selectDpcBaseData(communityId); | 
|---|
|  |  |  | //随手拍新增折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoAddPolylineData = comActEasyPhotoDAO.getEasyPhotoAddPolylineDataForDpc(communityId); | 
|---|
|  |  |  | statisticsInfo.setEasyPhotoAddPolylineData(easyPhotoAddPolylineData); | 
|---|
|  |  |  | //随手拍累计折线数据 | 
|---|
|  |  |  | List<StatisticsCommVO> easyPhotoTotalPolylineData = new ArrayList<>(); | 
|---|
|  |  |  | easyPhotoAddPolylineData.forEach(e -> { | 
|---|
|  |  |  | StatisticsCommVO temp = comActEasyPhotoDAO.getEasyPhotoTotalPolylineDateForDpc(communityId, e.getFiled()); | 
|---|
|  |  |  | temp.setFiled(e.getFiled()); | 
|---|
|  |  |  | easyPhotoTotalPolylineData.add(temp); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | statisticsInfo.setEasyPhotoTotalPolylineData(easyPhotoTotalPolylineData); | 
|---|
|  |  |  | return R.ok(statisticsInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 人大代表-随手拍展示列表 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R dpcEasyPhotoList(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | Page page = retrievePage(pageBaseDTO); | 
|---|
|  |  |  | return R.ok(comActEasyPhotoDAO.dpcEasyPhotoList(page, pageBaseDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Page retrievePage(PageBaseDTO pageBaseDTO) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return page; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public List<BigScreenActivityLine> getPastMonth(){ | 
|---|
|  |  |  | List<BigScreenActivityLine> bigScreenActivityLines=new ArrayList<>(); | 
|---|
|  |  |  | for(int i=11;i>=0;i--){ | 
|---|
|  |  |  | BigScreenActivityLine bigScreenActivityLine=new BigScreenActivityLine(); | 
|---|
|  |  |  | String date=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"MM"); | 
|---|
|  |  |  | String year=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"yyyy"); | 
|---|
|  |  |  | bigScreenActivityLine.setX(date); | 
|---|
|  |  |  | bigScreenActivityLine.setYear(year); | 
|---|
|  |  |  | bigScreenActivityLines.add(bigScreenActivityLine); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return bigScreenActivityLines; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|