| | |
| | | |
| | | @ApiModelProperty(value = "展示状态,小程序获取不同状态的投票列表 1.进行中 2.已结束", allowableValues = "1,2") |
| | | private Integer displayStatus; |
| | | |
| | | @ApiModelProperty("议事内容类型(1.社区议事 2.院落议事 3.党群议事)") |
| | | private Integer contentType; |
| | | } |
| | |
| | | @ApiModelProperty("已投票记录列表") |
| | | private List<ComActDiscussOptionUserVO> comActDiscussOptionUserVOList; |
| | | |
| | | @ApiModelProperty("议事内容类型(1.社区议事 2.院落议事 3.党群议事)") |
| | | private Integer contentType; |
| | | |
| | | @ApiModelProperty("已参与投票人数") |
| | | private Integer votedPersonNum; |
| | | |
New file |
| | |
| | | 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; |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/partybuildIng/getOrgDataStatistics") |
| | | R getOrgDataStatistics(@RequestBody ComDataStatisticsOrgDto statisticsOrgDto); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | @GetMapping("/partybuildIng/getHeaderOrgDataStatistics") |
| | | R getHeaderOrgDataStatistics(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | } |
| | |
| | | * 活动类型 |
| | | */ |
| | | private String activityType; |
| | | /** |
| | | * 单次活动时长(小时) |
| | | */ |
| | | private Integer duration; |
| | | /** |
| | | * 类型(1.居民活动 2.志愿者活动) |
| | | */ |
| | | private Integer type; |
| | | } |
| | |
| | | private Long publishBy; |
| | | |
| | | /** |
| | | * 议事内容类型(1.社区议事 2.院落议事 3.党群议事) |
| | | */ |
| | | private Integer contentType; |
| | | |
| | | /** |
| | | * 类型 1 议事 2 投票 |
| | | */ |
| | | public interface type{ |
| | |
| | | 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 = |
| | |
| | | // 查询当前活动下参与居民 |
| | | 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; |
| | | // 查询当前活动下参与志愿者 |
| | |
| | | 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} |
| | |
| | | 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} |
| | |
| | | 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' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | |
| | | 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' ) <= #{date} |
| | | </select> |
| | |
| | | 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 != """> |
| | | AND activity_type = #{pageBaseDTO.param2} |
| | |
| | | d.id, |
| | | d.`discuss_subject`, |
| | | d.type, |
| | | d.content_type, |
| | | COUNT( DISTINCT c.id ) commentNum, |
| | | u.NAME userName, |
| | | u.nick_name userNickName, |
| | |
| | | <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> |
| | |
| | | d.fabulous_num as signNum, |
| | | d.views_num, |
| | | d.status, |
| | | d.content_type, |
| | | u.NAME userName, |
| | | u.nick_name userNickName, |
| | | d.create_at |
| | |
| | | <if test="pageComActDiscussDTO.keyWord != null and pageComActDiscussDTO.keyWord != """> |
| | | 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> |
| | |
| | | </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, |
| | |
| | | <if test='pageComActDiscussDTO.displayStatus != null and pageComActDiscussDTO.displayStatus == 2'> |
| | | AND d.`end_time` < 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> |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | * @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); |
| | | } |
| | |
| | | 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 |
| | |
| | | * @return 组织下统计数据 |
| | | */ |
| | | R getOrgDataStatistics(ComDataStatisticsOrgDto statisticsOrgDto); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | R getHeaderOrgDataStatistics(Long communityId); |
| | | } |
| | |
| | | package com.panzhihua.service_dangjian.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | statisticsOrgVo.setEasyNum(statisticsMap.get("cumulativeEasyNum").toString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | statisticsOrgVo.setCompleteEasyList(completeEasyList); |
| | | statisticsOrgVo.setCompleteWishList(completeWishList); |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | </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> |
| | | |