From c8c80de7315b686c649caa218775d9ff17cca40d Mon Sep 17 00:00:00 2001 From: yiwenpeng <ywp303@163.com> Date: Tue, 4 Jun 2024 14:29:46 +0800 Subject: [PATCH] fix: 修复呼叫料盒,呼叫出空托盘时,完成补充入库后,原库位没有解锁的问题。 --- src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java index 9717d98..0e1b22b 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java @@ -328,25 +328,27 @@ public class ReceiptTaskService { //如果是补充入库 if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT)) { String fromLocationCode = task.getFromLocation(); + //修改库位状态和对应的容器 + Location updateLocation = new Location(); + updateLocation.setContainerCode(""); + updateLocation.setWarehouseCode(warehouseCode); + updateLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); + LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); + locationLambdaUpdateWrapper.eq(Location::getCode, fromLocationCode); + if (!locationService.update(updateLocation, locationLambdaUpdateWrapper)) { + throw new ServiceException("补充入库,更新库位失败"); + } + + //解除右侧库位禁用和对应4个库位标记 + Container container = containerService.getContainerByCode(task.getContainerCode()); + locationService.unbanRightLocationAndUnmark(container.getContainerType(), fromLocationCode); + Location toLocation = locationService.getLocationByCode(task.getToLocation()); + + inventoryHeader = inventoryHeaderService.getOne(new LambdaQueryWrapper<InventoryHeader>() .eq(InventoryHeader::getLocationCode, fromLocationCode) .eq(InventoryHeader::getContainerCode, task.getContainerCode())); if (inventoryHeader != null) { - //修改库位状态和对应的容器 - Location updateLocation = new Location(); - updateLocation.setContainerCode(""); - updateLocation.setWarehouseCode(warehouseCode); - updateLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); - LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate(); - locationLambdaUpdateWrapper.eq(Location::getCode, fromLocationCode); - locationLambdaUpdateWrapper.eq(Location::getWarehouseCode, warehouseCode); - if (!locationService.update(updateLocation, locationLambdaUpdateWrapper)) { - throw new ServiceException("补充入库,更新库位失败"); - } - //解除右侧库位禁用和对应4个库位标记 - Container container = containerService.getContainerByCode(task.getContainerCode()); - locationService.unbanRightLocationAndUnmark(container.getContainerType(), fromLocationCode); - Location toLocation = locationService.getLocationByCode(task.getToLocation()); inventoryHeader.setLocationCode(task.getToLocation()); if (!inventoryHeaderService.updateById(inventoryHeader)) { throw new ServiceException("补充入库,更新库存头表失败"); -- libgit2 0.22.2