Commit 0950b7ac by 吕明尚

修改抽奖

parent b642fd7a
...@@ -73,9 +73,9 @@ public class LotteryRecordsLog extends BaseEntity { ...@@ -73,9 +73,9 @@ public class LotteryRecordsLog extends BaseEntity {
private String hitPrize; private String hitPrize;
/** /**
* 是否发放 1未发放,2 已发放 3 发放失败 * 是否发放 0:未发放,1:已发放
*/ */
@Excel(name = " 是否发放 1未发放,2 已发放 3 发放失败") @Excel(name = " 是否发放 0:未发放,1:已发放")
private Integer isSend; private Integer isSend;
/** /**
......
...@@ -134,7 +134,7 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame ...@@ -134,7 +134,7 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
} }
List<Prize> prizeList = prizeService.list(new LambdaQueryWrapper<Prize>().eq(Prize::getGameId, wheelGame.getId())); List<Prize> prizeList = prizeService.list(new LambdaQueryWrapper<Prize>().eq(Prize::getGameId, wheelGame.getId()));
Prize prize = luckDraw(prizeList, wheelGame.getId()); Prize prize = luckDraw(prizeList, user.getId());
LotteryRecordsLog log = new LotteryRecordsLog(); LotteryRecordsLog log = new LotteryRecordsLog();
log.setGameId(wheelGame.getId()); log.setGameId(wheelGame.getId());
...@@ -149,13 +149,10 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame ...@@ -149,13 +149,10 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
try { try {
switch (couponType) { switch (couponType) {
case COUPON: case COUPON:
SConsumerCoupon sConsumerCoupon = new SConsumerCoupon();
sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon.setCouponId(prize.getCouponId());
SConsumerCoupon give = sConsumerCouponService.give(user.getId(), prize.getCouponId(), 30); SConsumerCoupon give = sConsumerCouponService.give(user.getId(), prize.getCouponId(), 30);
log.setIsHit(YesNoEnum.yes.getIndex()); log.setIsHit(YesNoEnum.yes.getIndex());
log.setIsSend(YesNoEnum.yes.getIndex()); log.setIsSend(YesNoEnum.yes.getIndex());
log.setHitPrize(prize.getPrizeName() + ":" + give.getName()); log.setHitPrize(PrizeTypeEnum.COUPON.getName());
log.setSendMsg(PrizeTypeEnum.COUPON.getName() + ":" + give.getName() + "以发放"); log.setSendMsg(PrizeTypeEnum.COUPON.getName() + ":" + give.getName() + "以发放");
lotteryRecordsLogService.save(log); lotteryRecordsLogService.save(log);
prize.setCurrentNum(prize.getCurrentNum() + YesNoEnum.yes.getIndex()); prize.setCurrentNum(prize.getCurrentNum() + YesNoEnum.yes.getIndex());
...@@ -166,7 +163,7 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame ...@@ -166,7 +163,7 @@ public class WheelGameServiceImpl extends ServiceImpl<WheelGameMapper, WheelGame
case GOODS: case GOODS:
log.setIsHit(YesNoEnum.yes.getIndex()); log.setIsHit(YesNoEnum.yes.getIndex());
log.setIsSend(YesNoEnum.yes.getIndex()); log.setIsSend(YesNoEnum.yes.getIndex());
log.setHitPrize(PrizeTypeEnum.GOODS.getName() + ":" + prize.getPrizeName()); log.setHitPrize(PrizeTypeEnum.GOODS.getName());
log.setSendMsg(PrizeTypeEnum.GOODS.getName() + ":" + prize.getPrizeName() + "以发放"); log.setSendMsg(PrizeTypeEnum.GOODS.getName() + ":" + prize.getPrizeName() + "以发放");
lotteryRecordsLogService.save(log); lotteryRecordsLogService.save(log);
prize.setCurrentNum(prize.getCurrentNum() + YesNoEnum.yes.getIndex()); prize.setCurrentNum(prize.getCurrentNum() + YesNoEnum.yes.getIndex());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment