| | |
| | | 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()); |
| | |
| | | @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); |
| | |
| | | } else { |
| | | map = new HashMap<>(); |
| | | } |
| | | |
| | | //获取分页信息 |
| | | List<MgtLotteryEventPageVo> voList = this.baseMapper.pageMgtLotteryEvent(page, dto); |
| | | //填充创建对象 |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }); |
| | |
| | | } |
| | | 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())); |
| | | |
| | |
| | | //答案选项数据 |
| | | 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()); |