From c40f8e3d2e08e108780091776437242528bf61d6 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期三, 20 七月 2022 17:44:56 +0800 Subject: [PATCH] bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java | 183 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 172 insertions(+), 11 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 856a0c2..c5c13d4 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 @@ -14,17 +14,7 @@ import javax.annotation.Resource; -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.BigScreenCourtyardStatisticsInfo; -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 com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -36,15 +26,21 @@ 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; @@ -57,32 +53,43 @@ 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; @@ -150,6 +157,12 @@ private ComFmsServiceDAO comFmsServiceDAO; @Resource private ComMngVolunteerMngDAO comMngVolunteerMngDAO; + @Resource + private ComActSocialOrgHatchDAO comActSocialOrgHatchDAO; + @Resource + private ComActDAO comActDAO; + @Resource + private ComActEnterpriseDAO comActEnterpriseDAO; /** * 大数据分析平台-居民自治 @@ -1217,6 +1230,154 @@ 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) { Long pageNum = pageBaseDTO.getPageNum(); Long size = pageBaseDTO.getPageSize(); -- Gitblit v1.7.1