diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
index 5aa5ae7..4f8eda6 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -1121,27 +1121,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             throw new JeecgBootException("完成入库任务时,保存库存交易失败");
         }
 
-        if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) {
-            success =
-                locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成入库任务时,更新源库位失败");
-            }
-        }
-
-        success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成入库任务时,更新库位失败");
-        }
-
-        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
-        if (!success) {
-            throw new JeecgBootException("完成入库任务时,更新任务失败");
-        }
-        success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
-            taskHeader.getContainerFillStatus(), warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成入库任务时,更新容器失败");
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode,
+            toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
         }
         if (!taskHeaderService.combineInventoryDetail(taskHeader)) {
             throw new JeecgBootException("合并入库库存失败");
@@ -1159,6 +1142,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (!inventoryHeaderService.updateInventoryContainerStatusByContainerCode(containerCode, warehouseCode)) {
             throw new JeecgBootException("完成入库任务时,更新托盘状态失败");
         }
+        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
+        if (!success) {
+            throw new JeecgBootException("完成出库任务,保存任务头失败");
+        }
         receiptDetaiList = receiptDetaiList.stream().filter(t -> t.getStatus().equals(QuantityConstant.RECEIPT_HEADER_COMPLETED)).collect(Collectors.toList());
         LogRecordContext.putVariable("taskHeader", taskHeader);
         LogRecordContext.putVariable("taskDetailList", taskDetailList);
@@ -1311,44 +1298,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (!success) {
             throw new JeecgBootException("完成出库任务,保存库存详情失败");
         }
-        taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
-        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
-        if (!success) {
-            throw new JeecgBootException("完成出库任务,保存任务头失败");
-        }
-        if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) {
-            success =
-                locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成整盘出库任务,更新源库位失败");
-            }
-            success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY,
-                QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成整盘出库任务,更新容器失败");
-            }
-        } else if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
-            if (!fromLocationCode.equals(toLocationCode)) {
-                success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY,
-                    warehouseCode);
-                if (!success) {
-                    throw new JeecgBootException("完成分拣出库任务,更新源库位失败");
-                }
-                success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-                if (!success) {
-                    throw new JeecgBootException("完成分拣出库任务,更新目标库位失败");
-                }
-            } else {
-                success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-                if (!success) {
-                    throw new JeecgBootException("完成分拣出库任务,更新源库位失败");
-                }
-            }
-            success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
-                inventoryDetailList.size() == 0 ? QuantityConstant.STATUS_CONTAINER_FILL_EMPTY : QuantityConstant.STATUS_CONTAINER_FILL_SOME, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成分拣出库任务,更新容器失败");
-            }
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode,
+            toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
         }
         ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId());
         if (shipmentContainerHeader == null) {
@@ -1380,6 +1333,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 throw new JeecgBootException("完成出库任务,更新库存状态失败");
             }
         }
+        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
+        if (!success) {
+            throw new JeecgBootException("完成出库任务,保存任务头失败");
+        }
         // 操作记录添加
         shipmentDetailList = shipmentDetailList.stream().filter(t -> t.getStatus().equals(QuantityConstant.SHIPMENT_HEADER_COMPLETED)).collect(Collectors.toList());
         LogRecordContext.putVariable("taskHeader", taskHeader);
@@ -1657,8 +1614,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         String toLocationCode, String warehouseCode) {
         Result result = null;
         boolean success = false;
-        if (StringUtils.isEmpty(toLocationCode) && taskType == QuantityConstant.TASK_TYPE_OVER_STATION) {
-            return Result.error("完成任务时, 目标库位号为空");
+        if (StringUtils.isEmpty(toLocationCode) && taskType != QuantityConstant.TASK_TYPE_OVER_STATION) {
+            return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空");
+        }
+        if (StringUtils.isEmpty(containerCode)) {
+            return Result.error("任务类型" + taskType + "完成任务时, 容器号为空");
+        }
+        Container container = containerService.getContainerByCode(containerCode, warehouseCode);
+        if (container == null) {
+            return Result.error("任务类型" + taskType + "完成任务时, 没有找到托盘" + containerCode);
         }
         switch (taskType) {
             case QuantityConstant.TASK_TYPE_WHOLERECEIPT:
@@ -1677,6 +1641,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             case QuantityConstant.TASK_TYPE_WHOLESHIPMENT:
             case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT:
             case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT:
+                if (StringUtils.isEmpty(fromLocationCode)) {
+                    return Result.error("任务类型" + taskType + "完成任务时, 起始库位号为空");
+                }
                 success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
                     QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode);
                 break;
@@ -1684,13 +1651,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             case QuantityConstant.TASK_TYPE_CYCLECOUNT:
             case QuantityConstant.TASK_TYPE_TRANSFER:
             case QuantityConstant.TASK_TYPE_CHECK_OUT:
+                if (StringUtils.isEmpty(fromLocationCode)) {
+                    return Result.error("任务类型" + taskType + "完成任务时, 起始库位号为空");
+                }
                 InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode);
                 if (inventoryHeader != null) {
-                    success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
-                        QuantityConstant.STATUS_CONTAINER_FILL_SOME, warehouseCode);
+                    if (fromLocationCode.equals(toLocationCode)) {
+                        success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
+                    } else {
+                        success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
+                            QuantityConstant.STATUS_CONTAINER_FILL_SOME, warehouseCode);
+                    }
                 } else {
-                    success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
-                        QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode);
+                    if (fromLocationCode.equals(toLocationCode)) {
+                        success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
+                    } else {
+                        success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
+                            QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode);
+                    }
                 }
                 break;
             case QuantityConstant.TASK_TYPE_OVER_STATION:
@@ -1699,20 +1677,30 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 break;
         }
         if (!success) {
-            throw new JeecgBootException("完成任务时,更新容器失败");
+            throw new JeecgBootException("任务类型" + taskType + "完成任务时, 更新容器失败");
         }
         if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) {
+            Location toLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
+            if (toLocation == null) {
+                return Result.error("完成任务时," + toLocationCode + "目标库位不存在");
+            }
             success =
                 locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
             if (!success) {
-                throw new JeecgBootException("完成任务时,更新源库位失败");
+                throw new JeecgBootException("任务类型" + taskType + "完成任务时,更新源库位失败");
             }
         }
-        success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成任务时,更新库位失败");
+        if (StringUtils.isNotEmpty(toLocationCode)) {
+            Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
+            if (toLocation == null) {
+                return Result.error("任务类型" + taskType + "完成任务时, " + toLocationCode + "目标库位不存在");
+            }
+            success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
+            if (!success) {
+                throw new JeecgBootException("任务类型" + taskType + "完成任务时,更新库位失败");
+            }
         }
-        return Result.OK("完成任务成功");
+        return Result.OK("任务类型" + taskType + "完成任务成功");
     }
 
     /**
@@ -1736,27 +1724,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (StringUtils.isEmpty(toLocationCode)) {
             return Result.error("完成空托盘入库任务时, 目标库位号为空");
         }
-        Container container = containerService.getContainerByCode(containerCode, warehouseCode);
-        if (container == null) {
-            return Result.error("完成空托盘入库任务时, 没有找到托盘" + containerCode);
-        }
-        Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
-        if (toLocation == null) {
-            return Result.error("完成空托盘入库任务时," + toLocationCode + "目标库位不存在");
-        }
-        boolean success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成空托盘入库任务时, 更新容器的库位号和状态失败");
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT,
+            containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
         }
-        success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
+        boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
         if (!success) {
-            throw new JeecgBootException("完成空托盘入库任务时, 更新库位的容器编码和状态失败");
+            throw new JeecgBootException("完成空托盘出库任务时, 更新任务失败");
         }
-        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
         log.info("完成空托入库任务");
-        if (!success) {
-            throw new JeecgBootException("完成空托盘入库任务时, 更新任务失败");
-        }
         return Result.OK("完成空托盘入库成功");
     }
 
@@ -1790,7 +1767,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         // 1.先拿到盘点单主单据
         CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(taskHeader.getShipmentContainerHeaderId());
 
-        if ((cycleCountDetail.getCountedQty().add(cycleCountDetail.getGapQty())).compareTo(BigDecimal.ZERO) == 0) {
+        if (cycleCountDetail.getGapQty().compareTo(BigDecimal.ZERO) == 0) {
             return Result.error("盘点单据系统实盘数量跟差异数量0,不能完成 单据号" + cycleCountDetail.getCycleCountHeadCode());
         }
 
@@ -2045,17 +2022,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (port == null) {
             return Result.error("完成空托盘出库任务时," + toPortCode + "目标出库口不存在");
         }
-        boolean success =
-            containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成空托盘出库任务时, 更新容器的库位号和状态失败");
-        }
-        success =
-            locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成空托盘出库任务时, 更新库位的容器编码和状态失败");
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT,
+            containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
         }
-        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
+        boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
         log.info("完成空托盘出库任务" + taskHeader.getId());
         if (!success) {
             throw new JeecgBootException("完成空托盘出库任务时, 更新任务失败");
@@ -2122,24 +2094,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 throw new JeecgBootException("完成移库任务时,保存库存交易失败");
             }
         }
-        taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
-        success = taskHeaderService.updateById(taskHeader);
-        if (!success) {
-            throw new JeecgBootException("完成移库任务时, 更新任务失败");
-        }
-        success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成移库任务时, 更新容器状态失败");
-        }
-        success =
-            locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成移库任务时, 更新起始库位状态失败");
-        }
-        success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成移库任务时, 更新目标库位状态失败");
-        }
         LambdaUpdateWrapper<InventoryHeader> inventoryHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
         inventoryHeaderLambdaUpdateWrapper.eq(InventoryHeader::getWarehouseCode, warehouseCode).eq(InventoryHeader::getContainerCode, containerCode)
             .eq(InventoryHeader::getLocationCode, fromLocationCode);
@@ -2157,6 +2111,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 throw new JeecgBootException("完成移库任务时, 更新库存详情失败");
             }
         }
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_OVER_STATION,
+            containerCode, fromLocationCode, toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
+        }
+        taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
+        success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
+        if (!success) {
+            throw new JeecgBootException("完成移库任务时, 更新任务失败");
+        }
         log.info("完成移库任务" + taskHeader.getId());
         return Result.OK("完成移库任务成功");
     }
@@ -2221,42 +2185,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             if (!success) {
                 throw new JeecgBootException("完成出库查看任务时,更新库存头失败");
             }
-            if (fromLocationCode.equals(toLocationCode)) {
-                success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-            } else {
-                success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-            }
-            if (!success) {
-                throw new JeecgBootException("完成出库查看任务时,更新容器状态失败");
-            }
-        } else {
-            if (fromLocationCode.equals(toLocationCode)) {
-                success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-            } else {
-                success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
-            }
-            if (!success) {
-                throw new JeecgBootException("完成出库查看任务时,更新容器状态失败");
-            }
         }
 
-        if (!fromLocationCode.equals(toLocationCode)) {
-            success =
-                locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成出库查看任务时,更新源库位失败");
-            }
-        } else {
-            success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成出库查看任务时,更新源库位失败");
-            }
-        }
-        if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) {
-            success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
-            if (!success) {
-                throw new JeecgBootException("完成出库查看任务时,更新目标库位失败");
-            }
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT,
+            containerCode, fromLocationCode, toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
         }
         taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
         success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
@@ -2304,16 +2238,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (toPort == null) {
             return Result.error("创建跨站任务时,目标站台为空");
         }
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_OVER_STATION,
+            containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
+        }
         taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
         boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
         if (!success) {
             throw new JeecgBootException("创建跨站任务时, 更新任务失败");
         }
-        success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
+//        success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
+//        if (!success) {
+//            throw new JeecgBootException("创建跨站任务时, 更新容器状态失败");
+//        }
         log.info("完成跨站任务" + taskHeader.getId());
-        if (!success) {
-            throw new JeecgBootException("创建跨站任务时, 更新容器状态失败");
-        }
         return Result.OK("完成跨站任务成功");
     }
 
@@ -2346,21 +2285,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         if (toLocation == null) {
             return Result.error("完成空托盘组入库任务时,没有找到库位" + toLocationCode);
         }
+        Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT,
+            containerCode, QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode);
+        if (!result.isSuccess()) {
+            throw new JeecgBootException(result.getMessage());
+        }
         taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
         boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
         if (!success) {
             throw new JeecgBootException("完成空托盘组入库任务时, 更新任务失败");
         }
-        success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY,
-            QuantityConstant.STATUS_CONTAINER_FILL_MANY, warehouseCode);
-        if (!success) {
-            throw new JeecgBootException("完成空托盘组入库任务时, 更新容器失败");
-        }
-        success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
         log.info("完成空托盘组入库任务" + taskHeader.getId());
-        if (!success) {
-            throw new JeecgBootException("完成空托盘组入库任务时, 更新库位失败");
-        }
         return Result.ok("完成空托盘组入库任务成功");
     }