From a62968fdcb4ebf66ecc0510bbc879e07b7d88382 Mon Sep 17 00:00:00 2001 From: "XI_TENG\\xixi_" <971623072> Date: Thu, 25 Jul 2024 13:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WarehousingInventoryController.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingInventoryController.java b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingInventoryController.java index eb969efc..23a32bca 100644 --- a/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingInventoryController.java +++ b/jnpf-java-boot/jnpf-scm/jnpf-scm-controller/src/main/java/jnpf/controller/WarehousingInventoryController.java @@ -546,6 +546,20 @@ public class WarehousingInventoryController { inventoryEntity.setInventoryNumber(frim);//库存数量 } inventoryService.saveOrUpdate(inventoryEntity); + } else { + //更新库存 + //根据商品id和批次号查询库存信息 + QueryWrapper inventoryQueryWrapper = new QueryWrapper<>(); + inventoryQueryWrapper.lambda().eq(InventoryEntity::getProductId, warehousingInventoryProductModel.getProductId()); + inventoryQueryWrapper.lambda().eq(InventoryEntity::getBatchNumber, warehousingInventoryProductModel.getBatchNumber()); + List inventoryList = inventoryService.list(inventoryQueryWrapper); + InventoryEntity inventoryEntity = new InventoryEntity(); + if(inventoryList != null && inventoryList.size() > 0){ + inventoryEntity = inventoryList.get(0); + BigDecimal frim =new BigDecimal(warehousingInventoryProductModel.getFirmOfferQuantity()); + inventoryEntity.setInventoryNumber(frim);//库存数量 + } + inventoryService.saveOrUpdate(inventoryEntity); } }