|
|
@@ -3,6 +3,7 @@ package org.springblade.gateway.point_gateway.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import io.jsonwebtoken.lang.Assert;
|
|
|
import org.springblade.common.enums.AppConstant;
|
|
|
+import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.gateway.point_gateway.enums.PointTypeEnum;
|
|
|
import org.springblade.gateway.point_gateway.excetion.PointException;
|
|
|
import org.springblade.gateway.point_gateway.service.PointExchangeService;
|
|
|
@@ -40,14 +41,14 @@ public class PointExchangeServiceImpl implements PointExchangeService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean exchange(Integer type,String phone, Long goodsId, Long addressId ,Long num) {
|
|
|
- System.out.println(phone);
|
|
|
+ public boolean exchange(Integer type,String phone, Long goodsId, Long addressId ,Long num,Long activeId) {
|
|
|
UserPufaPoint user = userPufaPointService.getOne(new LambdaQueryWrapper<UserPufaPoint>().eq(UserPufaPoint::getPhone,phone));
|
|
|
Assert.notNull(user,"用户不存在");
|
|
|
PointGoods goods = pointGoodsService.getById(goodsId);
|
|
|
Assert.notNull(goods,"商品不存在");
|
|
|
UserAddress address = userAddressService.getById(addressId);
|
|
|
Assert.notNull(address,"请添加收货地址");
|
|
|
+ Assert.notNull(activeId,"兑换失败");
|
|
|
|
|
|
Boolean isLimit = Optional.ofNullable(goods.getIsLimit()).orElse(false);
|
|
|
if (isLimit){
|