huliguo
15 小时以前 c279b0695286bea0e915981f4b8dc52abd039dd0
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -353,7 +353,7 @@
                     answer.setId(IdUtils.simpleUUID());
                     answer.setLotteryEventId(finalLotteryEvent.getId());
                     answer.setLotteryEventQuestionsId(question.getId());
                     answer.setAnswer(answersDTO.getAnswer());
                     answer.setAnswers(answersDTO.getAnswers());
                     answer.setIsRight(answersDTO.getIsRight());
                     return answer;
                  }).collect(Collectors.toList());
@@ -366,9 +366,10 @@
   @Override
   public List<MgtLotteryEventPageVo> pageMgtLotteryEvent(Page<MgtLotteryEventPageVo> page, MgtLotteryEventPageDto dto) {
      Map<Long,Shop> map;
      List<Shop> shopList;
      if (dto.getCreateObject()!=null){
         //根据 条件-创建对象 模糊查找门店集合
         List<Shop> shopList=remoteShopService.getShopListByShopName(dto.getCreateObject());
         shopList=remoteShopService.getShopListByShopName(dto.getCreateObject());
         if (null != shopList && !shopList.isEmpty()) {
            List<Long> shopIds = shopList.stream().map(Shop::getShopId).collect(Collectors.toList());
            dto.setShopIds(shopIds);
@@ -384,6 +385,7 @@
      } else {
            map = new HashMap<>();
        }
        //获取分页信息
      List<MgtLotteryEventPageVo> voList = this.baseMapper.pageMgtLotteryEvent(page, dto);
      //填充创建对象
@@ -392,7 +394,15 @@
            x.setCreateObject("平台创建");
         }else {
            //线下抽奖,获取门店名称
            x.setCreateObject(map.get(Long.valueOf(x.getShopId())).getShopName());
            if(map.containsKey(Long.valueOf(x.getShopId()))){
               x.setCreateObject(map.get(Long.valueOf(x.getShopId())).getShopName());
            }else {
               Shop shop = remoteShopService.getShop(Long.valueOf(x.getShopId())).getData();
               if (null != shop){
                  x.setCreateObject(shop.getShopName());
               }
            }
         }
      });
@@ -407,12 +417,14 @@
      }
      MgtLotteryEventDetailVO vo = new MgtLotteryEventDetailVO();
      BeanUtils.copyProperties(lotteryEvent, vo);
      if (lotteryEvent.getActivityType()==6){
      if (lotteryEvent.getActivityType()==6) {
         //线下抽奖 取商户名称
         Shop data = remoteShopService.getShop(Long.valueOf(lotteryEvent.getShopId())).getData();
         if (null != data){
         if (null != data) {
            vo.setShopName(data.getShopName());
         }
      }
      if(lotteryEvent.getActivityType()==5){
         //题干数据
         List<LotteryEventQuestions> questionsList = lotteryEventQuestionsService.getBaseMapper().selectList(new LambdaQueryWrapper<LotteryEventQuestions>().eq(LotteryEventQuestions::getLotteryEventId, lotteryEvent.getId()));
@@ -422,7 +434,7 @@
            //答案选项数据
            List<LotteryEventQuestionsAnswers> answersList = lotteryEventQuestionsAnswersService.getBaseMapper().selectList(new LambdaQueryWrapper<LotteryEventQuestionsAnswers>()
                  .eq(LotteryEventQuestionsAnswers::getLotteryEventId, lotteryEvent.getId())
                  .eq(LotteryEventQuestionsAnswers::getLotteryEventQuestionsId, questionVO.getLotteryEventId()));
                  .eq(LotteryEventQuestionsAnswers::getLotteryEventQuestionsId, questionVO.getId()));
            questionVO.setAnswersVOList(answersList);
            return questionVO;
         }).collect(Collectors.toList());