商品列表 校验 耗材
This commit is contained in:
@@ -408,17 +408,22 @@ public class ProductService {
|
|||||||
if (Integer.valueOf(tbProduct.getIsDistribute()).equals(1)) {//共享库存 1开启
|
if (Integer.valueOf(tbProduct.getIsDistribute()).equals(1)) {//共享库存 1开启
|
||||||
if (tbProduct.getStockNumber() != null && tbProduct.getStockNumber() <= 0) {
|
if (tbProduct.getStockNumber() != null && tbProduct.getStockNumber() <= 0) {
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!tbProduct.getTypeEnum().equals("sku")) {
|
if (!tbProduct.getTypeEnum().equals("sku")) {
|
||||||
if (skus.stream().anyMatch(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0))
|
if (skus.stream().anyMatch(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0)){
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
skus.removeIf(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0);
|
skus.removeIf(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0);
|
||||||
if (CollectionUtils.isEmpty(skus)) {
|
if (CollectionUtils.isEmpty(skus)) {
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Iterator<TbProductSku> iterator = skus.iterator();
|
Iterator<TbProductSku> iterator = skus.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
TbProductSku tbProductSku = iterator.next();
|
TbProductSku tbProductSku = iterator.next();
|
||||||
@@ -430,6 +435,7 @@ public class ProductService {
|
|||||||
if ("1".equals(consInfo.getIsCheck())) {
|
if ("1".equals(consInfo.getIsCheck())) {
|
||||||
if (N.gt(proskuCon.getSurplusStock(), consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))) {
|
if (N.gt(proskuCon.getSurplusStock(), consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -441,8 +447,6 @@ public class ProductService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Result queryProductSku(String code, String shopId, String productId, String spec_tag) {
|
public Result queryProductSku(String code, String shopId, String productId, String spec_tag) {
|
||||||
|
|||||||
Reference in New Issue
Block a user