puzhibing
3 天以前 e7a535db99f26ddd8a6333439728aeef5210cb52
修改bug
2个文件已修改
27 ■■■■ 已修改文件
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
@@ -63,12 +63,12 @@
    
    
    @ResponseBody
    @PostMapping("/getLotteryEvent/{id}")
    @PostMapping("/getLotteryEvent/{id}/{orderId}")
    @ApiOperation(value = "获取抽奖页详情【2.0】", tags = "抽奖活动")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path")
    })
    public R<LotteryEventVo> getLotteryEvent(@PathVariable("id") String id) {
    public R<LotteryEventVo> getLotteryEvent(@PathVariable("id") String id, @PathVariable("orderId") String orderId) {
        LotteryEventVo lotteryEvent = lotteryEventService.getLotteryEvent(id);
        TLotteryEvent event = lotteryEventService.getById(id);
        if (LocalDateTime.now().isBefore(event.getStartTime())) {
@@ -85,12 +85,12 @@
    
    
    @ResponseBody
    @PostMapping("/lotteryDraw/{id}")
    @PostMapping("/lotteryDraw/{id}/{orderId}")
    @ApiOperation(value = "抽奖操作【2.0】", tags = "抽奖活动", notes = "返回奖品ID")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path")
    })
    public R<TLotteryEventPrize> lotteryDraw(@PathVariable("id") String id) {
    public R<TLotteryEventPrize> lotteryDraw(@PathVariable("id") String id, @PathVariable("orderId") String orderId) {
        return lotteryEventService.lotteryDraw(id);
    }
    
@@ -122,12 +122,12 @@
    
    
    @ResponseBody
    @PostMapping("/getLotteryEventInfo/{id}")
    @PostMapping("/getLotteryEventInfo/{id}/{orderId}")
    @ApiOperation(value = "获取抽奖活动详情【2.0】", tags = "抽奖活动")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "抽奖活动id", required = true, dataType = "String", paramType = "path")
    })
    public R<LotteryEventInfoVo> getLotteryEventInfo(@PathVariable("id") String id){
    public R<LotteryEventInfoVo> getLotteryEventInfo(@PathVariable("id") String id, @PathVariable("orderId") String orderId){
        Long userId = SecurityUtils.getUserId();
        TLotteryEvent lotteryEvent = lotteryEventService.getById(id);
        LotteryEventInfoVo vo = new LotteryEventInfoVo();
@@ -209,12 +209,18 @@
                map.put("name", item.getAnswers());
                return map;
            }).collect(Collectors.toList());
            if (-1 == dto.getStepOrDown() || current == list.size() - 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());
                }
            }
//            if (-1 == dto.getStepOrDown() || current == list.size() - 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());
//                }
//            }
            vo.setOptions(options);
        }
        return R.ok(vo);
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -87,10 +87,6 @@
        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());
@@ -116,7 +112,6 @@
                return userLotteryEventVo;
            }).collect(Collectors.toList());
            vo.setYourPrizeList(collect);
        }
        //查询抽奖活动奖品
        List<TLotteryEventPrize> lotteryEventPrizeList = lotteryEventPrizeService.list(new QueryWrapper<TLotteryEventPrize>().eq("lottery_event_id", id));