From 51bd4ac4f323fab99ff9ac20763ca15af0e53a57 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期四, 22 一月 2026 21:51:15 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs |   39 +++++++++++++++------------------------
 1 files changed, 15 insertions(+), 24 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index e28d7e2..15db8e1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -5,6 +5,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_BasicService;
 using WIDESEA_Common.CommonEnum;
 using WIDESEA_Common.LocationEnum;
 using WIDESEA_Common.OrderEnum;
@@ -53,7 +54,7 @@
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
                 }
 
-                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�.ObjToInt())
+                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫佹搴撳瓨瀹屾垚.ObjToInt())
                 {
                     return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱");
                 }
@@ -68,43 +69,35 @@
                     return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
                 }
 
-
                 var newTask = new Dt_Task()
                 {                    
-                    CurrentAddress = stationCode,
+                    CurrentAddress = stations.GetValueOrDefault(stationCode) ?? "",
                     Grade = 0,
-                    NextAddress = stations.GetValueOrDefault(stationCode) ?? "",
+                    NextAddress = locationInfo.LocationCode,
                     PalletCode = palletCode,
                     Roadway = locationInfo.RoadwayNo,
-                    SourceAddress = stationCode,
+                    SourceAddress = stations.GetValueOrDefault(stationCode) ?? "",
                     TargetAddress = locationInfo.LocationCode,
                     TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                     TaskStatus = TaskStatusEnum.New.ObjToInt(),
                     WarehouseId = stockInfo.WarehouseId,
                     PalletType = stockInfo.PalletType,
-                    OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo
-                    
+                    OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo,
                 };
                 //绌虹
-                if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt())
+                if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()|| stockInfo.StockStatus == StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.閫佹搴撳瓨瀹屾垚.ObjToInt())
                 {
                     _unitOfWorkManage.BeginTran();
                     newTask.TaskType = TaskTypeEnum.InEmpty.ObjToInt();
-                    int taskId = BaseDal.AddData(newTask);
-                    newTask.TaskId = taskId;
 
-                    locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
-                    _locationInfoService.UpdateData(locationInfo);
-                    stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
-
-                    _stockRepository.UpdateData(stockInfo);
-                    _unitOfWorkManage.CommitTran();
-                }
-                //鏅轰粨鍏ユ櫤浠�
-                if (stockInfo.StockStatus == StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�.ObjToInt())
-                {
-                    _unitOfWorkManage.BeginTran();
-                    newTask.TaskType = TaskTypeEnum.AllocateInWarehouse.ObjToInt();
+                    if (stockInfo.StockStatus == StockStatusEmun.鏅轰粨鍏ユ櫤浠撶粍鐩樻殏瀛�.ObjToInt())
+                    {
+                        newTask.TaskType = TaskTypeEnum.AllocateInWarehouse.ObjToInt();
+                    }
+                    if (stockInfo.StockStatus == StockStatusEmun.閫佹搴撳瓨瀹屾垚.ObjToInt())
+                    {
+                        newTask.TaskType = TaskTypeEnum.InQuality.ObjToInt();
+                    }
                     int taskId = BaseDal.AddData(newTask);
                     newTask.TaskId = taskId;
 
@@ -125,8 +118,6 @@
                         inboundOrder = _inboundOrderService.Repository.QueryFirst(x => x.InboundOrderNo == orderNo && x.OrderStatus < InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt());
                     
                     }
-
-
                     stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
 
                     LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus;

--
Gitblit v1.9.3