From 0e952beae196d30275e64b168bbbb5e0c41d2cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=9E=9D=E5=88=9A?= Date: Mon, 16 Dec 2024 19:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=88=B0=E8=B4=A7=E6=8B=86?= =?UTF-8?q?=E6=89=B9=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E4=BF=9D=E5=AF=86?= =?UTF-8?q?=E6=8B=86=E6=89=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mom/wms/controller/ZWmsInventoryController.java | 4 +++- .../mom/wms/service/ZWmsInventoryService.java | 6 +++--- .../mom/wms/service/impl/DocumentServiceImpl.java | 10 ++++++---- .../mom/wms/service/impl/ZWmsInventoryServiceImpl.java | 8 ++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/ZWmsInventoryController.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/ZWmsInventoryController.java index 6510f20..ec30de8 100644 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/ZWmsInventoryController.java +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/controller/ZWmsInventoryController.java @@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** @@ -385,7 +386,8 @@ public class ZWmsInventoryController { String qmsSpecialMarking = request.get("qmsSpecialMarking"); String printer = request.get("printer"); boolean isSecrecy = Boolean.parseBoolean(request.get("isSecrecy")); - List splitInventoryIdList = inventoryService.splitInventory(site, user, parentInventoryId, splitQty, splitNum, null, null, null, null, qmsSpecialMarking, printer, isSecrecy); + List inventoryIdObj = inventoryService.splitInventory(site, user, parentInventoryId, splitQty, splitNum, null, null, null, null, qmsSpecialMarking, printer, isSecrecy); + List splitInventoryIdList = inventoryIdObj.stream().map(Inventory::getInventoryId).collect(Collectors.toList()); splitInventoryIdList.add(parentInventoryId); splitInventoryIdList.remove(splitInventoryIdList.size() - 1); return R.ok(splitInventoryIdList); diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/ZWmsInventoryService.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/ZWmsInventoryService.java index 9b61789..0a32f2e 100644 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/ZWmsInventoryService.java +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/ZWmsInventoryService.java @@ -87,11 +87,11 @@ public interface ZWmsInventoryService extends IService { * @param storageBinBo 货格BO(可选),为空则绑定到父库存货格 * @return 新库存ID集合 */ - List splitInventory(String site, String user, String parentInventory, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo); + List splitInventory(String site, String user, String parentInventory, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo); - List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy); + List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy); - List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy); + List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy); /** * 合并库存 diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java index 2e05263..45b670e 100644 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/DocumentServiceImpl.java @@ -2079,7 +2079,8 @@ public class DocumentServiceImpl extends ServiceImpl i // String parentInventoryStatus = parentInventory.getStatus(); //库存拆分 - String inventoryId = inventoryService.splitInventory(site, user, parentInventoryId, inventoryQty, 1, documentNo, byCode.getDocumentType(), null,isSecrecy).get(0); + Inventory inventoryIdObj = inventoryService.splitInventory(site, user, parentInventoryId, inventoryQty, 1, documentNo, byCode.getDocumentType(), null,isSecrecy).get(0); + String inventoryId = inventoryIdObj.getInventoryId(); requestQty = requestQty.add(inventoryQty); DocumentSfc documentSfc = new DocumentSfc(); @@ -2101,9 +2102,9 @@ public class DocumentServiceImpl extends ServiceImpl i // documentSfc.setGradeThrCarrier(groupNo); documentSfcService.save(documentSfc); if (isSecrecy) { - paramMap.put("UUID", inventoryId); + paramMap.put("UUID", inventoryIdObj.getSecrecyId()); paramMap.put("QTY", documentSfc.getQty()); - paramMap.put("CODE", inventoryId); + paramMap.put("CODE", inventoryIdObj.getSecrecyId()); }else{ paramMap.put("ITEM", item); paramMap.put("DES", itemDesc); @@ -5737,7 +5738,7 @@ public class DocumentServiceImpl extends ServiceImpl i .eq(StorageBinBindInventory::getInventoryBo, inventoryBo) .eq(StorageBinBindInventory::getStatus, "Y") .select(StorageBinBindInventory::getStorageBinBo)); - String freezeInventoryId = inventoryService.splitInventory(site, + Inventory inventoryIdObj = inventoryService.splitInventory(site, user, parentInventoryId, ngQty, @@ -5747,6 +5748,7 @@ public class DocumentServiceImpl extends ServiceImpl i storageBinBindInventory.getStorageBinBo(), Collections.singletonList(parentInventoryId + "-1"), null, null, false ).get(0); + String freezeInventoryId = inventoryIdObj.getInventoryId(); inventoryService.update(Wrappers.lambdaUpdate(Inventory.class) .eq(Inventory::getHandle, Inventory.genHandle(site, freezeInventoryId)) .set(Inventory::getStatus, Constant.INVENTORY_STSTUS_1005) diff --git a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/ZWmsInventoryServiceImpl.java b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/ZWmsInventoryServiceImpl.java index b6425dc..5af0571 100644 --- a/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/ZWmsInventoryServiceImpl.java +++ b/mom-wms-core/src/main/java/com/foreverwin/mom/wms/service/impl/ZWmsInventoryServiceImpl.java @@ -380,19 +380,19 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo) { + public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo) { return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, false); } @Override - public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy) { + public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy) { return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, isSecrecy); } //@GlobalTransactional @Override @Transactional(rollbackFor = Exception.class) - public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy) { + public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy) { Inventory parentInventory = isSecrecy ? lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getSecrecyId, parentInventoryId) .one() : getById(Inventory.genHandle(site, parentInventoryId)); if (parentInventory == null) { @@ -486,7 +486,7 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl