| | |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberGiftRecord; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.model.AddIntegralRecordVo; |
| | | import com.ruoyi.system.api.model.AddOrderVo; |
| | | import com.ruoyi.system.api.service.RemoteCouponService; |
| | | import com.ruoyi.system.api.service.RemoteMemberService; |
| | | import com.ruoyi.system.api.service.RemoteOrderService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import com.ruoyi.system.api.service.*; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | userLotteryEvent.setNumber(lotteryEventPrize.getNumber()); |
| | | //中奖优惠券 |
| | | if (1 == lotteryEventPrize.getPrizeType()) { |
| | | remoteCouponService.addMemberCoupon(lotteryEventPrize.getObjectId(), lotteryEventPrize.getNumber(), userId); |
| | | AddMemberCoupon addMemberCoupon = new AddMemberCoupon(); |
| | | addMemberCoupon.setCouponId(lotteryEventPrize.getObjectId()); |
| | | addMemberCoupon.setNumber(lotteryEventPrize.getNumber()); |
| | | addMemberCoupon.setUserId(userId); |
| | | remoteCouponService.addMemberCoupon(addMemberCoupon); |
| | | } |
| | | //中奖积分 |
| | | if (4 == lotteryEventPrize.getPrizeType()) { |
| | | remoteMemberService.addIntegralRecord(lotteryEventPrize.getNumber(), userId, id); |
| | | AddIntegralRecordVo addIntegralRecordVo = new AddIntegralRecordVo(); |
| | | addIntegralRecordVo.setIntegral(lotteryEventPrize.getNumber()); |
| | | addIntegralRecordVo.setUserId(userId); |
| | | addIntegralRecordVo.setOrderId(id); |
| | | remoteMemberService.addIntegralRecord(addIntegralRecordVo); |
| | | } |
| | | userLotteryEvent.setCreateTime(LocalDateTime.now()); |
| | | userLotteryEventService.save(userLotteryEvent); |
| | |
| | | memberGiftRecord.setCouponNumber(userLotteryEvent.getNumber()); |
| | | memberGiftRecord.setCouponName(userLotteryEvent.getObjectName()); |
| | | memberGiftRecord.setVerifyStatus(2); |
| | | memberGiftRecord.setVerifyTime(new Date()); |
| | | break; |
| | | case 2: |
| | | memberGiftRecord.setGiftType(2); |
| | |
| | | memberGiftRecord.setGiftType(5); |
| | | memberGiftRecord.setIntegralNumber(userLotteryEvent.getNumber()); |
| | | memberGiftRecord.setVerifyStatus(2); |
| | | memberGiftRecord.setVerifyTime(new Date()); |
| | | break; |
| | | } |
| | | memberGiftRecord.setPrizeFrom(2); |