luoyuanqiao
2022-02-24 72c41a8bb4210d9c8f87be7b99ea7c180a5d40e9
党支部统计接口
1个文件已添加
14个文件已修改
167 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/ComDataStatisticsHeaderOrgVo.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/PartyBuildingService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActActivityDO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussDOMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/PartyBuildIngApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbMemberService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComActDiscussDTO.java
@@ -57,4 +57,7 @@
    @ApiModelProperty(value = "展示状态,小程序获取不同状态的投票列表 1.进行中 2.已结束", allowableValues = "1,2")
    private Integer displayStatus;
    @ApiModelProperty("议事内容类型(1.社区议事 2.院落议事 3.党群议事)")
    private Integer contentType;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDiscussVO.java
@@ -126,6 +126,9 @@
    @ApiModelProperty("已投票记录列表")
    private List<ComActDiscussOptionUserVO> comActDiscussOptionUserVOList;
    @ApiModelProperty("议事内容类型(1.社区议事 2.院落议事 3.党群议事)")
    private Integer contentType;
    @ApiModelProperty("已参与投票人数")
    private Integer votedPersonNum;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/ComDataStatisticsHeaderOrgVo.java
New file
@@ -0,0 +1,26 @@
package com.panzhihua.common.model.vos.partybuilding;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author lyq
 * 查询党建数据统计党组织返回参数
 */
@Data
@ApiModel("查询党建数据统计党组织返回参数")
public class ComDataStatisticsHeaderOrgVo {
    @ApiModelProperty(value = "党组织数量")
    private Integer orgNum = 0;
    @ApiModelProperty(value = "党组织绑定小区数量")
    private Integer areaNum = 0;
    @ApiModelProperty(value = "小区覆盖率")
    private BigDecimal villageRate = BigDecimal.ZERO;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/PartyBuildingService.java
@@ -555,4 +555,13 @@
     */
    @PostMapping("/partybuildIng/getOrgDataStatistics")
    R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto);
    /**
     * 查询党组织表头统计数据
     * @param communityId
     *            社区id
     * @return  党组织表头统计数据
     */
    @GetMapping("/partybuildIng/getHeaderOrgDataStatistics")
    R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java
@@ -799,4 +799,10 @@
    public R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto) {
        return partyBuildingService.getOrgDataStatistics(statisticsOrgDto);
    }
    @ApiOperation(value = "党支部表头数据统计",response = ComDataStatisticsHeaderOrgVo.class)
    @GetMapping("/dataStatistics/header/org")
    public R getHeaderOrgDataStatistics() {
        return partyBuildingService.getHeaderOrgDataStatistics(this.getCommunityId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActActivityDO.java
@@ -209,4 +209,12 @@
     * 活动类型
     */
    private String activityType;
    /**
     * 单次活动时长(小时)
     */
    private Integer duration;
    /**
     * 类型(1.居民活动 2.志愿者活动)
     */
    private Integer type;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java
@@ -158,6 +158,11 @@
    private Long publishBy;
    /**
     * 议事内容类型(1.社区议事 2.院落议事 3.党群议事)
     */
    private Integer contentType;
    /**
     * 类型 1 议事 2 投票
     */
    public interface type{
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -478,6 +478,7 @@
                return R.fail("已经报名过了,请勿重复提交");
            }
            Integer volunteerMax = actActivityDO.getVolunteerMax();
            Integer activityType = actActivityDO.getType();
            Integer residentMax = actActivityDO.getParticipantMax();
            R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(String.valueOf(userId));
            LoginUserInfoVO loginUserInfoVO =
@@ -485,7 +486,7 @@
            // 查询当前活动下参与居民
            Integer residentCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda()
                    .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 0).eq(ComActActSignDO::getStatus, 1));
            if (volunteerMax != 0) {
            if (activityType.equals(2)) {
                //志愿者活动
                boolean userIsVolunteer = loginUserInfoVO.getIsVolunteer() == 1;
                // 查询当前活动下参与志愿者
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -74,16 +74,13 @@
            SELECT  a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name,
                COUNT(if(s.is_volunteer=1,NULL,s.id))participant_now, a.volunteer_max,
                COUNT(if(s.is_volunteer=1,s.id,NULL))volunteer_now, a.`status`, a.publish_at, a.is_qr_code,
                a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward
                a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward,a.type,a.duration
            FROM  com_act_activity a
            LEFT JOIN sys_user u ON a.sponsor_id=u.user_id
            LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) s ON a.id=s.activity_id
            WHERE   a.`status` = 1 AND a.community_id = ${comActActivityVO.communityId}
                <if test='comActActivityVO.type != null and comActActivityVO.type == 1'>
                    AND a.volunteer_max != 0
                </if>
                <if test='comActActivityVO.type != null and comActActivityVO.type == 2'>
                    AND a.volunteer_max = 0
                <if test='comActActivityVO.type != null'>
                    AND a.type = #{comActActivityVO.type}
                </if>
                <if test='comActActivityVO.rewardWay != null and comActActivityVO.rewardWay != 0'>
                    AND a.reward_way = #{comActActivityVO.rewardWay}
@@ -105,16 +102,13 @@
                SELECT  a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name,
                    COUNT(if(s.is_volunteer=1,NULL,s.id))participant_now, a.volunteer_max,
                    COUNT(if(s.is_volunteer=1,s.id,NULL))volunteer_now, a.`status`, a.publish_at,
                    a.is_qr_code, a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward
                    a.is_qr_code, a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward,a.type,a.duration
                FROM  com_act_activity a
                LEFT JOIN sys_user u ON a.sponsor_id=u.user_id
                LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) s ON a.id=s.activity_id
                WHERE   a.`status` != 1 AND a.community_id = ${comActActivityVO.communityId}
                    <if test='comActActivityVO.type != null and comActActivityVO.type == 1'>
                        AND a.volunteer_max != 0
                    </if>
                    <if test='comActActivityVO.type != null and comActActivityVO.type == 2'>
                        AND a.volunteer_max = 0
                    <if test='comActActivityVO.type != null'>
                        AND a.type = #{comActActivityVO.type}
                    </if>
                    <if test='comActActivityVO.rewardWay != null and comActActivityVO.rewardWay != 0'>
                        AND a.reward_way = #{comActActivityVO.rewardWay}
@@ -191,10 +185,10 @@
            FROM com_act_activity
            WHERE community_id = ${communityId}
            <if test="isResidentAct">
                AND volunteer_max = 0
                AND `type` = 1
            </if>
            <if test="!isResidentAct">
                AND volunteer_max != 0
                AND `type` = 2
            </if>
            AND DATE_FORMAT( publish_at, '%Y-%m' ) &gt; DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed
            UNION ALL SELECT * FROM
@@ -220,10 +214,10 @@
        FROM com_act_activity
        WHERE community_id = ${communityId}
        <if test="isResidentAct">
            AND volunteer_max = 0
            AND `type` = 1
        </if>
        <if test="!isResidentAct">
            AND volunteer_max != 0
            AND `type` = 2
        </if>
        AND DATE_FORMAT( publish_at, '%Y-%m' ) &lt;= #{date}
    </select>
@@ -241,10 +235,10 @@
            AND community_id = ${pageBaseDTO.communityId}
        </if>
        <if test="isResidentAct">
            AND volunteer_max = 0
            AND `type` = 1
        </if>
        <if test="!isResidentAct">
            AND volunteer_max != 0
            AND `type` = 2
        </if>
        <if test="pageBaseDTO.param2 != null and pageBaseDTO.param2 != &quot;&quot;">
            AND activity_type = #{pageBaseDTO.param2}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussDOMapper.xml
@@ -76,6 +76,7 @@
        d.id,
        d.`discuss_subject`,
        d.type,
        d.content_type,
        COUNT( DISTINCT c.id ) commentNum,
        u.NAME userName,
        u.nick_name userNickName,
@@ -97,6 +98,9 @@
        <if test="pageComActDiscussDTO.status != null">
            and d.status = #{pageComActDiscussDTO.status}
        </if>
        <if test="pageComActDiscussDTO.contentType != null">
            and d.content_type = #{pageComActDiscussDTO.contentType}
        </if>
        GROUP BY   d.id  )t
        order by t.create_at desc
    </select>
@@ -111,6 +115,7 @@
        d.fabulous_num as signNum,
        d.views_num,
        d.status,
        d.content_type,
        u.NAME userName,
        u.nick_name userNickName,
        d.create_at
@@ -132,6 +137,9 @@
        <if test="pageComActDiscussDTO.keyWord != null and pageComActDiscussDTO.keyWord != &quot;&quot;">
            and (d.`discuss_subject` LIKE concat(#{pageComActDiscussDTO.keyWord}, '%' ) or
            u.`name` LIKE concat(#{pageComActDiscussDTO.keyWord}, '%' ))
        </if>
        <if test="pageComActDiscussDTO.contentType != null">
            and d.content_type = #{pageComActDiscussDTO.contentType}
        </if>
        order by d.create_at desc
    </select>
@@ -158,7 +166,7 @@
    </select>
    <select id="pageDiscussApplets" resultType="com.panzhihua.common.model.vos.community.ComActDiscussVO">
        SELECT t.* FROM (
            SELECT d.id, d.vote_title, if(d.address IS NULL OR d.address='null',a.name,d.address )address, d.photo_pah,
            SELECT d.id, d.vote_title, if(d.address IS NULL OR d.address='null',a.name,d.address )address, d.photo_pah,d.content_type,
                d.`discuss_subject`, d.type, d.end_time, d.status, d.views_num, d.join_num, d.fabulous_num AS signNum,
                d.comment_num AS commentNum, d.release_at, d.img_width, d.img_height, d.is_repeat, d.count, u.type AS userType, if(u.type=1,u.name,a.name) userName,
                if(u.type=1,u.nick_name,a.name) userNickName,
@@ -193,6 +201,9 @@
                <if test='pageComActDiscussDTO.displayStatus != null and pageComActDiscussDTO.displayStatus == 2'>
                    AND d.`end_time` &lt; now()
                </if>
                <if test="pageComActDiscussDTO.contentType != null">
                    and d.content_type = #{pageComActDiscussDTO.contentType}
                </if>
            GROUP BY d.id
        ) t ORDER BY t.create_at DESC
    </select>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/PartyBuildIngApi.java
@@ -725,4 +725,15 @@
    public R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto) {
        return comPbMemberService.getOrgDataStatistics(statisticsOrgDto);
    }
    /**
     * 查询党组织表头统计数据
     * @param communityId
     *            社区id
     * @return  党组织表头统计数据
     */
    @GetMapping("/getHeaderOrgDataStatistics")
    public R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId) {
        return comPbMemberService.getHeaderOrgDataStatistics(communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java
@@ -155,4 +155,12 @@
     * @return  社区党组织下某个时间段统计数据
     */
    Map<String,Object> getOrgDataStatisticsRightDown(@Param("communityId") Long communityId,@Param("orgIds") List<Long> orgIds,@Param("startDate") String startDate,@Param("endDate") String endDate);
    /**
     * 查询党组织表头统计数据
     * @param communityId
     *            社区id
     * @return  党组织表头统计数据
     */
    ComDataStatisticsHeaderOrgVo getHeaderOrgDataStatistics(@Param("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbMemberService.java
@@ -9,6 +9,7 @@
import com.panzhihua.common.model.vos.partybuilding.*;
import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -208,4 +209,12 @@
     * @return  组织下统计数据
     */
    R getOrgDataStatistics(ComDataStatisticsOrgDto statisticsOrgDto);
    /**
     * 查询党组织表头统计数据
     * @param communityId
     *            社区id
     * @return  党组织表头统计数据
     */
    R getHeaderOrgDataStatistics(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_dangjian.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -763,8 +764,6 @@
                    statisticsOrgVo.setEasyNum(statisticsMap.get("cumulativeEasyNum").toString());
                }
            }
        }
        statisticsOrgVo.setCompleteEasyList(completeEasyList);
        statisticsOrgVo.setCompleteWishList(completeWishList);
@@ -773,4 +772,24 @@
        return R.ok(statisticsOrgVo);
    }
    /**
     * 查询党组织表头统计数据
     * @param communityId
     *            社区id
     * @return  党组织表头统计数据
     */
    @Override
    public R getHeaderOrgDataStatistics(Long communityId) {
        ComDataStatisticsHeaderOrgVo headerOrgVo = comPbMemberDAO.getHeaderOrgDataStatistics(communityId);
        if(headerOrgVo != null){
            if(headerOrgVo.getOrgNum() == null || headerOrgVo.getOrgNum().equals(0)){
                headerOrgVo.setVillageRate(BigDecimal.ZERO);
            }else{
                headerOrgVo.setVillageRate(BigDecimal.valueOf(headerOrgVo.getAreaNum()).divide(BigDecimal.valueOf(headerOrgVo.getOrgNum())
                        ,4,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)));
            }
        }
        return R.ok(headerOrgVo);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -450,5 +450,15 @@
        </foreach>
            )
    </select>
    <select id="getHeaderOrgDataStatistics" resultType="com.panzhihua.common.model.vos.partybuilding.ComDataStatisticsHeaderOrgVo">
        SELECT
            count( id ) AS orgNum,
            ( SELECT count( id ) FROM com_pb_org WHERE community_id = #{communityId} AND area_id IS NOT NULL ) AS areaNum
        FROM
            com_pb_org
        WHERE
            community_id = #{communityId}
    </select>
</mapper>