puhanshu
2022-03-10 db3fc1165777c9e66e179ce018fc05aa15d2c051
大屏院落议事相关代码提交
1个文件已添加
10个文件已修改
227 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenCourtyardStatisticsInfo.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActFourMemberDao.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussDOMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDynDOMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActFourMemberMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/BigScreenCourtyardStatisticsInfo.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: BigScreenCourtyardStatisticsInfo
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 金沙定制页面-院落议事大屏统计数据
 * @author: hans
 * @date: 2022/03/10 10:04
 */
@Data
@ApiModel("金沙定制页面-院落议事大屏统计数据")
public class BigScreenCourtyardStatisticsInfo {
    @ApiModelProperty("院落议事数量")
    private Integer discussTotal;
    @ApiModelProperty("议事类")
    private Integer ysTotal;
    @ApiModelProperty("投票类")
    private Integer tpTotal;
    @ApiModelProperty(value = "院落议事新增折线数据")
    private List<StatisticsCommVO> discussAddPolylineData;
    @ApiModelProperty(value = "院落议事累计折线数据")
    private List<StatisticsCommVO> discussTotalPolylineData;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -9475,4 +9475,20 @@
     */
    @PostMapping("/screen/fourMember/resolve")
    R pageFourMemberResolve(@RequestBody PageBaseDTO pageBaseDTO);
    /**
     * 金沙定制页面-四长四员院落议事展示列表
     * @param pageBaseDTO
     * @return
     */
    @PostMapping("/screen/courtyard/list")
    R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO);
    /**
     * 金沙定制页面-院落议事
     * @param communityId
     * @return
     */
    @GetMapping("/screen/courtyard/base")
    R getCourtyardBaseData(@RequestParam("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -4,6 +4,7 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo;
import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -664,4 +665,17 @@
        communityRankDTO.setCommunityId(this.getCommunityId());
        return communityService.getIntegralCommunityRankApplets(communityRankDTO);
    }
    @ApiOperation(value = "金沙定制页面-四长四员院落议事展示列表,param3(1.议事 2.投票)", response = ComActDiscussVO.class)
    @PostMapping("/courtyard/list")
    public R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO) {
        pageBaseDTO.setCommunityId(this.getCommunityId());
        return communityService.pageCourtyardDiscuss(pageBaseDTO);
    }
    @ApiOperation(value = "金沙定制页面-院落议事", response = BigScreenCourtyardStatisticsInfo.class)
    @GetMapping("/courtyard/base")
    public R getCourtyardBaseData() {
        return communityService.getCourtyardBaseData(this.getCommunityId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -493,4 +493,24 @@
    public R pageFourMemberResolve(@RequestBody PageBaseDTO pageBaseDTO) {
        return bigScreenStatisticsService.pageFourMemberResolve(pageBaseDTO);
    }
    /**
     * 金沙定制页面-四长四员院落议事展示列表
     * @param pageBaseDTO
     * @return
     */
    @PostMapping("/courtyard/list")
    public R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO) {
        return bigScreenStatisticsService.pageCourtyardDiscuss(pageBaseDTO);
    }
    /**
     * 金沙定制页面-院落议事
     * @param communityId
     * @return
     */
    @GetMapping("/courtyard/base")
    public R getCourtyardBaseData(@RequestParam("communityId") Long communityId) {
        return bigScreenStatisticsService.getCourtyardBaseData(communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -4,7 +4,9 @@
import java.util.List;
import java.util.Map;
import com.panzhihua.common.model.dtos.PageBaseDTO;
import com.panzhihua.common.model.vos.community.StatisticsCommVO;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -226,4 +228,18 @@
     * @return
     */
    List<String> getTitles(@Param("type") int type, @Param("communityId") Long communityId, @Param("pageSize") Integer pageSize);
    /**
     * 金沙定制页面-四长四员院落议事展示列表
     * @param pageBaseDTO
     * @return
     */
    IPage<ComActDiscussVO> pageCourtyardDiscuss(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO);
    /**
     * 金沙定制页面-院落议事基础统计数据
     * @param communityId
     * @return
     */
    BigScreenCourtyardStatisticsInfo getCourtyardBaseData(@Param("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActFourMemberDao.java
@@ -60,4 +60,19 @@
     * @return
     */
    StatisticsCommVO retrieveJJWTTotalPolylineData(@Param("communityId") Long communityId, @Param("date") String date);
    /**
     * 新增院落议事数统计
     * @param communityId
     * @return
     */
    List<StatisticsCommVO> retrieveYLYSAddPolylineData(@Param("communityId") Long communityId);
    /**
     * 累计院落议事数统计
     * @param communityId
     * @param date
     * @return
     */
    StatisticsCommVO retrieveYLYSTotalPolylineData(@Param("communityId") Long communityId, @Param("date") String date);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java
@@ -277,4 +277,18 @@
     * @return
     */
    R pageFourMemberResolve(PageBaseDTO pageBaseDTO);
    /**
     * 金沙定制页面-四长四员院落议事展示列表
     * @param pageBaseDTO
     * @return
     */
    R pageCourtyardDiscuss(PageBaseDTO pageBaseDTO);
    /**
     * 金沙定制页面-院落议事
     * @param communityId
     * @return
     */
    R getCourtyardBaseData(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -17,6 +17,7 @@
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;
@@ -882,6 +883,17 @@
            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);
    }
@@ -1166,6 +1178,39 @@
        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);
    }
    private Page retrievePage(PageBaseDTO pageBaseDTO) {
        Long pageNum = pageBaseDTO.getPageNum();
        Long size = pageBaseDTO.getPageSize();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussDOMapper.xml
@@ -329,5 +329,21 @@
        WHERE
            community_id = ${communityId}
    </select>
    <select id="pageCourtyardDiscuss" resultType="com.panzhihua.common.model.vos.community.ComActDiscussVO">
        SELECT id, `type`, discuss_subject, photo_pah FROM com_act_discuss
        WHERE community_id = #{pageBaseDTO.communityId}
        AND content_type = 2 AND is_del = 2 AND photo_pah IS NOT NULL
        <if test="pageBaseDTO.param3 != null">
            AND `type` = #{pageBaseDTO.param3}
        </if>
        ORDER BY create_at DESC
    </select>
    <select id="getCourtyardBaseData"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo">
        SELECT
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS discussTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND `type` = 1) AS ysTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND `type` = 2) AS tpTotal
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDynDOMapper.xml
@@ -90,6 +90,8 @@
        (SELECT COUNT(DISTINCT d2.user_id) FROM com_act_discuss d1 INNER JOIN com_act_discuss_comment d2 ON d1.id = d2.discuss_id WHERE d1.community_id = #{communityId} AND d1.is_del = 2) AS ystpcyTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND is_del = 2 AND `type` = 1) AS ysTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND is_del = 2 AND `type` = 2) AS tpTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS ylysTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 1 AND is_del = 2) AS sqysTotal,
        (SELECT COUNT(id) FROM com_pb_member WHERE community_id = #{communityId} AND audit_result = 1) AS dyTotal,
        (SELECT COUNT(id) FROM com_act_four_member WHERE community_id = #{communityId}) AS szsyTotal,
        (SELECT COUNT(id) FROM com_act_four_member WHERE community_id = #{communityId} AND (position LIKE CONCAT('%','居民小组长','%') OR position = '全部')) AS jmxzzTotal,
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActFourMemberMapper.xml
@@ -71,7 +71,8 @@
            INNER JOIN com_act_micro_wish t2 ON t1.service_id = t2.id
            WHERE t1.community_id = #{communityId} AND t1.`type` = 5 AND t1.service_type = 2 AND t2.`status` = 6
            )
        ) AS jjwtTotal
        ) AS jjwtTotal,
        (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS ylysTotal
    </select>
    <select id="getFourMembers" resultType="com.panzhihua.common.model.vos.community.ComActFourMemberVO">
        SELECT
@@ -135,5 +136,35 @@
        AND t1.service_type = 2 AND t2.`status` = 6 AND DATE_FORMAT( t2.create_at, '%Y-%m' ) &lt;= #{date}
        ) AS num
    </select>
    <select id="retrieveYLYSAddPolylineData"
            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(1) AS num
            FROM com_act_discuss
            WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND DATE_FORMAT( create_at, '%Y-%m' ) &gt; 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="retrieveYLYSTotalPolylineData"
            resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO">
        SELECT COUNT(1) AS num
        FROM com_act_discuss
        WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND DATE_FORMAT( create_at, '%Y-%m' ) &lt;= #{date}
    </select>
</mapper>