检验库存
This commit is contained in:
@@ -162,6 +162,8 @@ public class OrderDetail implements Serializable {
|
|||||||
* 是否等叫
|
* 是否等叫
|
||||||
*/
|
*/
|
||||||
private Integer isWaitCall;
|
private Integer isWaitCall;
|
||||||
|
@Column(ignore = true)
|
||||||
|
private Integer isAutoSoldStock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 套餐商品选择信息
|
* 套餐商品选择信息
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ import com.czg.order.vo.*;
|
|||||||
import com.czg.pay.PayNotifyRespDTO;
|
import com.czg.pay.PayNotifyRespDTO;
|
||||||
import com.czg.product.entity.Product;
|
import com.czg.product.entity.Product;
|
||||||
import com.czg.product.entity.ShopProdCategory;
|
import com.czg.product.entity.ShopProdCategory;
|
||||||
import com.czg.product.service.ConsInfoService;
|
|
||||||
import com.czg.product.service.ProductRpcService;
|
import com.czg.product.service.ProductRpcService;
|
||||||
import com.czg.product.service.ProductService;
|
import com.czg.product.service.ProductService;
|
||||||
import com.czg.product.service.ShopProdCategoryService;
|
import com.czg.product.service.ShopProdCategoryService;
|
||||||
@@ -1048,7 +1047,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
BigDecimal packFee = BigDecimal.ZERO;
|
BigDecimal packFee = BigDecimal.ZERO;
|
||||||
Map<Long, BigDecimal> productNumMap = new HashMap<>();
|
Map<Long, BigDecimal> productNumMap = new HashMap<>();
|
||||||
for (OrderDetail detail : orderDetails) {
|
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())) {
|
if (productNumMap.containsKey(detail.getProductId())) {
|
||||||
productNumMap.put(detail.getProductId(), productNumMap.get(detail.getProductId()).add(detail.getNum().subtract(detail.getReturnNum())));
|
productNumMap.put(detail.getProductId(), productNumMap.get(detail.getProductId()).add(detail.getNum().subtract(detail.getReturnNum())));
|
||||||
} else {
|
} else {
|
||||||
@@ -1086,16 +1085,6 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
if (CollUtil.isEmpty(productNumMap)) {
|
if (CollUtil.isEmpty(productNumMap)) {
|
||||||
return;
|
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);
|
List<ConsStockRecord> consNumList = orderInfoCustomMapper.getConsByProductAndNum(shopId, productNumMap);
|
||||||
for (ConsStockRecord consStockRecord : consNumList) {
|
for (ConsStockRecord consStockRecord : consNumList) {
|
||||||
if (consStockRecord.getStockNumber().compareTo(consStockRecord.getCurrentStockNumber()) > 0) {
|
if (consStockRecord.getStockNumber().compareTo(consStockRecord.getCurrentStockNumber()) > 0) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
cart.product_id as productId,
|
cart.product_id as productId,
|
||||||
pros.cover_img as productImg,
|
pros.cover_img as productImg,
|
||||||
pros.type as productType,
|
pros.type as productType,
|
||||||
|
pros.is_auto_sold_stock as isAutoSoldStock,
|
||||||
cart.sku_id as skuId,
|
cart.sku_id as skuId,
|
||||||
cart.is_time_discount as isTimeDiscount,
|
cart.is_time_discount as isTimeDiscount,
|
||||||
skus.spec_info as skuName,
|
skus.spec_info as skuName,
|
||||||
|
|||||||
Reference in New Issue
Block a user