| | |
| | | return map; |
| | | }).collect(Collectors.toList()); |
| | | if (-1 == dto.getStepOrDown() || current == list.size() - 1) { |
| | | TUserLotteryEventQuestionsAnswers one = userLotteryEventQuestionsAnswersService.getOne(new QueryWrapper<TUserLotteryEventQuestionsAnswers>().eq("lottery_event_id", dto.getId()).eq("user_id", userId).orderByDesc("create_time").last(" limit 0, 1")); |
| | | TUserLotteryEventQuestionsAnswers one = userLotteryEventQuestionsAnswersService.getOne(new QueryWrapper<TUserLotteryEventQuestionsAnswers>().eq("lottery_event_question_id", lotteryEventQuestions.getId()).eq("user_id", userId).orderByDesc("create_time").last(" limit 0, 1")); |
| | | if (null != one) { |
| | | vo.setAnswer(lotteryEventQuestionsAnswersService.getById(one.getLotteryEventQuestionsAnswersId()).getAnswers()); |
| | | } |
| | |
| | | integralChangeDto.setIntegralType(1); |
| | | integralChangeDto.setUserId(userId); |
| | | Boolean complete = memberService.changeIntegral(integralChangeDto); |
| | | // if (complete) { |
| | | // throw new ServiceException(AppErrorConstant.DOUBLE_INTEGRAL_TASK); |
| | | // } |
| | | if (complete) { |
| | | throw new ServiceException(AppErrorConstant.DOUBLE_INTEGRAL_TASK); |
| | | } |
| | | //判断是否可以抽奖 |
| | | List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(3).getData(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | remoteActivityService.addActivityRecord(activityRecord); |
| | | //扣除redis库存 |
| | | redisService.setCacheObject(SecurityConstant.ACTIVITY_GOODS + "-" + activityId + "-" + goodsId, surpNum - buyNum); |
| | | appPlaceOrderVo.setLotteryDraw(false); |
| | | // 返回AppPlaceOrderVo对象 |
| | | List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData(); |
| | | if (data.size() > 0) { |
| | | BigDecimal finalOrderPayMoney = orderPayMoney; |
| | | List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList()); |
| | | if (collect.size() > 0) { |
| | | appPlaceOrderVo.setLotteryDraw(true); |
| | | appPlaceOrderVo.setLotteryEventId(collect.get(0).getId()); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("活动订单购买失败:"+e.getMessage()); |
| | | throw new ServiceException(e.getMessage()); |