springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/PageBaseDTO.java
@@ -24,6 +24,9 @@ @ApiModelProperty(value = "查询参数id", example = "10") private Long paramId; @ApiModelProperty(value = "字符串类型查询参数", example = "10") private String param2; @ApiModelProperty(value = "社区id", hidden = true) private Long communityId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenResidentActStatisticsInfo.java
New file @@ -0,0 +1,36 @@ package com.panzhihua.common.model.vos.community.bigscreen; import java.util.List; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @title: BigScreenResidentActStatisticsInfo * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 居民活动大屏统计数据 * @author: hans * @date: 2021/12/24 15:06 */ @Data @ApiModel("居民活动大屏统计数据") public class BigScreenResidentActStatisticsInfo { @ApiModelProperty("居民活动发布次数") private Integer publishNum = 0; @ApiModelProperty("居民活动参与人数") private Integer joinNum = 0; @ApiModelProperty(value = "居民活动饼图数据") private List<StatisticsCommVO> actCircleData; @ApiModelProperty(value = "居民活动新增折线数据") private List<StatisticsCommVO> actAddPolylineData; @ApiModelProperty(value = "居民活动累计折线数据") private List<StatisticsCommVO> actTotalPolylineData; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenVolunteerActStatisticsInfo.java
New file @@ -0,0 +1,36 @@ package com.panzhihua.common.model.vos.community.bigscreen; import java.util.List; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @title: BigScreenVolunteerActStatisticsInfo * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 志愿者活动大屏统计数据 * @author: hans * @date: 2021/12/24 16:25 */ @Data @ApiModel("志愿者活动大屏统计数据") public class BigScreenVolunteerActStatisticsInfo { @ApiModelProperty("志愿者活动发布次数") private Integer publishNum = 0; @ApiModelProperty("志愿者活动参与人数") private Integer joinNum = 0; @ApiModelProperty(value = "志愿者活动饼图数据") private List<StatisticsCommVO> actCircleData; @ApiModelProperty(value = "志愿者活动新增折线数据") private List<StatisticsCommVO> actAddPolylineData; @ApiModelProperty(value = "志愿者活动累计折线数据") private List<StatisticsCommVO> actTotalPolylineData; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/ResidentAutonomyStatisticsVO.java
@@ -52,6 +52,12 @@ @ApiModelProperty(value = "业主委员会小区覆盖率") private BigDecimal areaCoverPercent; @ApiModelProperty(value = "业主委员会党员占比大于50%数量") private Integer committeeMostlyTotal = 0; @ApiModelProperty(value = "业主委员会党员占比") private List<StatisticsCommVO> committeePartyPercent; @ApiModelProperty(value = "议事投票本月总数") private Integer discussCurrentMonCount; @@ -126,4 +132,16 @@ @ApiModelProperty(value = "爱心义仓捐赠物品图片") private List<String> warehouseImages; @ApiModelProperty(value = "居民活动本月总数") private Integer residentActCurrentMonCount; @ApiModelProperty(value = "居民活动总数") private Integer residentActTotalCount; @ApiModelProperty(value = "居民活动分类柱状统计") private List<StatisticsCommVO> residentActHistogram; @ApiModelProperty(value = "居民自治组织数") private Integer residentAutonomyOrgCount = 0; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7680,4 +7680,36 @@ */ @PostMapping("/screen/index/questionnaireList") R indexQuestionnaireList(@RequestBody PageBaseDTO pageBaseDTO); /** * 首页二级页面-居民活动 * @param communityId * @return */ @GetMapping("/screen/index/residentAct") R indexResidentAct(@RequestParam("communityId") Long communityId); /** * 首页二级页面-居民活动展示列表 * @param pageBaseDTO * @return */ @PostMapping("/screen/index/residentActList") R indexResidentActList(@RequestBody PageBaseDTO pageBaseDTO); /** * 首页二级页面-志愿者活动 * @param communityId * @return */ @GetMapping("/screen/index/volunteerAct") R indexVolunteerAct(@RequestParam("communityId") Long communityId); /** * 首页二级页面-志愿者活动展示列表 * @param pageBaseDTO * @return */ @PostMapping("/screen/index/volunteerActList") R indexVolunteerActList(@RequestBody PageBaseDTO pageBaseDTO); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -1,46 +1,68 @@ package com.panzhihua.community_backstage.api; import javax.annotation.Resource; import javax.validation.Valid; import cn.hutool.http.HttpUtil; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenResidentActStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerActStatisticsInfo; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.constants.HttpConstant; 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.community.ComActDynVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyOrg; import com.panzhihua.common.model.vos.community.bigscreen.WestScreenStatics; import com.panzhihua.common.model.vos.partybuilding.PartyBuildingComPbDynVO; import com.panzhihua.common.service.partybuilding.PartyBuildingService; import com.panzhihua.common.model.vos.community.ComActDynVO; import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; import com.panzhihua.common.model.vos.community.ComActMicroWishVO; import com.panzhihua.common.model.vos.community.ComActQuestnaireVO; import com.panzhihua.common.model.vos.community.bigscreen.*; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; import com.panzhihua.common.utlis.HttpClientUtil; import com.panzhihua.common.utlis.HttpUtils; import io.swagger.annotations.ApiImplicitParam; import org.springframework.web.bind.annotation.*; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.PageBaseDTO; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDTO; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; 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.ComActMicroWishVO; import com.panzhihua.common.model.vos.community.ComActQuestnaireVO; 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.BigScreenServiceData; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenServiceUser; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyOrg; import com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO; import com.panzhihua.common.model.vos.community.bigscreen.IndexInfo; import com.panzhihua.common.model.vos.community.bigscreen.ResidentAutonomyStatisticsVO; import com.panzhihua.common.model.vos.community.bigscreen.WestScreenStatics; import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.*; import com.panzhihua.common.model.vos.community.screen.event.EventComprehensiveGovernanceStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.EventGridMemberVO; import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.EventListVO; import com.panzhihua.common.model.vos.community.screen.event.EventNewStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.EventPopulationStatisticsVO; import com.panzhihua.common.model.vos.community.screen.event.EventPopulationStreetVO; import com.panzhihua.common.model.vos.community.screen.event.EventStatisticsVO; import com.panzhihua.common.model.vos.community.screen.index.IndexStatisticsVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; import com.panzhihua.common.model.vos.partybuilding.PartyBuildingComPbDynVO; import com.panzhihua.common.model.vos.screen.ScreenDrawEventPopulationTotalVO; import com.panzhihua.common.model.vos.screen.ScreenDrawEventVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.service.grid.GridService; import com.panzhihua.common.service.partybuilding.PartyBuildingService; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.HttpClientUtil; import com.panzhihua.common.utlis.HttpUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -449,4 +471,42 @@ pagePopularMerchantDTO.setCommunityId(communityId); return communityService.getScreenPopularMerchants(pagePopularMerchantDTO); } /** * 首页二级页面-居民活动 */ @ApiOperation(value = "首页二级页面-居民活动", response = BigScreenResidentActStatisticsInfo.class) @GetMapping("/index/residentAct") public R indexResidentAct() { return communityService.indexResidentAct(this.getCommunityId()); } /** * 首页二级页面-居民活动展示列表 */ @ApiOperation(value = "首页二级页面-居民活动展示列表", response = ComActActivityVO.class) @PostMapping("/index/residentActList") public R indexResidentActList(@RequestBody PageBaseDTO pageBaseDTO) { pageBaseDTO.setCommunityId(this.getCommunityId()); return communityService.indexResidentActList(pageBaseDTO); } /** * 首页二级页面-志愿者活动 */ @ApiOperation(value = "首页二级页面-志愿者活动", response = BigScreenVolunteerActStatisticsInfo.class) @GetMapping("/index/volunteerAct") public R indexVolunteerAct() { return communityService.indexVolunteerAct(this.getCommunityId()); } /** * 首页二级页面-志愿者活动展示列表 */ @ApiOperation(value = "首页二级页面-志愿者活动展示列表", response = ComActActivityVO.class) @PostMapping("/index/volunteerActList") public R indexVolunteerActList(@RequestBody PageBaseDTO pageBaseDTO) { pageBaseDTO.setCommunityId(this.getCommunityId()); return communityService.indexVolunteerActList(pageBaseDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -296,4 +296,43 @@ return bigScreenStatisticsService.getScreenPopularMerchants(pagePopularMerchantDTO); } /** * 首页二级页面-居民活动 * @param communityId * @return */ @GetMapping("/index/residentAct") public R indexResidentAct(@RequestParam("communityId") Long communityId) { return bigScreenStatisticsService.indexResidentAct(communityId); } /** * 首页二级页面-居民活动展示列表 * @param pageBaseDTO * @return */ @PostMapping("/index/residentActList") public R indexResidentActList(@RequestBody PageBaseDTO pageBaseDTO) { return bigScreenStatisticsService.indexResidentActList(pageBaseDTO); } /** * 首页二级页面-志愿者活动 * @param communityId * @return */ @GetMapping("/index/volunteerAct") public R indexVolunteerAct(@RequestParam("communityId") Long communityId) { return bigScreenStatisticsService.indexVolunteerAct(communityId); } /** * 首页二级页面-志愿者活动展示列表 * @param pageBaseDTO * @return */ @PostMapping("/index/volunteerActList") public R indexVolunteerActList(@RequestBody PageBaseDTO pageBaseDTO) { return bigScreenStatisticsService.indexVolunteerActList(pageBaseDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -4,8 +4,10 @@ import java.util.List; import java.util.Map; import com.panzhihua.common.model.dtos.PageBaseDTO; import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -231,4 +233,39 @@ * @return */ int addActivityType(@Param("comActActivityTypeVO") ComActActivityTypeVO comActActivityTypeVO); /** * 居民活动分类统计数据 * @param communityId * @param isResidentAct * @return */ List<StatisticsCommVO> selectResidentActHistogramData(@Param("communityId") Long communityId, @Param("isResidentAct") boolean isResidentAct); /** * 居民活动分类人口参与统计 * @param communityId * @param isResidentAct * @return */ List<StatisticsCommVO> getIndexResidentActBaseData(@Param("communityId") Long communityId, @Param("isResidentAct") boolean isResidentAct); /** * 获取活动新增折线数据 * @param communityId * @param isResidentAct * @return */ List<StatisticsCommVO> getActAddPolylineData(@Param("communityId") Long communityId, @Param("isResidentAct") boolean isResidentAct); /** * 获取活动累计折线数据 * @param communityId * @param isResidentAct * @param date * @return */ StatisticsCommVO getActTotalPolylineData(@Param("communityId") Long communityId, @Param("isResidentAct") boolean isResidentAct, @Param("date") String date); IPage<ComActActivityVO> indexActList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO, @Param("isResidentAct") boolean isResidentAct); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActCommitteeDao.java
@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.property.CommonPage; import com.panzhihua.common.model.vos.community.ComActCommiteeVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import org.apache.ibatis.annotations.Mapper; import com.panzhihua.service_community.entity.ComActCommittee; import org.apache.ibatis.annotations.Param; import java.util.List; /** * (ComActCommittee)表数据库访问层 @@ -25,4 +28,10 @@ */ IPage<ComActCommiteeVO> pageList(Page page, @Param("commonPage")CommonPage commonPage); /** * 业主委员会党员占比 * @param communityId * @return */ List<StatisticsCommVO> selectCommitteePartyPercent(@Param("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java
@@ -123,4 +123,32 @@ * @return */ R indexQuestionnaireList(PageBaseDTO pageBaseDTO); /** * 首页二级页面-居民活动 * @param communityId * @return */ R indexResidentAct(Long communityId); /** * 首页二级页面-居民活动展示列表 * @param pageBaseDTO * @return */ R indexResidentActList(PageBaseDTO pageBaseDTO); /** * 首页二级页面-志愿者活动 * @param communityId * @return */ R indexVolunteerAct(Long communityId); /** * 首页二级页面-志愿者活动展示列表 * @param pageBaseDTO * @return */ R indexVolunteerActList(PageBaseDTO pageBaseDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -14,6 +14,10 @@ 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 org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -91,6 +95,12 @@ @Resource private ComActDynDAO comActDynDAO; @Resource private ComActActivityDAO comActActivityDAO; @Resource private ComActCommitteeDao comActCommitteeDao; /** * 大数据分析平台-居民自治 @@ -187,6 +197,19 @@ //捐赠图片 List<String> warehouseImages = comActWarehouseDonatesDao.getWarehouseImages(communityId, pageSize); statisticsVO.setWarehouseImages(warehouseImages); //居民活动柱状统计 List<StatisticsCommVO> residentActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, true); //居民活动发布总数 int residentActTotalCount = 0; if (!residentActHistogram.isEmpty()) { residentActTotalCount = residentActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); } statisticsVO.setResidentActTotalCount(residentActTotalCount); statisticsVO.setResidentActHistogram(residentActHistogram); //业主委员会党员占比 List<StatisticsCommVO> committeePartyPercent = comActCommitteeDao.selectCommitteePartyPercent(communityId); statisticsVO.setCommitteePartyPercent(committeePartyPercent); return R.ok(statisticsVO); } @@ -649,6 +672,138 @@ return R.ok(comActQuestnaireDAO.selectQuestionnaireDisplayList(page, pageBaseDTO)); } /** * 首页二级页面-居民活动 * @param communityId * @return */ @Override public R indexResidentAct(Long communityId) { BigScreenResidentActStatisticsInfo statisticsInfo = new BigScreenResidentActStatisticsInfo(); List<StatisticsCommVO> actCircleData = comActActivityDAO.getIndexResidentActBaseData(communityId, true); statisticsInfo.setActCircleData(actCircleData); if (!actCircleData.isEmpty()) { statisticsInfo.setJoinNum(actCircleData.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum()); } List<StatisticsCommVO> residentActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, true); //居民活动发布总数 int publishNum = 0; if (!residentActHistogram.isEmpty()) { publishNum = residentActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); } 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()); temp.setFiled(e.getFiled()); actTotalPolylineData.add(temp); }); statisticsInfo.setActTotalPolylineData(actTotalPolylineData); return R.ok(statisticsInfo); } /** * 首页二级页面-居民活动展示列表 * @param pageBaseDTO * @return */ @Override public R indexResidentActList(PageBaseDTO pageBaseDTO) { Page page = retrievePage(pageBaseDTO); return R.ok(comActActivityDAO.indexActList(page, pageBaseDTO, true)); } /** * 首页二级页面-志愿者活动 * @param communityId * @return */ @Override public R indexVolunteerAct(Long communityId) { BigScreenVolunteerActStatisticsInfo statisticsInfo = new BigScreenVolunteerActStatisticsInfo(); List<StatisticsCommVO> actCircleData = comActActivityDAO.getIndexResidentActBaseData(communityId, false); statisticsInfo.setActCircleData(actCircleData); if (!actCircleData.isEmpty()) { statisticsInfo.setJoinNum(actCircleData.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum()); } List<StatisticsCommVO> volunteerActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, false); //志愿者活动发布总数 int publishNum = 0; if (!volunteerActHistogram.isEmpty()) { publishNum = volunteerActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); } 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()); temp.setFiled(e.getFiled()); actTotalPolylineData.add(temp); }); statisticsInfo.setActTotalPolylineData(actTotalPolylineData); return R.ok(statisticsInfo); } /** * 首页二级页面-志愿者活动展示列表 * @param pageBaseDTO * @return */ @Override public R indexVolunteerActList(PageBaseDTO pageBaseDTO) { Page page = retrievePage(pageBaseDTO); return R.ok(comActActivityDAO.indexActList(page, pageBaseDTO, false)); } private Page retrievePage(PageBaseDTO pageBaseDTO) { Long pageNum = pageBaseDTO.getPageNum(); Long size = pageBaseDTO.getPageSize(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -146,4 +146,83 @@ <select id="listActivityType" resultType="com.panzhihua.common.model.vos.community.ComActActivityTypeVO"> SELECT * FROM com_act_activity_type WHERE `type` = #{type} AND community_id = #{communityId} ORDER BY id ASC </select> <select id="selectResidentActHistogramData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT activity_type AS filed, COUNT(id) AS num FROM com_act_activity WHERE community_id = #{communityId} <if test="isResidentAct"> AND volunteer_max = 0 </if> <if test="!isResidentAct"> AND volunteer_max != 0 </if> GROUP BY filed </select> <select id="getIndexResidentActBaseData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT filed, num, ROUND(num/total,2) AS percent FROM (SELECT t1.activity_type AS filed, COUNT(t2.id) AS num FROM com_act_activity t1 LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) t2 ON t1.id = t2.activity_id WHERE t1.community_id = #{communityId} <if test="isResidentAct"> AND t1.volunteer_max = 0 </if> <if test="!isResidentAct"> AND t1.volunteer_max != 0 </if> GROUP BY filed) temp1, (SELECT COUNT(t2.id) AS total FROM com_act_activity t1 LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) t2 ON t1.id = t2.activity_id WHERE t1.community_id = #{communityId} <if test="isResidentAct"> AND t1.volunteer_max = 0 </if> <if test="!isResidentAct"> AND t1.volunteer_max != 0 </if> ) temp2 </select> <select id="getActAddPolylineData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT DATE_FORMAT( publish_at, '%m' ) AS filed, COUNT(id) AS num FROM com_act_activity WHERE community_id = #{communityId} <if test="isResidentAct"> AND volunteer_max = 0 </if> <if test="!isResidentAct"> AND volunteer_max != 0 </if> AND DATE_FORMAT( publish_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed </select> <select id="getActTotalPolylineData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT COUNT(id) AS num FROM com_act_activity WHERE community_id = #{communityId} <if test="isResidentAct"> AND volunteer_max = 0 </if> <if test="!isResidentAct"> AND volunteer_max != 0 </if> AND DATE_FORMAT( publish_at, '%Y%m' ) <= #{date} </select> <select id="indexActList" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> SELECT id, `status`, activity_type, activity_name, cover FROM com_act_activity WHERE community_id = #{pageBaseDTO.communityId} <if test="isResidentAct"> AND volunteer_max = 0 </if> <if test="!isResidentAct"> AND volunteer_max != 0 </if> <if test="pageBaseDTO.param2 != null and pageBaseDTO.param2 != """> AND activity_type = #{pageBaseDTO.param2} </if> ORDER BY id DESC </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActCommitteeMapper.xml
@@ -38,5 +38,11 @@ </where> order by t.create_time desc </select> <select id="selectCommitteePartyPercent" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT `name` AS filed, 0 AS num, 0 AS percent FROM com_act_committee WHERE community_id = #{communityId} </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml
@@ -316,7 +316,10 @@ WHERE d1.community_id = #{communityId} AND d1.is_del = 2 AND `type` = 1) t16, (SELECT COUNT(DISTINCT d2.user_id) AS voteCount FROM com_act_discuss d1 INNER JOIN com_act_discuss_option_user d2 ON d1.id = d2.discuss_id WHERE d1.community_id = #{communityId} AND d1.is_del = 2 AND `type` = 2) t17 WHERE d1.community_id = #{communityId} AND d1.is_del = 2 AND `type` = 2) t17, (SELECT COUNT(id) AS residentActCurrentMonCount FROM com_act_activity WHERE community_id = #{communityId} AND volunteer_max = 0 AND DATE_FORMAT( publish_at, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )) t18 </select> <select id="selectGridsGovernance" resultType="com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO">