| | |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.account.api.vo.PaymentUserCoupon; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.api.feignClient.PointSettingClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private GoodsClient goodsClient; |
| | | |
| | | @Resource |
| | | private PointSettingClient pointSettingClient; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | //如果是积分兑换,增加积分的历史记录 |
| | | if (data.getSendType()!=1){ |
| | | int point = data.getNeedPoint().intValue(); |
| | | Integer lavePoint = byId.getLavePoint(); |
| | | //扣除积分 |
| | | byId.setLavePoint(byId.getLavePoint() - point); |
| | | appUserService.updateById(byId); |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(4); |
| | | userPoint.setHistoricalPoint(byId.getLavePoint()); |
| | | userPoint.setVariablePoint(data.getNeedPoint().intValue()); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(byId.getLavePoint()); |
| | | userPoint.setAppUserId(userid); |
| | | userPoint.setObjectId(Long.valueOf(data.getId())); |
| | | userPointService.save(userPoint); |
| | | //扣除积分 |
| | | byId.setLavePoint(byId.getLavePoint() - userPoint.getVariablePoint()); |
| | | appUserService.updateById(byId); |
| | | } |
| | | //增加优惠券记录,根据时间类型设置开始结束时间 |
| | | UserCoupon userCoupon = new UserCoupon(); |