Merge remote-tracking branch 'origin/release-2024-04-25' into release-2024-04-25

release-2024-04-25
huangyawei 1 month ago
commit aa6dd2f391

@ -38,6 +38,7 @@ public class ErrorConstants {
public final static String USER_ALREADY_EXISTS_ARTIST = "用户已发起过音乐人审核"; public final static String USER_ALREADY_EXISTS_ARTIST = "用户已发起过音乐人审核";
public final static String USER_STATUS_ERROR = "用户状态错误"; public final static String USER_STATUS_ERROR = "用户状态错误";
public final static String USER_NAME_ALREADY_EXISTS = "用户名已存在"; 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 = "会员码不存在"; public static final String MEMBERSHIP_CODE_NOT_EXISTS = "会员码不存在";

@ -48,4 +48,10 @@ public class TaskPointIdConstants {
public static final String INVITE_USER_20 = "22"; public static final String INVITE_USER_20 = "22";
// 积分抽奖
public static final String LOTTERY = "1000";
// 积分抽奖返还
public static final String LOTTERY_RETURNS = "1001";
} }

@ -41,6 +41,9 @@ public enum PointEnums {
PARTICIPATED(1, "已参加"), PARTICIPATED(1, "已参加"),
NOT_PARTICIPATED(2, "未参加"), NOT_PARTICIPATED(2, "未参加"),
ALREADY_POPUP(1, "已弹出"),
NOT_POPUP(0, "未弹出"),
; ;
private final Integer code; private final Integer code;
private final String description; private final String description;

@ -18,8 +18,10 @@ import com.luoo.user.pojo.*;
import com.luoo.user.service.*; import com.luoo.user.service.*;
import com.luoo.user.util.EmojiConverterUtil; import com.luoo.user.util.EmojiConverterUtil;
import com.luoo.user.util.IpUtil; import com.luoo.user.util.IpUtil;
import com.luoo.user.vo.userinfo.UserInfoForInviteVO;
import com.luoo.user.vo.userinfo.UserinfoShippingAddressAppVO; import com.luoo.user.vo.userinfo.UserinfoShippingAddressAppVO;
import constants.Constants; import constants.Constants;
import constants.ErrorConstants;
import constants.TaskPointIdConstants; import constants.TaskPointIdConstants;
import controller.BaseController; import controller.BaseController;
import dto.UserLoginDto; import dto.UserLoginDto;
@ -132,6 +134,17 @@ public class MyController extends BaseController {
return Result.success(userRespDTO); return Result.success(userRespDTO);
} }
@ApiOperation(value = "1.1 根据邀请码获取用户部分信息", notes = "无认证")
@GetMapping("/userInfo/invite")
public Result<UserInfoForInviteVO> 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 = "游客无法编辑个人信息") @ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息")
@PutMapping("/userInfo") @PutMapping("/userInfo")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)

@ -385,7 +385,7 @@ public class PointController {
@ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP") @ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP")
@GetMapping("/lottery/result/{id}") @GetMapping("/lottery/result/{id}")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
public Result<Integer> findLotteryResult( public Result<LotteryUserAPPVO> findLotteryResult(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) { @ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
return Result.success(lotteryService.getLotteryUserResult(id, token)); return Result.success(lotteryService.getLotteryUserResult(id, token));
@ -426,6 +426,15 @@ public class PointController {
return Result.success(lotteryService.getLotteryDetailAPPVO(id)); return Result.success(lotteryService.getLotteryDetailAPPVO(id));
} }
@ApiOperation(value = "3.15. 记录用户中奖信息已弹出", notes = "APP")
@PostMapping("/app/popup")
@GlobalInterceptor(checkAppUserLogin = true)
public Result<Void> 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();
}
} }

@ -14,6 +14,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -82,4 +83,7 @@ public class LotteryAddDto implements Serializable {
@ApiModelProperty(value = "抽奖地区列表") @ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList; private List<LotteryRegion> lotteryRegionList;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
} }

@ -12,6 +12,7 @@ import javax.persistence.Transient;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -85,4 +86,7 @@ public class LotteryUpdateDto implements Serializable {
@ApiModelProperty(value = "抽奖地区列表") @ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList; private List<LotteryRegion> lotteryRegionList;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
} }

@ -26,7 +26,11 @@ public class drawListener {
@RabbitHandler @RabbitHandler
public void executeDraw(DrawDTO drawDTO) { public void executeDraw(DrawDTO drawDTO) {
log.info("drawDTO:{}", drawDTO); log.info("drawDTO:{}", drawDTO);
userPointLogService.executeDraw(drawDTO); try {
userPointLogService.executeDraw(drawDTO);
} catch (Exception e) {
e.printStackTrace();
}
} }
} }

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
@ -149,6 +150,16 @@ public class Lottery implements Serializable {
@ApiModelProperty(value = "停止原因") @ApiModelProperty(value = "停止原因")
private String stopReason; 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 @Transient
@ApiModelProperty(value = "抽奖地区列表") @ApiModelProperty(value = "抽奖地区列表")
private List<LotteryRegion> lotteryRegionList; private List<LotteryRegion> lotteryRegionList;

@ -85,4 +85,8 @@ public class LotteryUser implements Serializable {
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private String updateUser; private String updateUser;
@Column(name = "popup")
@ApiModelProperty(value = "是否已弹出弹框 0-默认状态,未弹出 1-已弹出")
private Integer popup;
} }

@ -19,6 +19,7 @@ import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import constants.Constants; import constants.Constants;
import constants.ErrorConstants; import constants.ErrorConstants;
import constants.TaskPointIdConstants;
import dto.UserLoginDto; import dto.UserLoginDto;
import enums.PointEnums; import enums.PointEnums;
import enums.UserTypeEnum; import enums.UserTypeEnum;
@ -26,6 +27,7 @@ import enums.UserVipStatusEnum;
import exception.BizException; import exception.BizException;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -266,6 +268,8 @@ public class LotteryService {
if (lottery.getDrawTime() == null) { if (lottery.getDrawTime() == null) {
throw new BizException(ErrorConstants.DRAW_TIME_IS_REQUIRED); throw new BizException(ErrorConstants.DRAW_TIME_IS_REQUIRED);
} }
// 发布时间
lottery.setPublishTime(LocalDateTime.now());
lottery.setUpdateUser(userLoginDto.getUserId()); lottery.setUpdateUser(userLoginDto.getUserId());
lottery.setUpdateUserName(userLoginDto.getNickName()); lottery.setUpdateUserName(userLoginDto.getNickName());
@ -306,7 +310,7 @@ public class LotteryService {
.id(String.valueOf(idWorker.nextId())) .id(String.valueOf(idWorker.nextId()))
.type(PointEnums.TASK_POINT_TYPE_ADD.getCode()) .type(PointEnums.TASK_POINT_TYPE_ADD.getCode())
.createUser(lotteryUser.getUserId()) .createUser(lotteryUser.getUserId())
.taskPointId(null) .taskPointId(TaskPointIdConstants.LOTTERY_RETURNS)
.description(POINTS_WILL_BE_RETURNED) .description(POINTS_WILL_BE_RETURNED)
.userId(lotteryUser.getUserId()) .userId(lotteryUser.getUserId())
.score(lottery.getPoint()) .score(lottery.getPoint())
@ -352,7 +356,7 @@ public class LotteryService {
// 已参与抽奖,不能再次参与 // 已参与抽奖,不能再次参与
LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId()); LotteryUser byLotteryIdAndUserId = lotteryUserDao.findByLotteryIdAndUserId(id, userLoginDto.getUserId());
if(byLotteryIdAndUserId != null) { if (byLotteryIdAndUserId != null) {
throw new BizException(ErrorConstants.ALREADY_PARTICIPATED); throw new BizException(ErrorConstants.ALREADY_PARTICIPATED);
} }
@ -399,6 +403,7 @@ public class LotteryService {
.score(point) .score(point)
.type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode()) .type(PointEnums.TASK_POINT_TYPE_REDUCE.getCode())
.userId(userLoginDto.getUserId()) .userId(userLoginDto.getUserId())
.taskPointId(TaskPointIdConstants.LOTTERY)
.build(); .build();
rabbitTemplate.convertAndSend("draw", drawDTO); rabbitTemplate.convertAndSend("draw", drawDTO);
@ -450,7 +455,9 @@ public class LotteryService {
qLottery.createTime, qLottery.createTime,
qLottery.createUser, qLottery.createUser,
qLottery.createUserName, qLottery.createUserName,
qLottery.stopReason qLottery.stopReason,
qLottery.price,
qLottery.publishTime
)).from(qLottery) )).from(qLottery)
.where(booleanBuilder) .where(booleanBuilder)
.orderBy(qLottery.createTime.desc()) .orderBy(qLottery.createTime.desc())
@ -464,6 +471,7 @@ public class LotteryService {
BooleanBuilder booleanBuilder = new BooleanBuilder(); BooleanBuilder booleanBuilder = new BooleanBuilder();
QLottery qLottery = QLottery.lottery; QLottery qLottery = QLottery.lottery;
checkCondition(booleanBuilder, qLottery, lotterySearchDto); 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); Pageable pageable = PageRequest.of(page - 1, size);
List<LotteryAPPVO> list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class, List<LotteryAPPVO> list = jpaQueryFactory.select(Projections.constructor(LotteryAPPVO.class,
@ -484,10 +492,12 @@ public class LotteryService {
qLottery.description, qLottery.description,
qLottery.status, qLottery.status,
qLottery.createTime, qLottery.createTime,
qLottery.stopReason qLottery.stopReason,
qLottery.price,
qLottery.publishTime
)).from(qLottery) )).from(qLottery)
.where(booleanBuilder) .where(booleanBuilder)
.orderBy(qLottery.createTime.desc()) .orderBy(qLottery.status.asc(), qLottery.publishTime.desc())
.offset(pageable.getOffset()) .offset(pageable.getOffset())
.limit(pageable.getPageSize()) .limit(pageable.getPageSize())
.fetch(); .fetch();
@ -572,14 +582,6 @@ public class LotteryService {
} }
public PageResult<LotteryUserAPPVO> findPageByLotteryId(Integer page, Integer size, String lotteryId) { public PageResult<LotteryUserAPPVO> findPageByLotteryId(Integer page, Integer size, String lotteryId) {
// Sort sort = new Sort(Direction.DESC, "createTime");
// PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
//
// Specification<LotteryUser> specification = getLotteryUserSpecification(lotteryId);
// Page<LotteryUser> lotteryUserPage = lotteryUserDao.findAll(specification, pageRequest);
//
// long totalElements = lotteryUserPage.getTotalElements();
// return new PageResult<>(totalElements, lotteryUserPage.getContent());
QLotteryUser qLotteryUser = QLotteryUser.lotteryUser; QLotteryUser qLotteryUser = QLotteryUser.lotteryUser;
QUserInfo qUserInfo = QUserInfo.userInfo; 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); 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.description,
qLottery.status, qLottery.status,
qLottery.createTime, qLottery.createTime,
qLottery.stopReason qLottery.stopReason,
qLottery.price,
qLottery.publishTime
)) ))
.from(qLottery) .from(qLottery)
.where(qLottery.id.eq(lotteryId)) .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) { private void checkLotteryUserCondition(BooleanBuilder booleanBuilder, QLotteryUser qLotteryUser, String lotteryId, Integer userType) {
booleanBuilder.and(qLotteryUser.lotteryId.eq(lotteryId)); booleanBuilder.and(qLotteryUser.lotteryId.eq(lotteryId));
if (Objects.nonNull(userType)) { if (Objects.nonNull(userType)) {

@ -82,10 +82,10 @@ public class UserInfoService {
private final UserPointLogDao userPointLogDao; private final UserPointLogDao userPointLogDao;
public UserInfoService(UserInfoDao userInfoDao, IdWorker idWorker, RedisTemplate redisTemplate, public UserInfoService(UserInfoDao userInfoDao, IdWorker idWorker, RedisTemplate redisTemplate,
RabbitTemplate rabbitTemplate, BCryptPasswordEncoder encoder, HttpServletRequest request, RabbitTemplate rabbitTemplate, BCryptPasswordEncoder encoder, HttpServletRequest request,
JwtUtil jwtUtil, UserRealNameDao userRealNameDao, UserBankDao userBankDao, JwtUtil jwtUtil, UserRealNameDao userRealNameDao, UserBankDao userBankDao,
WithdrawDao withdrawDao, UserPointLogService userPointLogService, WithdrawDao withdrawDao, UserPointLogService userPointLogService,
UserPointLogDao userPointLogDao) { UserPointLogDao userPointLogDao) {
this.userInfoDao = userInfoDao; this.userInfoDao = userInfoDao;
this.idWorker = idWorker; this.idWorker = idWorker;
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
@ -233,8 +233,8 @@ public class UserInfoService {
* *
* *
* @param loginUserInfo * @param loginUserInfo
* @param loginReq * @param loginReq
* @return token * @return token
*/ */
public String loginOrRegisterWithInvite(UserInfo loginUserInfo, LoginReq loginReq) { public String loginOrRegisterWithInvite(UserInfo loginUserInfo, LoginReq loginReq) {
UserInfo userInfo = userInfoDao.findByMobile(loginUserInfo.getMobile()); UserInfo userInfo = userInfoDao.findByMobile(loginUserInfo.getMobile());
@ -269,7 +269,7 @@ public class UserInfoService {
userInfoDao.save(userInfo); userInfoDao.save(userInfo);
String token = Constants.TOKEN_PREFIX String token = Constants.TOKEN_PREFIX
+ jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); + 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); userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token);
} }
@ -279,7 +279,7 @@ public class UserInfoService {
/** /**
* *
* *
* @param userInfo * @param userInfo
* @param invitationCode * @param invitationCode
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -343,7 +343,7 @@ public class UserInfoService {
String token = Constants.TOKEN_PREFIX String token = Constants.TOKEN_PREFIX
+ jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); + 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); userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token);
} }
@ -383,7 +383,7 @@ public class UserInfoService {
userInfoDao.save(userInfo); userInfoDao.save(userInfo);
String token = Constants.TOKEN_PREFIX String token = Constants.TOKEN_PREFIX
+ jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); + 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); userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token);
} }
@ -469,7 +469,7 @@ public class UserInfoService {
userInfoDao.save(userInfo); userInfoDao.save(userInfo);
String token = Constants.TOKEN_PREFIX String token = Constants.TOKEN_PREFIX
+ jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); + 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); userPointLogService.addByTaskNew(TaskPointIdConstants.NEW_USER_WELCOME_AWARD, token);
} }
@ -804,9 +804,9 @@ public class UserInfoService {
/** /**
* *
* *
* @param token token * @param token token
* @param page * @param page
* @param size * @param size
* @return * @return
*/ */
public PageResult<Withdraw> withdrawPageResult(String token, Integer page, Integer size) { public PageResult<Withdraw> withdrawPageResult(String token, Integer page, Integer size) {
@ -820,7 +820,7 @@ public class UserInfoService {
long totalElements = withdrawPage.getTotalElements(); long totalElements = withdrawPage.getTotalElements();
List<Withdraw> content = withdrawPage.getContent(); List<Withdraw> content = withdrawPage.getContent();
for (Withdraw withdraw : content) { for (Withdraw withdraw : content) {
if(withdraw.getState() != null) { if (withdraw.getState() != null) {
withdraw.setStateStr(Objects.requireNonNull(WithdrawStateEnum.getByCode(withdraw.getState())).getDesc()); withdraw.setStateStr(Objects.requireNonNull(WithdrawStateEnum.getByCode(withdraw.getState())).getDesc());
} }
} }
@ -843,21 +843,21 @@ public class UserInfoService {
/** /**
* *
* *
* @param userId id * @param userId id
* @param token uuid * @param token uuid
* @param type 1- 2- * @param type 1- 2-
* @return token * @return token
*/ */
public void scan(String userId, String token, Integer type) throws Exception { public void scan(String userId, String token, Integer type) throws Exception {
Object o = redisTemplate.opsForValue().get(token); Object o = redisTemplate.opsForValue().get(token);
if (o == null) { if (o == null) {
throw new BizException("二维码失效!"); 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("登录认证已完成"); throw new BizException("登录认证已完成");
} }
if(type == 1) { if (type == 1) {
// 扫码 // 扫码
redisTemplate.opsForValue().set(token, 1, 60, TimeUnit.SECONDS); redisTemplate.opsForValue().set(token, 1, 60, TimeUnit.SECONDS);
} else { } else {
@ -884,7 +884,7 @@ public class UserInfoService {
public String createInvitationCode(String token) { public String createInvitationCode(String token) {
UserLoginDto user = jwtUtil.getUserLoginDto(token); UserLoginDto user = jwtUtil.getUserLoginDto(token);
UserInfo byId = userInfoDao.getById(user.getUserId()); UserInfo byId = userInfoDao.getById(user.getUserId());
if(StringUtils.isNotBlank(byId.getInvitationCode())) { if (StringUtils.isNotBlank(byId.getInvitationCode())) {
return byId.getInvitationCode(); return byId.getInvitationCode();
} }
@ -907,4 +907,14 @@ public class UserInfoService {
public List<UserInfo> getExpireVipList() { public List<UserInfo> getExpireVipList() {
return userInfoDao.getExpireVipList(); return userInfoDao.getExpireVipList();
} }
/**
*
*
* @param invitationCode
* @return
*/
public UserInfo getUserInfoByInvitationCode(String invitationCode) {
return userInfoDao.findByInvitationCode(invitationCode);
}
} }

@ -241,6 +241,7 @@ public class UserPointLogService {
.description(LOTTERY_POINTS_TYPE) .description(LOTTERY_POINTS_TYPE)
.userId(drawDTO.getUserId()) .userId(drawDTO.getUserId())
.score(drawDTO.getScore()) .score(drawDTO.getScore())
.taskPointId(drawDTO.getTaskPointId())
.build(); .build();
userPointLogDao.save(userPointLog); userPointLogDao.save(userPointLog);
@ -253,6 +254,7 @@ public class UserPointLogService {
.userId(drawDTO.getUserId()) .userId(drawDTO.getUserId())
.createUser(drawDTO.getUserId()) .createUser(drawDTO.getUserId())
.updateUser(drawDTO.getUserId()) .updateUser(drawDTO.getUserId())
.popup(PointEnums.NOT_POPUP.getCode())
.build(); .build();
lotteryUserDao.save(lotteryUser); lotteryUserDao.save(lotteryUser);

@ -9,6 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -83,6 +84,12 @@ public class LotteryAPPVO implements Serializable {
@ApiModelProperty(value = "停止原因") @ApiModelProperty(value = "停止原因")
private String stopReason; private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@Transient @Transient
@ApiModelProperty(value = "本人是否参与抽奖 1-已参加 2-未参加") @ApiModelProperty(value = "本人是否参与抽奖 1-已参加 2-未参加")
private Integer isParticipate; private Integer isParticipate;
@ -117,6 +124,29 @@ public class LotteryAPPVO implements Serializable {
this.stopReason = stopReason; 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) { 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.id = id;
this.code = code; this.code = code;

@ -7,6 +7,8 @@ import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -17,8 +19,9 @@ import java.util.List;
* @create: 2024-08-10 10:48 * @create: 2024-08-10 10:48
**/ **/
@Data @Data
public class LotteryDetailAPPVO { public class LotteryDetailAPPVO implements Serializable {
private static final long serialVersionUID = 3343138215330629195L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private String id; private String id;
@ -77,6 +80,12 @@ public class LotteryDetailAPPVO {
@ApiModelProperty(value = "停止原因") @ApiModelProperty(value = "停止原因")
private String stopReason; private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@ApiModelProperty(value = "抽奖区域列表") @ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegionDetailVO> lotteryRegionList; List<LotteryRegionDetailVO> lotteryRegionList;
@ -109,4 +118,25 @@ public class LotteryDetailAPPVO {
this.createTime = createTime; this.createTime = createTime;
this.stopReason = stopReason; 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;
}
} }

@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.luoo.user.pojo.LotteryRegion; import com.luoo.user.pojo.LotteryRegion;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -18,8 +20,9 @@ import org.springframework.format.annotation.DateTimeFormat;
* @create: 2024-08-10 10:48 * @create: 2024-08-10 10:48
**/ **/
@Data @Data
public class LotteryDetailPCVO { public class LotteryDetailPCVO implements Serializable {
private static final long serialVersionUID = 5759663954223098686L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private String id; private String id;
@ -78,6 +81,12 @@ public class LotteryDetailPCVO {
@ApiModelProperty(value = "停止原因") @ApiModelProperty(value = "停止原因")
private String stopReason; private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@ApiModelProperty(value = "抽奖区域列表") @ApiModelProperty(value = "抽奖区域列表")
List<LotteryRegionDetailVO> lotteryRegionList; List<LotteryRegionDetailVO> lotteryRegionList;
@ -102,4 +111,25 @@ public class LotteryDetailPCVO {
this.createTime = createTime; this.createTime = createTime;
this.stopReason = stopReason; 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;
}
} }

@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Transient; import javax.persistence.Transient;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@ -87,6 +88,12 @@ public class LotteryPCVO implements Serializable {
@ApiModelProperty(value = "停止原因") @ApiModelProperty(value = "停止原因")
private String stopReason; private String stopReason;
@ApiModelProperty(value = "抽奖物品价格")
private BigDecimal price;
@ApiModelProperty(value = "发布时间")
private LocalDateTime publishTime;
@Transient @Transient
@ApiModelProperty(value = "参与人数") @ApiModelProperty(value = "参与人数")
private Long participateNum; private Long participateNum;
@ -118,4 +125,29 @@ public class LotteryPCVO implements Serializable {
this.createUserName = createUserName; this.createUserName = createUserName;
this.stopReason = stopReason; 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;
}
} }

@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable;
/** /**
* @program: luoo_parent * @program: luoo_parent
* @description: * @description:
@ -14,7 +16,10 @@ import lombok.NoArgsConstructor;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class LotteryRegionDetailVO { public class LotteryRegionDetailVO implements Serializable {
private static final long serialVersionUID = -9065811057137976240L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private String id; private String id;

@ -20,6 +20,8 @@ import java.time.LocalDateTime;
@Data @Data
public class LotteryUserAPPVO implements Serializable { public class LotteryUserAPPVO implements Serializable {
private static final long serialVersionUID = -8573021684153967737L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; private String id;
@ -59,6 +61,15 @@ public class LotteryUserAPPVO implements Serializable {
@ApiModelProperty(value = "抽奖人头像") @ApiModelProperty(value = "抽奖人头像")
private String avatar; private String avatar;
@ApiModelProperty(value = "是否已弹出弹框 0-默认状态,未弹出 1-已弹出")
private Integer popup;
@ApiModelProperty(value = "区域名称")
private String regionName;
@ApiModelProperty(value = "区域编码")
private String regionCode;
public LotteryUserAPPVO() { public LotteryUserAPPVO() {
} }
@ -75,4 +86,21 @@ public class LotteryUserAPPVO implements Serializable {
this.nickName = nickName; this.nickName = nickName;
this.avatar = avatar; 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;
}
} }

@ -15,6 +15,8 @@ import lombok.Data;
@Data @Data
public class LotteryUserDetailPCVO implements Serializable { public class LotteryUserDetailPCVO implements Serializable {
private static final long serialVersionUID = 7496284381599533274L;
@ApiModelProperty(value = "抽奖id") @ApiModelProperty(value = "抽奖id")
private String lotteryId; private String lotteryId;

@ -14,6 +14,8 @@ import java.io.Serializable;
@Data @Data
public class UserInvitationLogVO implements Serializable { public class UserInvitationLogVO implements Serializable {
private static final long serialVersionUID = -5698797470129332684L;
@ApiModelProperty(value = "邀请人数") @ApiModelProperty(value = "邀请人数")
private Integer num; private Integer num;

@ -21,6 +21,8 @@ import java.time.LocalDateTime;
@AllArgsConstructor @AllArgsConstructor
public class UserPointLogVO implements Serializable { public class UserPointLogVO implements Serializable {
private static final long serialVersionUID = 7386740510263145282L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
String id; String id;
@ApiModelProperty(value = "积分") @ApiModelProperty(value = "积分")

@ -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;
}

@ -18,4 +18,13 @@ create index tb_lottery_user_user_id_index
alter table tb_lottery_user alter table tb_lottery_user
add constraint tb_lottery_user_pk add constraint tb_lottery_user_pk
unique (lottery_id, user_id); 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-已弹出';

Loading…
Cancel
Save