Merge branch 'test_integral' into test
# Conflicts:
# springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
# springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActWarehouseOperationMapper.xml
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.QRActivityCodeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:10 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"活动二维码"}) |
| | | @RestController |
| | | @RequestMapping("comActActivityCode") |
| | | public class ComActActivityCodeApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 查看二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("查看二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.getQRCode(qrCodeVO); |
| | | } |
| | | |
| | | /** |
| | | * 重置二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("重置二维码") |
| | | @PostMapping("/resetQRCode") |
| | | public R resetQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.resetQRCode(qrCodeVO); |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.vos.community.MyActivityEvaluateVO; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComMngCarAppletDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageVolunteerDTO; |
| | | 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.ActivitySignInRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private PartyBuildingService partyBuildingService; |
| | | |
| | | @ApiOperation(value = "分页查询小区", response = ComMngStructAreaVO.class) |
| | | @PostMapping("pagearea") |
| | |
| | | return communityService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的评价", response = MyActivityEvaluateVO.class) |
| | | @GetMapping("activity/my-evaluate") |
| | | public R listMyActivityEvaluate(@RequestParam("activityId") Long activityId) { |
| | | return communityService.listMyActivityEvaluate(getUserId(), activityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "报名/取消报名社区活动") |
| | | @PutMapping("signactivity") |
| | | public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO) { |
| | | Long userId = this.getUserId(); |
| | | Long activityId = signactivityVO.getActivityId(); |
| | | Integer isVolunteer = signactivityVO.getIsVolunteer(); |
| | | signactivityVO.setUserId(userId); |
| | | R r = communityService.signActivity(signactivityVO); |
| | | if (R.isOk(r) && signactivityVO.getType().intValue() == 1) { |
| | | R r2 = communityService.detailActivity(activityId, userId,null,null); |
| | | ComActActivityVO comActActivityVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(r2.getData()), ComActActivityVO.class); |
| | | Integer isVolunteer = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), Integer.class); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(1); |
| | |
| | | return communityService.listActivitySigns(activitySignVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动报名签到情况", response = ActivitySignInRecordVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "社区活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true) |
| | | }) |
| | | @GetMapping("activity/sign-in/list") |
| | | public R listSignInRecord(@RequestParam("id") Long id, @RequestParam("type") Integer type) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | if (loginUserInfo.getIsCommunityWorker().intValue() != 1) { |
| | | return R.fail("非社区工作人员"); |
| | | } |
| | | if (type.intValue() == 1) { |
| | | return communityService.listSignInRecord(id); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动签到记录", response = ComActActRegistVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "活动主键", required = true), |
| | | @ApiImplicitParam(name = "type", value = "活动类型,1.居民/志愿者活动 2.党员活动", required = true) |
| | | }) |
| | | @GetMapping("activity/regist/list") |
| | | public R listRegistRecord(@RequestParam("id") Long id, |
| | | @RequestParam("type") Integer type) { |
| | | if (type.intValue() == 1) { |
| | | return communityService.listRegistRecord(id, this.getUserId()); |
| | | } |
| | | return R.fail("type不存在"); |
| | | } |
| | | |
| | | // @ApiOperation(value = "新增社区动态浏览记录") |
| | | // @PostMapping("dynamicuser") |
| | | // public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){ |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "我的活动", response = ComActActivityVO.class) |
| | | @ApiImplicitParam(name = "status", value = "活动状态(4 进行中 5 已结束 6 已取消)", required = false) |
| | | @GetMapping("listactivity") |
| | | public R listActivity() { |
| | | public R listActivity(@RequestParam("status") Integer status) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | R r = communityService.listActivity(userId); |
| | | R r = communityService.listActivity(userId, status); |
| | | if (R.isOk(r)) { |
| | | comActActivityVOS = (List<ComActActivityVO>)r.getData(); |
| | | } |
| | | R r1 = partyBuildingService.listActivity(userId, communityId); |
| | | R r1 = partyBuildingService.listActivity(userId, communityId, status); |
| | | if (R.isOk(r1)) { |
| | | List<ComActActivityVO> data = (List<ComActActivityVO>)r1.getData(); |
| | | comActActivityVOS.addAll(data); |
| | |
| | | * 接口未实现 |
| | | */ |
| | | public static final int NOT_IMPLEMENTED = 501; |
| | | |
| | | /** |
| | | * 暂不支持 |
| | | */ |
| | | public static final int NOT_ACCEPTABLE = 406; |
| | | } |
| | |
| | | @ApiModelProperty("业务id") |
| | | private Long serviceId; |
| | | |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)") |
| | | @ApiModelProperty("积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)8活动签到") |
| | | private Integer integralType; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | |
| | | @ApiModelProperty(value = "是否是评论(1.是 2.否)") |
| | | private Integer isComment; |
| | | |
| | | @ApiModelProperty(value = "签到类型 1居民 志愿者签到 2党员签到") |
| | | private Integer activityType; |
| | | |
| | | public AddComActIntegralUserDTO(Long serviceId, Integer integralType, Long communityId, Long userId) { |
| | | this.serviceId = serviceId; |
| | | this.integralType = integralType; |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: ActivitySignInRecordVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 活动报名签到记录 |
| | | * @author: hans |
| | | * @date: 2021/10/19 9:22 |
| | | */ |
| | | @Data |
| | | @ApiModel("活动报名签到记录") |
| | | public class ActivitySignInRecordVO { |
| | | |
| | | @ApiModelProperty("活动类型,1.居民/志愿者活动 2.党员活动") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("活动主键") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty("真实名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("报名时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("参与次数") |
| | | private Integer times; |
| | | |
| | | @ApiModelProperty("活动限制次数") |
| | | private Integer limit; |
| | | } |
| | |
| | | private Long pageNum = 1L; |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | /** |
| | | * 报名状态 0 已取消 1已报名 |
| | | */ |
| | | @ApiModelProperty("报名状态 0 已取消 1已报名") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 取消原因 |
| | | */ |
| | | @ApiModelProperty("取消原因") |
| | | private String reason; |
| | | |
| | | /** |
| | | * 参与次数 |
| | | */ |
| | | @ApiModelProperty("参与次数") |
| | | private Integer times; |
| | | |
| | | /** |
| | | * 获取奖励 |
| | | */ |
| | | @ApiModelProperty("获取奖励") |
| | | private Integer award; |
| | | |
| | | /** |
| | | * 活动限制次数 |
| | | */ |
| | | @ApiModelProperty("活动限制次数") |
| | | private Integer limit; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "签到位置") |
| | | private String position; |
| | | |
| | | @ApiModelProperty(value = "签到次数") |
| | | private Integer times; |
| | | |
| | | @ApiModelProperty(value = "二维码id") |
| | | private Integer codeId; |
| | | |
| | | @ApiModelProperty(value = "本次签到获取的积分奖励") |
| | | private Integer award; |
| | | |
| | | @ApiModelProperty(value = "活动类型 1居民,志愿者 2党员") |
| | | private Integer activityType; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ExcelProperty(value = "人群标签", index = 3) |
| | | private String tags; |
| | | |
| | | @ExcelProperty(value = "报名状态",index = 5) |
| | | private Integer status; |
| | | |
| | | @ExcelProperty(value = "取消原因", index = 6) |
| | | private String reason; |
| | | |
| | | @ExcelProperty(value = "参与情况", index = 7) |
| | | private String condition; |
| | | |
| | | @ExcelProperty(value = "获得奖励", index = 7) |
| | | private String award; |
| | | @ExcelIgnore |
| | | private Integer times; |
| | | @ExcelIgnore |
| | | private Integer limit; |
| | | |
| | | public void setCondition(String condition) { |
| | | if(this.times!=null&&this.limit!=null){ |
| | | this.condition = "("+times+"/"+limit+")"; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: ComActActivityTypeVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 活动分类vo |
| | | * @author: hans |
| | | * @date: 2021/10/21 11:11 |
| | | */ |
| | | @Data |
| | | @ApiModel("活动分类vo") |
| | | public class ComActActivityTypeVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("类型名称") |
| | | @NotBlank(groups = AddGroup.class, message = "类型名称不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("活动类型(1.志愿者 2.居民 3.党员)") |
| | | @NotNull(groups = AddGroup.class, message = "活动类型不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "社区id", hidden = true) |
| | | private Long communityId; |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("活动名称") |
| | | @NotBlank(groups = AddGroup.class, message = "活动名称不可为空") |
| | | private String activityName; |
| | | |
| | | @ApiModelProperty("负责人userID") |
| | |
| | | private String sponsorName; |
| | | |
| | | @ApiModelProperty("活动地址") |
| | | @NotBlank(groups = AddGroup.class, message = "活动地址不可为空") |
| | | private String activityAddr; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @NotBlank(groups = AddGroup.class, message = "纬度不可为空") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @NotBlank(groups = AddGroup.class, message = "经度不可为空") |
| | | private String lng; |
| | | |
| | | @ApiModelProperty("活动状态 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消") |
| | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date publishAt; |
| | | |
| | | @ApiModelProperty("活动结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @NotNull(groups = AddGroup.class, message = "活动结束时间不可为空") |
| | | private Date endAt; |
| | | |
| | | @ApiModelProperty("活动开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @NotNull(groups = AddGroup.class, message = "活动开始时间不可为空") |
| | | private Date beginAt; |
| | | |
| | | @ApiModelProperty("报名开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @NotNull(groups = AddGroup.class, message = "报名开始时间不可为空") |
| | | private Date signUpBegin; |
| | | |
| | | @ApiModelProperty("报名结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @NotNull(groups = AddGroup.class, message = "报名结束时间不可为空") |
| | | private Date signUpEnd; |
| | | |
| | | @ApiModelProperty("参加人群(多个以逗号隔开)") |
| | |
| | | private Integer participantNow; |
| | | |
| | | @ApiModelProperty("活动封面") |
| | | @NotBlank(groups = AddGroup.class, message = "活动封面不可为空") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("是否有奖品 1 有 0 无") |
| | |
| | | private String contactName; |
| | | |
| | | @ApiModelProperty("联系人电话") |
| | | @NotBlank(groups = AddGroup.class, message = "联系人电话不可为空") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty("是否签到 1 是 0否") |
| | |
| | | private String rewardDesc; |
| | | |
| | | @ApiModelProperty("活动内容") |
| | | @NotBlank(groups = AddGroup.class, message = "活动内容不可为空") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("活动奖品集合") |
| | |
| | | @ApiModelProperty(value = "查询筛选:0-本小区 1-全部") |
| | | private Integer choice; |
| | | |
| | | @ApiModelProperty("签到范围,默认0无限制") |
| | | @NotNull(groups = AddGroup.class, message = "签到范围不可为空") |
| | | private Integer range; |
| | | |
| | | @ApiModelProperty("是否有积分奖励(1.是 2.否)") |
| | | @NotNull(groups = AddGroup.class, message = "是否有积分奖励不可为空") |
| | | private Integer haveIntegralReward; |
| | | |
| | | @ApiModelProperty("积分奖励方式(1.按次奖励 2.记时奖励)") |
| | | private Integer rewardWay; |
| | | |
| | | @ApiModelProperty("参与签到/打卡奖励积分") |
| | | private Integer rewardIntegral; |
| | | |
| | | @ApiModelProperty("参与次数上限,按次奖励需传入,无次数限制-1") |
| | | private Integer limit; |
| | | |
| | | @ApiModelProperty("是否允许取消(1.允许 2.不允许)") |
| | | @NotNull(groups = AddGroup.class, message = "是否允许取消不可为空") |
| | | private Integer canCancel; |
| | | |
| | | @ApiModelProperty("取消活动扣除积分数目") |
| | | @NotNull(groups = AddGroup.class, message = "取消活动扣除积分数目不可为空") |
| | | private Integer cancelDeduct; |
| | | |
| | | @ApiModelProperty("用户已参与次数") |
| | | private Integer times; |
| | | |
| | | @ApiModelProperty("已获取积分") |
| | | private Integer award; |
| | | |
| | | @ApiModelProperty("二维码类型 1居民,志愿者 2党员") |
| | | private Integer codeType; |
| | | |
| | | @ApiModelProperty("活动类型") |
| | | private String activityType; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: MyActivityEvaluateVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 我的评价vo |
| | | * @author: hans |
| | | * @date: 2021/10/21 17:14 |
| | | */ |
| | | @Data |
| | | @ApiModel("我的评价vo") |
| | | public class MyActivityEvaluateVO { |
| | | |
| | | @ApiModelProperty("是否展示评价按钮(1.展示 0.不展示)") |
| | | private Integer isDisplay; |
| | | |
| | | @ApiModelProperty("评论详情") |
| | | private List<ComActActEvaluateVO> myEvaluateList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class QRActivityCodeVO { |
| | | @ApiModelProperty("数据主键id") |
| | | private Integer id; |
| | | @ApiModelProperty("二维码类型 1居民,志愿者 2党员") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "二维码id",example = "1") |
| | | private Long codeId; |
| | | } |
| | |
| | | private Long activityId; |
| | | @ApiModelProperty(value = "当前登录用户id", hidden = true) |
| | | private Long userId; |
| | | @ApiModelProperty("取消原因") |
| | | private String reason; |
| | | |
| | | } |
| | |
| | | @ApiModel("小程序-用户社区积分明细返回参数") |
| | | public class ComActIntegralCommunityTradeVO { |
| | | |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)") |
| | | @ApiModelProperty("交易业务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷)8活动签到") |
| | | private Integer serviceType; |
| | | |
| | | @ApiModelProperty("交易数量") |
| | |
| | | @ApiModelProperty("是否是个人发起 1 是 0 否") |
| | | private Integer isPerson; |
| | | |
| | | @ApiModelProperty("二维码类型 1居民,志愿者 2党员") |
| | | private Integer codeType; |
| | | |
| | | } |
| | |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param status |
| | | * @return 活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | R listActivity(@RequestParam("userId") Long userId); |
| | | R listActivity(@RequestParam("userId") Long userId, |
| | | @RequestParam(value = "status", required = false) Integer status); |
| | | |
| | | /** |
| | | * 用户确认心愿 |
| | |
| | | */ |
| | | @GetMapping("/population/house/status/task") |
| | | R timedTaskHouseJobHandler(); |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActActivityCode/getQRCode") |
| | | public R getQRCode(@RequestBody QRActivityCodeVO qrCodeVO); |
| | | |
| | | /** |
| | | * 重置二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/comActActivityCode/resetQRCode") |
| | | public R resetQRCode(@RequestBody QRActivityCodeVO qrCodeVO); |
| | | |
| | | /** |
| | | * 活动报名签到情况 |
| | | * @param id 活动主键id |
| | | * @return |
| | | */ |
| | | @GetMapping("/activity/sign-in/list") |
| | | R listSignInRecord(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 活动签到记录 |
| | | * @param id 活动主键 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping("/activity/regist/list") |
| | | R listRegistRecord(@RequestParam("id") Long id, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取活动类型(目前只有志愿者活动需要获取) |
| | | * @param communityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("/activity/type/list") |
| | | R listActivityType(@RequestParam("communityId") Long communityId, @RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 添加活动类型 |
| | | * @param comActActivityTypeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/activity/type/add") |
| | | R addActivityType(@RequestBody ComActActivityTypeVO comActActivityTypeVO); |
| | | |
| | | /** |
| | | * 我的评价 |
| | | * @param userId |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/activity/my-evaluate") |
| | | R listMyActivityEvaluate(@RequestParam("userId") Long userId, @RequestParam("activityId") Long activityId); |
| | | } |
| | |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id 同一用户在不同社区都是党员 |
| | | * @param status |
| | | * @return 党建活动列表 |
| | | */ |
| | | @PostMapping("/partybuildIng/listactivity") |
| | | R listActivity(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId); |
| | | R listActivity(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId, |
| | | @RequestParam(value = "status", required = false) Integer status); |
| | | |
| | | /** |
| | | * 党员活动人员参入列表 |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.QRActivityCodeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:10 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"活动二维码"}) |
| | | @RestController |
| | | @RequestMapping("comActActivityCode") |
| | | public class ComActActivityCodeApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 查看二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("查看二维码") |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.getQRCode(qrCodeVO); |
| | | } |
| | | |
| | | /** |
| | | * 重置二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @ApiOperation("重置二维码") |
| | | @PostMapping("/resetQRCode") |
| | | public R resetQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | return this.communityService.resetQRCode(qrCodeVO); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import java.io.*; |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStreamWriter; |
| | | import java.io.Writer; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.vos.LiveVO; |
| | | import com.panzhihua.common.model.vos.WeatherVO; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.Version; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | import com.panzhihua.common.model.dtos.community.integral.admin.AddComActIntegralUserDTO; |
| | | 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.ComActActEvaluateExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPictureVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActSignExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoClassifyVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ExportEasyPhotoVO; |
| | |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.QRCodeUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.Version; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @ApiOperation(value = "新增社区活动") |
| | | @PostMapping("activity") |
| | | public R addActivity(@RequestBody ComActActivityVO comActActivityVO) { |
| | | public R addActivity(@RequestBody @Validated(AddGroup.class) ComActActivityVO comActActivityVO) { |
| | | if (comActActivityVO.getHaveIntegralReward().intValue() == 1) { |
| | | if (isNull(comActActivityVO.getRewardWay())) { |
| | | return R.fail("奖励方式不能为空"); |
| | | } |
| | | if (isNull(comActActivityVO.getRewardIntegral())) { |
| | | return R.fail("奖励积分不能为空"); |
| | | } |
| | | if (comActActivityVO.getRewardWay().intValue() == 1 && isNull(comActActivityVO.getLimit())) { |
| | | return R.fail("参与次数上限不能为空"); |
| | | } |
| | | } |
| | | if(nonNull(comActActivityVO.getVolunteerMax()) && comActActivityVO.getVolunteerMax().intValue() == 0) { |
| | | return R.fail("志愿者参与上限不能为0"); |
| | | } |
| | | Long communityId = this.getCommunityId(); |
| | | comActActivityVO.setCommunityId(communityId); |
| | | comActActivityVO.setUserId(this.getLoginUserInfo().getUserId()); |
| | |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @Deprecated |
| | | @ApiOperation(value = "社区活动签到二维码下载") |
| | | @PostMapping("qrCode/export") |
| | | public R activityRegistQRCodeExport(@RequestParam("activityId") Long activityId){ |
| | |
| | | } |
| | | return communityService.wishHandleListAdmin(loginUserInfo.getCommunityId(),type); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加活动类型") |
| | | @PostMapping("activity/type/add") |
| | | public R addActivityType(@RequestBody @Validated(AddGroup.class) ComActActivityTypeVO comActActivityTypeVO) { |
| | | comActActivityTypeVO.setCommunityId(getCommunityId()); |
| | | return communityService.addActivityType(comActActivityTypeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取活动类型(目前只有志愿者活动需要获取)", response = ComActActivityTypeVO.class) |
| | | @ApiImplicitParam(name = "type", value = "活动类型(1.志愿者 2.居民 3.党员)", required = true) |
| | | @GetMapping("activity/type/list") |
| | | public R listActivityType(@RequestParam("type") Integer type) { |
| | | return communityService.listActivityType(getCommunityId(), type); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.community.QRActivityCodeVO; |
| | | import com.panzhihua.common.model.vos.community.warehouse.QRCodeVO; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | import com.panzhihua.service_community.service.ComActActivityCodeService; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActActivityCode") |
| | | public class ComActActivityCodeApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActActivityCodeService comActActivityCodeService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | return this.comActActivityCodeService.pageList(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return R.ok(this.comActActivityCodeService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comActActivityCode 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public R insert(@RequestBody ComActActivityCode comActActivityCode) { |
| | | return R.ok(this.comActActivityCodeService.save(comActActivityCode)); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comActActivityCode 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComActActivityCode comActActivityCode) { |
| | | return R.ok(this.comActActivityCodeService.updateById(comActActivityCode)); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return R.ok(this.comActActivityCodeService.removeById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/getQRCode") |
| | | public R getQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | ComActActivityCode comActActivityCode = comActActivityCodeService.getOne(new QueryWrapper<ComActActivityCode>() |
| | | .lambda().eq(ComActActivityCode::getStatus,1).eq(ComActActivityCode::getActivityId,qrCodeVO.getId()) |
| | | .eq(ComActActivityCode::getType,qrCodeVO.getType())); |
| | | if(comActActivityCode!=null){ |
| | | qrCodeVO.setCodeId(comActActivityCode.getId()); |
| | | return R.ok(QRCodeUtil.getBase64QRCode(JSONObject.toJSONString(qrCodeVO))); |
| | | } |
| | | return R.fail("该活动无有效二维码"); |
| | | } |
| | | |
| | | /** |
| | | * 重置二维码 |
| | | * @param qrCodeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/resetQRCode") |
| | | public R resetQRCode(@RequestBody QRActivityCodeVO qrCodeVO){ |
| | | ComActActivityCode comActActivityCode=comActActivityCodeService.getOne(new QueryWrapper<ComActActivityCode>().lambda().eq(ComActActivityCode::getStatus,1).eq(ComActActivityCode::getActivityId,qrCodeVO.getId()).eq(ComActActivityCode::getType,qrCodeVO.getType())); |
| | | if(comActActivityCode!=null){ |
| | | comActActivityCodeService.update(new UpdateWrapper<ComActActivityCode>().lambda().eq(ComActActivityCode::getActivityId,qrCodeVO.getId()).eq(ComActActivityCode::getType,qrCodeVO.getType()).set(ComActActivityCode::getStatus,0)); |
| | | ComActActivityCode comActActivityCode1=new ComActActivityCode(); |
| | | comActActivityCode1.setActivityId(qrCodeVO.getId().longValue()); |
| | | comActActivityCode1.setCreateTime(new Date()); |
| | | comActActivityCode1.setType(qrCodeVO.getType()); |
| | | comActActivityCode1.setStatus(1); |
| | | comActActivityCodeService.save(comActActivityCode1); |
| | | qrCodeVO.setCodeId(comActActivityCode1.getId()); |
| | | return R.ok(QRCodeUtil.getBase64QRCode(JSONObject.toJSONString(qrCodeVO))); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | |
| | | }); |
| | | } |
| | | comActActivityVO1.setComActActPrizeVOList(comActActPrizeVOList); |
| | | Integer participantMax = comActActivityVO1.getParticipantMax(); |
| | | if (participantMax.intValue() == 0) { |
| | | Integer volunteerMax = comActActivityVO1.getVolunteerMax(); |
| | | if (volunteerMax.intValue() != 0) { |
| | | comActActivityVO1.setType(1); |
| | | } else { |
| | | comActActivityVO1.setType(2); |
| | |
| | | * @return 活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | public R listActivity(@RequestParam("userId") Long userId) { |
| | | return comActActivityService.listActivity(userId); |
| | | public R listActivity(@RequestParam("userId") Long userId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | return comActActivityService.listActivity(userId, status); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R pageMicroWishAdmin(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | return comActMicroWishService.pageMicroWishAdmin(comActMicroWishVO); |
| | | } |
| | | |
| | | /** |
| | | * 活动报名签到情况 |
| | | * @param id 活动主键id |
| | | * @return |
| | | */ |
| | | @GetMapping("activity/sign-in/list") |
| | | public R listSignInRecord(@RequestParam("id") Long id) { |
| | | return comActActivityService.listSignInRecord(id); |
| | | } |
| | | |
| | | /** |
| | | * 活动签到记录 |
| | | * @param id 活动主键 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping("activity/regist/list") |
| | | public R listRegistRecord(@RequestParam("id") Long id, @RequestParam("userId") Long userId) { |
| | | return comActActivityService.listRegistRecord(id, userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动类型(目前只有志愿者活动需要获取) |
| | | * @param communityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @GetMapping("activity/type/list") |
| | | public R listActivityType(@RequestParam("communityId") Long communityId, @RequestParam("type") Integer type) { |
| | | return comActActivityService.listActivityType(communityId, type); |
| | | } |
| | | |
| | | /** |
| | | * 添加活动类型 |
| | | * @param comActActivityTypeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("activity/type/add") |
| | | public R addActivityType(@RequestBody ComActActivityTypeVO comActActivityTypeVO) { |
| | | return comActActivityService.addActivityType(comActActivityTypeVO); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价 |
| | | * @param userId |
| | | * @param activityId 活动id |
| | | * @return |
| | | */ |
| | | @GetMapping("activity/my-evaluate") |
| | | public R listMyActivityEvaluate(@RequestParam("userId") Long userId, @RequestParam("activityId") Long activityId) { |
| | | return comActActEvaluateService.listMyActivityEvaluate(userId, activityId); |
| | | } |
| | | } |
| | |
| | | List<ComActActRegistExcelVO> getRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | |
| | | List<ComActActRegistExcelVO> getNoRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); |
| | | |
| | | /** |
| | | * 活动签到记录 |
| | | * @param id 活动主键 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | List<ComActActRegistVO> listRegistRecord(@Param("id") Long id, @Param("userId") Long userId); |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ActivitySignInRecordVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActSignExcelVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Mapper |
| | | public interface ComActActSignDAO extends BaseMapper<ComActActSignDO> { |
| | | // 居民 党员 志愿者 1 2 3 |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " |
| | | + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "JOIN sys_user u ON a.user_id = u.user_id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" |
| | | + "AND u.phone = #{activitySignVO.phone} " + " </if> " |
| | | + "<if test='activitySignVO.tags != null and activitySignVO.tags != ""'>" |
| | | + "AND u.tags like concat('%',#{activitySignVO.tags},'%') " + " </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, " |
| | | // + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | // + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer, a.status , a.times ,a.reason,a.award,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.tags != null and activitySignVO.tags != ""'>" |
| | | // + "AND u.tags like concat('%',#{activitySignVO.tags},'%') " + " </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>") |
| | | IPage<ActivitySignVO> listActivitySign(Page page, @Param("activitySignVO") ActivitySignVO activitySignVO); |
| | | |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " |
| | | @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " |
| | | + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " |
| | | + "u.phone, " + "u.openid, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " |
| | | + "JOIN sys_user u ON a.user_id = u.user_id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " |
| | | + "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'>" |
| | |
| | | * @return 需要默认好评的记录列表 |
| | | */ |
| | | List<ComActActSignDO> selectNeedEvaluateSignRecords(@Param("activityIds") List<Long> activityIds); |
| | | |
| | | /** |
| | | * 获取活动报名签到记录 |
| | | * @param id 活动主键id |
| | | * @return |
| | | */ |
| | | List<ActivitySignInRecordVO> listSignInRecord(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 获取用户活动报名记录 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<ActivitySignVO> selectList(@Param("userId") Long userId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:09 |
| | | */ |
| | | @Mapper |
| | | public interface ComActActivityCodeDao extends BaseMapper<ComActActivityCode> { |
| | | |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityTypeVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + "<if test='comActActivityVO.type != null and comActActivityVO.type==1 '>" |
| | | + "AND a.volunteer_max!=0 " + " </if> " |
| | | + "<if test='comActActivityVO.type != null and comActActivityVO.type==2 '>" + "AND a.participant_max!=0 " |
| | | + "<if test='comActActivityVO.type != null and comActActivityVO.type==2 '>" + "AND a.volunteer_max=0 " |
| | | + " </if> " + " group by a.id " + " order by a.status asc,a.publish_at desc " + "</script>") |
| | | IPage<ComActActivityVO> pageActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Select("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.* " + "FROM " + "com_act_activity a " |
| | | + "left join sys_user u on a.sponsor_id=u.user_id " + "left join com_act_act_sign s on a.id=s.activity_id " |
| | | + "left join com_act ca on a.community_id=ca.community_id " + "where a.id=#{id} " + " group by a.id ") |
| | | ComActActivityVO inforActivity(Long id); |
| | | // @Select("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.* " + "FROM " + "com_act_activity a " |
| | | // + "left join sys_user u on a.sponsor_id=u.user_id " + "left join com_act_act_sign s on a.id=s.activity_id " |
| | | // + "left join com_act ca on a.community_id=ca.community_id " + "where a.id=#{id} " + " group by a.id ") |
| | | |
| | | /** |
| | | * 活动详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ComActActivityVO inforActivity(@Param("id") Long id); |
| | | |
| | | @Select("SELECT " + "a.* " + "FROM " + "com_act_act_sign s " + "JOIN com_act_activity a ON s.activity_id = a.id " |
| | | + "WHERE " + "s.user_id = #{comActActivityVO.sponsorId} " + "ORDER BY " + "s.create_at DESC") |
| | |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | |
| | | @Select("<script> " + "select t.* from ( " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | + "a.activity_addr, " + "a.participant_max, " + "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 " + "FROM " |
| | | + " com_act_activity a " + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " |
| | | + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + "WHERE " |
| | | + " a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} " |
| | | + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" |
| | | + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + " </if> " |
| | | + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>" |
| | | + "AND a.`status` = 99 " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + "group by a.id " + " " + " union all " + "select t1.* from ( " + " " + " SELECT " + "a.id, " |
| | | + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " + "a.participant_max, " |
| | | + "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 " + "FROM " + " com_act_activity a " |
| | | + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " |
| | | + "WHERE " + " a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} " |
| | | + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" |
| | | + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + " </if> " |
| | | + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>" |
| | | + "AND a.`status` = #{comActActivityVO.status} " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | + " </if> " + " group by a.id order by a.publish_at desc)t1 )t" + "</script>") |
| | | IPage<ComActActivityVO> pageActivityCommunityBack(Page page, |
| | | @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | // @Select("<script> " + "select t.* from ( " + "SELECT " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, " |
| | | // + "a.activity_addr, " + "a.participant_max, " + "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 " + "FROM " |
| | | // + " com_act_activity a " + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " |
| | | // + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + "WHERE " |
| | | // + " a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} " |
| | | // + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" |
| | | // + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + " </if> " |
| | | // + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>" |
| | | // + "AND a.`status` = 99 " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | // + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | // + " </if> " + "group by a.id " + " " + " union all " + "select t1.* from ( " + " " + " SELECT " + "a.id, " |
| | | // + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " + "a.participant_max, " |
| | | // + "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 " + "FROM " + " com_act_activity a " |
| | | // + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " |
| | | // + "WHERE " + " a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} " |
| | | // + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" |
| | | // + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) " + " </if> " |
| | | // + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>" |
| | | // + "AND a.`status` = #{comActActivityVO.status} " + " </if> " + "<if test='comActActivityVO.beginAt != null '>" |
| | | // + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} " |
| | | // + " </if> " + " group by a.id order by a.publish_at desc)t1 )t" + "</script>") |
| | | /** |
| | | * 分页查询社区活动 |
| | | * @param page |
| | | * @param comActActivityVO |
| | | * @return |
| | | */ |
| | | IPage<ComActActivityVO> pageActivityCommunityBack(@Param("page") Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0") |
| | | List<Long> getActivityEndIds(); |
| | |
| | | * @return 活动列表 |
| | | */ |
| | | List<ComActActivityVO> getIndexTopActivityList(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 获取活动类型(目前只有志愿者活动需要获取) |
| | | * @param communityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<ComActActivityTypeVO> listActivityType(@Param("communityId") Long communityId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 添加活动类型 |
| | | * @param comActActivityTypeVO |
| | | * @return |
| | | */ |
| | | int addActivityType(@Param("comActActivityTypeVO") ComActActivityTypeVO comActActivityTypeVO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | 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.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.integral.admin.ComActActivityPeopleVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyBuildingActivityVO; |
| | | import com.panzhihua.service_community.model.dos.ComPbActivityDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员活动 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 17:59 |
| | | **/ |
| | | @Mapper |
| | | public interface ComBpActivityDAO extends BaseMapper<ComPbActivityDO> { |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + "SELECT\n" + "a.id,\n" + "a.name,\n" + "a.address,\n" + "a.status,\n" |
| | | + "a.create_at releaseTimeBegin,\n" + "a.activity_time_begin,\n" + "a.activity_time_end,\n" |
| | | + "a.enroll_time_begin,\n" + "a.release_time,\n" + "a.enroll_time_end \n" + "FROM\n" |
| | | + "com_pb_activity_member m\n" + "JOIN com_pb_activity a ON m.activity_id = a.id \n" + "WHERE\n" |
| | | + "m.member_id = #{id} \n" + "<if test='name != null and name.trim() != ""'>" |
| | | + "AND a.`name` like concat (#{name},'%') \n" + " </if> " + "<if test='releaseTimeBegin != null '>" |
| | | + "AND a.create_at BETWEEN #{releaseTimeBegin} \n" + "AND #{releaseTimeEnd} \n" + " </if> " |
| | | + "<if test='activityTimeBegin != null '>" + "AND a.activity_time_begin BETWEEN #{activityTimeBegin} \n" |
| | | + "AND #{activityTimeEnd}" + " </if> " + "</script>") |
| | | List<PartyBuildingActivityVO> listPartyMemberActivities(PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "a.id,\n" + "a.name,\n" + "a.address,\n" + "a.status,\n" + "a.release_time,\n" |
| | | + "a.activity_time_begin,\n" + "a.activity_time_end,\n" + "a.enroll_time_begin,\n" + "a.cover,\n" |
| | | + "if(u.type=3 ,'管理员',u.name)createByName,\n" + "a.enroll_time_end \n" + "FROM\n" + "com_pb_activity a\n" |
| | | + "left join sys_user u on a.create_by=u.user_id \n" |
| | | + "where a.community_id=#{partyBuildingActivityVO.communityId}\n" |
| | | + "<if test='partyBuildingActivityVO.name != null and partyBuildingActivityVO.name.trim() != ""'>" |
| | | + "and a.name = #{partyBuildingActivityVO.name} \n" + " </if> " |
| | | + "<if test='partyBuildingActivityVO.isAppliets != null and partyBuildingActivityVO.isAppliets==1'>" |
| | | + " and a.`status` not in(5,6) " + " </if> " |
| | | + "<if test='partyBuildingActivityVO.status != null and partyBuildingActivityVO.status != 0 and partyBuildingActivityVO.isAppliets ==null '>" |
| | | + "AND a.`status` = #{partyBuildingActivityVO.status} \n" + " </if> " |
| | | + "<if test='partyBuildingActivityVO.status != null and partyBuildingActivityVO.status != 0 and partyBuildingActivityVO.isAppliets !=null and partyBuildingActivityVO.isAppliets==1'>" |
| | | + "AND a.`status` in (3,4) \n" + " </if> " + "<if test='partyBuildingActivityVO.releaseTimeBegin != null '>" |
| | | + "AND a.release_time BETWEEN #{partyBuildingActivityVO.releaseTimeBegin} \n" |
| | | + "AND #{partyBuildingActivityVO.releaseTimeEnd} \n" + " </if> " |
| | | + "<if test='partyBuildingActivityVO.activityTimeBegin != null '>" |
| | | + "AND a.activity_time_begin BETWEEN #{partyBuildingActivityVO.activityTimeBegin} \n" |
| | | + "AND #{partyBuildingActivityVO.activityTimeEnd}" + " </if> " + "order by a.create_at desc " + "</script>") |
| | | IPage<PartyBuildingActivityVO> pageActivity(Page page, |
| | | @Param("partyBuildingActivityVO") PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | @Select("select t.id from (\n" + "SELECT \n" + "a.participation_lowest_num,\n" + "a.name,\n" + "a.id,\n" |
| | | + "COUNT(m.id)num\n" + "FROM\n" + "com_pb_activity a\n" |
| | | + "LEFT JOIN com_pb_activity_member m ON a.id = m.activity_id\n" |
| | | + "WHERE a.`status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),a.enroll_time_end)<=0\n" |
| | | + "GROUP BY a.id)t where t.num<t.participation_lowest_num") |
| | | List<Long> selectTimedTaskPartyBuildingActivity(); |
| | | |
| | | @Select("SELECT \n" + "u.user_id\n" + "FROM\n" + "com_pb_activity_member m\n" |
| | | + "JOIN com_pb_member r on m.member_id=r.id\n" + "join sys_user u on r.id_card=u.id_card and u.type=1 \n" |
| | | + "where m.activity_id=#{activityId}") |
| | | List<Long> selectTimedTaskPartyBuildingActivityUserids(Long activityId); |
| | | |
| | | @Update("<script> " + "update com_pb_activity set `status`=6 WHERE id in \n" |
| | | + "<foreach item=\"item\" collection=\"ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" |
| | | + "#{item}\n" + "</foreach>\n" + "</script>") |
| | | int updateBatchIds(@Param("ids") List<Long> ids); |
| | | |
| | | @Update("update com_pb_activity set status=2 where `status`=1 and TIMESTAMPDIFF(MINUTE,SYSDATE(),release_time)<=0") |
| | | int updateStatusToNotBegin(); |
| | | |
| | | @Update("update com_pb_activity set status=3 where `status`=2 and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_begin)<=0") |
| | | int updateStatusToSign(); |
| | | |
| | | @Update("update com_pb_activity set status=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_end)<=0") |
| | | int updateStatusToActiveOrEnd(); |
| | | |
| | | @Select("select id from com_pb_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_end)<=0") |
| | | List<Long> getTaskPbActivityEndIds(); |
| | | |
| | | @Select("select caas.user_id,caas.activity_id,caa.community_id from com_pb_activity_member as caas left join com_pb_activity as caa on caa.id = caas.activity_id where caa.id = #{activityId}") |
| | | List<ComActActivityPeopleVO> getTaskPbActivityPeopleList(@Param("activityId") Long activityId); |
| | | |
| | | @Select("select type,name from sys_user where user_id=#{createBy}") |
| | | LoginUserInfoVO selectUserInfoByUserId(Long createBy); |
| | | |
| | | /** |
| | | * 根据社区id查询社区名称 |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 社区名字 |
| | | */ |
| | | @Select("select name from com_act where community_id=#{communityId}") |
| | | String selectCommunityNameByCommunityId(Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:08 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("签到二维码表") |
| | | public class ComActActivityCode implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 821676065778343316L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 活动id |
| | | */ |
| | | @ApiModelProperty(value = "活动id") |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 二维码编号 |
| | | */ |
| | | @ApiModelProperty(value = "二维码编号") |
| | | private String code; |
| | | |
| | | /** |
| | | * 状态 1 有效 2过时 |
| | | */ |
| | | @ApiModelProperty(value = "状态 1 有效 2过时") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 二维码类型 1居民志愿者 2党员 |
| | | */ |
| | | @ApiModelProperty("二维码类型 1居民志愿者 2党员") |
| | | private Integer type; |
| | | |
| | | } |
| | |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 奖励积分 |
| | | */ |
| | | private Integer award; |
| | | |
| | | /** |
| | | * 签到位置 |
| | | */ |
| | | private String position; |
| | | |
| | | /** |
| | | * 签到次数 |
| | | */ |
| | | private Integer times; |
| | | |
| | | /** |
| | | * 二维码id |
| | | */ |
| | | private Integer codeId; |
| | | |
| | | /** |
| | | * 活动类型 1居民,志愿者 2党员 |
| | | */ |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 是否是志愿者 0 否 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | 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; |
| | | |
| | |
| | | * 是否是志愿者 0 不是 1 是 |
| | | */ |
| | | private Integer isVolunteer; |
| | | |
| | | /** |
| | | * 报名状态 0 已取消 1已报名 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 取消原因 |
| | | */ |
| | | private String reason; |
| | | } |
| | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | * 活动是否已默认好评 |
| | | */ |
| | | private Integer isDefaultPraise; |
| | | /** |
| | | * 签到范围,默认0无限制 |
| | | */ |
| | | @TableField("`range`") |
| | | private Integer range; |
| | | /** |
| | | * 是否有积分奖励(1.是 2.否) |
| | | */ |
| | | private Integer haveIntegralReward; |
| | | /** |
| | | * 积分奖励方式(1.按次奖励 2.记时奖励) |
| | | */ |
| | | private Integer rewardWay; |
| | | /** |
| | | * 奖励积分 |
| | | */ |
| | | private Integer rewardIntegral; |
| | | /** |
| | | * 参与次数上限 |
| | | */ |
| | | @TableField("`limit`") |
| | | private Integer limit; |
| | | /** |
| | | * 是否允许取消(1.允许 2.不允许) |
| | | */ |
| | | private Integer canCancel; |
| | | /** |
| | | * 取消扣除积分 |
| | | */ |
| | | private Integer cancelDeduct; |
| | | /** |
| | | * 活动类型 |
| | | */ |
| | | private String activityType; |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员活动 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-30 17:54 |
| | | **/ |
| | | @Data |
| | | @TableName(value = "com_pb_activity") |
| | | public class ComPbActivityDO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 活动名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 活动地点 |
| | | */ |
| | | private String address; |
| | | |
| | | /** |
| | | * 1 待发布 2 未开始 3 报名中 4 进行中 5 已结束 6 已取消 |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 活动开始时间 |
| | | */ |
| | | private Date activityTimeBegin; |
| | | |
| | | /** |
| | | * 活动结束时间 |
| | | */ |
| | | private Date activityTimeEnd; |
| | | |
| | | /** |
| | | * 报名开始时间 |
| | | */ |
| | | private Date enrollTimeBegin; |
| | | |
| | | /** |
| | | * 报名结束时间 |
| | | */ |
| | | private Date enrollTimeEnd; |
| | | |
| | | /** |
| | | * 活动参入人数 |
| | | */ |
| | | private Integer participationNum; |
| | | |
| | | /** |
| | | * 活动封面 |
| | | */ |
| | | private String cover; |
| | | |
| | | /** |
| | | * 活动内容-富文本 |
| | | */ |
| | | private String richText; |
| | | /** |
| | | * 活动最低参入人数-未达到到时间自动取消 |
| | | */ |
| | | private Integer participationLowestNum; |
| | | |
| | | /** |
| | | * 取消原因 |
| | | */ |
| | | private String cancelReason; |
| | | |
| | | /** |
| | | * 发布人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 发布时间 |
| | | */ |
| | | private Date releaseTime; |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | } |
| | |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | R listEvaluate(Long userId); |
| | | |
| | | /** |
| | | * 我的评价 |
| | | * @param userId |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | R listMyActivityEvaluate(Long userId, Long activityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:09 |
| | | */ |
| | | public interface ComActActivityCodeService extends IService<ComActActivityCode> { |
| | | R pageList(CommonPage commonPage); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param status |
| | | * @return 活动列表 |
| | | */ |
| | | R listActivity(Long userId); |
| | | R listActivity(Long userId, Integer status); |
| | | |
| | | /** |
| | | * 查询志愿者参与的所有已经完成的活动 |
| | |
| | | * @return 用户签到列表 |
| | | */ |
| | | R listSignInActivity(Long userId); |
| | | |
| | | /** |
| | | * 获取活动报名签到记录 |
| | | * @param id 活动主键id |
| | | * @return |
| | | */ |
| | | R listSignInRecord(Long id); |
| | | |
| | | /** |
| | | * 活动签到记录 |
| | | * @param id 活动主键 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | R listRegistRecord(Long id, Long userId); |
| | | |
| | | /** |
| | | * 获取活动类型(目前只有志愿者活动需要获取) |
| | | * @param communityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | R listActivityType(Long communityId, Integer type); |
| | | |
| | | /** |
| | | * 添加活动类型 |
| | | * @param comActActivityTypeVO |
| | | * @return |
| | | */ |
| | | R addActivityType(ComActActivityTypeVO comActActivityTypeVO); |
| | | } |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.MyActivityEvaluateVO; |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.dao.ComActActRegistDAO; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | |
| | | //需要签到类型 |
| | | int registCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getUserId, userId).eq(ComActActRegistDO::getActivityId, activityId)); |
| | | if (registCount <= 0) { |
| | | int evaluateCount = this.baseMapper.selectCount(new QueryWrapper<ComActActEvaluateDO>().lambda() |
| | | .eq(ComActActEvaluateDO::getUserId, userId).eq(ComActActEvaluateDO::getActivityId, activityId)); |
| | | if (registCount <= evaluateCount) { |
| | | //未签到,不能评价 |
| | | return R.fail("未签到,不能评价"); |
| | | } |
| | |
| | | if (nowDate.before(beginAt)) { |
| | | return R.fail("活动还未开始,暂不支持评价"); |
| | | } |
| | | } |
| | | ComActActEvaluateDO currentUserEvaluateForThisActivity = this.baseMapper.selectOne(new QueryWrapper<ComActActEvaluateDO>() |
| | | .lambda().eq(ComActActEvaluateDO::getActivityId, activityId).eq(ComActActEvaluateDO::getUserId, userId)); |
| | | if (Objects.nonNull(currentUserEvaluateForThisActivity)) { |
| | | return R.fail("该用户已评论过了,请勿重复评论"); |
| | | } |
| | | ComActActEvaluateDO comActActEvaluateDO = new ComActActEvaluateDO(); |
| | | BeanUtils.copyProperties(comActActEvaluateVO, comActActEvaluateDO); |
| | |
| | | public R listEvaluate(Long userId) { |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = this.baseMapper.selectList(new QueryWrapper<ComActActEvaluateDO>() |
| | | .lambda().eq(ComActActEvaluateDO::getUserId, userId)); |
| | | ArrayList<ComActActEvaluateVO> comActActEvaluateVOS = new ArrayList<>(); |
| | | List<ComActActEvaluateVO> comActActEvaluateVOS = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | |
| | | } |
| | | return R.ok(comActActEvaluateVOS); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价 |
| | | * @param userId |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R listMyActivityEvaluate(Long userId, Long activityId) { |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = this.baseMapper.selectList(new QueryWrapper<ComActActEvaluateDO>() |
| | | .lambda().eq(ComActActEvaluateDO::getUserId, userId).eq(ComActActEvaluateDO::getActivityId, activityId)); |
| | | List<ComActActEvaluateVO> comActActEvaluateVOS = new ArrayList<>(); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | | BeanUtils.copyProperties(comActActEvaluateDO, comActActEvaluateVO); |
| | | comActActEvaluateVOS.add(comActActEvaluateVO); |
| | | }); |
| | | } |
| | | int registCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | |
| | | MyActivityEvaluateVO evaluateVO = new MyActivityEvaluateVO(); |
| | | evaluateVO.setMyEvaluateList(comActActEvaluateVOS); |
| | | boolean needDisplay = registCount > comActActEvaluateVOS.size() && |
| | | new Date().before(DateUtils.addDays(comActActivityDO.getEndAt(), 3)); |
| | | evaluateVO.setIsDisplay(needDisplay ? 1 : 0); |
| | | return R.ok(evaluateVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | import com.panzhihua.service_community.dao.ComActActivityCodeDao; |
| | | import com.panzhihua.service_community.service.ComActActivityCodeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 签到二维码表(ComActActivityCode)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-15 15:23:10 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActActivityCodeServiceImpl extends ServiceImpl<ComActActivityCodeDao, ComActActivityCode> implements ComActActivityCodeService { |
| | | |
| | | @Override |
| | | public R pageList(CommonPage commonPage) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | 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 java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | 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.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | 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.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.ComBpActivityDAO; |
| | | import com.panzhihua.service_community.entity.ComActActivityCode; |
| | | 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.service.ComActActivityCodeService; |
| | | import com.panzhihua.service_community.service.ComActActivityService; |
| | | import com.panzhihua.service_community.service.ComActIntegralUserTradeService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | @Resource |
| | | private ComActActPictureDAO comActActPictureDAO; |
| | | @Resource |
| | | private ComActActivityCodeDao comActActivityCodeDao; |
| | | @Resource |
| | | private ComBpActivityDAO comBpActivityDAO; |
| | | @Resource |
| | | private ComActIntegralUserTradeService comActIntegralUserTradeService; |
| | | @Resource |
| | | private ComActActivityCodeService comActActivityCodeService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | comActActPictureDO.setUploadPicture(comActActivityVO.getCover()); |
| | | comActActPictureDO.setSysFlag(0); |
| | | comActActPictureDAO.insert(comActActPictureDO); |
| | | |
| | | ComActActivityCode comActActivityCode = new ComActActivityCode(); |
| | | comActActivityCode.setActivityId(comActActivityDO.getId().longValue()); |
| | | comActActivityCode.setCreateTime(new Date()); |
| | | comActActivityCode.setType(1); |
| | | comActActivityCode.setStatus(1); |
| | | comActActivityCodeService.save(comActActivityCode); |
| | | return R.ok(activityId); |
| | | } |
| | | |
| | |
| | | LambdaQueryWrapper<ComActActSignDO> actSignQuery = new LambdaQueryWrapper<>(); |
| | | actSignQuery.eq(ComActActSignDO::getActivityId, id); |
| | | actSignQuery.eq(ComActActSignDO::getUserId, userId); |
| | | actSignQuery.eq(ComActActSignDO::getStatus, 1); |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(actSignQuery); |
| | | if (!ObjectUtils.isEmpty(comActActSignDO)) { |
| | | comActActivityVO.setIsSign(1); |
| | |
| | | } |
| | | } |
| | | } |
| | | comActActivityVO.setCodeType(1); |
| | | return comActActivityVO; |
| | | } |
| | | |
| | |
| | | Long activityId = signactivityVO.getActivityId(); |
| | | Integer type = signactivityVO.getType(); |
| | | Long userId = signactivityVO.getUserId(); |
| | | Integer isVolunteer = signactivityVO.getIsVolunteer(); |
| | | Integer isVolunteer = 0; |
| | | // 查询社区活动 |
| | | ComActActivityDO actActivityDO = this.baseMapper.selectById(activityId); |
| | | if (isNull(actActivityDO)) { |
| | | return R.fail("活动不存在"); |
| | | } |
| | | int num = 0; |
| | | ComActActSignDO comActActSignDO = comActActSignDAO.selectOne(new QueryWrapper<ComActActSignDO>() |
| | | .lambda().eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getUserId, userId)); |
| | | if (1 == type) { |
| | | if (nonNull(comActActSignDO) && comActActSignDO.getStatus().equals(1)) { |
| | | return R.fail("已经报名过了,请勿重复提交"); |
| | | } |
| | | Integer volunteerMax = actActivityDO.getVolunteerMax(); |
| | | Integer residentMax = actActivityDO.getParticipantMax(); |
| | | R<LoginUserInfoVO> userInfoR = userService.getUserInfoByUserId(String.valueOf(userId)); |
| | | LoginUserInfoVO loginUserInfoVO = |
| | | JSONObject.parseObject(JSONObject.toJSONString(userInfoR.getData()), LoginUserInfoVO.class); |
| | | boolean userNotVolunteer = !(loginUserInfoVO.getIsVolunteer() == 1); |
| | | if (isVolunteer == 1 && userNotVolunteer) { |
| | | return R.fail("只有志愿者才能报名"); |
| | | } |
| | | |
| | | // 查询当前活动下参与志愿者/居民数量 |
| | | Integer count = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, isVolunteer)); |
| | | if (isVolunteer.equals(1) && actActivityDO.getVolunteerMax() <= count |
| | | && !actActivityDO.getVolunteerMax().equals(-1)) { |
| | | return R.fail("志愿者报名人数已满"); |
| | | } |
| | | |
| | | //审查用户是否有该活动报名权限(是否活动指定参与人群) |
| | | String currentUserTags = loginUserInfoVO.getTags(); |
| | | String attendPeople = actActivityDO.getAattendPeople(); |
| | | if (isVolunteer.intValue() == 0 && isNotBlank(attendPeople)) { |
| | | if (isBlank(currentUserTags)) { |
| | | currentUserTags = "全部居民"; |
| | | JSONObject.parseObject(JSONObject.toJSONString(userInfoR.getData()), LoginUserInfoVO.class); |
| | | // 查询当前活动下参与居民 |
| | | Integer residentCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 0)); |
| | | if (volunteerMax != 0) { |
| | | //志愿者活动 |
| | | boolean userIsVolunteer = loginUserInfoVO.getIsVolunteer() == 1; |
| | | // 查询当前活动下参与志愿者 |
| | | Integer volunteerCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, 1)); |
| | | if (userIsVolunteer) { |
| | | //用户是志愿者以志愿者身份参加 |
| | | if (volunteerMax > volunteerCount || volunteerMax.equals(-1)) { |
| | | //以志愿者身份报名 |
| | | isVolunteer = 1; |
| | | } else if (nonNull(residentMax) && (residentMax > residentCount || residentMax.equals(-1))) { |
| | | //志愿者报名人数已满,再以居民身份报名参加 |
| | | isVolunteer = 0; |
| | | } else { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } else { |
| | | currentUserTags = currentUserTags.concat(",全部居民"); |
| | | //用户是普通居民已居民身份参加 |
| | | if (nonNull(residentMax) && (residentMax > residentCount || residentMax.equals(-1))) { |
| | | //以居民身份报名参加 |
| | | isVolunteer = 0; |
| | | } else if (volunteerMax > volunteerCount || volunteerMax.equals(-1)) { |
| | | return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是志愿者哦~"); |
| | | } else { |
| | | return R.fail("报名人数已满"); |
| | | } |
| | | } |
| | | List<String> currentUserTagList = Arrays.asList(currentUserTags.split(",")); |
| | | boolean checkResult = currentUserTagList.stream().anyMatch(currentUserTag -> attendPeople.contains(currentUserTag)); |
| | | if (!checkResult) { |
| | | 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 (isVolunteer.equals(0) && actActivityDO.getParticipantMax() <= count |
| | | && !actActivityDO.getParticipantMax().equals(-1)) { |
| | | return R.fail("居民报名人数已满"); |
| | | } |
| | | |
| | | ComActActSignDO comActActSignDO = new ComActActSignDO(); |
| | | comActActSignDO.setActivityId(activityId); |
| | | comActActSignDO.setUserId(userId); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | try { |
| | | if (nonNull(comActActSignDO)) { |
| | | comActActSignDO.setStatus(1); |
| | | comActActSignDO.setCreateAt(new Date()); |
| | | comActActSignDO.setReason(null); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | num = comActActSignDAO.updateById(comActActSignDO); |
| | | } else { |
| | | comActActSignDO = new ComActActSignDO(); |
| | | comActActSignDO.setActivityId(activityId); |
| | | comActActSignDO.setUserId(userId); |
| | | comActActSignDO.setIsVolunteer(isVolunteer); |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains("unique_activity_id_user_id")) { |
| | | return R.fail("已经报名过了,请勿重复提交"); |
| | | } |
| | | log.error(e.getMessage()); |
| | | } |
| | | } else { |
| | | num = comActActSignDAO |
| | | .delete(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getUserId, userId) |
| | | .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getIsVolunteer, isVolunteer)); |
| | | if (isNull(signactivityVO.getReason())) { |
| | | return R.fail("缺少取消原因"); |
| | | } |
| | | if (isNull(comActActSignDO)) { |
| | | return R.fail("未报名"); |
| | | } |
| | | comActActSignDO.setStatus(0); |
| | | comActActSignDO.setReason(signactivityVO.getReason()); |
| | | num = comActActSignDAO.updateById(comActActSignDO); |
| | | } |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | return R.ok(isVolunteer); |
| | | } |
| | | return R.fail(); |
| | | } |
| | |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param status |
| | | * @return 活动列表 |
| | | */ |
| | | @Override |
| | | public R listActivity(Long userId) { |
| | | List<ComActActSignDO> comActActSignDOS = comActActSignDAO |
| | | .selectList(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActActSignDOS)) { |
| | | public R listActivity(Long userId, Integer status) { |
| | | List<ActivitySignVO> activitySignVOList = comActActSignDAO.selectList(userId); |
| | | if (ObjectUtils.isEmpty(activitySignVOList)) { |
| | | return R.fail(); |
| | | } |
| | | List<Long> longs = comActActSignDOS.stream().map(comActActSignDO -> comActActSignDO.getActivityId()) |
| | | List<Long> longs = activitySignVOList.stream().map(activitySignVO -> activitySignVO.getActivityId()) |
| | | .collect(Collectors.toList()); |
| | | List<ComActActivityDO> comActActivityDOS = comActActivityDAO.selectBatchIds(longs); |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | comActActivityDOS.forEach(comActActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | BeanUtils.copyProperties(comActActivityDO, comActActivityVO); |
| | | List<ComActActSignDO> collect = comActActSignDOS.stream() |
| | | .filter(comActActSignDO -> comActActSignDO.getActivityId().equals(comActActivityVO.getId())).limit(1) |
| | | .collect(Collectors.toList()); |
| | | ComActActSignDO comActActSignDO = collect.get(0); |
| | | Integer isVolunteer = comActActSignDO.getIsVolunteer(); |
| | | if (isVolunteer.intValue() == 1) { |
| | | comActActivityVO.setType(1); |
| | | } else { |
| | | comActActivityVO.setType(2); |
| | | } |
| | | Integer status = comActActivityVO.getStatus(); |
| | | if (status.intValue() == 3) { |
| | | comActActivityVO.setStatus(4); |
| | | } |
| | | comActActivityVO.setSingDate(comActActSignDOS.stream() |
| | | .filter(comActActSignDO1 -> comActActSignDO1.getActivityId().equals(comActActivityVO.getId())) |
| | | .collect(Collectors.toList()).get(0).getCreateAt()); |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | if (nonNull(status)) { |
| | | comActActivityDOS = comActActivityDOS.stream() |
| | | .filter(activityDO -> activityDO.getStatus().equals(status)).collect(Collectors.toList()); |
| | | } |
| | | if (!comActActivityDOS.isEmpty()) { |
| | | comActActivityDOS.forEach(comActActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | BeanUtils.copyProperties(comActActivityDO, comActActivityVO); |
| | | List<ActivitySignVO> collect = activitySignVOList.stream() |
| | | .filter(activitySignVO -> activitySignVO.getActivityId().equals(comActActivityVO.getId())).limit(1) |
| | | .collect(Collectors.toList()); |
| | | ActivitySignVO activitySignVO = collect.get(0); |
| | | Integer isVolunteer = activitySignVO.getIsVolunteer(); |
| | | if (isVolunteer.intValue() == 1) { |
| | | comActActivityVO.setType(1); |
| | | } else { |
| | | comActActivityVO.setType(2); |
| | | } |
| | | Integer activityStatus = comActActivityVO.getStatus(); |
| | | if (activityStatus.intValue() == 3) { |
| | | comActActivityVO.setStatus(4); |
| | | } |
| | | Date createAt = null; |
| | | try { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | createAt = simpleDateFormat.parse(activitySignVO.getCreateAt()); |
| | | } catch (ParseException e) { |
| | | log.error("时间转换异常【{}】", e.getMessage()); |
| | | } |
| | | comActActivityVO.setSingDate(createAt); |
| | | comActActivityVO.setTimes(activitySignVO.getTimes()); |
| | | comActActivityVO.setAward(activitySignVO.getAward()); |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | } |
| | | return R.ok(comActActivityVOS); |
| | | } |
| | | |
| | |
| | | if (isNull(activityId)) { |
| | | return R.fail("签到所属活动id不能为空!"); |
| | | } |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | return R.fail("活动不存在!"); |
| | | } |
| | | if(comActActRegistVO.getActivityType()==1){ |
| | | ComActActivityDO comActActivityDO = comActActivityDAO.selectById(activityId); |
| | | if (isNull(comActActivityDO)) { |
| | | 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("不在活动时间范围内"); |
| | | } |
| | | |
| | | int signCount = comActActRegistDAO.selectCount(new QueryWrapper<ComActActRegistDO>() |
| | | .lambda().eq(ComActActRegistDO::getActivityId, activityId).eq(ComActActRegistDO::getUserId, userId)); |
| | | |
| | | if (signCount > 0) { |
| | | 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 = comActActivityDO.getLimit().intValue(); |
| | | if(limit != -1 && signAllCount >= limit){ |
| | | return R.fail("签到次数上限"); |
| | | } |
| | | |
| | | // String activitySignInKey = String.join(DELIMITER, ACTIVITY_SIGN_IN, userId.toString(), activityId.toString()); |
| | | // if (stringRedisTemplate.hasKey(activitySignInKey)) { |
| | | // return R.fail("你已签到,如要再次签到请三十分钟后尝试!"); |
| | | // } |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0) { |
| | | ComActActRegistDO comActActRegistDO = new ComActActRegistDO(); |
| | | comActActRegistDO.setActivityId(activityId); |
| | | comActActRegistDO.setType(1); |
| | | comActActRegistDO.setUserId(userId); |
| | | comActActRegistDO.setIsVolunteer(comActActRegistVO.getIsVolunteer()); |
| | | comActActRegistDO.setCreateAt(nowDate); |
| | | comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | comActActRegistDO.setAward(comActActivityDO.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(1); |
| | | addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); |
| | | addComActIntegralUserDTO.setServiceId(activityId); |
| | | comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); |
| | | // ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | // opsForValue.set(activitySignInKey, "", 1800L, TimeUnit.SECONDS); |
| | | return R.ok(); |
| | | return R.ok(comActActivityDO.getRewardIntegral()); |
| | | } |
| | | 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("网络错误,请重试"); |
| | | // } |
| | | |
| | | return R.fail("网络错误,请重试"); |
| | | } |
| | | |
| | |
| | | }); |
| | | return R.ok(comActActRegistVOS); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动报名签到记录 |
| | | * @param id 活动主键id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R listSignInRecord(Long id) { |
| | | return R.ok(comActActSignDAO.listSignInRecord(id)); |
| | | } |
| | | |
| | | /** |
| | | * 活动签到记录 |
| | | * @param id 活动主键 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R listRegistRecord(Long id, Long userId) { |
| | | return R.ok(comActActRegistDAO.listRegistRecord(id, userId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动类型(目前只有志愿者活动需要获取) |
| | | * @param communityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R listActivityType(Long communityId, Integer type) { |
| | | return R.ok(this.baseMapper.listActivityType(communityId, type)); |
| | | } |
| | | |
| | | /** |
| | | * 添加活动类型 |
| | | * @param comActActivityTypeVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addActivityType(ComActActivityTypeVO comActActivityTypeVO) { |
| | | try { |
| | | this.baseMapper.addActivityType(comActActivityTypeVO); |
| | | } catch (Exception e) { |
| | | log.error("添加活动类型错误【{}】", e.getMessage()); |
| | | return R.fail("活动类型已存在"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_community.dao.ComBpActivityDAO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private ComActDiscussOptionService comActDiscussOptionService; |
| | | @Resource |
| | | private ComActActivityService comActActivityService; |
| | | @Resource |
| | | private ComBpActivityDAO comBpActivityDAO; |
| | | |
| | | /** |
| | | * 查询用户某个时间段交易数量 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addIntegralTradeAdmin(AddComActIntegralUserDTO integralUserDTO) { |
| | | // 判断增加积分类型 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷) |
| | | // 判断增加积分类型 积分任务类型(1.发布随手拍 2.发布微心愿 3.参与议事投票 4.参与志愿者活动 5.参与社区活动 6.参与党员活动 7.参与调查问卷 8.活动签到 9.取消活动) |
| | | Integer type = integralUserDTO.getIntegralType(); |
| | | // 业务id |
| | | Long serviceId = integralUserDTO.getServiceId(); |
| | |
| | | remark.append(questnaireDO.getTitle()); |
| | | remark.append("】"); |
| | | break; |
| | | case 8: |
| | | remark.append("成功参加活动奖励积分"); |
| | | if(integralUserDTO.getActivityType()==1){ |
| | | ComActActivityDO actActivityDO1 = comActActivityService.getById(serviceId); |
| | | if(actActivityDO1!=null){ |
| | | amount=actActivityDO1.getRewardIntegral(); |
| | | if(actActivityDO1.getVolunteerMax()!=0){ |
| | | identityType=3; |
| | | }else { |
| | | identityType=1; |
| | | } |
| | | } |
| | | } |
| | | // else { |
| | | // ComPbActivityDO comPbActivityDO = comBpActivityDAO.selectById(serviceId); |
| | | // if(comPbActivityDO!=null){ |
| | | // amount=comPbActivityDO.getRewardIntegral(); |
| | | // identityType=2; |
| | | // } |
| | | // } |
| | | default: |
| | | break; |
| | | } |
| | |
| | | caar.id, |
| | | caar.activity_id, |
| | | caar.create_at, |
| | | caar.position, |
| | | caar.times, |
| | | caar.award, |
| | | su.user_id, |
| | | su.`name`, |
| | | su.nick_name, |
| | |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | <if test="comActActRegistVO.type != null"> |
| | | AND caar.type = #{comActActRegistVO.type} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | |
| | | <select id="getRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> |
| | | SELECT |
| | | caar.create_at, |
| | | caar.positon, |
| | | caar.times, |
| | | caar.award, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | <if test="comActActRegistVO.type != null"> |
| | | AND caar.type = #{comActActRegistVO.type} |
| | | </if> |
| | | order by caar.create_at desc |
| | | </select> |
| | | |
| | | <select id="getNoRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> |
| | | SELECT |
| | | caas.create_at, |
| | | caar.positon, |
| | | caar.times, |
| | | caar.award, |
| | | su.`name` |
| | | su.phone, |
| | | su.tags, |
| | |
| | | <if test="comActActRegistVO.createAt != null"> |
| | | AND caar.create_at = #{comActActRegistVO.createAt} |
| | | </if> |
| | | <if test="comActActRegistVO.type != null"> |
| | | AND caar.type = #{comActActRegistVO.type} |
| | | </if> |
| | | </select> |
| | | <select id="listRegistRecord" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> |
| | | SELECT create_at, award FROM com_act_act_regist |
| | | WHERE activity_id = #{id} AND user_id = #{userId} AND `type` = 1 ORDER BY id DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="user_id" property="userId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="status" property="status" /> |
| | | <result column="reason" property="reason" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | |
| | | <select id="getSignLists" resultType="com.panzhihua.common.model.vos.community.ComActActSignExcelVO"> |
| | | SELECT |
| | | caas.create_at, |
| | | r.times, |
| | | cass.status, |
| | | cass.reason, |
| | | r.award * r.times as award, |
| | | t.limit, |
| | | su.`name`, |
| | | su.phone, |
| | | su.tags, |
| | |
| | | FROM |
| | | com_act_act_sign caas |
| | | LEFT JOIN sys_user su ON caas.user_id = su.user_id |
| | | left join com_act_activity t on cass.activity_id = t.id |
| | | LEFT JOIN ( |
| | | SELECT * FROM ( |
| | | SELECT * FROM com_act_act_regist |
| | | WHERE activity_id = #{activitySignVO.activityId} AND type = 1 |
| | | ORDER BY id DESC LIMIT 1000000 |
| | | ) temp GROUP BY activity_id, user_id |
| | | ) r ON caas.activity_id = r.activity_id AND caas.user_id = r.user_id |
| | | where caas.activity_id = #{activitySignVO.activityId} |
| | | <if test="activitySignVO.phone != null and activitySignVO.phone !=''"> |
| | | AND su.phone = #{activitySignVO.phone} |
| | | </if> |
| | | <if test='activitySignVO.status != null'> |
| | | AND caas.status = #{activitySignVO.status} |
| | | </if> |
| | | <if test="activitySignVO.name != null and activitySignVO.name !=''"> |
| | | AND su.`name` = #{activitySignVO.name} |
| | |
| | | #{id} |
| | | </foreach> AND e.id IS NULL |
| | | </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 u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, |
| | | u.phone, u.tags, a.create_at, a.is_volunteer, a.status , r.times , a.reason, r.times * r.award as award, 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 |
| | | LEFT JOIN ( |
| | | SELECT * FROM ( |
| | | SELECT * FROM com_act_act_regist |
| | | WHERE activity_id = #{activitySignVO.activityId} AND type = 1 |
| | | ORDER BY id DESC LIMIT 1000000 |
| | | ) temp GROUP BY activity_id, user_id |
| | | ) r ON a.activity_id = r.activity_id AND a.user_id = r.user_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.tags != null and activitySignVO.tags != ""'> |
| | | AND u.tags like concat('%',#{activitySignVO.tags},'%') |
| | | </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 |
| | | </select> |
| | | <select id="selectList" resultType="com.panzhihua.common.model.vos.community.ActivitySignVO"> |
| | | SELECT s.*, r.times, r.times * r.award AS award FROM `com_act_act_sign` s |
| | | LEFT JOIN ( |
| | | SELECT * FROM ( |
| | | SELECT * FROM com_act_act_regist |
| | | WHERE user_id = #{userId} AND type = 1 |
| | | ORDER BY id DESC LIMIT 1000000 |
| | | ) temp GROUP BY activity_id |
| | | ) r ON s.activity_id = r.activity_id |
| | | WHERE s.user_id = #{userId} AND s.status = 1 |
| | | </select> |
| | | <select id="listSignInRecord" resultType="com.panzhihua.common.model.vos.community.ActivitySignInRecordVO"> |
| | | SELECT s.activity_id, s.create_at, s.user_id, u.name, a.limit, r.type, r.times |
| | | FROM com_act_act_sign s |
| | | LEFT JOIN sys_user u ON s.user_id = u.user_id |
| | | LEFT JOIN com_act_activity a ON s.activity_id = a.id |
| | | LEFT JOIN ( |
| | | SELECT * FROM ( |
| | | SELECT * FROM com_act_act_regist |
| | | WHERE activity_id = #{id} AND type = 1 |
| | | ORDER BY id DESC LIMIT 1000000 |
| | | ) temp GROUP BY activity_id, user_id |
| | | ) r ON s.activity_id = r.activity_id AND s.user_id = r.user_id |
| | | WHERE s.activity_id = #{id} |
| | | </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.ComActActivityCodeDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActActivityCode" id="ComActActivityCodeBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="activityId" column="activity_id"/> |
| | | <result property="code" column="code"/> |
| | | <result property="status" column="status"/> |
| | | <result property="createTime" column="create_time"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <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="limit" property="limit" /> |
| | | <result column="can_cancel" property="canCancel" /> |
| | | <result column="cancel_deduct" property="cancelDeduct" /> |
| | | <result column="activity_type" property="activityType" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, contact_phone, is_regist, is_top, prize_remark, reward_desc, content, community_id, create_at, cancel_reason |
| | | </sql> |
| | | <insert id="addActivityType"> |
| | | INSERT INTO com_act_activity_type (`name`, `type`, community_id) |
| | | VALUES (#{comActActivityTypeVO.name}, #{comActActivityTypeVO.type}, #{comActActivityTypeVO.communityId}) |
| | | </insert> |
| | | |
| | | <select id="activityStatistics" resultType="com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO"> |
| | | SELECT IFNULL(volunteer_max,0) + IFNULL(participant_max,0) as signTotal |
| | |
| | | SELECT * FROM `com_act_activity` |
| | | WHERE community_id = #{communityId} and is_top = 1 and sign_up_end >= now() |
| | | </select> |
| | | <select id="pageActivityCommunityBack" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT t.* FROM ( |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, |
| | | 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 |
| | | FROM com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id=u.user_id |
| | | LEFT JOIN com_act_act_sign s ON a.id=s.activity_id |
| | | WHERE a.`status` = 1 AND a.community_id=#{comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 1'> |
| | | AND a.volunteer_max != 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 2'> |
| | | AND a.volunteer_max = 0 |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'> |
| | | AND a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) |
| | | </if> |
| | | <if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'> |
| | | AND a.`status` = 99 |
| | | </if> |
| | | <if test='comActActivityVO.beginAt != null '> |
| | | AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} |
| | | </if> |
| | | GROUP BY a.id |
| | | UNION ALL SELECT t1.* FROM ( |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, |
| | | 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 |
| | | FROM com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id=u.user_id |
| | | LEFT JOIN com_act_act_sign s ON a.id=s.activity_id |
| | | WHERE a.`status` != 1 AND a.community_id=#{comActActivityVO.communityId} |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 1'> |
| | | AND a.volunteer_max != 0 |
| | | </if> |
| | | <if test='comActActivityVO.type != null and comActActivityVO.type == 2'> |
| | | AND a.volunteer_max = 0 |
| | | </if> |
| | | <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} |
| | | </if> |
| | | <if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'> |
| | | AND a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) |
| | | </if> |
| | | <if test='comActActivityVO.status != null and comActActivityVO.status !=0 '> |
| | | AND a.`status` = #{comActActivityVO.status} |
| | | </if> |
| | | <if test='comActActivityVO.beginAt != null '> |
| | | AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} |
| | | </if> |
| | | GROUP BY a.id ORDER BY a.publish_at DESC |
| | | )t1 |
| | | )t |
| | | </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.* |
| | | 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 a.id = #{id} group by a.id |
| | | </select> |
| | | <select id="listActivityType" resultType="com.panzhihua.common.model.vos.community.ComActActivityTypeVO"> |
| | | SELECT * FROM com_act_activity_type WHERE `type` = #{type} AND community_id = #{communityId} ORDER BY id ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return 党建活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | public R listActivity(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId) { |
| | | return comBpActivityService.listActivity(userId, communityId); |
| | | public R listActivity(@RequestParam("userId") Long userId, |
| | | @RequestParam("communityId") Long communityId, |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | return comBpActivityService.listActivity(userId, communityId, status); |
| | | |
| | | } |
| | | |
| | |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id |
| | | * @param status |
| | | * @return 党建活动列表 |
| | | */ |
| | | R listActivity(Long userId, Long communityId); |
| | | R listActivity(Long userId, Long communityId, Integer status); |
| | | |
| | | /** |
| | | * 党员活动人员参入列表 |
| | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 党员活动 |
| | |
| | | comBpActivityDAO.selectCommunityNameByCommunityId(partyBuildingActivityVO.getCommunityId())); |
| | | } |
| | | |
| | | partyBuildingActivityVO.setCodeType(2); |
| | | return R.ok(partyBuildingActivityVO); |
| | | } |
| | | |
| | |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id |
| | | * @param status |
| | | * @return 党建活动列表 |
| | | */ |
| | | @Override |
| | | public R listActivity(Long userId, Long communityId) { |
| | | public R listActivity(Long userId, Long communityId, Integer status) { |
| | | List<ComActActivityVO> comActActivityVOS = new ArrayList<>(); |
| | | /*Long memberId=comPbActivityMemberDAO.selectMemberIdByUserId(userId,communityId); |
| | | if (ObjectUtils.isEmpty(memberId)) { |
| | |
| | | List<Long> collect = comPbActivityMemberDOS.stream() |
| | | .map(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId()).collect(Collectors.toList()); |
| | | List<ComPbActivityDO> comPbActivityDOS = comBpActivityDAO.selectBatchIds(collect); |
| | | |
| | | comPbActivityDOS.forEach(comPbActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | Long createBy = comPbActivityDO.getCreateBy(); |
| | | LoginUserInfoVO loginUserInfoVO = comPbActivityMemberDAO.selectUserInfo(createBy); |
| | | Integer type = loginUserInfoVO.getType(); |
| | | if (type == 1) { |
| | | comActActivityVO.setIsPerson(1); |
| | | } else { |
| | | comActActivityVO.setIsPerson(0); |
| | | } |
| | | Integer status = comPbActivityDO.getStatus(); |
| | | if (status.intValue() == 3) { |
| | | status = 4; |
| | | } |
| | | comActActivityVO.setType(3); |
| | | comActActivityVO.setId(comPbActivityDO.getId()); |
| | | comActActivityVO.setStatus(status); |
| | | comActActivityVO.setActivityName(comPbActivityDO.getName()); |
| | | comActActivityVO.setCover(comPbActivityDO.getCover()); |
| | | comActActivityVO.setBeginAt(comPbActivityDO.getActivityTimeBegin()); |
| | | comActActivityVO.setSingDate(comPbActivityMemberDOS.stream() |
| | | .filter(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId().equals(comActActivityVO.getId())) |
| | | .collect(Collectors.toList()).get(0).getCreateAt()); |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | if (nonNull(status)) { |
| | | comPbActivityDOS = comPbActivityDOS.stream() |
| | | .filter(activityDO -> activityDO.getStatus().equals(status)).collect(Collectors.toList()); |
| | | } |
| | | if (!comPbActivityDOS.isEmpty()) { |
| | | comPbActivityDOS.forEach(comPbActivityDO -> { |
| | | ComActActivityVO comActActivityVO = new ComActActivityVO(); |
| | | Long createBy = comPbActivityDO.getCreateBy(); |
| | | LoginUserInfoVO loginUserInfoVO = comPbActivityMemberDAO.selectUserInfo(createBy); |
| | | Integer type = loginUserInfoVO.getType(); |
| | | if (type == 1) { |
| | | comActActivityVO.setIsPerson(1); |
| | | } else { |
| | | comActActivityVO.setIsPerson(0); |
| | | } |
| | | Integer activityStatus = comPbActivityDO.getStatus(); |
| | | if (activityStatus.intValue() == 3) { |
| | | activityStatus = 4; |
| | | } |
| | | comActActivityVO.setType(3); |
| | | comActActivityVO.setId(comPbActivityDO.getId()); |
| | | comActActivityVO.setStatus(activityStatus); |
| | | comActActivityVO.setActivityName(comPbActivityDO.getName()); |
| | | comActActivityVO.setCover(comPbActivityDO.getCover()); |
| | | comActActivityVO.setBeginAt(comPbActivityDO.getActivityTimeBegin()); |
| | | comActActivityVO.setSingDate(comPbActivityMemberDOS.stream() |
| | | .filter(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId().equals(comActActivityVO.getId())) |
| | | .collect(Collectors.toList()).get(0).getCreateAt()); |
| | | comActActivityVOS.add(comActActivityVO); |
| | | }); |
| | | } |
| | | return R.ok(comActActivityVOS); |
| | | } |
| | | |