检验库存

This commit is contained in:
2026-04-13 10:36:24 +08:00
parent ca83a3a8a2
commit 75f2eebf7e
3 changed files with 4 additions and 12 deletions

View File

@@ -162,6 +162,8 @@ public class OrderDetail implements Serializable {
* 是否等叫
*/
private Integer isWaitCall;
@Column(ignore = true)
private Integer isAutoSoldStock;
/**
* 套餐商品选择信息

View File

@@ -45,7 +45,6 @@ import com.czg.order.vo.*;
import com.czg.pay.PayNotifyRespDTO;
import com.czg.product.entity.Product;
import com.czg.product.entity.ShopProdCategory;
import com.czg.product.service.ConsInfoService;
import com.czg.product.service.ProductRpcService;
import com.czg.product.service.ProductService;
import com.czg.product.service.ShopProdCategoryService;
@@ -1048,7 +1047,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
BigDecimal packFee = BigDecimal.ZERO;
Map<Long, BigDecimal> productNumMap = new HashMap<>();
for (OrderDetail detail : orderDetails) {
if (!detail.getIsTemporary().equals(1) && detail.getProductId() > 0) {
if (!detail.getIsTemporary().equals(1) && detail.getProductId() > 0 && 1 == detail.getIsAutoSoldStock()) {
if (productNumMap.containsKey(detail.getProductId())) {
productNumMap.put(detail.getProductId(), productNumMap.get(detail.getProductId()).add(detail.getNum().subtract(detail.getReturnNum())));
} else {
@@ -1086,16 +1085,6 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
if (CollUtil.isEmpty(productNumMap)) {
return;
}
// List<ConsInfo> consStockList = consInfoService.list(new QueryWrapper().select(ConsInfo::getId, ConsInfo::getConName, ConsInfo::getConUnit, ConsInfo::getStockNumber)
// .eq(ConsInfo::getShopId, shopId).eq(ConsInfo::getIsStock, 1));
// if (CollUtil.isEmpty(consStockList)) {
// return;
// }
// Map<Long, ConsInfo> map = consStockList.stream()
// .collect(Collectors.toMap(
// ConsInfo::getId,
// Function.identity()
// ));
List<ConsStockRecord> consNumList = orderInfoCustomMapper.getConsByProductAndNum(shopId, productNumMap);
for (ConsStockRecord consStockRecord : consNumList) {
if (consStockRecord.getStockNumber().compareTo(consStockRecord.getCurrentStockNumber()) > 0) {

View File

@@ -19,6 +19,7 @@
cart.product_id as productId,
pros.cover_img as productImg,
pros.type as productType,
pros.is_auto_sold_stock as isAutoSoldStock,
cart.sku_id as skuId,
cart.is_time_discount as isTimeDiscount,
skus.spec_info as skuName,