From 1d044540ee1b7041c7e89bdfe6d1339c99e80a4e Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期三, 08 一月 2025 14:41:16 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/HuaYiZhongHeng/BaiBuLiKu

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 931a2e7..78d25a5 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,20 +1,14 @@
-锘縰sing AngleSharp.Dom;
-using log4net.Core;
-using Mapster;
+锘縰sing Mapster;
 using Masuit.Tools;
-using SixLabors.Fonts.Tables.AdvancedTypographic;
-using System.Diagnostics;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using WIDESEA_Core.Const;
 using WIDESEA_DTO.MOM;
 using WIDESEA_DTO.WMS;
 using WIDESEA_IServices;
 using WIDESEA_IStoragIntegrationServices;
-using WIDESEA_StorageBasicRepository;
-using WIDESEA_StoragIntegrationServices;
 using WIDESEAWCS_BasicInfoRepository;
 using WIDESEAWCS_QuartzJob.Models;
+
 
 namespace WIDESEA_StorageTaskServices;
 
@@ -204,8 +198,8 @@
                     await DeleteStockInfoAsync(stock.Id);
                     await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
                     await AddStockInfoHtyAsync(stockInfo_Hty);
+                    await UpdateLocationAsync(loc); //璐ㄦ浠诲姟闇�瑕佹寔缁攣瀹氬簱浣�
                 }
-                await UpdateLocationAsync(loc);
                 await DeleteTaskAsync(task.TaskId);
                 await AddTaskHtyAsync(taskHty);
             });
@@ -1383,6 +1377,10 @@
             {
                 return content.Error("鏈煡璇㈠埌瀵瑰簲鐨勫簱瀛樹俊鎭�");
             }
+            if (stockInfo.LocationInfo.LocationStatus != (int)LocationEnum.InStock)
+            {
+                return content.Error("璇ヨ揣浣嶇姸鎬佷笉绛変簬銆愭湁璐с�戣鏌ョ湅鏄惁宸茬粡鏈変换鍔★紒");
+            }
 
             var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode);
             if (task != null)
@@ -1403,9 +1401,12 @@
             }
             else
             {
-                if (stockInfo.LocationInfo.RoadwayNo == "JZSC1")
+                if (stockInfo.LocationInfo.RoadwayNo.Contains("JZSC"))
                 {
-                    task = CreateTask(stockInfo, "002-021-001", taskType);
+                    var targetAddress = "002-021-001";
+                    if (stockInfo.LocationInfo.RoadwayNo == "JZSC4")
+                        targetAddress = "001-021-001";
+                    task = CreateTask(stockInfo, targetAddress, taskType);
                 }
             }
             //var taskId = await BaseDal.AddDataAsync(task);
@@ -1767,6 +1768,8 @@
 
     #endregion 澶栭儴鎺ュ彛鏂规硶
 
+
+
     #region 鍐呴儴璋冪敤鏂规硶
 
     /// <summary>
@@ -1959,6 +1962,10 @@
         taskHty.TaskId = 0;
         taskHty.OperateType = isHand ? (int)OperateTypeEnum.浜哄伐鍒犻櫎 : (int)OperateTypeEnum.鑷姩瀹屾垚;
         taskHty.SourceId = task.TaskId;
+        if (isHand)
+        {
+            taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
+        }
         taskHty.TaskState = TaskOutStatusEnum.OutFinish.ObjToInt();
         return taskHty;
     }

--
Gitblit v1.9.3