From 1ed946036aa3110055b15cc39157721221d5e5b7 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期二, 15 二月 2022 10:35:41 +0800 Subject: [PATCH] 三社功能提交 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java | 108 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 89 insertions(+), 19 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 7ab345f..d080650 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,6 +14,8 @@ import javax.annotation.Resource; +import com.panzhihua.common.model.vos.community.bigscreen.*; +import com.panzhihua.service_community.dao.*; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -22,29 +24,10 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; -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.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.BigScreenQuestionnaireStatisticsInfo; -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.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.service_community.dao.ComActDiscussDAO; -import com.panzhihua.service_community.dao.ComActDynDAO; -import com.panzhihua.service_community.dao.ComActEasyPhotoDAO; -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.ComActWarehouseDonatesDao; -import com.panzhihua.service_community.dao.ComMngPopulationDAO; -import com.panzhihua.service_community.dao.ComPropertyDao; -import com.panzhihua.service_community.dao.ConvenientMerchantDAO; import com.panzhihua.service_community.service.BigScreenStatisticsService; import lombok.extern.slf4j.Slf4j; @@ -91,6 +74,15 @@ @Resource private ComActDynDAO comActDynDAO; + + @Resource + private ComActSocialProjectDao comActSocialProjectDao; + + @Resource + private ComActSocialOrgDao comActSocialOrgDao; + + @Resource + private ComActSocialWorkerDao comActSocialWorkerDao; /** * 大数据分析平台-居民自治 @@ -649,6 +641,84 @@ return R.ok(comActQuestnaireDAO.selectQuestionnaireDisplayList(page, pageBaseDTO)); } + @Override + public R hmkBaseInfo() { + BigScreenHmkBaseInfo bigScreenHmkBaseInfo=comActSocialProjectDao.selectIndexBaseInfo(); + //项目数据 + BigScreenHmkProjectInfo bigScreenHmkProjectInfo=comActSocialProjectDao.selectBaseInfo(); + List<BigScreenHmkProjectTypeInfo> typeInfo=comActSocialProjectDao.selectType(); + if(bigScreenHmkProjectInfo.getCount()>0){ + typeInfo.forEach(bigScreenHmkProjectTypeInfo -> { + bigScreenHmkProjectTypeInfo.setPercent(bigScreenHmkProjectTypeInfo.getCount()/bigScreenHmkProjectInfo.getCount()); + }); + } + bigScreenHmkProjectInfo.setTypeInfoList(typeInfo); + //活动数据 + Integer countAll=comActSocialProjectDao.selectActivity(0); + BigScreenHmkProjectTypeInfo jm=new BigScreenHmkProjectTypeInfo(); + jm.setName("居民活动"); + jm.setCount(comActSocialProjectDao.selectActivity(2)); + if(countAll>0){ + jm.setPercent(jm.getCount()/countAll); + } + BigScreenHmkProjectTypeInfo zyz=new BigScreenHmkProjectTypeInfo(); + zyz.setName("志愿者活动"); + zyz.setCount(comActSocialProjectDao.selectActivity(1)); + 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(); + List<BigScreenHmkProjectTypeInfo> typeInfoList= comActSocialOrgDao.selectType(); + 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); + BigScreenHmkProjectTypeInfo ss=new BigScreenHmkProjectTypeInfo(); + ss.setName("30岁以下"); + ss.setCount(comActSocialWorkerDao.selectType(1)); + if(socialAll>0){ + ss.setPercent(ss.getCount()/socialAll); + } + BigScreenHmkProjectTypeInfo wj=new BigScreenHmkProjectTypeInfo(); + wj.setName("30-59岁"); + wj.setCount(comActSocialWorkerDao.selectType(2)); + if(socialAll>0){ + wj.setPercent(wj.getCount()/socialAll); + } + BigScreenHmkProjectTypeInfo ls=new BigScreenHmkProjectTypeInfo(); + ls.setName("60岁以上"); + ls.setCount(comActSocialWorkerDao.selectType(2)); + 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(); + if(socialAll>0){ + socialWorkerSkill.forEach(bigScreenHmkProjectTypeInfo -> { + bigScreenHmkProjectTypeInfo.setPercent(bigScreenHmkProjectTypeInfo.getCount()/socialAll); + }); + } + bigScreenHmkSocialWorkerInfo.setSocialWorkerSkill(socialWorkerSkill); + bigScreenHmkBaseInfo.setBigScreenHmkSocialWorkerInfo(bigScreenHmkSocialWorkerInfo); + + return R.ok(bigScreenHmkBaseInfo); + } + private Page retrievePage(PageBaseDTO pageBaseDTO) { Long pageNum = pageBaseDTO.getPageNum(); Long size = pageBaseDTO.getPageSize(); -- Gitblit v1.7.1