huliguo
1 天以前 b646898adf3f2ad119dd9fd1c7c01d7f0742bf97
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -87,36 +87,31 @@
      vo.setId(lotteryEvent.getId());
      vo.setName(lotteryEvent.getName());
      vo.setActivityProfile(lotteryEvent.getActivityProfile());
      //订单抽奖,每次进去都是新的抽奖机会
      if(2 == lotteryEvent.getActivityType()){
         vo.setLaveTimes(lotteryEvent.getTimes());
      }else{
         List<TUserLotteryEvent> userLotteryEvents = userLotteryEventService.list(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId));
         vo.setLaveTimes(lotteryEvent.getTimes() - userLotteryEvents.size());
      List<TUserLotteryEvent> userLotteryEvents = userLotteryEventService.list(new QueryWrapper<TUserLotteryEvent>().eq("lottery_event_id", id).eq("user_id", userId));
      vo.setLaveTimes(lotteryEvent.getTimes() - userLotteryEvents.size());
         //构建我的奖品明细
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
         List<UserLotteryEventVo> collect = userLotteryEvents.stream().map(s -> {
            UserLotteryEventVo userLotteryEventVo = new UserLotteryEventVo();
            userLotteryEventVo.setName(s.getObjectName());
            userLotteryEventVo.setPrizeType(s.getPrizeType());
            userLotteryEventVo.setNumber(s.getNumber());
            if (Arrays.asList(2, 3).contains(s.getPrizeType())) {
               MemberGiftRecord memberGiftRecord = remoteMemberService.getVerifyPrizeByGiftId(s.getId()).getData();
               userLotteryEventVo.setVerifyCode("3-" + memberGiftRecord.getPrizeId());
               userLotteryEventVo.setIsVerify(1 == memberGiftRecord.getVerifyStatus() ? 0 : 1);
               userLotteryEventVo.setVerifyTime(null == memberGiftRecord.getVerifyTime() ? "" : sdf.format(memberGiftRecord.getVerifyTime()));
            }
            Member member = remoteMemberService.getMember(userId).getData();
            userLotteryEventVo.setVerifyShop("全部门店");
            if (null != member && null != member.getRelationShopId()) {
               Shop shop = remoteShopService.getShop(member.getRelationShopId()).getData();
               userLotteryEventVo.setVerifyShop(shop.getShopName());
            }
            return userLotteryEventVo;
         }).collect(Collectors.toList());
         vo.setYourPrizeList(collect);
      }
      //构建我的奖品明细
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
      List<UserLotteryEventVo> collect = userLotteryEvents.stream().map(s -> {
         UserLotteryEventVo userLotteryEventVo = new UserLotteryEventVo();
         userLotteryEventVo.setName(s.getObjectName());
         userLotteryEventVo.setPrizeType(s.getPrizeType());
         userLotteryEventVo.setNumber(s.getNumber());
         if (Arrays.asList(2, 3).contains(s.getPrizeType())) {
            MemberGiftRecord memberGiftRecord = remoteMemberService.getVerifyPrizeByGiftId(s.getId()).getData();
            userLotteryEventVo.setVerifyCode("3-" + memberGiftRecord.getPrizeId());
            userLotteryEventVo.setIsVerify(1 == memberGiftRecord.getVerifyStatus() ? 0 : 1);
            userLotteryEventVo.setVerifyTime(null == memberGiftRecord.getVerifyTime() ? "" : sdf.format(memberGiftRecord.getVerifyTime()));
         }
         Member member = remoteMemberService.getMember(userId).getData();
         userLotteryEventVo.setVerifyShop("全部门店");
         if (null != member && null != member.getRelationShopId()) {
            Shop shop = remoteShopService.getShop(member.getRelationShopId()).getData();
            userLotteryEventVo.setVerifyShop(shop.getShopName());
         }
         return userLotteryEventVo;
      }).collect(Collectors.toList());
      vo.setYourPrizeList(collect);
      //查询抽奖活动奖品
      List<TLotteryEventPrize> lotteryEventPrizeList = lotteryEventPrizeService.list(new QueryWrapper<TLotteryEventPrize>().eq("lottery_event_id", id));