From c07e5e2fd354e52513e2e2ece610cb15b705396c Mon Sep 17 00:00:00 2001
From: youjie <272855983@qq.com>
Date: Fri, 17 Nov 2023 09:00:38 +0800
Subject: [PATCH] 修复双伸位库位  入库分配时 生成移库任务就返回 没有把库位号写到任务里的问题

---
 huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java |  9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
index 027533b..2388fe7 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
@@ -253,11 +253,16 @@ public class WcsServiceImpl implements WcsService {
                 if (destinationLocation == null) {
                     throw new JeecgBootException("创建移库任务失败, 目标库位为空");
                 }
-                Result result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode);
+                Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode);
                 if (!result.isSuccess()) {
                     throw new JeecgBootException("创建移库任务失败");
                 }
-                return Result.ok("移库任务先执行");
+                preTaskNo = result.getResult().getId();
+                taskHeader.setPreTaskNo(preTaskNo);
+                success = taskHeaderService.updatePreTaskNoById(preTaskNo, taskHeader.getId());
+                if (!success) {
+                    throw new JeecgBootException("更新任务状态失败");
+                }
             }
         } else {
             Location outSideLocation = locationService.getOutSideNear(location);
--
libgit2 0.22.2