diff --git a/luoo_common/src/main/java/constants/ErrorConstants.java b/luoo_common/src/main/java/constants/ErrorConstants.java index 769629d..77ac9f1 100644 --- a/luoo_common/src/main/java/constants/ErrorConstants.java +++ b/luoo_common/src/main/java/constants/ErrorConstants.java @@ -38,6 +38,7 @@ public class ErrorConstants { public final static String USER_ALREADY_EXISTS_ARTIST = "用户已发起过音乐人审核"; public final static String USER_STATUS_ERROR = "用户状态错误"; public final static String USER_NAME_ALREADY_EXISTS = "用户名已存在"; + public final static String USER_INVITE_CODE_NOT_EXIST = "邀请码不存在"; // 会员部分 public static final String MEMBERSHIP_CODE_NOT_EXISTS = "会员码不存在"; diff --git a/luoo_common/src/main/java/constants/TaskPointIdConstants.java b/luoo_common/src/main/java/constants/TaskPointIdConstants.java index 2252c51..bf2aa3e 100644 --- a/luoo_common/src/main/java/constants/TaskPointIdConstants.java +++ b/luoo_common/src/main/java/constants/TaskPointIdConstants.java @@ -48,4 +48,10 @@ public class TaskPointIdConstants { public static final String INVITE_USER_20 = "22"; + // 积分抽奖 + public static final String LOTTERY = "1000"; + + // 积分抽奖返还 + public static final String LOTTERY_RETURNS = "1001"; + } diff --git a/luoo_common/src/main/java/enums/PointEnums.java b/luoo_common/src/main/java/enums/PointEnums.java index a7841f9..8a93d05 100644 --- a/luoo_common/src/main/java/enums/PointEnums.java +++ b/luoo_common/src/main/java/enums/PointEnums.java @@ -41,6 +41,9 @@ public enum PointEnums { PARTICIPATED(1, "已参加"), NOT_PARTICIPATED(2, "未参加"), + ALREADY_POPUP(1, "已弹出"), + NOT_POPUP(0, "未弹出"), + ; private final Integer code; private final String description; diff --git a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java index 4493852..29d578b 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java @@ -18,8 +18,10 @@ import com.luoo.user.pojo.*; import com.luoo.user.service.*; import com.luoo.user.util.EmojiConverterUtil; import com.luoo.user.util.IpUtil; +import com.luoo.user.vo.userinfo.UserInfoForInviteVO; import com.luoo.user.vo.userinfo.UserinfoShippingAddressAppVO; import constants.Constants; +import constants.ErrorConstants; import constants.TaskPointIdConstants; import controller.BaseController; import dto.UserLoginDto; @@ -132,6 +134,17 @@ public class MyController extends BaseController { return Result.success(userRespDTO); } + @ApiOperation(value = "1.1 根据邀请码获取用户部分信息", notes = "无认证") + @GetMapping("/userInfo/invite") + public Result getUserInfoForInvite(String inviteCode) { + UserInfo userInfoByInvitationCode = userInfoService.getUserInfoByInvitationCode(inviteCode); + if(userInfoByInvitationCode != null) { + return Result.success(new UserInfoForInviteVO(userInfoByInvitationCode.getNickName(), Constants.RESOURCE_PREFIX + userInfoByInvitationCode.getAvatar(), inviteCode)); + } else { + return Result.failed(ErrorConstants.USER_INVITE_CODE_NOT_EXIST); + } + } + @ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息") @PutMapping("/userInfo") @GlobalInterceptor(checkAppUserLogin = true) diff --git a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java index 6e7e3b7..a3a8140 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java @@ -385,7 +385,7 @@ public class PointController { @ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP") @GetMapping("/lottery/result/{id}") @GlobalInterceptor(checkAppUserLogin = true) - public Result findLotteryResult( + public Result findLotteryResult( @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "抽奖id", required = true) @PathVariable String id) { return Result.success(lotteryService.getLotteryUserResult(id, token)); @@ -426,6 +426,15 @@ public class PointController { return Result.success(lotteryService.getLotteryDetailAPPVO(id)); } + @ApiOperation(value = "3.15. 记录用户中奖信息已弹出", notes = "APP") + @PostMapping("/app/popup") + @GlobalInterceptor(checkAppUserLogin = true) + public Result popup( + @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, + @ApiParam(value = "lotteryUser表(抽奖用户绑定)id", required = true) @PathVariable String id) { + lotteryService.popup(id); + return Result.success(); + } } diff --git a/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryAddDto.java b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryAddDto.java index 077c74e..3ff491f 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryAddDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryAddDto.java @@ -14,6 +14,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -82,4 +83,7 @@ public class LotteryAddDto implements Serializable { @ApiModelProperty(value = "抽奖地区列表") private List lotteryRegionList; + + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; } \ No newline at end of file diff --git a/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryUpdateDto.java b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryUpdateDto.java index 98c2302..3efeca4 100644 --- a/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryUpdateDto.java +++ b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryUpdateDto.java @@ -12,6 +12,7 @@ import javax.persistence.Transient; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -85,4 +86,7 @@ public class LotteryUpdateDto implements Serializable { @ApiModelProperty(value = "抽奖地区列表") private List lotteryRegionList; + + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; } \ No newline at end of file diff --git a/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java b/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java index fe02473..c50cdc2 100644 --- a/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java +++ b/luoo_user/src/main/java/com/luoo/user/listener/drawListener.java @@ -26,7 +26,11 @@ public class drawListener { @RabbitHandler public void executeDraw(DrawDTO drawDTO) { log.info("drawDTO:{}", drawDTO); - userPointLogService.executeDraw(drawDTO); + try { + userPointLogService.executeDraw(drawDTO); + } catch (Exception e) { + e.printStackTrace(); + } } } diff --git a/luoo_user/src/main/java/com/luoo/user/pojo/Lottery.java b/luoo_user/src/main/java/com/luoo/user/pojo/Lottery.java index b15813b..159f8b3 100644 --- a/luoo_user/src/main/java/com/luoo/user/pojo/Lottery.java +++ b/luoo_user/src/main/java/com/luoo/user/pojo/Lottery.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import javax.persistence.Column; @@ -149,6 +150,16 @@ public class Lottery implements Serializable { @ApiModelProperty(value = "停止原因") private String stopReason; + @Column(name = "publish_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "发布时间") + private LocalDateTime publishTime; + + @Column(name = "price") + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; + @Transient @ApiModelProperty(value = "抽奖地区列表") private List lotteryRegionList; diff --git a/luoo_user/src/main/java/com/luoo/user/pojo/LotteryUser.java b/luoo_user/src/main/java/com/luoo/user/pojo/LotteryUser.java index 8111931..a6e14c9 100644 --- a/luoo_user/src/main/java/com/luoo/user/pojo/LotteryUser.java +++ b/luoo_user/src/main/java/com/luoo/user/pojo/LotteryUser.java @@ -85,4 +85,8 @@ public class LotteryUser implements Serializable { @ApiModelProperty(value = "更新人") private String updateUser; + @Column(name = "popup") + @ApiModelProperty(value = "是否已弹出弹框 0-默认状态,未弹出 1-已弹出") + private Integer popup; + } \ No newline at end of file diff --git a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java index 9db3cda..0710a50 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java @@ -19,6 +19,7 @@ import com.querydsl.core.types.dsl.StringExpression; import com.querydsl.jpa.impl.JPAQueryFactory; import constants.Constants; import constants.ErrorConstants; +import constants.TaskPointIdConstants; import dto.UserLoginDto; import enums.PointEnums; import enums.UserTypeEnum; @@ -26,6 +27,7 @@ import enums.UserVipStatusEnum; import exception.BizException; import java.io.IOException; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -266,6 +268,8 @@ public class LotteryService { if (lottery.getDrawTime() == null) { throw new BizException(ErrorConstants.DRAW_TIME_IS_REQUIRED); } + // 发布时间 + lottery.setPublishTime(LocalDateTime.now()); lottery.setUpdateUser(userLoginDto.getUserId()); lottery.setUpdateUserName(userLoginDto.getNickName()); @@ -306,7 +310,7 @@ public class LotteryService { .id(String.valueOf(idWorker.nextId())) .type(PointEnums.TASK_POINT_TYPE_ADD.getCode()) .createUser(lotteryUser.getUserId()) - .taskPointId(null) + .taskPointId(TaskPointIdConstants.LOTTERY_RETURNS) .description(POINTS_WILL_BE_RETURNED) .userId(lotteryUser.getUserId()) .score(lottery.getPoint()) @@ -352,7 +356,7 @@ public class LotteryService { // 已参与抽奖,不能再次参与 LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId()); - if(byLotteryIdAndUserId != null) { + if (byLotteryIdAndUserId != null) { throw new BizException(ErrorConstants.ALREADY_PARTICIPATED); } @@ -399,6 +403,7 @@ public class LotteryService { .score(point) .type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode()) .userId(userLoginDto.getUserId()) + .taskPointId(TaskPointIdConstants.LOTTERY) .build(); rabbitTemplate.convertAndSend("draw", drawDTO); @@ -450,7 +455,9 @@ public class LotteryService { qLottery.createTime, qLottery.createUser, qLottery.createUserName, - qLottery.stopReason + qLottery.stopReason, + qLottery.price, + qLottery.publishTime )).from(qLottery) .where(booleanBuilder) .orderBy(qLottery.createTime.desc()) @@ -464,6 +471,7 @@ public class LotteryService { BooleanBuilder booleanBuilder = new BooleanBuilder(); QLottery qLottery = QLottery.lottery; checkCondition(booleanBuilder, qLottery, lotterySearchDto); + booleanBuilder.and(qLottery.status.in(new Integer[]{PointEnums.LOTTERY_STATUS_LOTTERY.getCode(), PointEnums.LOTTERY_STATUS_SIGN.getCode()})); // 创建分页对象 Pageable pageable = PageRequest.of(page - 1, size); List list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class, @@ -484,10 +492,12 @@ public class LotteryService { qLottery.description, qLottery.status, qLottery.createTime, - qLottery.stopReason + qLottery.stopReason, + qLottery.price, + qLottery.publishTime )).from(qLottery) .where(booleanBuilder) - .orderBy(qLottery.createTime.desc()) + .orderBy(qLottery.status.asc(), qLottery.publishTime.desc()) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .fetch(); @@ -572,14 +582,6 @@ public class LotteryService { } public PageResult findPageByLotteryId(Integer page, Integer size, String lotteryId) { -// Sort sort = new Sort(Direction.DESC, "createTime"); -// PageRequest pageRequest = PageRequest.of(page - 1, size, sort); -// -// Specification specification = getLotteryUserSpecification(lotteryId); -// Page lotteryUserPage = lotteryUserDao.findAll(specification, pageRequest); -// -// long totalElements = lotteryUserPage.getTotalElements(); -// return new PageResult<>(totalElements, lotteryUserPage.getContent()); QLotteryUser qLotteryUser = QLotteryUser.lotteryUser; QUserInfo qUserInfo = QUserInfo.userInfo; @@ -636,11 +638,44 @@ public class LotteryService { }; } - public Integer getLotteryUserResult(String lotteryId, String token) { + public LotteryUserAPPVO getLotteryUserResult(String lotteryId, String token) { + QLotteryUser qLotteryUser = QLotteryUser.lotteryUser; + QUserInfo qUserInfo = QUserInfo.userInfo; + QRegion qRegion = QRegion.region; + UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token); - LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId()); - return lotteryUser.getResult(); + BooleanBuilder booleanBuilder = new BooleanBuilder(); + booleanBuilder.and(qLotteryUser.lotteryId.eq(lotteryId)); + booleanBuilder.and(qLotteryUser.userId.eq(userLoginDto.getUserId())); + + // 头像字段拼接字符串 + StringExpression avatarWithPrefix = Expressions.stringTemplate("{0} || {1}", Constants.RESOURCE_PREFIX, qUserInfo.avatar); + + return jpaQueryFactory + .select(Projections.bean(LotteryUserAPPVO.class, + qLotteryUser.id.as("id"), + qLotteryUser.lotteryId.as("lotteryId"), + qLotteryUser.userId.as("userId"), + qLotteryUser.regionId.as("regionId"), + qLotteryUser.result.as("result"), + qLotteryUser.createTime.as("createTime"), + qLotteryUser.updateTime.as("updateTime"), + qLotteryUser.createUser.as("createUser"), + qLotteryUser.updateUser.as("updateUser"), + qUserInfo.nickName.as("nickName"), + avatarWithPrefix.as("avatar"), + qLotteryUser.popup.as("popup"), + qRegion.name.as("regionName"), + qRegion.code.as("regionCode") + )) + .from(qLotteryUser) + .leftJoin(qUserInfo) + .on(qLotteryUser.userId.eq(qUserInfo.id)) + .leftJoin(qRegion) + .on(qLotteryUser.regionId.eq(qRegion.id)) + .where(booleanBuilder) + .fetchOne(); } /** @@ -668,7 +703,9 @@ public class LotteryService { qLottery.description, qLottery.status, qLottery.createTime, - qLottery.stopReason + qLottery.stopReason, + qLottery.price, + qLottery.publishTime )) .from(qLottery) .where(qLottery.id.eq(lotteryId)) @@ -772,6 +809,13 @@ public class LotteryService { } + @Transactional(rollbackFor = Exception.class) + public void popup(String lotteryUserId) { + LotteryUser one = lotteryUserDao.getOne(lotteryUserId); + one.setPopup(PointEnums.ALREADY_POPUP.getCode()); + lotteryUserDao.save(one); + } + private void checkLotteryUserCondition(BooleanBuilder booleanBuilder, QLotteryUser qLotteryUser, String lotteryId, Integer userType) { booleanBuilder.and(qLotteryUser.lotteryId.eq(lotteryId)); if (Objects.nonNull(userType)) { diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java index 333be9c..28d154b 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java @@ -82,10 +82,10 @@ public class UserInfoService { private final UserPointLogDao userPointLogDao; public UserInfoService(UserInfoDao userInfoDao, IdWorker idWorker, RedisTemplate redisTemplate, - RabbitTemplate rabbitTemplate, BCryptPasswordEncoder encoder, HttpServletRequest request, - JwtUtil jwtUtil, UserRealNameDao userRealNameDao, UserBankDao userBankDao, - WithdrawDao withdrawDao, UserPointLogService userPointLogService, - UserPointLogDao userPointLogDao) { + RabbitTemplate rabbitTemplate, BCryptPasswordEncoder encoder, HttpServletRequest request, + JwtUtil jwtUtil, UserRealNameDao userRealNameDao, UserBankDao userBankDao, + WithdrawDao withdrawDao, UserPointLogService userPointLogService, + UserPointLogDao userPointLogDao) { this.userInfoDao = userInfoDao; this.idWorker = idWorker; this.redisTemplate = redisTemplate; @@ -233,8 +233,8 @@ public class UserInfoService { * 注册判断是否有邀请码 * * @param loginUserInfo 登录用户 - * @param loginReq 邀请码 - * @return token + * @param loginReq 邀请码 + * @return token */ public String loginOrRegisterWithInvite(UserInfo loginUserInfo, LoginReq loginReq) { UserInfo userInfo = userInfoDao.findByMobile(loginUserInfo.getMobile()); @@ -269,7 +269,7 @@ public class UserInfoService { userInfoDao.save(userInfo); String token = Constants.TOKEN_PREFIX + jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); - if(isNewUser) { + if (isNewUser) { // 只有新用户会获得积分 userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token); } @@ -279,7 +279,7 @@ public class UserInfoService { /** * 绑定邀请人 * - * @param userInfo 用户 + * @param userInfo 用户 * @param invitationCode 邀请码 */ @Transactional(rollbackFor = Exception.class) @@ -343,7 +343,7 @@ public class UserInfoService { String token = Constants.TOKEN_PREFIX + jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); - if(isNewUser) { + if (isNewUser) { // 只有新用户会获得积分 userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token); } @@ -383,7 +383,7 @@ public class UserInfoService { userInfoDao.save(userInfo); String token = Constants.TOKEN_PREFIX + jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); - if(isNewUser) { + if (isNewUser) { // 只有新用户会获得积分 userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token); } @@ -469,7 +469,7 @@ public class UserInfoService { userInfoDao.save(userInfo); String token = Constants.TOKEN_PREFIX + jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); - if(isNewUser) { + if (isNewUser) { // 只有新用户会获得积分 userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token); } @@ -804,9 +804,9 @@ public class UserInfoService { /** * 分页查询用户的提现记录 * - * @param token 登录token - * @param page 页码 - * @param size 每页数量 + * @param token 登录token + * @param page 页码 + * @param size 每页数量 * @return 列表 */ public PageResult withdrawPageResult(String token, Integer page, Integer size) { @@ -820,7 +820,7 @@ public class UserInfoService { long totalElements = withdrawPage.getTotalElements(); List content = withdrawPage.getContent(); for (Withdraw withdraw : content) { - if(withdraw.getState() != null) { + if (withdraw.getState() != null) { withdraw.setStateStr(Objects.requireNonNull(WithdrawStateEnum.getByCode(withdraw.getState())).getDesc()); } } @@ -843,21 +843,21 @@ public class UserInfoService { /** * 确定身份以及判断是否二维码过期等 * - * @param userId 用户id - * @param token 二维码uuid - * @param type 类型,1-扫码 2-确认 - * @return token + * @param userId 用户id + * @param token 二维码uuid + * @param type 类型,1-扫码 2-确认 + * @return token */ public void scan(String userId, String token, Integer type) throws Exception { Object o = redisTemplate.opsForValue().get(token); if (o == null) { throw new BizException("二维码失效!"); } - if(!String.valueOf(o).equals("0") && !String.valueOf(o).equals("1")) { + if (!String.valueOf(o).equals("0") && !String.valueOf(o).equals("1")) { throw new BizException("登录认证已完成"); } - if(type == 1) { + if (type == 1) { // 扫码 redisTemplate.opsForValue().set(token, 1, 60, TimeUnit.SECONDS); } else { @@ -884,7 +884,7 @@ public class UserInfoService { public String createInvitationCode(String token) { UserLoginDto user = jwtUtil.getUserLoginDto(token); UserInfo byId = userInfoDao.getById(user.getUserId()); - if(StringUtils.isNotBlank(byId.getInvitationCode())) { + if (StringUtils.isNotBlank(byId.getInvitationCode())) { return byId.getInvitationCode(); } @@ -907,4 +907,14 @@ public class UserInfoService { public List getExpireVipList() { return userInfoDao.getExpireVipList(); } + + /** + * 根据邀请码查询用户信息 + * + * @param invitationCode 邀请码 + * @return 用户信息 + */ + public UserInfo getUserInfoByInvitationCode(String invitationCode) { + return userInfoDao.findByInvitationCode(invitationCode); + } } diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java index c977537..8327a18 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserPointLogService.java @@ -241,6 +241,7 @@ public class UserPointLogService { .description(LOTTERY_POINTS_TYPE) .userId(drawDTO.getUserId()) .score(drawDTO.getScore()) + .taskPointId(drawDTO.getTaskPointId()) .build(); userPointLogDao.save(userPointLog); @@ -253,6 +254,7 @@ public class UserPointLogService { .userId(drawDTO.getUserId()) .createUser(drawDTO.getUserId()) .updateUser(drawDTO.getUserId()) + .popup(PointEnums.NOT_POPUP.getCode()) .build(); lotteryUserDao.save(lotteryUser); diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java index 256368f..6f53220 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryAPPVO.java @@ -9,6 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Transient; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -83,6 +84,12 @@ public class LotteryAPPVO implements Serializable { @ApiModelProperty(value = "停止原因") private String stopReason; + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; + + @ApiModelProperty(value = "发布时间") + private LocalDateTime publishTime; + @Transient @ApiModelProperty(value = "本人是否参与抽奖 1-已参加 2-未参加") private Integer isParticipate; @@ -117,6 +124,29 @@ public class LotteryAPPVO implements Serializable { this.stopReason = stopReason; } + public LotteryAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) { + this.id = id; + this.code = code; + this.title = title; + this.type = type; + this.num = num; + this.participant = participant; + this.point = point; + this.regionCode = regionCode; + this.regionName = regionName; + this.applyStartTime = applyStartTime; + this.applyEndTime = applyEndTime; + this.drawTime = drawTime; + this.way = way; + this.image = image; + this.description = description; + this.status = status; + this.createTime = createTime; + this.stopReason = stopReason; + this.price = price; + this.publishTime = publishTime; + } + public LotteryAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, Integer isParticipate) { this.id = id; this.code = code; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailAPPVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailAPPVO.java index c95afe9..3cb4f15 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailAPPVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailAPPVO.java @@ -7,6 +7,8 @@ import org.springframework.data.annotation.CreatedDate; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Transient; +import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -17,8 +19,9 @@ import java.util.List; * @create: 2024-08-10 10:48 **/ @Data -public class LotteryDetailAPPVO { +public class LotteryDetailAPPVO implements Serializable { + private static final long serialVersionUID = 3343138215330629195L; @ApiModelProperty(value = "主键") private String id; @@ -77,6 +80,12 @@ public class LotteryDetailAPPVO { @ApiModelProperty(value = "停止原因") private String stopReason; + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; + + @ApiModelProperty(value = "发布时间") + private LocalDateTime publishTime; + @ApiModelProperty(value = "抽奖区域列表") List lotteryRegionList; @@ -109,4 +118,25 @@ public class LotteryDetailAPPVO { this.createTime = createTime; this.stopReason = stopReason; } + + public LotteryDetailAPPVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) { + this.id = id; + this.code = code; + this.title = title; + this.type = type; + this.num = num; + this.participant = participant; + this.point = point; + this.applyStartTime = applyStartTime; + this.applyEndTime = applyEndTime; + this.drawTime = drawTime; + this.way = way; + this.image = image; + this.description = description; + this.status = status; + this.createTime = createTime; + this.stopReason = stopReason; + this.price = price; + this.publishTime = publishTime; + } } diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java index 01e533c..b09e3d7 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryDetailPCVO.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.luoo.user.pojo.LotteryRegion; import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; @@ -18,8 +20,9 @@ import org.springframework.format.annotation.DateTimeFormat; * @create: 2024-08-10 10:48 **/ @Data -public class LotteryDetailPCVO { +public class LotteryDetailPCVO implements Serializable { + private static final long serialVersionUID = 5759663954223098686L; @ApiModelProperty(value = "主键") private String id; @@ -78,6 +81,12 @@ public class LotteryDetailPCVO { @ApiModelProperty(value = "停止原因") private String stopReason; + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; + + @ApiModelProperty(value = "发布时间") + private LocalDateTime publishTime; + @ApiModelProperty(value = "抽奖区域列表") List lotteryRegionList; @@ -102,4 +111,25 @@ public class LotteryDetailPCVO { this.createTime = createTime; this.stopReason = stopReason; } + + public LotteryDetailPCVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String stopReason, BigDecimal price, LocalDateTime publishTime) { + this.id = id; + this.code = code; + this.title = title; + this.type = type; + this.num = num; + this.participant = participant; + this.point = point; + this.applyStartTime = applyStartTime; + this.applyEndTime = applyEndTime; + this.drawTime = drawTime; + this.way = way; + this.image = image; + this.description = description; + this.status = status; + this.createTime = createTime; + this.stopReason = stopReason; + this.price = price; + this.publishTime = publishTime; + } } diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryPCVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryPCVO.java index 9685fd0..ac859e0 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryPCVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryPCVO.java @@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Transient; import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; /** @@ -87,6 +88,12 @@ public class LotteryPCVO implements Serializable { @ApiModelProperty(value = "停止原因") private String stopReason; + @ApiModelProperty(value = "抽奖物品价格") + private BigDecimal price; + + @ApiModelProperty(value = "发布时间") + private LocalDateTime publishTime; + @Transient @ApiModelProperty(value = "参与人数") private Long participateNum; @@ -118,4 +125,29 @@ public class LotteryPCVO implements Serializable { this.createUserName = createUserName; this.stopReason = stopReason; } + + public LotteryPCVO(String id, String code, String title, Integer type, Integer num, Integer participant, Integer point, String regionCode, String regionName, LocalDateTime applyStartTime, LocalDateTime applyEndTime, LocalDateTime drawTime, Integer way, String image, String description, Integer status, LocalDateTime createTime, String createUser, String createUserName, String stopReason, BigDecimal price, LocalDateTime publishTime) { + this.id = id; + this.code = code; + this.title = title; + this.type = type; + this.num = num; + this.participant = participant; + this.point = point; + this.regionCode = regionCode; + this.regionName = regionName; + this.applyStartTime = applyStartTime; + this.applyEndTime = applyEndTime; + this.drawTime = drawTime; + this.way = way; + this.image = image; + this.description = description; + this.status = status; + this.createTime = createTime; + this.createUser = createUser; + this.createUserName = createUserName; + this.stopReason = stopReason; + this.price = price; + this.publishTime = publishTime; + } } \ No newline at end of file diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java index 401a08c..e616422 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryRegionDetailVO.java @@ -5,6 +5,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; + /** * @program: luoo_parent * @description: 抽奖区域 @@ -14,7 +16,10 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -public class LotteryRegionDetailVO { +public class LotteryRegionDetailVO implements Serializable { + + private static final long serialVersionUID = -9065811057137976240L; + @ApiModelProperty(value = "主键") private String id; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserAPPVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserAPPVO.java index e54aa77..6d9cb4e 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserAPPVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserAPPVO.java @@ -20,6 +20,8 @@ import java.time.LocalDateTime; @Data public class LotteryUserAPPVO implements Serializable { + private static final long serialVersionUID = -8573021684153967737L; + @ApiModelProperty(value = "id") private String id; @@ -59,6 +61,15 @@ public class LotteryUserAPPVO implements Serializable { @ApiModelProperty(value = "抽奖人头像") private String avatar; + @ApiModelProperty(value = "是否已弹出弹框 0-默认状态,未弹出 1-已弹出") + private Integer popup; + + @ApiModelProperty(value = "区域名称") + private String regionName; + + @ApiModelProperty(value = "区域编码") + private String regionCode; + public LotteryUserAPPVO() { } @@ -75,4 +86,21 @@ public class LotteryUserAPPVO implements Serializable { this.nickName = nickName; this.avatar = avatar; } + + public LotteryUserAPPVO(String id, String lotteryId, String userId, Integer regionId, Integer result, LocalDateTime createTime, LocalDateTime updateTime, String createUser, String updateUser, String nickName, String avatar, Integer popup, String regionName, String regionCode) { + this.id = id; + this.lotteryId = lotteryId; + this.userId = userId; + this.regionId = regionId; + this.result = result; + this.createTime = createTime; + this.updateTime = updateTime; + this.createUser = createUser; + this.updateUser = updateUser; + this.nickName = nickName; + this.avatar = avatar; + this.popup = popup; + this.regionName = regionName; + this.regionCode = regionCode; + } } diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserDetailPCVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserDetailPCVO.java index ef0d14e..fd39f4a 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserDetailPCVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/LotteryUserDetailPCVO.java @@ -15,6 +15,8 @@ import lombok.Data; @Data public class LotteryUserDetailPCVO implements Serializable { + private static final long serialVersionUID = 7496284381599533274L; + @ApiModelProperty(value = "抽奖id") private String lotteryId; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/UserInvitationLogVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/UserInvitationLogVO.java index 415ec88..f9f49c2 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/UserInvitationLogVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/UserInvitationLogVO.java @@ -14,6 +14,8 @@ import java.io.Serializable; @Data public class UserInvitationLogVO implements Serializable { + private static final long serialVersionUID = -5698797470129332684L; + @ApiModelProperty(value = "邀请人数") private Integer num; diff --git a/luoo_user/src/main/java/com/luoo/user/vo/point/UserPointLogVO.java b/luoo_user/src/main/java/com/luoo/user/vo/point/UserPointLogVO.java index 73237a0..5743e34 100644 --- a/luoo_user/src/main/java/com/luoo/user/vo/point/UserPointLogVO.java +++ b/luoo_user/src/main/java/com/luoo/user/vo/point/UserPointLogVO.java @@ -21,6 +21,8 @@ import java.time.LocalDateTime; @AllArgsConstructor public class UserPointLogVO implements Serializable { + private static final long serialVersionUID = 7386740510263145282L; + @ApiModelProperty(value = "主键") String id; @ApiModelProperty(value = "积分") diff --git a/luoo_user/src/main/java/com/luoo/user/vo/userinfo/UserInfoForInviteVO.java b/luoo_user/src/main/java/com/luoo/user/vo/userinfo/UserInfoForInviteVO.java new file mode 100644 index 0000000..be902cc --- /dev/null +++ b/luoo_user/src/main/java/com/luoo/user/vo/userinfo/UserInfoForInviteVO.java @@ -0,0 +1,31 @@ +package com.luoo.user.vo.userinfo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @program: luoo_parent + * @description: 邀请h5展示的对象信息 + * @author: yawei.huang + * @create: 2024-10-10 08:14 + **/ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class UserInfoForInviteVO implements Serializable { + + private static final long serialVersionUID = -3383281434773850094L; + + @ApiModelProperty(value = "用户昵称") + private String nickName; + + @ApiModelProperty(value = "用户头像") + private String avatar; + + @ApiModelProperty(value = "邀请码") + private String inviteCode; +} diff --git a/luoo_user/src/main/resources/sql/20240904.sql b/luoo_user/src/main/resources/sql/20240904.sql index 1e40810..89bc3be 100644 --- a/luoo_user/src/main/resources/sql/20240904.sql +++ b/luoo_user/src/main/resources/sql/20240904.sql @@ -18,4 +18,13 @@ create index tb_lottery_user_user_id_index alter table tb_lottery_user add constraint tb_lottery_user_pk - unique (lottery_id, user_id); \ No newline at end of file + unique (lottery_id, user_id); + +alter table tb_lottery + add publish_time datetime null comment '发布时间'; + +alter table tb_lottery + add price decimal null comment '抽奖物品价格'; + +alter table tb_lottery_user + add popup tinyint null comment '是否已弹出弹框 0-默认状态,未弹出 1-已弹出';