|
|
@ -28,27 +28,12 @@ import enums.PointEnums;
|
|
|
|
import enums.UserTypeEnum;
|
|
|
|
import enums.UserTypeEnum;
|
|
|
|
import enums.UserVipStatusEnum;
|
|
|
|
import enums.UserVipStatusEnum;
|
|
|
|
import exception.BizException;
|
|
|
|
import exception.BizException;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.Root;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
|
|
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
|
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@ -56,6 +41,17 @@ import util.IdWorker;
|
|
|
|
import util.JwtUtil;
|
|
|
|
import util.JwtUtil;
|
|
|
|
import util.RedisLockUtil;
|
|
|
|
import util.RedisLockUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.Root;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @program: luoo_parent
|
|
|
|
* @program: luoo_parent
|
|
|
|
* @description: 抽奖
|
|
|
|
* @description: 抽奖
|
|
|
@ -94,7 +90,9 @@ public class LotteryService {
|
|
|
|
|
|
|
|
|
|
|
|
private final UserinfoShippingAddressService userinfoShippingAddressService;
|
|
|
|
private final UserinfoShippingAddressService userinfoShippingAddressService;
|
|
|
|
|
|
|
|
|
|
|
|
public LotteryService(LotteryDao lotteryDao, JwtUtil jwtUtil, IdWorker idWorker, RedisLockUtil redisLockUtil, RegionService regionService, LotteryRegionDao lotteryRegionDao, UserInfoDao userInfoDao, RabbitTemplate rabbitTemplate, LotteryUserDao lotteryUserDao, DrawLotteryScheduler drawLotteryScheduler, JPAQueryFactory jpaQueryFactory, EnvConfig envConfig, UserinfoShippingAddressService userinfoShippingAddressService) {
|
|
|
|
private final UserPointLogService userPointLogService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public LotteryService(LotteryDao lotteryDao, JwtUtil jwtUtil, IdWorker idWorker, RedisLockUtil redisLockUtil, RegionService regionService, LotteryRegionDao lotteryRegionDao, UserInfoDao userInfoDao, RabbitTemplate rabbitTemplate, LotteryUserDao lotteryUserDao, DrawLotteryScheduler drawLotteryScheduler, JPAQueryFactory jpaQueryFactory, EnvConfig envConfig, UserinfoShippingAddressService userinfoShippingAddressService, UserPointLogService userPointLogService) {
|
|
|
|
this.lotteryDao = lotteryDao;
|
|
|
|
this.lotteryDao = lotteryDao;
|
|
|
|
this.jwtUtil = jwtUtil;
|
|
|
|
this.jwtUtil = jwtUtil;
|
|
|
|
this.idWorker = idWorker;
|
|
|
|
this.idWorker = idWorker;
|
|
|
@ -108,6 +106,7 @@ public class LotteryService {
|
|
|
|
this.jpaQueryFactory = jpaQueryFactory;
|
|
|
|
this.jpaQueryFactory = jpaQueryFactory;
|
|
|
|
this.envConfig = envConfig;
|
|
|
|
this.envConfig = envConfig;
|
|
|
|
this.userinfoShippingAddressService = userinfoShippingAddressService;
|
|
|
|
this.userinfoShippingAddressService = userinfoShippingAddressService;
|
|
|
|
|
|
|
|
this.userPointLogService = userPointLogService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -905,4 +904,13 @@ public class LotteryService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
public void avatarOld() {
|
|
|
|
|
|
|
|
List<UserInfo> oldUserListWhoIsAlreadyNewAvatar = userInfoDao.getOldUserListWhoIsAlreadyNewAvatar();
|
|
|
|
|
|
|
|
oldUserListWhoIsAlreadyNewAvatar.forEach(userInfo -> {
|
|
|
|
|
|
|
|
log.info("用户:{},积分增加:{}", userInfo.getNickName(), TaskPointIdConstants.MODIFY_AVATAR);
|
|
|
|
|
|
|
|
userPointLogService.addByTaskDailyAndUserId(TaskPointIdConstants.MODIFY_AVATAR, userInfo.getId());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|