From 24cfb68e8f0e2b99f3e37d6bb815ed8d4b57a474 Mon Sep 17 00:00:00 2001 From: "XI_TENG\\xixi_" <971623072> Date: Fri, 31 May 2024 13:54:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=8E=A7=E5=88=B6=E5=BA=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehousingOutboundController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingOutboundController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingOutboundController.java index 04ed58a0..b41bfad4 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingOutboundController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingOutboundController.java @@ -12,6 +12,7 @@ import jnpf.engine.entity.FlowTaskNodeEntity; import jnpf.engine.service.FlowTaskNodeService; import jnpf.engine.service.FlowTaskService; import jnpf.exception.DataException; +import jnpf.model.deliveryorder.DeliveryProductRelationModel; import jnpf.model.warehousingstorage.WarehousingStorageProductModel; import jnpf.model.yunguan.YunguanPurchaseInBoundModel; import jnpf.model.yunguan.YunguanSaleOutBoundModel; @@ -244,6 +245,22 @@ public class WarehousingOutboundController { if (StringUtil.isNotEmpty(b)){ return ActionResult.fail(b ); } + + for (WarehousingOutboundProductModel model : warehousingOutboundForm.getWarehousingOutboundProductList()){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InventoryEntity::getProductId,model.getProductId()); + queryWrapper.lambda().eq(InventoryEntity::getBatchNumber,model.getBatchNumber()); + queryWrapper.lambda().isNull(InventoryEntity::getDeleteMark); + InventoryEntity inventoryEntity = inventoryService.getOne(queryWrapper); + if (ObjectUtil.isNotEmpty(inventoryEntity)) { + if (inventoryEntity.getInventoryNumber().compareTo(new BigDecimal(model.getOutboundNumber())) == -1){ + return ActionResult.fail("库存数量不足"); + } + }else{ + return ActionResult.fail("库区不存在"); + } + } + try{ warehousingOutboundService.saveOrUpdate(warehousingOutboundForm, id ,true); FlowTaskEntity flowTaskEntity = flowTaskService.getById(id);