| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.dto.SendCouponDto; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.mapper.TAppUserVipDetailMapper; |
| | | |
| | | import com.ruoyi.account.service.TAppUserVipDetailService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.TVip; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TAppUserVipDetailServiceImpl extends ServiceImpl<TAppUserVipDetailMapper, TAppUserVipDetail> implements TAppUserVipDetailService { |
| | | @Resource |
| | | private VipClient vipClient; |
| | | |
| | | @Override |
| | | public void giveVipCoupun(Long appUserId, Integer vipId) { |
| | | //给这个用户发放对应vip的优惠卷以及充电次数加满 |
| | | //给这个用户发放对应vip的优惠卷以及充电次数加满 ,重置抵扣金额 |
| | | R<TVip> info = vipClient.getInfo(vipId); |
| | | TVip data = info.getData(); |
| | | String coupon = data.getCoupon(); |
| | | if (coupon!=null) { |
| | | List<SendCouponDto> sendList = JSON.parseArray(coupon).toJavaList(SendCouponDto.class); |
| | | for (SendCouponDto sendCouponDto : sendList) { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |