商品模块代码提交
This commit is contained in:
@@ -15,6 +15,7 @@ import com.czg.product.entity.ProdSku;
|
||||
import com.czg.product.entity.Product;
|
||||
import com.czg.product.enums.ProductIsSaleTypeEnum;
|
||||
import com.czg.product.enums.ProductTypeEnum;
|
||||
import com.czg.product.param.ProdRefundToStockParam;
|
||||
import com.czg.product.param.ProductIsSaleParam;
|
||||
import com.czg.product.param.ProductIsSoldOutParam;
|
||||
import com.czg.product.service.ProductService;
|
||||
@@ -294,4 +295,15 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refundToStock(ProdRefundToStockParam param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
Product entity = super.getOne(query().eq(Product::getId, param.getId()).eq(Product::getShopId, shopId));
|
||||
if (entity == null) {
|
||||
throw new CzgException("商品不存在");
|
||||
}
|
||||
entity.setIsRefundStock(param.getIsReturn());
|
||||
super.updateById(entity);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user