springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenDpcStatisticsInfo.java
New file @@ -0,0 +1,30 @@ 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: BigScreenEasyPhotoStatisticsInfo * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 随手拍大屏统计数据 * @author: hans * @date: 2021/12/16 13:31 */ @Data @ApiModel("随手拍大屏统计数据") public class BigScreenDpcStatisticsInfo { @ApiModelProperty("人大个数") private Integer dpcNum; @ApiModelProperty(value = "随手拍新增折线数据") private List<StatisticsCommVO> easyPhotoAddPolylineData; @ApiModelProperty(value = "随手拍累计折线数据") private List<StatisticsCommVO> easyPhotoTotalPolylineData; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -9837,4 +9837,19 @@ */ @PostMapping("/dpc/feedback") R addEasyPhotoFeedbackForDpc(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO); /** * 人大代表 * @param communityId * @return */ @GetMapping("/screen/dpc/base") R dpcBase(@RequestParam("communityId") Long communityId); /** * 人大代表-随手拍展示列表 * @return */ @PostMapping("/screen/dpc/easyPhotoList") R dpcEasyPhotoList(@RequestBody PageBaseDTO pageBaseDTO); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -6,6 +6,7 @@ import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenFiveAssociationsStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenHatchStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO; @@ -722,4 +723,17 @@ pageBaseDTO.setCommunityId(this.getCommunityId()); return communityService.pageSocialOrgList(pageBaseDTO); } @ApiOperation(value = "人大代表", response = BigScreenDpcStatisticsInfo.class) @GetMapping("/dpc/base") public R dpcBase() { return communityService.dpcBase(this.getCommunityId()); } @ApiOperation(value = "人大代表-随手拍展示列表", response = ComActEasyPhotoVO.class) @PostMapping("/dpc/easyPhotoList") public R dpcEasyPhotoList(@RequestBody PageBaseDTO pageBaseDTO) { pageBaseDTO.setCommunityId(this.getCommunityId()); return communityService.dpcEasyPhotoList(pageBaseDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -573,4 +573,23 @@ public R pageSocialOrgList(@RequestBody PageBaseDTO pageBaseDTO) { return bigScreenStatisticsService.pageSocialOrgList(pageBaseDTO); } /** * 人大代表 * @param communityId * @return */ @GetMapping("/dpc/base") public R dpcBase(@RequestParam("communityId") Long communityId) { return bigScreenStatisticsService.dpcBase(communityId); } /** * 人大代表-随手拍展示列表 * @return */ @PostMapping("/dpc/easyPhotoList") public R dpcEasyPhotoList(@RequestBody PageBaseDTO pageBaseDTO) { return bigScreenStatisticsService.dpcEasyPhotoList(pageBaseDTO); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -8,6 +8,7 @@ import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import com.panzhihua.common.model.vos.community.TodoEventsVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenEasyPhotoStatisticsInfo; import com.panzhihua.common.model.vos.community.bigscreen.BigscreenGridsGovernanceStatisticsVO; import com.panzhihua.common.model.vos.community.bigscreen.GridsGovernanceStatisticsVO; @@ -422,4 +423,34 @@ * @return */ List<ComActEasyPhotoVO> getPartyBuildIngRecord(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); /** * 获取上报人大代表的随手拍新增数据 * @param communityId * @return */ List<StatisticsCommVO> getEasyPhotoAddPolylineDataForDpc(@Param("communityId") Long communityId); /** * 上报人大代表的随手拍累计折线数据 * @param communityId * @param date * @return */ StatisticsCommVO getEasyPhotoTotalPolylineDateForDpc(@Param("communityId") Long communityId, @Param("date") String date); /** * 人大代表-随手拍展示列表 * @param page * @param pageBaseDTO * @return */ IPage<ComActEasyPhotoVO> dpcEasyPhotoList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 获取人大代表基础数据 * @param communityId * @return */ BigScreenDpcStatisticsInfo selectDpcBaseData(@Param("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java
@@ -333,4 +333,17 @@ * @return */ R pageSocialOrgList(PageBaseDTO pageBaseDTO); /** * 人大代表 * @param communityId * @return */ R dpcBase(Long communityId); /** * 人大代表-随手拍展示列表 * @return */ R dpcEasyPhotoList(PageBaseDTO pageBaseDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -14,6 +14,7 @@ import javax.annotation.Resource; 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; @@ -1345,6 +1346,38 @@ 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(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml
@@ -562,5 +562,50 @@ </if> order by p.create_at desc </select> <select id="getEasyPhotoAddPolylineDataForDpc" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT filed, SUM(num) AS num FROM ( SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num FROM com_act_easy_photo WHERE community_id = ${communityId} AND del_tag = 0 AND is_report_dpc = 1 AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed UNION ALL SELECT * FROM ( SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num ) temT ) temp GROUP BY filed ORDER BY filed ASC </select> <select id="getEasyPhotoTotalPolylineDateForDpc" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> SELECT COUNT(id) AS num FROM com_act_easy_photo WHERE community_id = ${communityId} AND del_tag = 0 AND is_report_dpc = 1 AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} </select> <select id="dpcEasyPhotoList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO"> SELECT t1.id, t1.detail, t1.photo_path_list, t1.`status`, t2.`name` AS classifyName FROM com_act_easy_photo t1 LEFT JOIN com_act_easy_photo_classify t2 ON t1.classify_id = t2.id WHERE t1.community_id = ${pageBaseDTO.communityId} AND t1.`status` IN(4,5) AND t1.del_tag = 0 AND t1.is_report_dpc = 1 <if test="pageBaseDTO.paramId != null"> AND t1.classify_id = #{pageBaseDTO.paramId} </if> ORDER BY t1.id DESC </select> <select id="selectDpcBaseData" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo"> SELECT (select count(id) from com_act_dpc where community_id = ${communityId} AND is_del = 0) AS dpcNum </select> </mapper>