| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.integral.IntegralTradeVO; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | return communityService.getIntegralReceiveApplets(userInfoVO.getUserId(), userInfoVO.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询我的积分列表", response = ComActIntegralUserVO.class) |
| | | @PostMapping("/user/list") |
| | | public R getIntegralUserList() { |
| | | @ApiOperation(value = "积分统计", response = ComActIntegralUserVO.class) |
| | | @ApiImplicitParam(name = "communityId", value = "社区id") |
| | | @GetMapping("/user/statistics") |
| | | public R getIntegralUserList(@RequestParam(value = "communityId", required = false) Long communityId) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getIntegralUserListApplets(userInfoVO.getUserId(), userInfoVO.getCommunityId()); |
| | | return communityService.getIntegralUserListApplets(userInfoVO.getUserId(), communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询我的积分余额", response = ComActIntegralUserVO.class) |
| | | @ApiImplicitParam(name = "communityId", value = "社区id", required = true) |
| | | @GetMapping("/user/balance") |
| | | public R getUserIntegralBalance(@RequestParam("communityId") Long communityId) { |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getUserIntegralBalance(userInfoVO.getUserId(), communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取积分详情", response = IntegralTradeVO.class) |
| | | @ApiImplicitParam(name = "id", value = "积分明细id", required = true) |
| | | @GetMapping("/user/detail") |
| | | public R getUserIntegralDetail(@RequestParam("id") Long id) { |
| | | return communityService.getUserIntegralDetail(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区积分排行榜", response = ComActIntegralCommunityRankVO.class) |
| | |
| | | LoginUserInfoVO userInfoVO = this.getLoginUserInfo(); |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | if (communityRankDTO.getCommunityId() == null) { |
| | | communityRankDTO.setCommunityId(userInfoVO.getCommunityId()); |
| | | } |
| | | return communityService.getIntegralCommunityRankApplets(communityRankDTO); |
| | | } |
| | |
| | | if (userInfoVO == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | communityTradeDTO.setCommunityId(userInfoVO.getCommunityId()); |
| | | communityTradeDTO.setUserId(userInfoVO.getUserId()); |
| | | return communityService.getIntegralCommunityTradeApplets(communityTradeDTO); |
| | | } |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerOrgTeamDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerServiceTypeDto; |
| | | import com.panzhihua.common.model.dtos.common.PageComMngVolunteerSkillDto; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComStreetDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.common.ComMngVolunteerOrgTeamVo; |
| | |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static org.apache.commons.lang3.ObjectUtils.isEmpty; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActRegistVO.setUserId(loginUserInfo.getUserId()); |
| | | comActActRegistVO.setIsVolunteer(loginUserInfo.getIsVolunteer()); |
| | | return communityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | |
| | | public R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActActEvaluateVO.setUserId(loginUserInfo.getUserId()); |
| | | comActActEvaluateVO.setIsVolunteer(loginUserInfo.getIsVolunteer()); |
| | | return communityService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动邀请列表", response = ActivityInviteVO.class) |
| | | @PostMapping("activity/invite/list") |
| | | public R pageActivityInviteList(@RequestBody @Valid PageActivityInviteDTO pageActivityInviteDTO) { |
| | | return communityService.pageActivityInviteList(pageActivityInviteDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加邀请人员") |
| | | @PostMapping("activity/invite/add") |
| | | public R activityInviteAdd(@RequestBody @Valid List<ActivityInviteDTO> list) { |
| | | if (!isEmpty(list)) { |
| | | list.forEach(e -> e.setCreatedBy(this.getUserId())); |
| | | } else { |
| | | return R.fail("列表为空"); |
| | | } |
| | | return communityService.activityInviteAdd(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除邀请人员") |
| | | @ApiImplicitParam(name = "id", value = "邀请主键id", required = true) |
| | | @DeleteMapping("activity/invite/delete") |
| | | public R activityInviteDelete(@RequestParam("id") Long id) { |
| | | return communityService.activityInviteDelete(id); |
| | | } |
| | | |
| | | // @ApiOperation(value = "新增社区动态浏览记录") |
| | | // @PostMapping("dynamicuser") |
| | | // public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | |
| | | return partyBuildingService.getPagePbMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询注册党员列表",response = PartyBuildingMemberVO.class) |
| | | @PostMapping("/page/registerMember") |
| | | public R pageRegisterMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | partyBuildingMemberVO.setAppid(this.getAppId()); |
| | | return partyBuildingService.pageRegisterMember(partyBuildingMemberVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有社区列表", response = EventGridCommunityAdminVO.class) |
| | | @GetMapping("/community/list") |
| | | public R getCommunityLists() { |
| | |
| | | .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).collect(toList()); |
| | | collect.forEach(comActActivityVO -> { |
| | | ArrayList<ComActActRegistVO> currentList = new ArrayList<>(); |
| | | Integer[] rewardWayArr = {0}; |
| | | comActActRegistVOS.forEach(activitySignInVO -> { |
| | | if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) { |
| | | currentList.add(activitySignInVO); |
| | | if(comActActivityVO.getType()!=3&&comActActivityVO.getType()!=5){ |
| | | |
| | | Integer signIdentity = activitySignInVO.getSignIdentity(); |
| | | Integer rewardWay = null; |
| | | Integer rewardIntegral = 0; |
| | | switch (signIdentity) { |
| | | case 1: |
| | | rewardWay = comActActivityVO.getParticipantRewardWay(); |
| | | rewardIntegral = comActActivityVO.getParticipantRewardIntegral(); |
| | | break; |
| | | case 2: |
| | | rewardWay = comActActivityVO.getVolunteerRewardWay(); |
| | | rewardIntegral = comActActivityVO.getVolunteerRewardIntegral(); |
| | | break; |
| | | case 3: |
| | | rewardWay = comActActivityVO.getPbRewardWay(); |
| | | rewardIntegral = comActActivityVO.getPbRewardIntegral(); |
| | | default: |
| | | break; |
| | | } |
| | | rewardWayArr[0] = rewardWay; |
| | | if(rewardWay == 1){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | | comActActivityVO.setTimes(1); |
| | | comActActivityVO.setAward(comActActivityVO.getRewardIntegral()); |
| | | comActActivityVO.setAward(rewardIntegral); |
| | | } |
| | | else { |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | comActActivityVO.setAward(comActActivityVO.getRewardIntegral()*comActActivityVO.getTimes()); |
| | | comActActivityVO.setAward(rewardIntegral*comActActivityVO.getTimes()); |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | if(activitySignInVO.getEndTime()!=null){ |
| | | comActActivityVO.setIsComment(1); |
| | | if(comActActivityVO.getTimes()==null){ |
| | | comActActivityVO.setTimes(1); |
| | | comActActivityVO.setAward(comActActivityVO.getRewardIntegral()); |
| | | comActActivityVO.setAward(activitySignInVO.getAward()); |
| | | } |
| | | else { |
| | | comActActivityVO.setTimes(comActActivityVO.getTimes()+1); |
| | | comActActivityVO.setAward(comActActivityVO.getRewardIntegral()*comActActivityVO.getTimes()); |
| | | comActActivityVO.setAward(comActActivityVO.getAward() + activitySignInVO.getAward()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | Integer limit = comActActivityVO.getLimit(); |
| | | if(limit != null && limit>0 &¤tList.size()>0){ |
| | | if(comActActivityVO.getType()==3||comActActivityVO.getType()==5){ |
| | | if(rewardWayArr[0] == 2){ |
| | | if(limit==currentList.size()&¤tList.get(currentList.size()-1).getEndTime()!=null){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | if(limit==currentList.size()){ |
| | | comActActivityVO.setIsRegist(1); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ActivityInviteDTO |
| | | * @projectName: |
| | | * @description: 活动邀请请求参数 |
| | | * @author: hans |
| | | * @date: 2022/08/02 9:55 |
| | | */ |
| | | @Data |
| | | @ApiModel("活动邀请请求参数") |
| | | public class ActivityInviteDTO { |
| | | |
| | | @ApiModelProperty("受邀活动id") |
| | | @NotNull(message = "受邀活动id不能为空") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("受邀用户id") |
| | | @NotNull(message = "受邀用户id不能为空") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("受邀用户姓名") |
| | | @NotBlank(message = "受邀用户姓名不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("受邀用户电话") |
| | | @NotBlank(message = "受邀用户电话不能为空") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "邀请人", hidden = true) |
| | | private Long createdBy; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ActivityInviteDTO |
| | | * @projectName: |
| | | * @description: 活动邀请请求参数 |
| | | * @author: hans |
| | | * @date: 2022/08/02 9:55 |
| | | */ |
| | | @Data |
| | | @ApiModel("活动邀请请求参数") |
| | | public class PageActivityInviteDTO { |
| | | |
| | | @ApiModelProperty("受邀活动id") |
| | | @NotNull(message = "受邀活动id不能为空") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | } |
| | |
| | | @ApiModelProperty("身份类型(1.全部 2.居民 3.志愿者 4.党员)") |
| | | private Integer type = 1; |
| | | |
| | | @ApiModelProperty("变动类型(1.增加 2.减少)") |
| | | private Integer changeType; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | |
| | | @ApiModelProperty("变动类型(1.增加 2.减少)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)") |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 \" +\n" + |
| | | " \"5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动)") |
| | | private Integer serviceType; |
| | | } |
| | |
| | | @ApiModelProperty("业务id") |
| | | private Long serviceId; |
| | | |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参加居民活动 5.参加志愿者活动 6.参与党员活动 7.参与调查问卷 8.取消活动 )") |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动)") |
| | | private Integer integralType; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | |
| | | @ApiModelProperty(value = "签到类型 1居民 志愿者签到 2党员签到") |
| | | private Integer activityType; |
| | | |
| | | @ApiModelProperty(value = "是否是志愿者 0 不是 1 是") |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty(value = "以什么身份报名(1.居民 2.党员 3.志愿者)") |
| | | private Integer signIdentity; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer integral; |
| | | |
| | | private Integer integralPartyTime; |
| | | |
| | | private String remark; |
| | | |
| | | public AddComActIntegralUserDTO(Long serviceId, Integer integralType, Long communityId, Long userId) { |
| | | this.serviceId = serviceId; |
| | |
| | | public AddComActIntegralUserDTO() {} |
| | | |
| | | /** |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参加居民活动 5.参加志愿者活动 6.参与党员活动 7.参与调查问卷 8.取消活动 ) |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | */ |
| | | public interface integralType { |
| | | int fbssp = 1; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ActivityInviteVO |
| | | * @projectName: |
| | | * @description: 活动邀请信息 |
| | | * @author: hans |
| | | * @date: 2022/08/02 10:54 |
| | | */ |
| | | @Data |
| | | @ApiModel("活动邀请信息") |
| | | public class ActivityInviteVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("受邀活动id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("受邀用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("受邀用户姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("受邀用户电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("是否报名,true-报名,false-未报名") |
| | | private Boolean isSign; |
| | | |
| | | @ApiModelProperty("邀请人") |
| | | private Long createdBy; |
| | | |
| | | @ApiModelProperty("邀请时间") |
| | | private Date createdAt; |
| | | } |
| | |
| | | private String createAt; |
| | | @ApiModelProperty("人员头像") |
| | | private String imageUrl; |
| | | @ApiModelProperty(value = "是否是志愿者", hidden = true) |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty("以什么身份报名(1.居民 2.党员 3.志愿者)") |
| | | private Integer signIdentity; |
| | | @ApiModelProperty(value = "列表人员类型 1 普通居民 2 志愿者", hidden = true) |
| | | private Integer type; |
| | | @ApiModelProperty("人员主键") |
| | |
| | | */ |
| | | @ApiModelProperty("活动限制次数") |
| | | private Integer limit; |
| | | |
| | | @ApiModelProperty("是否邀请参与") |
| | | private Boolean isInvite; |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("评分星级1.差 2.一般 3.还不错 4.很满意 5.强烈推荐") |
| | | private Integer starLevel; |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("是否是志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty("以什么身份报名(1.居民 2.党员 3.志愿者)") |
| | | private Integer signIdentity; |
| | | |
| | | @ApiModelProperty("用户openid") |
| | | private String openid; |
| | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty("当前志愿者数量") |
| | | private Integer volunteerNow; |
| | | |
| | | @ApiModelProperty("参与者人数下线") |
| | | @ApiModelProperty("居民人数下线") |
| | | private Integer participantMin; |
| | | |
| | | @ApiModelProperty("参与者人数上限(不填写则默认不限人数)") |
| | | @ApiModelProperty("居民人数上限(不填写则默认不限人数)") |
| | | private Integer participantMax; |
| | | |
| | | @ApiModelProperty("当前参与者数量") |
| | | @ApiModelProperty("当前居民数量") |
| | | private Integer participantNow; |
| | | |
| | | @ApiModelProperty("活动封面") |
| | |
| | | @ApiModelProperty(value = "是否已经报名 1 已报名 0 未报名") |
| | | private Integer isSign = 0; |
| | | |
| | | @ApiModelProperty(value = "是不是以志愿者身份报名的 1 是 0 不是") |
| | | private Integer isVolunteer = 0; |
| | | @ApiModelProperty(value = "以什么身份报名(1.居民 2.党员 3.志愿者)") |
| | | private Integer signIdentity; |
| | | |
| | | @ApiModelProperty(value = "当前登录者id", hidden = true) |
| | | private Long userId; |
| | |
| | | @ApiModelProperty("活动参加志愿者人员集合") |
| | | private List<ActivitySignVO> activityVolunteerList; |
| | | |
| | | @ApiModelProperty("活动类型 1 支援者活动 2 普通社区活动 3 党建活动 4项目活动 5服务活动") |
| | | @ApiModelProperty("活动参加党员人员集合") |
| | | private List<ActivitySignVO> activityPbList; |
| | | |
| | | @ApiModelProperty("活动类型 1 社区活动 4项目活动 5服务活动") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("活动创建时间") |
| | |
| | | @NotNull(groups = AddGroup.class, message = "是否有积分奖励不可为空") |
| | | private Integer haveIntegralReward; |
| | | |
| | | @ApiModelProperty("积分奖励方式(1.按次奖励 2.记时奖励)") |
| | | private Integer rewardWay; |
| | | @ApiModelProperty("居民积分奖励方式(1.按次奖励 2.记时奖励)") |
| | | private Integer participantRewardWay; |
| | | |
| | | @ApiModelProperty("参与签到/打卡奖励积分") |
| | | private Integer rewardIntegral; |
| | | @ApiModelProperty("居民参与签到/打卡奖励积分") |
| | | private Integer participantRewardIntegral; |
| | | |
| | | @ApiModelProperty("志愿者积分奖励方式(1.按次奖励 2.记时奖励)") |
| | | private Integer volunteerRewardWay; |
| | | |
| | | @ApiModelProperty("志愿者参与签到/打卡奖励积分") |
| | | private Integer volunteerRewardIntegral; |
| | | |
| | | @ApiModelProperty("党员积分奖励方式(1.按次奖励 2.记时奖励)") |
| | | private Integer pbRewardWay; |
| | | |
| | | @ApiModelProperty("党员参与签到/打卡奖励积分") |
| | | private Integer pbRewardIntegral; |
| | | |
| | | @ApiModelProperty("参与次数上限,按次奖励需传入,无次数限制-1") |
| | | private Integer limit; |
| | |
| | | */ |
| | | @ApiModelProperty("党员参与者人数上限") |
| | | private Integer partyMemberMax; |
| | | |
| | | @ApiModelProperty("当前党员数量") |
| | | private Integer partyMemberNow; |
| | | |
| | | /** |
| | | * 签退范围,默认0无限制 |
| | | */ |
| | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long checkUnitId; |
| | | |
| | | @ApiModelProperty("活动话题id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long topicId; |
| | | |
| | | @ApiModelProperty("活动邀请人员") |
| | | private List<ActivityInviteDTO> activityInviteList; |
| | | |
| | | @ApiModelProperty(value = "街道id", hidden = true) |
| | | private Long streetId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "类型 1 报名 2 取消报名", example = "1", required = true) |
| | | @Min(value = 1, groups = {AddGroup.class}, message = "操作类型不能为空") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "以什么身份报名活动 1 志愿者 0 普通居民", example = "1", required = true) |
| | | @Min(value = 0, groups = {AddGroup.class}, message = "报名身份不能为空") |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty(value = "以什么身份报名(1.居民 2.党员 3.志愿者)", example = "1", required = true) |
| | | @Min(value = 1, groups = {AddGroup.class}, message = "报名身份不能为空") |
| | | private Integer signIdentity; |
| | | @ApiModelProperty(value = "活动主键", required = true) |
| | | @Min(value = 1, groups = {AddGroup.class}, message = "活动主键不能为空") |
| | | private Long activityId; |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModel("小程序-用户社区积分明细返回参数") |
| | | public class ComActIntegralCommunityTradeVO { |
| | | |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)8活动签到") |
| | | @ApiModelProperty("积分明细id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 \" +\n" + |
| | | " \"5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动") |
| | | private Integer serviceType; |
| | | |
| | | @ApiModelProperty("交易数量") |
| | |
| | | private Integer type; |
| | | @ApiModelProperty("限制次数") |
| | | private Integer count; |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)") |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 \" +\n" + |
| | | " \"5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动)") |
| | | private Integer integralType; |
| | | @ApiModelProperty("积分任务备注") |
| | | private String remark; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActIntegralUserVO |
| | | * @projectName: |
| | | * @description: 小程序-积分统计返回参数 |
| | | * @author: hans |
| | | * @date: 2022/08/02 16:01 |
| | | */ |
| | | @Data |
| | | @ApiModel("小程序-用户积分页面返回参数") |
| | | @ApiModel("小程序-积分统计返回参数") |
| | | public class ComActIntegralUserVO { |
| | | |
| | | @ApiModelProperty("用户积分总额") |
| | |
| | | @ApiModelProperty("用户绑定社区") |
| | | private String communityName; |
| | | |
| | | @ApiModelProperty("用户积分列表") |
| | | @ApiModelProperty("社区活动已获积分") |
| | | private Integer actAmount; |
| | | |
| | | @ApiModelProperty("居民积分总额") |
| | | private Integer residentAmount; |
| | | |
| | | @ApiModelProperty("志愿者积分总额") |
| | | private Integer volunteerAmount; |
| | | |
| | | @ApiModelProperty("党员积分总额") |
| | | private Integer partyMemberAmount; |
| | | |
| | | @ApiModelProperty("单位党员活动已获积分") |
| | | private Integer unitPartyMemberAmount; |
| | | |
| | | @ApiModelProperty("各社区已获积分统计") |
| | | private List<ComActIntegralUserListVO> integralUserList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.integral; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: IntegralTradeVO |
| | | * @projectName: |
| | | * @description: 积分明细信息 |
| | | * @author: hans |
| | | * @date: 2022/08/03 10:28 |
| | | */ |
| | | @Data |
| | | @ApiModel("积分明细信息") |
| | | public class IntegralTradeVO { |
| | | |
| | | @ApiModelProperty("积分明细id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("交易积分数量") |
| | | private Integer amount; |
| | | |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 \" +\n" + |
| | | " \"5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动)") |
| | | private Integer serviceType; |
| | | |
| | | @ApiModelProperty("交易业务id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long serviceId; |
| | | |
| | | @ApiModelProperty("交易备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("交易时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("变动类型(1.增加 2.减少)") |
| | | private Integer changeType; |
| | | |
| | | @ApiModelProperty("交易身份类型(1.居民 2.党员 3.志愿者)") |
| | | private Integer identityType; |
| | | |
| | | @ApiModelProperty("社区名称") |
| | | private String communityName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("是否志愿者 0 否 1 是") |
| | | private Integer isVolunteer; |
| | | @ApiModelProperty("以什么身份报名(1.居民 2.党员 3.志愿者)") |
| | | private Integer signIdentity; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | |
| | | private Integer type; |
| | | @ApiModelProperty("限制次数") |
| | | private Integer count; |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)") |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 \" +\n" + |
| | | " \"5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动)") |
| | | private Integer integralType; |
| | | @ApiModelProperty("积分任务备注") |
| | | private String remark; |
| | |
| | | private String belongTo; |
| | | @ApiModelProperty("微信昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "appid", hidden = true) |
| | | private String appid; |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.acid.*; |
| | | import com.panzhihua.common.model.dtos.community.dpc.AddDpcDTO; |
| | | import com.panzhihua.common.model.dtos.community.dpc.EditDpcDTO; |
| | |
| | | R getIntegralReceiveApplets(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 小程序-查询用户积分列表 |
| | | * 小程序-积分统计 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @return 用户积分列表 |
| | | */ |
| | | @PostMapping("/integral/user/list/applets") |
| | | R getIntegralUserListApplets(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId); |
| | | @GetMapping("/integral/user/statistics") |
| | | R getIntegralUserListApplets(@RequestParam("userId") Long userId, @RequestParam(value = "communityId", required = false) Long communityId); |
| | | |
| | | /** |
| | | * 查询我的积分余额 |
| | | * @param userId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/integral/user/balance") |
| | | R getUserIntegralBalance(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 小程序-查询社区积分账户排行榜 |
| | |
| | | */ |
| | | @GetMapping("/comActEasyPhotoHandler/detail") |
| | | R detailEasyPhotoHandler(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 活动邀请列表 |
| | | * @param pageActivityInviteDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/activity/invite/list") |
| | | R pageActivityInviteList(@RequestBody PageActivityInviteDTO pageActivityInviteDTO); |
| | | |
| | | /** |
| | | * 添加邀请人员 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping("/activity/invite/add") |
| | | R activityInviteAdd(@RequestBody List<ActivityInviteDTO> list); |
| | | |
| | | /** |
| | | * 删除邀请人员 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/activity/invite/delete") |
| | | R activityInviteDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/integral/user/detail") |
| | | R getUserIntegralDetail(@RequestParam("id") Long id); |
| | | } |
| | |
| | | |
| | | @GetMapping("/comPbCheckUnit/detailByPhone") |
| | | public R detailByPhone(@RequestParam("phone") String phone); |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param partyBuildingMemberVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/partybuildIng/page/registerMember") |
| | | R pageRegisterMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO); |
| | | } |
| | |
| | | |
| | | long day = diff / nd; |
| | | |
| | | long hour = diff % nd / nh; |
| | | long hour = diff / nh; |
| | | |
| | | long min = diff % nd % nh / nm; |
| | | long min = diff / nm; |
| | | |
| | | return (int)day; |
| | | return (int)min; |
| | | } |
| | | |
| | | /** |
| | |
| | | // 遍历参与活动人员列表 |
| | | activitySignVOS.forEach(activitySignVO1 -> { |
| | | Long aLong = activitySignVO1.getId(); |
| | | int isVolunteer = activitySignVO1.getIsVolunteer().intValue(); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(aLong); |
| | | sysUserNoticeVO.setType(1); |
| | |
| | | sysUserNoticeVO.setTitle("活动因故取消"); |
| | | sysUserNoticeVO.setBusinessContent("报名人数不足活动自动取消"); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | sysUserNoticeVO.setActivityType(activitySignVO.getIsVolunteer().intValue() == 1 ? 1 : 2); |
| | | sysUserNoticeVO.setActivityType(activitySignVO.getSignIdentity()); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增社区活动取消通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 小程序-查询用户积分列表 |
| | | * 小程序-积分统计 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @return 用户积分列表 |
| | | */ |
| | | @PostMapping("/user/list/applets") |
| | | @GetMapping("/user/statistics") |
| | | public R getIntegralUserListApplets(@RequestParam("userId") Long userId, |
| | | @RequestParam("communityId") Long communityId) { |
| | | @RequestParam(value = "communityId", required = false) Long communityId) { |
| | | return comActIntegralUserService.getIntegralUserListApplets(userId, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 查询我的积分余额 |
| | | * @param userId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/user/balance") |
| | | public R getUserIntegralBalance(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId) { |
| | | return comActIntegralUserService.getUserIntegralBalance(userId, communityId); |
| | | } |
| | | |
| | | /** |
| | |
| | | return comActIntegralUserService.getTaskActivityPeopleList(activityId); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/user/detail") |
| | | public R getUserIntegralDetail(@RequestParam("id") Long id) { |
| | | return comActIntegralUserService.getUserIntegralDetail(id); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | |
| | | private ComActMicroWishOperationRecordService wishOperationRecordService; |
| | | @Resource |
| | | private ComActActEvaluateDAO comActActEvaluateDAO; |
| | | @Resource |
| | | private ComActActivityInviteService comActActivityInviteService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getSignIdentity() == 3).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect)) { |
| | | int size = collect.size(); |
| | | if (size >= 6) { |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect1 = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getSignIdentity() == 1).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect1)) { |
| | | int size = collect1.size(); |
| | | if (size >= 6) { |
| | | comActActivityVO.setActivitySignVOList(collect1.subList(0, 6)); |
| | | } else { |
| | | comActActivityVO.setActivitySignVOList(collect1); |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect2 = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getSignIdentity() == 2).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect2)) { |
| | | int size = collect2.size(); |
| | | if (size >= 6) { |
| | | comActActivityVO.setActivityPbList(collect2.subList(0, 6)); |
| | | } else { |
| | | comActActivityVO.setActivityPbList(collect2); |
| | | } |
| | | } |
| | | } |
| | |
| | | public R addEasyPhotoFeedbackForDpc(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | return comActEasyPhotoService.addEasyPhotoFeedbackForDpc(comActEasyPhotoVO); |
| | | } |
| | | |
| | | /** |
| | | * 活动邀请列表 |
| | | * @param pageActivityInviteDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("activity/invite/list") |
| | | public R pageActivityInviteList(@RequestBody PageActivityInviteDTO pageActivityInviteDTO) { |
| | | return comActActivityInviteService.pageActivityInviteList(pageActivityInviteDTO); |
| | | } |
| | | |
| | | /** |
| | | * 添加邀请人员 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @PostMapping("activity/invite/add") |
| | | public R activityInviteAdd(@RequestBody List<ActivityInviteDTO> list) { |
| | | return comActActivityInviteService.activityInviteAdd(list); |
| | | } |
| | | |
| | | /** |
| | | * 删除邀请人员 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping("activity/invite/delete") |
| | | public R activityInviteDelete(@RequestParam("id") Long id) { |
| | | return comActActivityInviteService.activityInviteDelete(id); |
| | | } |
| | | } |
| | |
| | | |
| | | IPage<ActivitySignVO> listActivitySignParty(Page page, @Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, u.openid, " |
| | | + "CASE WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer, a.status , a.reason, t.limit " + "FROM " + "com_act_act_sign a " |
| | | + "JOIN sys_user u ON a.user_id = u.user_id left join com_act_activity t on a.activity_id = t.id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" |
| | | + "AND u.phone = #{activitySignVO.phone} " + " </if> " |
| | | + "<if test='activitySignVO.status != null'>" |
| | | + "AND a.status = #{activitySignVO.status} " + " </if> " |
| | | + "<if test='activitySignVO.name != null and activitySignVO.name != ""'>" |
| | | + "AND u.`name` = #{activitySignVO.name} " + " </if> " |
| | | + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'>" |
| | | + "AND u.is_partymember = 0 and a.is_volunteer=0 " + " </if> " |
| | | + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==2'>" |
| | | + "AND u.is_partymember = 1 " + " </if> " |
| | | + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==3'>" |
| | | + "AND a.is_volunteer=1 " + " </if> " + "<if test='activitySignVO.type != null and activitySignVO.type != 0'>" |
| | | + "AND a.is_volunteer=#{activitySignVO.type}-1 " + " </if> " + " order by a.create_at desc " + "</script>") |
| | | //@Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, u.openid, " |
| | | // + "CASE WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | // + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer, a.status , a.reason, t.limit " + "FROM " + "com_act_act_sign a " |
| | | // + "JOIN sys_user u ON a.user_id = u.user_id left join com_act_activity t on a.activity_id = t.id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | // + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" |
| | | // + "AND u.phone = #{activitySignVO.phone} " + " </if> " |
| | | // + "<if test='activitySignVO.status != null'>" |
| | | // + "AND a.status = #{activitySignVO.status} " + " </if> " |
| | | // + "<if test='activitySignVO.name != null and activitySignVO.name != ""'>" |
| | | // + "AND u.`name` = #{activitySignVO.name} " + " </if> " |
| | | // + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'>" |
| | | // + "AND u.is_partymember = 0 and a.is_volunteer=0 " + " </if> " |
| | | // + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==2'>" |
| | | // + "AND u.is_partymember = 1 " + " </if> " |
| | | // + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==3'>" |
| | | // + "AND a.is_volunteer=1 " + " </if> " + "<if test='activitySignVO.type != null and activitySignVO.type != 0'>" |
| | | // + "AND a.is_volunteer=#{activitySignVO.type}-1 " + " </if> " + " order by a.create_at desc " + "</script>") |
| | | List<ActivitySignVO> listActivitySigns(@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | List<ComActActSignExcelVO> getSignLists (@Param("activitySignVO") ActivitySignVO activitySignVO); |
| | |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | + "a.activity_addr, " + "a.aattend_people," |
| | | + "a.`status`, " + "a.is_qr_code, " + "a.publish_at, " + "a.begin_at, " + "a.cover, " + "a.end_at, " + "a.volunteer_max, " |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " |
| | | + "count(if(s.is_volunteer=0,s.id,null))participant_now, " + "a.participant_max, " + "a.sign_up_begin, " |
| | | + "a.sign_up_end, " + "ca.name as communityName,a.type,a.party_member_max " + "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 " |
| | | + "left join com_act ca on a.community_id=ca.community_id " + " where 1=1 " + |
| | | |
| | | "<if test='comActActivityVO.communityId != null and comActActivityVO.communityId!=0'>" + "AND a.community_id = ${comActActivityVO.communityId} " + " </if> " |
| | | + |
| | | "<if test='comActActivityVO.phone != null and comActActivityVO.phone!=""'>" + "AND a.phone = ${comActActivityVO.phone} " + " </if> " |
| | | + |
| | | "<if test='comActActivityVO.areaCode !=null '>" + "AND ca.area_code = ${comActActivityVO.areaCode} " + " </if> " |
| | | + |
| | | "<if test='comActActivityVO.checkUnitId !=null '>" + "AND a.check_unit_id = #{comActActivityVO.checkUnitId} " + " </if> " |
| | | + |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != ""'>" |
| | | + " and a.activity_name like concat(#{comActActivityVO.activityName},'%') " + " </if> " |
| | | + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng==null'>" |
| | | + "AND a.`status` = #{comActActivityVO.status} " + " </if> " |
| | | + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng!=null and comActActivityVO.isIng==1'>" |
| | | + "AND a.`status` in (3,4) " + " </if> " |
| | | + "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" |
| | | + "AND a.`status` != 1 AND a.`status` != 6 " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + "<if test='comActActivityVO.type != null'>" |
| | | + "AND a.type=#{comActActivityVO.type} " + " </if> " |
| | | + " group by a.id " + " ORDER BY a.status = 99 desc,a.publish_at DESC " + "</script>") |
| | | // @Select("<script> " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | // + "a.activity_addr, " + "a.aattend_people," |
| | | // + "a.`status`, " + "a.is_qr_code, " + "a.publish_at, " + "a.begin_at, " + "a.cover, " + "a.end_at, " + "a.volunteer_max, " |
| | | // + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " |
| | | // + "count(if(s.is_volunteer=0,s.id,null))participant_now, " + "a.participant_max, " + "a.sign_up_begin, " |
| | | // + "a.sign_up_end, " + "ca.name as communityName,a.type,a.party_member_max " + "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 " |
| | | // + "left join com_act ca on a.community_id=ca.community_id " + " where 1=1 " + |
| | | // |
| | | // "<if test='comActActivityVO.communityId != null and comActActivityVO.communityId!=0'>" + "AND a.community_id = ${comActActivityVO.communityId} " + " </if> " |
| | | // + |
| | | // "<if test='comActActivityVO.phone != null and comActActivityVO.phone!=""'>" + "AND a.phone = ${comActActivityVO.phone} " + " </if> " |
| | | // + |
| | | // "<if test='comActActivityVO.areaCode !=null '>" + "AND ca.area_code = ${comActActivityVO.areaCode} " + " </if> " |
| | | // + |
| | | // "<if test='comActActivityVO.checkUnitId !=null '>" + "AND a.check_unit_id = #{comActActivityVO.checkUnitId} " + " </if> " |
| | | // + |
| | | // "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != ""'>" |
| | | // + " and a.activity_name like concat(#{comActActivityVO.activityName},'%') " + " </if> " |
| | | // + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng==null'>" |
| | | // + "AND a.`status` = #{comActActivityVO.status} " + " </if> " |
| | | // + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.isIng!=null and comActActivityVO.isIng==1'>" |
| | | // + "AND a.`status` in (3,4) " + " </if> " |
| | | // + "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" |
| | | // + "AND a.`status` != 1 AND a.`status` != 6 " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | // + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | // + " </if> " + "<if test='comActActivityVO.type != null'>" |
| | | // + "AND a.type=#{comActActivityVO.type} " + " </if> " |
| | | // + " group by a.id " + " ORDER BY a.status = 99 desc,a.publish_at DESC " + "</script>") |
| | | IPage<ComActActivityVO> pageActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | // @Select("SELECT " + "u.name sponsorName, " + "ca.name communityName, " |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ActivityInviteVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | |
| | | /** |
| | | * 活动邀请表(ComActActivityInvite)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-08-01 15:54:10 |
| | | */ |
| | | @Mapper |
| | | public interface ComActActivityInviteDAO extends BaseMapper<ComActActivityInvite> { |
| | | |
| | | /** |
| | | * 批量新增数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<ComActActivityInvite> 实例对象列表 |
| | | * @return 影响行数 |
| | | */ |
| | | int insertBatch(@Param("entities") List<ComActActivityInvite> entities); |
| | | |
| | | /** |
| | | * 批量新增或按主键更新数据(MyBatis原生foreach方法) |
| | | * |
| | | * @param entities |
| | | * List<ComActActivityInvite> 实例对象列表 |
| | | * @return 影响行数 |
| | | * @throws org.springframework.jdbc.BadSqlGrammarException |
| | | * 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<ComActActivityInvite> entities); |
| | | |
| | | /** |
| | | * 活动邀请列表 |
| | | * @param page |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | IPage<ActivityInviteVO> pageActivityInviteList(@Param("page") Page page, @Param("dto") PageActivityInviteDTO dto); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.vos.community.integral.ComActIntegralUserVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return 社区活动报名且未参与人员列表 |
| | | */ |
| | | List<ComActActivityPeopleVO> getTaskActivityPeopleList(@Param("activityId") Long activityId); |
| | | |
| | | /** |
| | | * 积分统计 |
| | | * @param userId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | ComActIntegralUserVO getUserIntegralStatistics(@Param("userId") Long userId, @Param("communityId") Long communityId); |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.panzhihua.common.model.vos.community.integral.IntegralTradeVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("integralRuleDTO") PageComActIntegralTradeDTO integralRuleDTO); |
| | | |
| | | IntegralUserVO getUserInfo(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | IntegralTradeVO getUserIntegralDetail(@Param("id") Long id); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<BigScreenServiceUser> bigScreenServiceUser(@Param("communityId")Long communityId); |
| | | |
| | | /** |
| | | * 通过userID确认是否是党员 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Integer checkIsPbMember(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 通过userID确认是否是志愿者 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Integer checkIsVolunteer(@Param("userId") Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 活动邀请表(ComActActivityInvite)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-08-01 15:54:11 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_act_activity_invite") |
| | | @SuppressWarnings("serial") |
| | | public class ComActActivityInvite implements Serializable { |
| | | private static final long serialVersionUID = 354077865574560151L; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | /** |
| | | * 受邀活动id |
| | | */ |
| | | private Long activityId; |
| | | /** |
| | | * 受邀用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 受邀用户姓名 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 受邀用户电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 是否报名 |
| | | */ |
| | | private Boolean isSign; |
| | | /** |
| | | * 邀请人 |
| | | */ |
| | | private Long createdBy; |
| | | /** |
| | | * 邀请时间 |
| | | */ |
| | | private Date createdAt; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 是否是志愿者 0 否 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | | * 以什么身份报名(1.居民 2.党员 3.志愿者 |
| | | */ |
| | | private Integer signIdentity; |
| | | |
| | | /** |
| | | * 评分星级1.差 2.一般 3.还不错 4.很满意 5.强烈推荐 |
| | |
| | | * 照片(多张以逗号隔开) |
| | | */ |
| | | private String photo; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActEvaluateDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", isVolunteer=" + isVolunteer + |
| | | ", starLevel=" + starLevel + |
| | | ", evaluateContent=" + evaluateContent + |
| | | ", photo=" + photo + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | private Long codeId; |
| | | |
| | | /** |
| | | * 活动类型 1居民,志愿者 2党员 |
| | | * 活动类型 1 社区活动 4项目活动 5服务活动 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 是否是志愿者 0 否 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActActRegistDO{" + |
| | | "id=" + id + |
| | | ", activityId=" + activityId + |
| | | ", userId=" + userId + |
| | | ", createAt=" + createAt + |
| | | ", isVolunteer=" + isVolunteer + |
| | | "}"; |
| | | } |
| | | * 以什么身份报名(1.居民 2.党员 3.志愿者 |
| | | */ |
| | | private Integer signIdentity; |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | /** |
| | | * 是否是志愿者 0 不是 1 是 |
| | | * 以什么身份报名(1.居民 2.党员 3.志愿者) |
| | | */ |
| | | private Integer isVolunteer; |
| | | private Integer signIdentity; |
| | | |
| | | /** |
| | | * 报名状态 0 已取消 1已报名 |
| | |
| | | private String reason; |
| | | |
| | | private Integer times; |
| | | |
| | | /** |
| | | * 是否邀请 |
| | | */ |
| | | private Boolean isInvite; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 志愿者人数上限 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer volunteerMax; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 参与者人数上限 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer participantMax; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer haveIntegralReward; |
| | | /** |
| | | * 积分奖励方式(1.按次奖励 2.记时奖励) |
| | | * 居民积分奖励方式(1.按次奖励 2.记时奖励) |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer rewardWay; |
| | | private Integer participantRewardWay; |
| | | |
| | | /** |
| | | * 奖励积分 |
| | | * 居民参与签到/打卡奖励积分 |
| | | */ |
| | | private Integer rewardIntegral; |
| | | private Integer participantRewardIntegral; |
| | | |
| | | /** |
| | | * 志愿者积分奖励方式(1.按次奖励 2.记时奖励) |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer volunteerRewardWay; |
| | | |
| | | /** |
| | | * 志愿者参与签到/打卡奖励积分 |
| | | */ |
| | | private Integer volunteerRewardIntegral; |
| | | |
| | | /** |
| | | * 党员积分奖励方式(1.按次奖励 2.记时奖励) |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer pbRewardWay; |
| | | |
| | | /** |
| | | * 党员参与签到/打卡奖励积分 |
| | | */ |
| | | private Integer pbRewardIntegral; |
| | | |
| | | /** |
| | | * 参与次数上限 |
| | | */ |
| | |
| | | private Long projectId; |
| | | |
| | | /** |
| | | * 1志愿者活动 2居民活动 3党员活动 4项目活动 |
| | | * 活动类型 1 社区活动 4项目活动 5服务活动 |
| | | */ |
| | | private Integer type; |
| | | |
| | |
| | | /** |
| | | * 党员参与者人数上限 |
| | | */ |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer partyMemberMax; |
| | | /** |
| | | * 签退范围,默认0无限制 |
| | |
| | | private String phone; |
| | | |
| | | private Long checkUnitId; |
| | | |
| | | private Long topicId; |
| | | } |
| | |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷) |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | */ |
| | | private Integer integralType; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参加居民活动 5.参加志愿者活动 6.参加党员活动 7.参与调查问卷) |
| | | * 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | */ |
| | | public interface integralType { |
| | | int fbssp = 1; |
| | |
| | | private Long serviceId; |
| | | |
| | | /** |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷) |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | */ |
| | | private Integer serviceType; |
| | | |
| | |
| | | * 邻里圈数量 |
| | | */ |
| | | private Integer count; |
| | | /** |
| | | * 使用类型(1.邻里圈话题 2.活动话题) |
| | | */ |
| | | private Integer belongType; |
| | | /** |
| | | * 关联id |
| | | */ |
| | | private Long refId; |
| | | |
| | | /** |
| | | * 状态(1.启用 2.禁用) |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 活动邀请表(ComActActivityInvite)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-08-01 15:54:12 |
| | | */ |
| | | public interface ComActActivityInviteService extends IService<ComActActivityInvite> { |
| | | |
| | | /** |
| | | * 活动邀请列表 |
| | | * @param pageActivityInviteDTO |
| | | * @return |
| | | */ |
| | | R pageActivityInviteList(PageActivityInviteDTO pageActivityInviteDTO); |
| | | |
| | | /** |
| | | * 添加邀请人员 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | R activityInviteAdd(List<ActivityInviteDTO> list); |
| | | |
| | | /** |
| | | * 删除邀请人员 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R activityInviteDelete(Long id); |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | |
| | | R getIntegralReceiveApplets(Long userId, Long communityId); |
| | | |
| | | /** |
| | | * 小程序-查询用户积分列表 |
| | | * 小程序-积分统计 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | |
| | | */ |
| | | R getTaskActivityPeopleList(Long activityId); |
| | | |
| | | /** |
| | | * 查询我的积分余额 |
| | | * @param userId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R getUserIntegralBalance(Long userId, Long communityId); |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getUserIntegralDetail(Long id); |
| | | } |
| | |
| | | * @param serviceId |
| | | * 交易业务id |
| | | * @param serviceType |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷) |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | * @param amount |
| | | * 交易积分数量 |
| | | * @param changeType |
| | |
| | | */ |
| | | R addIntegralTradeAdmin(AddComActIntegralUserDTO integralUserDTO); |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getUserIntegralDetail(Long id); |
| | | } |
| | |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | ComActActSignDO comActActSignDO = comActActSignDAO |
| | | .selectOne(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getActivityId, activityId) |
| | | .eq(ComActActSignDO::getUserId, userId).eq(ComActActSignDO::getStatus, 1)); |
| | | if (isNull(comActActSignDO)) { |
| | | return R.fail("活动未报名"); |
| | | } |
| | | Date beginAt = comActActivityDO.getBeginAt(); |
| | | Date nowDate = new Date(); |
| | | Integer isQrCode = comActActivityDO.getIsQrCode(); |
| | |
| | | } |
| | | ComActActEvaluateDO comActActEvaluateDO = new ComActActEvaluateDO(); |
| | | BeanUtils.copyProperties(comActActEvaluateVO, comActActEvaluateDO); |
| | | comActActEvaluateDO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | int result = this.baseMapper.insert(comActActEvaluateDO); |
| | | if (result < 0) { |
| | | return R.fail("评论失败,请重试"); |
| | |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActSignDOS.stream().map(comActActSignDO -> { |
| | | ComActActEvaluateDO comActActEvaluateDO = new ComActActEvaluateDO(); |
| | | comActActEvaluateDO.setActivityId(comActActSignDO.getActivityId()); |
| | | comActActEvaluateDO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | comActActEvaluateDO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | comActActEvaluateDO.setUserId(comActActSignDO.getUserId()); |
| | | comActActEvaluateDO.setCreateAt(new Date()); |
| | | comActActEvaluateDO.setStarLevel(5); |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComActActivityInviteDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | import com.panzhihua.service_community.service.ComActActivityInviteService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * 活动邀请表(ComActActivityInvite)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2022-08-01 15:54:12 |
| | | */ |
| | | @Service("comActActivityInviteService") |
| | | public class ComActActivityInviteServiceImpl extends ServiceImpl<ComActActivityInviteDAO, ComActActivityInvite> |
| | | implements ComActActivityInviteService { |
| | | |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | |
| | | /** |
| | | * 活动邀请列表 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageActivityInviteList(PageActivityInviteDTO dto) { |
| | | return R.ok(this.baseMapper.pageActivityInviteList(new Page<>(dto.getPageNum(), dto.getPageSize()), dto)); |
| | | } |
| | | |
| | | /** |
| | | * 添加邀请人员 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R activityInviteAdd(List<ActivityInviteDTO> list) { |
| | | ComActActivityDO activityDO = comActActivityDAO.selectById(list.get(0).getActivityId()); |
| | | if (isNull(activityDO)) { |
| | | return R.fail(HttpStatus.NOT_FOUND, "活动不存在"); |
| | | } |
| | | if (activityDO.getStatus().intValue() > 3) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "报名已结束,操作失败"); |
| | | } |
| | | List<ComActActivityInvite> inviteEntityList = new ArrayList<>(); |
| | | list.forEach(e -> { |
| | | ComActActivityInvite inviteEntity = new ComActActivityInvite(); |
| | | BeanUtils.copyProperties(e, inviteEntity); |
| | | inviteEntityList.add(inviteEntity); |
| | | }); |
| | | this.saveBatch(inviteEntityList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除邀请人员 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R activityInviteDelete(Long id) { |
| | | ComActActivityInvite activityInvite = this.baseMapper.selectById(id); |
| | | ComActActSignDO signDO = comActActSignDAO.selectOne(new LambdaQueryWrapper<ComActActSignDO>() |
| | | .eq(ComActActSignDO::getActivityId, activityInvite.getActivityId()) |
| | | .eq(ComActActSignDO::getUserId, activityInvite.getUserId()) |
| | | .eq(ComActActSignDO::getStatus, 1)); |
| | | if (nonNull(signDO)) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "已报名,不可删除"); |
| | | } |
| | | return R.ok(this.removeById(id)); |
| | | } |
| | | } |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotBlank; |
| | | import static org.apache.commons.lang3.ObjectUtils.isEmpty; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.entity.ComPbCheckUnit; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; |
| | | import com.panzhihua.service_community.dao.ComActActivityInviteDAO; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleTopicWestMapper; |
| | | import com.panzhihua.service_community.dao.ComPbMemberDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | import com.panzhihua.service_community.service.ComActActivityInviteService; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleTopicWestService; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPictureVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityActivitiesVO; |
| | | import com.panzhihua.common.model.vos.community.CommunityGovernanceTrendsVO; |
| | | import com.panzhihua.common.model.vos.community.PartyActivityLine; |
| | | import com.panzhihua.common.model.vos.community.PartyActivityStatics; |
| | | import com.panzhihua.common.model.vos.community.PartyActivityTypeChart; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.screen.work.ActActivityListVO; |
| | | import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActPictureDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComActActivityCodeDao; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActSocialProjectDao; |
| | | import com.panzhihua.service_community.dao.ComBpActivityDAO; |
| | | import com.panzhihua.service_community.dao.ComPbCheckUnitDao; |
| | | import com.panzhihua.service_community.dao.ComStreetDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.entity.ComPbCheckUnit; |
| | | import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActPictureDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActRegistDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActSignDO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.service.ComActActivityCodeService; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | import com.panzhihua.service_community.service.ComActIntegralUserTradeService; |
| | |
| | | private ComActSocialProjectDao comActSocialProjectDao; |
| | | @Resource |
| | | private ComStreetDAO comStreetDAO; |
| | | @Resource |
| | | private ComPbMemberDAO pbMemberDAO; |
| | | @Resource |
| | | private ComActNeighborCircleTopicWestMapper comActNeighborCircleTopicWestMapper; |
| | | @Resource |
| | | private ComActActivityInviteService comActActivityInviteService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | */ |
| | | @Override |
| | | public R addActivity(ComActActivityVO comActActivityVO) { |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 2) { |
| | | comActActivityVO.setRewardWay(null); |
| | | } |
| | | ComActActivityDO comActActivityDO = new ComActActivityDO(); |
| | | BeanUtils.copyProperties(comActActivityVO, comActActivityDO); |
| | | Integer status = comActActivityVO.getStatus(); |
| | |
| | | .eq(ComActActivityDO::getActivityName, comActActivityDO.getActivityName()) |
| | | .orderByDesc(ComActActivityDO::getCreateAt).last(" limit 1 ")); |
| | | Long activityId = one.getId(); |
| | | |
| | | List<ActivityInviteDTO> inviteList = comActActivityVO.getActivityInviteList(); |
| | | if (!isEmpty(inviteList)) { |
| | | List<ComActActivityInvite> inviteEntityList = new ArrayList<>(); |
| | | inviteList.forEach(e -> { |
| | | ComActActivityInvite inviteEntity = new ComActActivityInvite(); |
| | | BeanUtils.copyProperties(e, inviteEntity); |
| | | inviteEntity.setCreatedBy(comActActivityVO.getUserId()); |
| | | inviteEntityList.add(inviteEntity); |
| | | }); |
| | | comActActivityInviteService.saveBatch(inviteEntityList); |
| | | } |
| | | |
| | | ComActNeighborCircleTopicWestDO topicWestDO = new ComActNeighborCircleTopicWestDO(); |
| | | topicWestDO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | topicWestDO.setBelongType(2); |
| | | topicWestDO.setRefId(activityId); |
| | | topicWestDO.setName(comActActivityDO.getActivityName()); |
| | | topicWestDO.setCreateAt(new Date()); |
| | | topicWestDO.setCount(0); |
| | | topicWestDO.setHotNum(0L); |
| | | topicWestDO.setStatus(ComActNeighborCircleTopicWestDO.status.yes); |
| | | comActNeighborCircleTopicWestMapper.insert(topicWestDO); |
| | | |
| | | ComActActivityDO activityUpdate = new ComActActivityDO(); |
| | | activityUpdate.setId(activityId); |
| | | activityUpdate.setTopicId(topicWestDO.getId()); |
| | | this.baseMapper.updateById(activityUpdate); |
| | | |
| | | //保存上传照片 |
| | | ComActActPictureDO comActActPictureDO = new ComActActPictureDO(); |
| | |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 2) { |
| | | comActActivityVO.setRewardWay(null); |
| | | } |
| | | BeanUtils.copyProperties(comActActivityVO, comActActivityDO); |
| | | |
| | |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(actSignQuery); |
| | | if (!ObjectUtils.isEmpty(comActActSignDO)) { |
| | | comActActivityVO.setIsSign(1); |
| | | comActActivityVO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | comActActivityVO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | } |
| | | List<ComActActRegistDO> regList = comActActRegistDAO.selectList(new QueryWrapper<ComActActRegistDO>().lambda() |
| | | .eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, id)); |
| | |
| | | comActActivityVO.setSignType(1); |
| | | } |
| | | } |
| | | comActActivityVO.setCodeType(1); |
| | | } |
| | | comActActivityVO.setCodeType(1); |
| | | return comActActivityVO; |
| | | } |
| | | |
| | |
| | | int num = 0; |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(new QueryWrapper<ComActActSignDO>() |
| | | .lambda().eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getUserId, userId)); |
| | | Integer signIdentity = signactivityVO.getSignIdentity(); |
| | | if (1 == type) { |
| | | if (nonNull(comActActSignDO) && comActActSignDO.getStatus().equals(1)) { |
| | | 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 = |
| | | JSONObject.parseObject(JSONObject.toJSONString(userInfoR.getData()), LoginUserInfoVO.class); |
| | | // 查询当前活动下参与居民 |
| | | Integer residentCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 0).eq(ComActActSignDO::getStatus, 1)); |
| | | if (activityType.equals(1)) { |
| | | //志愿者活动 |
| | | boolean userIsVolunteer = loginUserInfoVO.getIsVolunteer() == 1; |
| | | // 查询当前活动下参与志愿者 |
| | | Integer volunteerCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 1).eq(ComActActSignDO::getStatus, 1)); |
| | | if (userIsVolunteer) { |
| | | //用户是志愿者以志愿者身份参加 |
| | | if (volunteerMax > volunteerCount || volunteerMax.equals(-1)) { |
| | | //以志愿者身份报名 |
| | | isVolunteer = 1; |
| | | } else if (nonNull(residentMax) && (residentMax > residentCount || residentMax.equals(-1))) { |
| | | //志愿者报名人数已满,再以居民身份报名参加 |
| | | isVolunteer = 0; |
| | | } else { |
| | | Boolean isInvite = false; |
| | | if (activityType == 1) { |
| | | if (signIdentity == 1) { |
| | | //以居民身份参与活动 |
| | | Integer residentMax = actActivityDO.getParticipantMax(); |
| | | if (residentMax == null) { |
| | | return R.fail("活动暂未对居民开放"); |
| | | } |
| | | // 查询当前活动下参与居民 |
| | | Integer residentCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getSignIdentity, 1).eq(ComActActSignDO::getStatus, 1)); |
| | | if (residentMax != -1 && residentMax <= residentCount) { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } else { |
| | | //用户是普通居民已居民身份参加 |
| | | if (nonNull(residentMax) && (residentMax > residentCount || residentMax.equals(-1))) { |
| | | //以居民身份报名参加 |
| | | isVolunteer = 0; |
| | | } else if (volunteerMax > volunteerCount || volunteerMax.equals(-1)) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是志愿者哦~"); |
| | | } else if (signIdentity == 2) { |
| | | //以党员身份参与活动 |
| | | Integer partyMemberMax = actActivityDO.getPartyMemberMax(); |
| | | if (partyMemberMax == null) { |
| | | return R.fail("活动暂未对党员开放"); |
| | | } |
| | | ComActActivityInvite activityInvite = comActActivityInviteService.getBaseMapper().selectOne(new LambdaQueryWrapper<ComActActivityInvite>() |
| | | .eq(ComActActivityInvite::getActivityId, activityId).eq(ComActActivityInvite::getUserId, userId)); |
| | | if (isNull(activityInvite)) { |
| | | int count = pbMemberDAO.checkIsPbMember(userId); |
| | | if (count < 1) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是党员"); |
| | | } |
| | | // 查询当前活动下参与志愿者 |
| | | Integer partyMemberCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getSignIdentity, 2) |
| | | .eq(ComActActSignDO::getStatus, 1).eq(ComActActSignDO::getIsInvite, false)); |
| | | if (partyMemberMax != -1 && partyMemberMax <= partyMemberCount) { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } else { |
| | | isInvite = true; |
| | | } |
| | | } else { |
| | | //以志愿者身份参与活动 |
| | | Integer volunteerMax = actActivityDO.getVolunteerMax(); |
| | | if (volunteerMax == null) { |
| | | return R.fail("活动暂未对志愿者开放"); |
| | | } |
| | | int count = pbMemberDAO.checkIsVolunteer(userId); |
| | | if (count < 1) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是志愿者"); |
| | | } |
| | | // 查询当前活动下参与志愿者 |
| | | Integer volunteerCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getSignIdentity, 3).eq(ComActActSignDO::getStatus, 1)); |
| | | if (volunteerMax != -1 && volunteerMax <= volunteerCount) { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } |
| | | } else { |
| | | //普通居民活动 |
| | | //审查用户是否有该活动报名权限(是否活动指定参与人群) |
| | | String currentUserTags = loginUserInfoVO.getTags(); |
| | | String attendPeople = actActivityDO.getAattendPeople(); |
| | | if (isNotBlank(attendPeople)) { |
| | | if (isBlank(currentUserTags)) { |
| | | currentUserTags = "全部居民"; |
| | | } else { |
| | | currentUserTags = currentUserTags.concat(",全部居民"); |
| | | } |
| | | List<String> currentUserTagList = Arrays.asList(currentUserTags.split(",")); |
| | | boolean checkResult = currentUserTagList.stream().anyMatch(currentUserTag -> attendPeople.contains(currentUserTag)); |
| | | if (!checkResult) { |
| | | return R.fail("您不是指定参与人群!"); |
| | | } |
| | | } |
| | | if (residentMax > residentCount || residentMax.equals(-1)) { |
| | | //用户参加居民活动 |
| | | isVolunteer = 0; |
| | | } else { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } |
| | | if (nonNull(comActActSignDO)) { |
| | | comActActSignDO.setStatus(1); |
| | | comActActSignDO.setCreateAt(new Date()); |
| | | comActActSignDO.setReason(null); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | comActActSignDO.setSignIdentity(signIdentity); |
| | | comActActSignDO.setTimes(comActActSignDO.getTimes()+1); |
| | | comActActSignDO.setIsInvite(isInvite); |
| | | num = comActActSignDAO.updateById(comActActSignDO); |
| | | } else { |
| | | comActActSignDO = new ComActActSignDO(); |
| | | comActActSignDO.setActivityId(activityId); |
| | | comActActSignDO.setUserId(userId); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | comActActSignDO.setSignIdentity(signIdentity); |
| | | comActActSignDO.setTimes(1); |
| | | comActActSignDO.setIsInvite(isInvite); |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | } |
| | | } else { |
| | |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(8); |
| | | addComActIntegralUserDTO.setActivityType(actActivityDO.getType()); |
| | | addComActIntegralUserDTO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | addComActIntegralUserDTO.setIntegral(actActivityDO.getCancelDeduct()); |
| | | addComActIntegralUserDTO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | addComActIntegralUserDTO.setCommunityId(actActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | addComActIntegralUserDTO.setRemark(actActivityDO.getType().intValue() == 5 ? "单位党员活动-取消报名" : "社区活动-取消报名"); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | } |
| | | } |
| | |
| | | if (isNull(activityId)) { |
| | | return R.fail("签到所属活动id不能为空!"); |
| | | } |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在!"); |
| | | } |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在!"); |
| | | } |
| | | |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getUserId, userId).eq(ComActActSignDO::getStatus, 1)); |
| | | if (isNull(comActActSignDO)) { |
| | | return R.fail("活动未报名"); |
| | | } |
| | | ComActActSignDO comActActSignDO = comActActSignDAO |
| | | .selectOne(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getActivityId, activityId) |
| | | .eq(ComActActSignDO::getUserId, userId).eq(ComActActSignDO::getStatus, 1)); |
| | | if (isNull(comActActSignDO)) { |
| | | return R.fail("活动未报名"); |
| | | } |
| | | |
| | | Date beginAt = comActActivityDO.getBeginAt(); |
| | | Date endAt = comActActivityDO.getEndAt(); |
| | | Date nowDate = new Date(); |
| | | if (nowDate.before(beginAt) || nowDate.after(endAt)) { |
| | | return R.fail("不在活动时间范围内"); |
| | | Date beginAt = comActActivityDO.getBeginAt(); |
| | | Date endAt = comActActivityDO.getEndAt(); |
| | | Date nowDate = new Date(); |
| | | if (nowDate.before(beginAt) || nowDate.after(endAt)) { |
| | | return R.fail("不在活动时间范围内"); |
| | | } |
| | | Integer rewardWay = null; |
| | | Integer rewardIntegral = 0; |
| | | Integer integralType = null; |
| | | String remark = ""; |
| | | switch (comActActSignDO.getSignIdentity()) { |
| | | case 1: |
| | | rewardWay = comActActivityDO.getParticipantRewardWay(); |
| | | rewardIntegral = comActActivityDO.getParticipantRewardIntegral(); |
| | | integralType = 4; |
| | | remark = "社区活动-居民身份成功参与"; |
| | | break; |
| | | case 2: |
| | | rewardWay = comActActivityDO.getPbRewardWay(); |
| | | rewardIntegral = comActActivityDO.getPbRewardIntegral(); |
| | | integralType = 5; |
| | | remark = "社区活动-党员身份成功参与"; |
| | | case 3: |
| | | rewardWay = comActActivityDO.getVolunteerRewardWay(); |
| | | rewardIntegral = comActActivityDO.getVolunteerRewardIntegral(); |
| | | integralType = 6; |
| | | remark = "社区活动-志愿者身份成功参与"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | if (comActActivityDO.getType().intValue() == 5) { |
| | | integralType = 9; |
| | | remark = "单位党员活动-成功参与"; |
| | | } |
| | | boolean isHave = rewardIntegral > 0; |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | if (comActActRegistVO.getSignType() != null && comActActRegistVO.getSignType() == 2) { |
| | | ComActActRegistDO comActActActRegistDO = comActActRegistDAO.selectOne(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId) |
| | | .eq(ComActActRegistDO::getCodeId, comActActRegistVO.getCodeId())); |
| | | if (comActActActRegistDO == null) { |
| | | return R.fail("未签到无法签退"); |
| | | } |
| | | Integer haveIntegralReward = comActActivityDO.getHaveIntegralReward(); |
| | | boolean isHave = nonNull(haveIntegralReward) && haveIntegralReward.equals(1); |
| | | |
| | | // String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | // if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | // return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | // } |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | if(comActActRegistVO.getSignType()!=null&&comActActRegistVO.getSignType()==2){ |
| | | ComActActRegistDO comActActActRegistDO=comActActRegistDAO.selectOne(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getCodeId,comActActRegistVO.getCodeId())); |
| | | if(comActActActRegistDO==null){ |
| | | return R.fail("未签到无法签退"); |
| | | } |
| | | if(comActActActRegistDO.getEndTime()!=null){ |
| | | return R.fail("无法重复签退"); |
| | | } |
| | | comActActRegistDO.setId(comActActActRegistDO.getId()); |
| | | comActActRegistDO.setEndTime(new Date()); |
| | | int result=comActActRegistDAO.updateById(comActActRegistDO); |
| | | if (result > 0) { |
| | | if (isHave) { |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO=new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(6); |
| | | addComActIntegralUserDTO.setActivityType(2); |
| | | addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | return R.ok(comActActivityDO.getRewardIntegral()); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | if (comActActActRegistDO.getEndTime() != null) { |
| | | return R.fail("无法重复签退"); |
| | | } |
| | | else { |
| | | int signDayCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getCodeId,comActActRegistVO.getCodeId())); |
| | | int signAllCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | if (signDayCount > 0) { |
| | | return R.fail("请扫描新的签到码"); |
| | | } |
| | | int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActRegistDO.getStartTime(), nowDate); |
| | | comActActRegistDO.setId(comActActActRegistDO.getId()); |
| | | comActActRegistDO.setEndTime(nowDate); |
| | | comActActRegistDO.setAward(rewardIntegral * hours); |
| | | int result = comActActRegistDAO.updateById(comActActRegistDO); |
| | | if (result > 0) { |
| | | if (isHave) { |
| | | int limit = comActActivityDO.getLimit().intValue(); |
| | | if(limit != -1 && signAllCount >= limit){ |
| | | return R.fail("签到次数上限"); |
| | | } |
| | | } |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setStartTime(new Date()); |
| | | comActActRegistDO.setType(comActActivityDO.getType()); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | comActActRegistDO.setAward(isHave ? comActActivityDO.getRewardIntegral() : 0); |
| | | comActActRegistDO.setPosition(comActActRegistVO.getPosition()); |
| | | comActActRegistDO.setTimes(signAllCount+1); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0&&comActActivityDO.getType()!=3) { |
| | | if (isHave) { |
| | | boolean isVolunteerAct = comActActivityDO.getVolunteerMax() != 0; |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO=new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(isVolunteerAct ? 5 : 4); |
| | | addComActIntegralUserDTO.setActivityType(1); |
| | | addComActIntegralUserDTO.setIsVolunteer(comActActSignDO.getIsVolunteer()); |
| | | addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | return R.ok(comActActivityDO.getRewardIntegral()); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | else { |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(integralType); |
| | | addComActIntegralUserDTO.setIntegral(rewardIntegral * hours); |
| | | addComActIntegralUserDTO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | addComActIntegralUserDTO.setRemark(remark); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | return R.ok(rewardIntegral * hours); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail("网络错误,请重试"); |
| | | // else { |
| | | // ComPbActivityDO comPbActivityDO=comBpActivityDAO.selectById(activityId); |
| | | // if (isNull(comPbActivityDO)) { |
| | | // return R.fail("活动不存在!"); |
| | | // } |
| | | // |
| | | // Date beginAt = comPbActivityDO.getActivityTimeBegin(); |
| | | // Date endAt = comPbActivityDO.getActivityTimeEnd(); |
| | | // Date nowDate = new Date(); |
| | | // if (nowDate.before(beginAt) || nowDate.after(endAt)) { |
| | | // return R.fail("不在活动时间范围内"); |
| | | // } |
| | | // |
| | | // int signDayCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | // .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getCodeId,comActActRegistVO.getCodeId())); |
| | | // int signAllCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | // .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | // if (signDayCount >= 0) { |
| | | // return R.fail("请扫描新的签到码"); |
| | | // } |
| | | // int limit = comPbActivityDO.getLimit().intValue(); |
| | | // if(limit != -1 && signAllCount >= limit){ |
| | | // return R.fail("签到次数上限"); |
| | | // } |
| | | // |
| | | // ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | // comActActRegistDO.setActivityId(activityId); |
| | | // comActActRegistDO.setType(2); |
| | | // comActActRegistDO.setUserId(userId); |
| | | // comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | // comActActRegistDO.setCreateAt(nowDate); |
| | | // comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | // comActActRegistDO.setAward(comPbActivityDO.getRewardIntegral()); |
| | | // comActActRegistDO.setPosition(comActActRegistVO.getPosition()); |
| | | // comActActRegistDO.setTimes(signAllCount+1); |
| | | // int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | // if (result > 0) { |
| | | // AddComActIntegralUserDTO addComActIntegralUserDTO=new AddComActIntegralUserDTO(); |
| | | // addComActIntegralUserDTO.setUserId(userId); |
| | | // addComActIntegralUserDTO.setIntegralType(8); |
| | | // addComActIntegralUserDTO.setActivityType(2); |
| | | // addComActIntegralUserDTO.setCommunityId(comPbActivityDO.getCommunityId()); |
| | | // addComActIntegralUserDTO.setServiceId(activityId); |
| | | // comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | //// ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | //// opsForValue.set(activitySignInKey, "", 1800L, TimeUnit.SECONDS); |
| | | // return R.ok(); |
| | | // } |
| | | // return R.fail("网络错误,请重试"); |
| | | // } |
| | | } else { |
| | | int signDayCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>().lambda() |
| | | .eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId) |
| | | .eq(ComActActRegistDO::getCodeId, comActActRegistVO.getCodeId())); |
| | | int signAllCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>().lambda() |
| | | .eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | if (signDayCount > 0) { |
| | | return R.fail("请扫描新的签到码"); |
| | | } |
| | | if (isHave) { |
| | | int limit = comActActivityDO.getLimit().intValue(); |
| | | if (limit != -1 && signAllCount >= limit) { |
| | | return R.fail("签到次数上限"); |
| | | } |
| | | } |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setStartTime(new Date()); |
| | | comActActRegistDO.setType(comActActivityDO.getType()); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | comActActRegistDO.setAward(rewardWay == 1 ? rewardIntegral : 0); |
| | | comActActRegistDO.setPosition(comActActRegistVO.getPosition()); |
| | | comActActRegistDO.setTimes(signAllCount + 1); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0 && isHave && rewardWay == 1) { |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(userId); |
| | | addComActIntegralUserDTO.setIntegralType(integralType); |
| | | addComActIntegralUserDTO.setIntegral(rewardIntegral); |
| | | addComActIntegralUserDTO.setSignIdentity(comActActSignDO.getSignIdentity()); |
| | | addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | addComActIntegralUserDTO.setRemark(remark); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | return R.ok(rewardIntegral); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail("网络错误,请重试"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-28 16:02:57 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 小程序-查询用户积分列表 |
| | | * 小程序-积分统计 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | |
| | | */ |
| | | @Override |
| | | public R getIntegralUserListApplets(Long userId, Long communityId) { |
| | | ComActIntegralUserVO integralUserVO = new ComActIntegralUserVO(); |
| | | Integer amount = 0; |
| | | // 查询该用户在本社区下的积分账户是否存在,不存在则需要给用户创建 |
| | | ComActIntegralUserDO integralUserDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActIntegralUserDO>().lambda() |
| | |
| | | integralUserDO.setCreateAt(new Date()); |
| | | this.baseMapper.insert(integralUserDO); |
| | | } |
| | | |
| | | // 查询用户积分账户列表 |
| | | List<ComActIntegralUserListVO> integralUserList = this.baseMapper.getIntegralUserListApplets(userId); |
| | | if (!integralUserList.isEmpty()) { |
| | | for (ComActIntegralUserListVO integralUser : integralUserList) { |
| | | // 查询用户在本社区积分排行 |
| | | IntegralUserRankVO userRank = |
| | | this.baseMapper.getIntegralUserRank(integralUser.getCommunityId(), userId); |
| | | if (userRank != null) { |
| | | integralUser.setRank(userRank.getRank()); |
| | | amount += integralUser.getAmount(); |
| | | } |
| | | } |
| | | ComActIntegralUserVO integralUserVO = this.baseMapper.getUserIntegralStatistics(userId, communityId); |
| | | if (isNull(communityId)) { |
| | | // 各社区已获积分统计 |
| | | List<ComActIntegralUserListVO> integralUserList = this.baseMapper.getIntegralUserListApplets(userId); |
| | | integralUserVO.setIntegralUserList(integralUserList); |
| | | } |
| | | // 查询用户绑定社区名字 |
| | | ComActDO actDO = comActDAO.selectById(communityId); |
| | | if (actDO != null) { |
| | | integralUserVO.setCommunityName(actDO.getName()); |
| | | } |
| | | |
| | | integralUserVO.setAmount(amount); |
| | | integralUserVO.setIntegralUserList(integralUserList); |
| | | return R.ok(integralUserVO); |
| | | } |
| | | |
| | |
| | | public R getTaskActivityPeopleList(Long activityId) { |
| | | return R.ok(this.baseMapper.getTaskActivityPeopleList(activityId)); |
| | | } |
| | | |
| | | @Override |
| | | public R getUserIntegralBalance(Long userId, Long communityId) { |
| | | ComActIntegralUserVO integralUserVO = new ComActIntegralUserVO(); |
| | | // 查询该用户在本社区下的积分账户是否存在,不存在则需要给用户创建 |
| | | ComActIntegralUserDO integralUserDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActIntegralUserDO>().lambda() |
| | | .eq(ComActIntegralUserDO::getCommunityId, communityId).eq(ComActIntegralUserDO::getUserId, userId)); |
| | | if (integralUserDO == null) { |
| | | integralUserDO = new ComActIntegralUserDO(); |
| | | integralUserDO.setCommunityId(communityId); |
| | | integralUserDO.setUserId(userId); |
| | | integralUserDO.setCreateAt(new Date()); |
| | | this.baseMapper.insert(integralUserDO); |
| | | } |
| | | // 查询用户绑定社区名字 |
| | | ComActDO actDO = comActDAO.selectById(communityId); |
| | | if (actDO != null) { |
| | | integralUserVO.setCommunityName(actDO.getName()); |
| | | } |
| | | integralUserVO.setAmount(integralUserDO.getIntegralSum()); |
| | | return R.ok(integralUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getUserIntegralDetail(Long id) { |
| | | return comActIntegralUserTradeService.getUserIntegralDetail(id); |
| | | } |
| | | } |
| | |
| | | * @param serviceId |
| | | * 交易业务id |
| | | * @param serviceType |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷) |
| | | * 交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | * "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | * @param amount |
| | | * 交易积分数量 |
| | | * @param changeType |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addIntegralTradeAdmin(AddComActIntegralUserDTO integralUserDTO) { |
| | | // 判断增加积分类型 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参加居民活动 5.参加志愿者活动 6.参与党员活动 7.参与调查问卷 8.取消活动) |
| | | // 判断增加积分类型 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.社区活动-居民身份参与 " + |
| | | // "5.社区活动-党员身份参与 6.社区活动-志愿者身份参与 7.参与调查问卷 8.取消活动 9.参与单位党员活动) |
| | | Integer type = integralUserDTO.getIntegralType(); |
| | | // 业务id |
| | | Long serviceId = integralUserDTO.getServiceId(); |
| | |
| | | Date nowDate = new Date(); |
| | | |
| | | Integer changeType = ComActIntegralUserTradeDO.changeType.add; |
| | | |
| | | Integer isVolunteer = integralUserDTO.getIsVolunteer(); |
| | | |
| | | if (!type.equals(8)) { |
| | | // 查询随手拍增加积分数量 |
| | |
| | | } |
| | | } |
| | | break; |
| | | case 4: |
| | | if (nonNull(isVolunteer) && isVolunteer.equals(1)) { |
| | | identityType = 3; |
| | | } else { |
| | | identityType = 1; |
| | | } |
| | | remark.append("成功参加居民活动奖励积分"); |
| | | ComActActivityDO actActivityDO1 = comActActivityService.getById(serviceId); |
| | | if(actActivityDO1 != null) { |
| | | amount = actActivityDO1.getRewardIntegral(); |
| | | } |
| | | break; |
| | | case 5: |
| | | if (nonNull(isVolunteer) && isVolunteer.equals(0)) { |
| | | identityType = 1; |
| | | } else { |
| | | identityType = 3; |
| | | } |
| | | remark.append("成功参加志愿者活动奖励积分"); |
| | | ComActActivityDO actActivityDO = comActActivityService.getById(serviceId); |
| | | if(actActivityDO != null) { |
| | | amount = actActivityDO.getRewardIntegral(); |
| | | } |
| | | break; |
| | | case 6: |
| | | identityType = 2; |
| | | remark.append("成功参加党员活动奖励积分"); |
| | | ComActActivityDO actActivityDO3 = comActActivityService.getById(serviceId); |
| | | if(actActivityDO3 != null) { |
| | | amount = actActivityDO3.getRewardIntegral(); |
| | | } |
| | | break; |
| | | case 7: |
| | | // 查询调查问卷 |
| | | ComActQuestnaireDO questnaireDO = comActQuestnaireDAO.selectById(serviceId); |
| | |
| | | break; |
| | | case 8: |
| | | changeType = ComActIntegralUserTradeDO.changeType.reduce; |
| | | ComActActivityDO actActivityDO2 = comActActivityService.getById(serviceId); |
| | | if (actActivityDO2 != null) { |
| | | amount = -actActivityDO2.getCancelDeduct(); |
| | | if (actActivityDO2.getType()==1) { |
| | | identityType=3; |
| | | remark.append("取消志愿者活动扣除积分"); |
| | | } else if(actActivityDO2.getType()==3){ |
| | | identityType=2; |
| | | remark.append("取消党员活动扣除积分"); |
| | | } |
| | | else { |
| | | identityType=1; |
| | | remark.append("取消居民活动扣除积分"); |
| | | } |
| | | |
| | | } |
| | | // else { |
| | | // ComPbActivityDO comPbActivityDO = comBpActivityDAO.selectById(serviceId); |
| | | // if(comPbActivityDO!=null){ |
| | | // amount=comPbActivityDO.getRewardIntegral(); |
| | | // identityType=2; |
| | | // } |
| | | // } |
| | | amount = -integralUserDTO.getIntegral(); |
| | | remark.append(integralUserDTO.getRemark()); |
| | | break; |
| | | case 4: |
| | | case 5: |
| | | case 6: |
| | | case 9: |
| | | identityType = integralUserDTO.getSignIdentity(); |
| | | remark.append(integralUserDTO.getRemark()); |
| | | amount = integralUserDTO.getIntegral(); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取积分详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getUserIntegralDetail(Long id) { |
| | | return R.ok(this.baseMapper.getUserIntegralDetail(id)); |
| | | } |
| | | |
| | | private int addIntegral(int integral) { |
| | | return integral > 0 ? integral : 0; |
| | | } |
| | |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicWestDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getBelongType, 1) |
| | | .eq(ComActNeighborCircleTopicWestDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId())); |
| | | if (circleTopicDO != null) { |
| | | return R.fail("该话题已存在"); |
| | |
| | | this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>().lambda() |
| | | .eq(ComActNeighborCircleTopicWestDO::getName, addCircleTopicAdminDTO.getName()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getCommunityId, addCircleTopicAdminDTO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getBelongType, 1) |
| | | .ne(ComActNeighborCircleTopicWestDO::getId, circleTopicDO.getId())); |
| | | if (oldCircleTopicDO != null && !oldCircleTopicDO.getId().equals(addCircleTopicAdminDTO.getId())) { |
| | | return R.fail("该话题已存在"); |
| | |
| | | public R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | ComActNeighborCircleTopicWestDO circleTopicDO = this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicWestDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicWestDO::getCommunityId,circleTopicAppDTO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicWestDO::getBelongType, 1) |
| | | .eq(ComActNeighborCircleTopicWestDO::getName,circleTopicAppDTO.getName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicWestDO(); |
| | |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="sign_identity" property="signIdentity" /> |
| | | <result column="star_level" property="starLevel" /> |
| | | <result column="evaluate_content" property="evaluateContent" /> |
| | | <result column="photo" property="photo" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer, star_level, evaluate_content, photo |
| | | id, activity_id, user_id, create_at, sign_identity, star_level, evaluate_content, photo |
| | | </sql> |
| | | |
| | | <select id="pageActivityEvaluates" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> |
| | |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caae.is_volunteer, |
| | | CASE WHEN t.type = 1 and caae.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and caae.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity |
| | | caae.sign_identity AS identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | |
| | | caae.evaluate_content, |
| | | su.`name`, |
| | | su.phone, |
| | | CASE WHEN t.type = 1 and caae.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and caae.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity |
| | | caae.sign_identity AS identity |
| | | |
| | | FROM |
| | | com_act_act_evaluate caae |
| | |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="sign_identity" property="signIdentity" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | id, activity_id, user_id, create_at, sign_identity |
| | | </sql> |
| | | |
| | | <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> |
| | |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caar.is_volunteer, |
| | | t.duration, |
| | | CASE WHEN t.type = 1 and caar.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and caar.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity |
| | | caar.sign_identity AS identity, |
| | | t.duration |
| | | |
| | | FROM |
| | | com_act_act_regist caar |
| | |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE WHEN t.type = 1 and caar.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and caar.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity |
| | | |
| | | caar.sign_identity AS identity |
| | | FROM |
| | | com_act_act_regist caar |
| | | LEFT JOIN sys_user su ON caar.user_id = su.user_id |
| | |
| | | su.`name` |
| | | su.phone, |
| | | su.tags, |
| | | CASE |
| | | |
| | | WHEN su.is_partymember = 1 THEN |
| | | '党员' |
| | | WHEN caas.is_volunteer = 1 THEN |
| | | '志愿者' ELSE '居民' |
| | | END identity |
| | | caas.sign_identity AS identity |
| | | FROM |
| | | (SELECT * FROM com_act_act_sign WHERE `status` = 1) caas |
| | | LEFT JOIN sys_user su ON caas.user_id = su.user_id |
| | |
| | | su.phone, |
| | | su.image_url, |
| | | su.tags, |
| | | caar.is_volunteer, |
| | | caar.sign_identity, |
| | | t.duration, |
| | | t.status, |
| | | caar.start_time, |
| | |
| | | <result column="activity_id" property="activityId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="sign_identity" property="signIdentity" /> |
| | | <result column="status" property="status" /> |
| | | <result column="reason" property="reason" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_id, user_id, create_at, is_volunteer |
| | | id, activity_id, user_id, create_at, sign_identity |
| | | </sql> |
| | | |
| | | <select id="getSignLists" resultType="com.panzhihua.common.model.vos.community.ComActActSignExcelVO"> |
| | |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | | CASE WHEN t.type = 1 and caas.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and caas.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity |
| | | caas.sign_identity AS identity |
| | | |
| | | FROM |
| | | com_act_act_sign caas |
| | |
| | | </select> |
| | | |
| | | <select id="selectNeedEvaluateSignRecords" resultMap="BaseResultMap"> |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.is_volunteer |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.sign_identity |
| | | FROM `com_act_act_sign` s |
| | | LEFT JOIN `com_act_act_evaluate` e |
| | | ON s.activity_id=e.activity_id AND s.user_id=e.user_id |
| | |
| | | </select> |
| | | <select id="listActivitySign" resultType="com.panzhihua.common.model.vos.community.ActivitySignVO"> |
| | | SELECT u.user_id id, u.image_url, u.name, u.nick_name, |
| | | CASE WHEN t.type = 1 and a.is_volunteer = 1 THEN '志愿者' WHEN t.type = 1 and a.is_volunteer = 0 THEN '居民' WHEN t.type=2 THEN '居民' ELSE '党员' END identity, |
| | | u.phone, u.tags, a.create_at, a.is_volunteer, a.status , a.times, |
| | | a.reason, IF(r.times IS NULL, 0, r.award * r.times) AS award, t.limit |
| | | a.sign_identity AS identity, |
| | | u.phone, u.tags, a.create_at, a.sign_identity, a.status , a.times, |
| | | a.reason, IF(r.times IS NULL, 0, r.award * r.times) AS award, t.limit, a.is_invite |
| | | FROM com_act_act_sign a |
| | | JOIN sys_user u ON a.user_id = u.user_id |
| | | left join com_act_activity t on a.activity_id = t.id |
| | |
| | | <if test='activitySignVO.name != null and activitySignVO.name != ""'> |
| | | AND u.`name` = #{activitySignVO.name} |
| | | </if> |
| | | <if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'> |
| | | AND u.is_partymember = 0 and a.is_volunteer=0 |
| | | </if> |
| | | <if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==2'> |
| | | AND u.is_partymember = 1 |
| | | </if> |
| | | <if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==3'> |
| | | AND a.is_volunteer=1 |
| | | </if> |
| | | <if test='activitySignVO.type != null and activitySignVO.type != 0'> |
| | | AND a.is_volunteer=#{activitySignVO.type}-1 |
| | | <if test='activitySignVO.identity != null'> |
| | | AND a.sign_identity = #{activitySignVO.identity} |
| | | </if> |
| | | order by a.create_at desc |
| | | </select> |
| | |
| | | order by a.create_at desc |
| | | </select> |
| | | <select id="selectList" resultType="com.panzhihua.common.model.vos.community.ActivitySignVO"> |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.is_volunteer, r.times, r.times * r.award AS award FROM `com_act_act_sign` s |
| | | SELECT s.id,s.activity_id,s.user_id,s.create_at,s.sign_identity, r.times, r.times * r.award AS award |
| | | FROM `com_act_act_sign` s |
| | | LEFT JOIN ( |
| | | SELECT * FROM ( |
| | | SELECT * FROM com_act_act_regist |
| | |
| | | ) r ON s.activity_id = r.activity_id AND s.user_id = r.user_id |
| | | WHERE s.activity_id = #{id} |
| | | </select> |
| | | <select id="listActivitySigns" resultType="com.panzhihua.common.model.vos.community.ActivitySignVO"> |
| | | SELECT |
| | | u.user_id id, |
| | | u.image_url, |
| | | u.NAME, |
| | | u.nick_name, |
| | | u.openid, |
| | | a.sign_identity AS identity, |
| | | u.phone, |
| | | u.tags, |
| | | a.create_at, |
| | | a.sign_identity, |
| | | a.STATUS, |
| | | a.reason, |
| | | t.limit |
| | | FROM |
| | | com_act_act_sign a |
| | | JOIN sys_user u ON a.user_id = u.user_id |
| | | LEFT JOIN com_act_activity t ON a.activity_id = t.id |
| | | WHERE |
| | | a.activity_id = #{activitySignVO.activityId} |
| | | <if test='activitySignVO.phone != null and activitySignVO.phone != ""'> |
| | | AND u.phone = #{activitySignVO.phone} |
| | | </if> |
| | | <if test='activitySignVO.status != null'> |
| | | AND a.status = #{activitySignVO.status} |
| | | </if> |
| | | <if test='activitySignVO.name != null and activitySignVO.name != ""'> |
| | | AND u.`name` = #{activitySignVO.name} |
| | | </if> |
| | | <if test='activitySignVO.identity != null'> |
| | | AND a.sign_identity = #{activitySignVO.identity} |
| | | </if> |
| | | ORDER BY a.create_at DESC |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.panzhihua.service_community.dao.ComActActivityInviteDAO"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActActivityInvite" id="ComActActivityInviteMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="activityId" column="activity_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="phone" column="phone" jdbcType="VARCHAR"/> |
| | | <result property="isSign" column="is_sign" jdbcType="VARCHAR"/> |
| | | <result property="createdBy" column="created_by" jdbcType="INTEGER"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="pageActivityInviteList" resultType="com.panzhihua.common.model.vos.community.ActivityInviteVO"> |
| | | SELECT * FROM com_act_activity_invite WHERE activity_id = #{dto.activityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | <result column="cancel_reason" property="cancelReason" /> |
| | | <result column="range" property="range" /> |
| | | <result column="have_integral_reward" property="haveIntegralReward" /> |
| | | <result column="reward_way" property="rewardWay" /> |
| | | <result column="reward_integral" property="rewardIntegral" /> |
| | | <result column="participant_reward_way" property="participantRewardWay" /> |
| | | <result column="participant_reward_integral" property="participantRewardIntegral" /> |
| | | <result column="volunteer_reward_way" property="volunteerRewardWay" /> |
| | | <result column="volunteer_reward_integral" property="volunteerRewardIntegral" /> |
| | | <result column="pb_reward_way" property="pbRewardWay" /> |
| | | <result column="pb_reward_integral" property="pbRewardIntegral" /> |
| | | <result column="limit" property="limit" /> |
| | | <result column="can_cancel" property="canCancel" /> |
| | | <result column="cancel_deduct" property="cancelDeduct" /> |
| | |
| | | <select id="pageActivityCommunityBack" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | 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.reward_integral,a.party_member_max,a.party_member_min,a.cover,a.type,a.duration<if test='comActActivityVO.type != null and comActActivityVO.type == 4'>,so.socialCount</if> |
| | | count(IF( s.sign_identity = 1, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 2, s.id, NULL )) partyMemberNow, |
| | | count(IF( s.sign_identity = 3, s.id, NULL )) volunteer_now, a.volunteer_max, a.`status`, a.publish_at, |
| | | a.is_qr_code, a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.participant_reward_way, |
| | | a.volunteer_reward_way,a.pb_reward_way, |
| | | a.activity_type, a.have_integral_reward ,a.participant_reward_integral,a.volunteer_reward_integral,a.pb_reward_integral, |
| | | a.party_member_max,a.party_member_min,a.cover,a.type,a.duration<if test='comActActivityVO.type != null and comActActivityVO.type == 4'>,so.socialCount</if> |
| | | 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.community_id=#{comActActivityVO.communityId} |
| | | <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} |
| | | </if> |
| | | <if test='comActActivityVO.activityType != null and comActActivityVO.activityType !=""'> |
| | | AND a.activity_type = #{comActActivityVO.activityType} |
| | |
| | | </select> |
| | | <select id="inforActivity" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT u.name sponsorName, ca.name communityName, |
| | | count(if(s.is_volunteer=1,s.id,null))volunteer_now, count(if(s.is_volunteer=0,s.id,null))participant_now, a.*,t1.name as projectName |
| | | count(IF( s.sign_identity = 1, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 2, s.id, NULL )) partyMemberNow, |
| | | count(IF( s.sign_identity = 3, s.id, NULL )) volunteer_now, a.*,t1.name as projectName |
| | | 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 |
| | |
| | | |
| | | <select id="selectProjectActivity" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | 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.cover , t1.evaluateLevel |
| | | count(IF( s.sign_identity = 1, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 2, s.id, NULL )) partyMemberNow, |
| | | count(IF( s.sign_identity = 3, s.id, NULL )) volunteer_now, a.volunteer_max,a.`status`, a.publish_at, a.is_qr_code, |
| | | a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.participant_reward_way, |
| | | a.volunteer_reward_way,a.pb_reward_way, a.activity_type, a.have_integral_reward , a.cover , t1.evaluateLevel |
| | | 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 |
| | |
| | | </select> |
| | | |
| | | <select id="partyMemberDetail" resultType="com.panzhihua.common.model.vos.community.PartyMemberDetailVO"> |
| | | select t.activity_name,t.activity_addr,t.begin_at,t1.position,t1.start_time,t1.end_time,t.duration,t. reward_integral from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id |
| | | select t.activity_name,t.activity_addr,t.begin_at,t1.position,t1.start_time,t1.end_time,t.duration,t.participant_reward_integral,t.volunteer_reward_integral,t.pb_reward_integral from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id |
| | | where t.type = 3 and t1.user_id = #{commonPage.userId} |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.begin_at between #{commonPage.beginTime} and #{commonPage.endTime} |
| | |
| | | </select> |
| | | |
| | | <select id="exportPartyMemberDetail" resultType="com.panzhihua.common.model.vos.community.PartyMemberDetailVO"> |
| | | select t.activity_name,t.activity_addr,t.begin_at,t1.position,t1.start_time,t1.end_time,t.duration,t. reward_integral from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id |
| | | select t.activity_name,t.activity_addr,t.begin_at,t1.position,t1.start_time,t1.end_time,t.duration,t.participant_reward_integral,t.volunteer_reward_integral,t.pb_reward_integral from com_act_activity t LEFT JOIN com_act_act_regist t1 on t.id = t1.activity_id |
| | | where t.type = 3 and t1.user_id = #{commonPage.userId} |
| | | <if test="commonPage.beginTime !=null"> |
| | | and t.begin_at between #{commonPage.beginTime} and #{commonPage.endTime} |
| | |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name, |
| | | a.volunteer_max, |
| | | 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.reward_integral,a.party_member_max,a.party_member_min,a.cover,a.type,a.duration |
| | | a.is_qr_code, a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.participant_reward_way, |
| | | a.volunteer_reward_way,a.pb_reward_way, a.activity_type, a.have_integral_reward ,a.participant_reward_integral,a.volunteer_reward_integral,a.pb_reward_integral,a.party_member_max,a.party_member_min,a.cover,a.type,a.duration |
| | | FROM com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id=u.user_id |
| | | LEFT JOIN com_act_act_regist s ON a.id=s.activity_id |
| | |
| | | a.cover, |
| | | a.end_at, |
| | | a.volunteer_max, |
| | | count( |
| | | IF |
| | | ( s.is_volunteer = 1, s.id, NULL )) volunteer_now, |
| | | count( |
| | | IF |
| | | ( s.is_volunteer = 0, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 1, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 2, s.id, NULL )) partyMemberNow, |
| | | count(IF( s.sign_identity = 3, s.id, NULL )) volunteer_now, |
| | | a.participant_max, |
| | | a.sign_up_begin, |
| | | a.sign_up_end, |
| | | ca.NAME AS communityName, |
| | | a.type, |
| | | a.party_member_max |
| | | a.party_member_max, |
| | | a.topic_id |
| | | FROM |
| | | com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id = u.user_id |
| | |
| | | JOIN (SELECT * FROM com_act_social_project WHERE (street_id = #{comActActivityVO.streetId} OR community_id = #{comActActivityVO.communityId}) AND `status` =3) t ON a.project_id = t.id |
| | | GROUP BY a.id ORDER BY a.status = 99 desc,a.publish_at DESC |
| | | </select> |
| | | <select id="pageActivity" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT |
| | | a.id, |
| | | a.activity_name, |
| | | u.`name` sponsorName, |
| | | a.activity_addr, |
| | | a.aattend_people, |
| | | a.`status`, |
| | | a.is_qr_code, |
| | | a.publish_at, |
| | | a.begin_at, |
| | | a.cover, |
| | | a.end_at, |
| | | a.volunteer_max, |
| | | count(IF( s.sign_identity = 1, s.id, NULL )) participant_now, |
| | | count(IF( s.sign_identity = 2, s.id, NULL )) partyMemberNow, |
| | | count(IF( s.sign_identity = 3, s.id, NULL )) volunteer_now, |
| | | a.participant_max, |
| | | a.sign_up_begin, |
| | | a.sign_up_end, |
| | | ca.NAME AS communityName, |
| | | a.type, |
| | | a.party_member_max, |
| | | a.topic_id |
| | | 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 |
| | | LEFT JOIN com_act ca ON a.community_id = ca.community_id |
| | | WHERE 1 = 1 |
| | | <if test ="comActActivityVO.communityId != null and comActActivityVO.communityId != 0"> |
| | | AND a.community_id = ${comActActivityVO.communityId} |
| | | </if> |
| | | <if test ="comActActivityVO.phone != null and comActActivityVO.phone != """> |
| | | AND a.phone = ${comActActivityVO.phone} |
| | | </if> |
| | | <if test ="comActActivityVO.areaCode != null"> |
| | | AND ca.area_code = ${comActActivityVO.areaCode} |
| | | </if> |
| | | <if test ="comActActivityVO.checkUnitId != null"> |
| | | AND a.check_unit_id = #{comActActivityVO.checkUnitId} |
| | | </if> |
| | | <if test="comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != """> |
| | | AND a.activity_name LIKE concat(#{comActActivityVO.activityName},'%') |
| | | </if> |
| | | <if test="comActActivityVO.status != null and comActActivityVO.status != 0 and comActActivityVO.isIng == null"> |
| | | AND a.`status` = #{comActActivityVO.status} |
| | | </if> |
| | | <if test="comActActivityVO.status != null and comActActivityVO.status != 0 and comActActivityVO.isIng != null and comActActivityVO.isIng == 1"> |
| | | AND a.`status` IN (3,4) |
| | | </if> |
| | | <if test="comActActivityVO.isApplets != null and comActActivityVO.isApplets == 1"> |
| | | AND a.`status` != 1 AND a.`status` != 6 |
| | | </if> |
| | | <if test="comActActivityVO.beginAt != null"> |
| | | AND a.begin_at >= #{comActActivityVO.beginAt} AND a.end_at <= #{comActActivityVO.endAt} |
| | | </if> |
| | | <if test="comActActivityVO.type != null"> |
| | | AND a.type = #{comActActivityVO.type} |
| | | </if> |
| | | GROUP BY a.id |
| | | ORDER BY a.status = 99 DESC,a.publish_at DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="getIntegralUserListApplets" resultType="com.panzhihua.common.model.vos.community.integral.ComActIntegralUserListVO"> |
| | | SELECT |
| | | caiu.integral_sum as amount, |
| | | caiu.community_id, |
| | | ca.`name` AS communityName |
| | | SUM(t.amount) AS amount, |
| | | t1.community_id, |
| | | t1.`name` AS communityName |
| | | FROM |
| | | com_act_integral_user AS caiu |
| | | Inner JOIN com_act AS ca ON ca.community_id = caiu.community_id |
| | | com_act_integral_user_trade t |
| | | INNER JOIN com_act t1 ON t.community_id = t1.community_id |
| | | WHERE |
| | | caiu.user_id = #{userId} and caiu.community_id !=11 |
| | | t.change_type = 1 AND t.user_id = #{userId} |
| | | GROUP BY t1.community_id |
| | | ORDER BY amount DESC |
| | | </select> |
| | | |
| | | <select id="getIntegralUserRank" resultType="com.panzhihua.common.model.vos.community.integral.IntegralUserRankVO"> |
| | |
| | | su.nick_name, |
| | | su.image_url, |
| | | <if test="communityRankDTO.type == 1"> |
| | | caiu.integral_sum as amount, |
| | | SUM(caiu.integral_sum) as amount, |
| | | </if> |
| | | <if test="communityRankDTO.type == 2"> |
| | | caiu.integral_resident as amount, |
| | | SUM(caiu.integral_resident) as amount, |
| | | </if> |
| | | <if test="communityRankDTO.type == 3"> |
| | | caiu.integral_volunteer as amount, |
| | | SUM(caiu.integral_volunteer) as amount, |
| | | </if> |
| | | <if test="communityRankDTO.type == 4"> |
| | | caiu.integral_party as amount, |
| | | SUM(caiu.integral_party) as amount, |
| | | </if> |
| | | su.is_partymember, |
| | | su.is_volunteer |
| | | FROM |
| | | com_act_integral_user AS caiu |
| | | LEFT JOIN sys_user AS su ON su.user_id = caiu.user_id |
| | | WHERE |
| | | caiu.community_id = ${communityRankDTO.communityId} and su.nick_name is not null |
| | | WHERE su.nick_name is not null |
| | | <if test="communityRankDTO.communityId != null"> |
| | | AND caiu.community_id = ${communityRankDTO.communityId} |
| | | </if> |
| | | <if test="communityRankDTO.type == 3"> |
| | | and su.is_volunteer = 1 |
| | | </if> |
| | | <if test="communityRankDTO.type == 4"> |
| | | and su.is_partymember = 1 |
| | | </if> |
| | | |
| | | <if test="communityRankDTO.type == 1"> |
| | | order by caiu.integral_sum desc,su.create_at asc |
| | | </if> |
| | | <if test="communityRankDTO.type == 2"> |
| | | order by caiu.integral_resident desc,su.create_at asc |
| | | </if> |
| | | <if test="communityRankDTO.type == 3"> |
| | | order by caiu.integral_volunteer desc,su.create_at asc |
| | | </if> |
| | | <if test="communityRankDTO.type == 4"> |
| | | order by caiu.integral_party desc,su.create_at asc |
| | | </if> |
| | | GROUP BY caiu.user_id |
| | | ORDER BY amount desc |
| | | </select> |
| | | |
| | | <select id="getTaskActivityPeopleList" resultType="com.panzhihua.common.model.vos.community.integral.admin.ComActActivityPeopleVO"> |
| | | select caas.user_id,caas.activity_id,caa.community_id,caas.is_volunteer |
| | | select caas.user_id,caas.activity_id,caa.community_id,caas.sign_identity |
| | | from (SELECT * FROM com_act_act_sign WHERE `status` = 1) as caas |
| | | left join com_act_activity as caa on caa.id = caas.activity_id |
| | | left join com_act_act_regist AS caar ON caas.user_id = caar.user_id AND caas.activity_id = caar.activity_id |
| | | where caa.id = #{activityId} AND caar.id IS NULL |
| | | </select> |
| | | <select id="getUserIntegralStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.integral.ComActIntegralUserVO"> |
| | | SELECT |
| | | SUM(t.amount) AS amount, |
| | | SUM(IF(t.service_type IN(4,5,6),t.amount,0)) AS actAmount, |
| | | SUM(IF(t.service_type = 4,t.amount,0)) AS residentAmount, |
| | | SUM(IF(t.service_type = 5,t.amount,0)) AS partyMemberAmount, |
| | | SUM(IF(t.service_type = 6,t.amount,0)) AS volunteerAmount, |
| | | SUM(IF(t.service_type = 9,t.amount,0)) AS unitPartyMemberAmount |
| | | <if test="communityId != null"> |
| | | ,t1.community_id, |
| | | t1.`name` AS communityName |
| | | </if> |
| | | FROM |
| | | com_act_integral_user_trade t |
| | | INNER JOIN com_act t1 ON t.community_id = t1.community_id |
| | | WHERE |
| | | t.change_type = 1 AND t.user_id = #{userId} |
| | | <if test="communityId != null"> |
| | | AND t.community_id = #{communityId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <select id="getIntegralCommunityTradeApplets" parameterType="com.panzhihua.common.model.dtos.community.integral.ComActIntegralCommunityRankDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.integral.ComActIntegralCommunityTradeVO"> |
| | | SELECT |
| | | caiut.id, |
| | | caiut.amount, |
| | | caiut.service_type, |
| | | caiut.remark, |
| | |
| | | com_act_integral_user_trade AS caiut |
| | | LEFT JOIN com_act AS ca ON ca.community_id = caiut.community_id |
| | | <where> |
| | | 1=1 |
| | | <if test="communityTradeDTO.changeType != null"> |
| | | AND caiut.change_type = #{communityTradeDTO.changeType} |
| | | </if> |
| | | <if test="communityTradeDTO.communityId != null"> |
| | | and caiut.community_id = ${communityTradeDTO.communityId} |
| | | </if> |
| | |
| | | <select id="getUserInfo" resultType="com.panzhihua.common.model.vos.community.integral.admin.IntegralUserVO"> |
| | | select user_id,phone,nick_name,id_card,`name`,`status`,is_volunteer,is_partymember,create_at from sys_user where user_id = #{userId} |
| | | </select> |
| | | <select id="getUserIntegralDetail" |
| | | resultType="com.panzhihua.common.model.vos.community.integral.IntegralTradeVO"> |
| | | SELECT |
| | | caiut.id, |
| | | caiut.amount, |
| | | caiut.service_type, |
| | | caiut.service_id, |
| | | caiut.remark, |
| | | caiut.create_at, |
| | | caiut.change_type, |
| | | caiut.identity_type, |
| | | ca.`name` AS communityName |
| | | FROM |
| | | com_act_integral_user_trade AS caiut |
| | | LEFT JOIN com_act AS ca ON ca.community_id = caiut.community_id |
| | | WHERE caiut = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | com_act_neighbor_circle_topic_west AS canct |
| | | LEFT JOIN sys_user AS su ON su.user_id = canct.create_by |
| | | <where> |
| | | canct.belong_type = 1 |
| | | <if test="circleTopicAdminDTO.communityId != null"> |
| | | and canct.community_id = ${circleTopicAdminDTO.communityId} |
| | | </if> |
| | |
| | | |
| | | <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO"> |
| | | SELECT canct.id, canct.`name`, canct.hot_num,( SELECT count( id ) FROM com_act_neighbor_circle_west WHERE is_del = 2 AND `status` = 2 and topic_id = canct.id) AS `count` |
| | | from com_act_neighbor_circle_topic_west as canct where canct.`status` = 1 and canct.community_id = ${communityId} |
| | | from com_act_neighbor_circle_topic_west as canct where canct.`status` = 1 and canct.community_id = ${communityId} AND canct.belong_type = 1 |
| | | <if test="isZero != null and isZero == 1"> |
| | | and `count` > 0 |
| | | </if> |
| | |
| | | where act_id = #{communityId} GROUP BY village_id |
| | | ) t1 on t.village_id = t1.village_id where t.community_id = ${communityId} |
| | | </select> |
| | | <select id="checkIsPbMember" resultType="java.lang.Integer"> |
| | | SELECT |
| | | (SELECT COUNT(id) FROM com_pb_member WHERE phone = (SELECT phone FROM sys_user WHERE user_id = #{userId}) AND audit_result = 1) |
| | | + |
| | | (SELECT COUNT(id) FROM com_pb_member_west WHERE phone = (SELECT phone FROM sys_user WHERE user_id = #{userId}) AND audit_result = 1) |
| | | </select> |
| | | <select id="checkIsVolunteer" resultType="java.lang.Integer"> |
| | | SELECT COUNT(id) FROM com_mng_volunteer_mng WHERE state = 2 AND phone = (SELECT phone FROM sys_user WHERE user_id = #{userId}) |
| | | </select> |
| | | </mapper> |
| | |
| | | public R memberDetail(@RequestParam("id")Long id){ |
| | | return comPbMemberService.memberDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param partyBuildingMemberVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/page/registerMember") |
| | | public R pageRegisterMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) { |
| | | return comPbMemberService.pageRegisterMember(partyBuildingMemberVO); |
| | | } |
| | | } |
| | |
| | | PartyBuildingMemberVO getDetailByApp(Long id); |
| | | |
| | | PartyBuildingMemberVO selectDetail(@Param("phone") String phone,@Param("type")Integer type); |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param page |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | IPage<PartyBuildingMemberVO> pageRegisterMember(@Param("page") Page page, @Param("dto") PartyBuildingMemberVO dto); |
| | | } |
| | |
| | | R getPartyMember(String phone,Integer type); |
| | | |
| | | R memberDetail(Long id); |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param partyBuildingMemberVO |
| | | * @return |
| | | */ |
| | | R pageRegisterMember(PartyBuildingMemberVO partyBuildingMemberVO); |
| | | } |
| | |
| | | public R memberDetail(Long id) { |
| | | return R.ok(comPbMemberDAO.getDetailByApp(id)); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageRegisterMember(PartyBuildingMemberVO dto) { |
| | | return R.ok(comPbMemberDAO.pageRegisterMember(new Page(dto.getPageNum(), dto.getPageSize()), dto)); |
| | | } |
| | | } |
| | |
| | | left join com_mng_village t2 on t.village_id = t2.village_id |
| | | left join com_act t4 on t.community_id = t4.community_id where t.id = #{id} |
| | | </select> |
| | | <select id="pageRegisterMember" |
| | | resultType="com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO"> |
| | | SELECT m.`name`, m.phone, u.user_id |
| | | FROM com_pb_member m |
| | | INNER JOIN sys_user u ON m.phone = u.phone AND u.type = 1 AND u.app_id = #{dto.appid} |
| | | WHERE 1=1 |
| | | <if test="dto.checkUnitId != null"> |
| | | AND m.check_unit_id = #{dto.checkUnitId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | | |
| | |
| | | sysUserNoticeVO.setBusinessContent("报名人数不足活动自动取消"); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | sysUserNoticeVO |
| | | .setActivityType(activitySignVO.getIsVolunteer().intValue() == 1 ? 1 : 2); |
| | | .setActivityType(activitySignVO.getSignIdentity().intValue() == 1 ? 1 : 2); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增社区活动取消通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | |
| | | AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); |
| | | addComActIntegralUserDTO.setUserId(people.getUserId()); |
| | | addComActIntegralUserDTO.setIntegralType(AddComActIntegralUserDTO.integralType.qxhd); |
| | | addComActIntegralUserDTO.setActivityType(1); |
| | | addComActIntegralUserDTO.setIsVolunteer(people.getIsVolunteer()); |
| | | addComActIntegralUserDTO.setSignIdentity(people.getSignIdentity()); |
| | | addComActIntegralUserDTO.setCommunityId(people.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | communityService.addIntegralTradeAdmin(addComActIntegralUserDTO); |