| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.api.domain.GetLotteryEventList; |
| | | import com.ruoyi.goods.api.domain.TLotteryEvent; |
| | | import com.ruoyi.goods.api.domain.TLotteryEventUser; |
| | | import com.ruoyi.goods.api.service.LotteryEventClient; |
| | | import com.ruoyi.member.domain.vo.AppIntegralRecordPageVo; |
| | | import com.ruoyi.member.domain.vo.AppIntegralTaskListVo; |
| | |
| | | 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(); |
| | | GetLotteryEventList getLotteryEventList = new GetLotteryEventList(); |
| | | getLotteryEventList.setActivityType(3); |
| | | getLotteryEventList.setUserId(SecurityUtils.getUserId()); |
| | | List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(data.size() > 0){ |
| | | TLotteryEvent tLotteryEvent = data.get(0); |
| | | map.put("lotteryEventId", tLotteryEvent.getId()); |
| | | map.put("name", tLotteryEvent.getActivityProfile()); |
| | | map.put("image", tLotteryEvent.getCoverImage()); |
| | | //将数据添加到普通抽奖列表中 |
| | | TLotteryEventUser lotteryEventUser = new TLotteryEventUser(); |
| | | lotteryEventUser.setId(IdUtils.simpleUUID()); |
| | | lotteryEventUser.setLotteryEventId(tLotteryEvent.getId()); |
| | | lotteryEventUser.setUser_id(SecurityUtils.getUserId()); |
| | | lotteryEventClient.addLotteryEventUser(lotteryEventUser); |
| | | } |
| | | return R.ok(map); |
| | | } |