退款 扣除库存校验
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.czg.service.product.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.czg.product.enums.InOutItemEnum;
|
||||
import com.czg.product.enums.InOutTypeEnum;
|
||||
import com.czg.product.service.ProductRpcService;
|
||||
@@ -16,7 +14,6 @@ import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.czg.constant.CacheConstant.ADMIN_CLIENT_PRODUCT_LIST;
|
||||
|
||||
@@ -39,32 +36,20 @@ public class ProductRpcServiceImpl implements ProductRpcService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void paySuccessSubtractStock(Long shopId, Long orderId, List<Map<String, Object>> dataList) {
|
||||
List<ProductStockVO> list = BeanUtil.copyToList(dataList, ProductStockVO.class);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
public void paySuccessSubtractStock(Long shopId, Long orderId, List<ProductStockVO> list) {
|
||||
productService.consStockByProduct(shopId, InOutTypeEnum.OUT, InOutItemEnum.ORDER_OUT, list, orderId, "订单消费");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void orderCancelRecoverStock(Long shopId, Long orderId, List<Map<String, Object>> dataList) {
|
||||
List<ProductStockVO> list = BeanUtil.copyToList(dataList, ProductStockVO.class);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
public void orderCancelRecoverStock(Long shopId, Long orderId, List<ProductStockVO> list) {
|
||||
productService.consStockByProduct(shopId, InOutTypeEnum.IN, InOutItemEnum.ORDER_IN, list, orderId, "订单取消/过期返还库存");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void orderRefundReturnStock(Long shopId, Long orderId, List<Map<String, Object>> dataList) {
|
||||
List<ProductStockVO> list = BeanUtil.copyToList(dataList, ProductStockVO.class);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
public void orderRefundReturnStock(Long shopId, Long orderId, List<ProductStockVO> list) {
|
||||
productService.consStockByProduct(shopId, InOutTypeEnum.IN, InOutItemEnum.ORDER_IN, list, orderId, "订单退菜/退款返还库存");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user