| | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | // 最大抽奖次数
|
| | | private static int MAX_COUNT = 5;
|
| | |
|
| | | /**
|
| | | * 用户券列表查询
|
| | |
| | |
|
| | | List<DeviceLotteryRecord> list = deviceLotteryRecordService.listByPlatformAndDevice(platformType,
|
| | | device);
|
| | | if (list != null && list.size() == MAX_COUNT) { // 无抽奖机会
|
| | | if (list != null && list.size() == Constant.MAX_COUNT_LOTTERY_NEWBIES) { // 无抽奖机会
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "抽奖次数不足"));
|
| | | return;
|
| | | } else if (list != null && list.size() < MAX_COUNT) { // 拥有抽奖机会
|
| | | } else if (list != null && list.size() < Constant.MAX_COUNT_LOTTERY_NEWBIES) { // 拥有抽奖机会
|
| | |
|
| | | for (DeviceLotteryRecord deviceLotteryRecord : list) {
|
| | | Long systemCouponId = deviceLotteryRecord.getSystemCouponId();
|
| | |
| | | hasPrize = coupon.getType().name();
|
| | | }
|
| | |
|
| | | count = MAX_COUNT - 1 - list.size();
|
| | | count = Constant.MAX_COUNT_LOTTERY_NEWBIES - 1 - list.size();
|
| | |
|
| | | } else {
|
| | | count = MAX_COUNT - 1;
|
| | | count = Constant.MAX_COUNT_LOTTERY_NEWBIES - 1;
|
| | | }
|
| | |
|
| | | // 奖品
|
| | | prize = getLotteryPrize(MAX_COUNT, countPrize, list.size(), couponId);
|
| | | prize = getLotteryPrize(Constant.MAX_COUNT_LOTTERY_NEWBIES, countPrize, list.size(), couponId);
|
| | | // 抽中
|
| | | Long newCouponId = null;
|
| | | if (prize != null && prize.trim().length() > 0) {
|
| | |
| | | }
|
| | |
|
| | | // 奖品
|
| | | prize = getLotteryPrize(MAX_COUNT, list.size(), MAX_COUNT - lotteryNewbies, couponId);
|
| | | prize = getLotteryPrize(Constant.MAX_COUNT_LOTTERY_NEWBIES, list.size(), Constant.MAX_COUNT_LOTTERY_NEWBIES - lotteryNewbies, couponId);
|
| | | // 抽中
|
| | | if (prize != null && prize.trim().length() > 0) {
|
| | |
|