diff --git a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailedDto.java b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailedDto.java index 196eb91..af4846e 100644 --- a/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailedDto.java +++ b/mom-wms-api/src/main/java/com/foreverwin/mom/wms/dto/DocumentDetailedDto.java @@ -22,7 +22,7 @@ public class DocumentDetailedDto extends DocumentDetailed { } public void setIsSecrecy(boolean isSecrecy) { - isSecrecy = isSecrecy; + this.isSecrecy = isSecrecy; } private String isPack; 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 ec30de8..eda0b4a 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 @@ -386,7 +386,7 @@ public class ZWmsInventoryController { String qmsSpecialMarking = request.get("qmsSpecialMarking"); String printer = request.get("printer"); boolean isSecrecy = Boolean.parseBoolean(request.get("isSecrecy")); - List inventoryIdObj = 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,false); List splitInventoryIdList = inventoryIdObj.stream().map(Inventory::getInventoryId).collect(Collectors.toList()); splitInventoryIdList.add(parentInventoryId); splitInventoryIdList.remove(splitInventoryIdList.size() - 1); 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 0a32f2e..30228bd 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 @@ -89,9 +89,9 @@ public interface ZWmsInventoryService extends IService { */ 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,boolean isSecrecy, boolean inventoryIdSelect); - 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, boolean inventoryIdSelect); /** * 合并库存 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 45b670e..1eb9b68 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,7 @@ public class DocumentServiceImpl extends ServiceImpl i // String parentInventoryStatus = parentInventory.getStatus(); //库存拆分 - Inventory inventoryIdObj = 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(),isSecrecy,true).get(0); String inventoryId = inventoryIdObj.getInventoryId(); requestQty = requestQty.add(inventoryQty); @@ -5746,7 +5746,7 @@ public class DocumentServiceImpl extends ServiceImpl i documentNo, null, storageBinBindInventory.getStorageBinBo(), - Collections.singletonList(parentInventoryId + "-1"), null, null, false + Collections.singletonList(parentInventoryId + "-1"), null, null, false,false ).get(0); String freezeInventoryId = inventoryIdObj.getInventoryId(); inventoryService.update(Wrappers.lambdaUpdate(Inventory.class) 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 5af0571..a99771f 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 @@ -381,20 +381,26 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl 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); + return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, false,false); } @Override - 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); + public List splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, boolean isSecrecy,boolean inventoryIdSelect) { + return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, null, null, null, null, isSecrecy,inventoryIdSelect); } //@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) { - Inventory parentInventory = isSecrecy ? lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getSecrecyId, parentInventoryId) - .one() : getById(Inventory.genHandle(site, parentInventoryId)); + 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,boolean inventoryIdSelect) { + Inventory parentInventory = null; + if(inventoryIdSelect){ + // 优先级最高 + parentInventory = getById(Inventory.genHandle(site, parentInventoryId)); + }else{ + parentInventory = isSecrecy ? lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getSecrecyId, parentInventoryId) + .one() : getById(Inventory.genHandle(site, parentInventoryId)); + } if (parentInventory == null) { throw BusinessException.build("库存不存在"); } else {