From 90a0c4e0ab42a3574cfb6f9fd3b031dac9e7fb0d Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 13 三月 2025 18:04:58 +0800
Subject: [PATCH] 空托出入库

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
index 90c8d2c..3e82900 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
@@ -303,7 +303,10 @@
                 Dt_LocationInfo? locationInfo = null;
                 string CarChargingStation = AppSettings.Configuration[nameof(CarChargingStation)];//鑾峰彇绌挎杞﹀厖鐢典綅缃�
                 var ChargingStations = CarChargingStation.Split(",");
-                Dt_StockInfoDetail instockInfoDetail = _stockService.StockInfoDetailService.Repository.QueryData(x => x.MaterielCode == stockInfoDetail.MaterielCode).OrderByDescending(x => x.CreateDate).First();
+                Dt_StockInfoDetail? instockInfoDetail = null;
+                var instockInfoDetails = _stockService.StockInfoDetailService.Repository.QueryData(x => x.MaterielCode == stockInfoDetail.MaterielCode && x.Status == StockStatusEmun.宸插叆搴�.ObjToInt());
+                if (instockInfoDetails != null && instockInfoDetails.Count > 0)
+                    instockInfoDetail = instockInfoDetails.OrderByDescending(x => x.CreateDate).First();
                 if (instockInfoDetail != null) instockInfo = _stockService.StockInfoService.Repository.GetStockInfo(instockInfoDetail.StockId);
                 if (instockInfo != null)//鏃犲簱瀛�
                 {
@@ -323,6 +326,12 @@
                 }
                 if (locationInfo == null) locationInfo = _basicService.LocationInfoService.AssignLocation(2);//閲嶆柊鍒嗛厤璐т綅
                 if (locationInfo == null) throw new Exception($"鏃犲彲鍏ヨ揣浣�");
+                Dt_LocationInfo? locationInfo1 = null;
+                if (locationInfo.Row == 1)
+                {
+                    locationInfo1 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == 2 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column);
+                    locationInfo1.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
+                }
 
                 task.TaskState = (int)InTaskStatusEnum.SC_InExecuting;
                 task.CurrentAddress = task.NextAddress;
@@ -343,6 +352,7 @@
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                 _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                 _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
+                if (locationInfo1 != null) _basicService.LocationInfoService.Repository.UpdateData(locationInfo1);
                 Db.Ado.CommitTran();
 
                 return WebResponseContent.Instance.OK(data: new ReceiveWMSInfo()

--
Gitblit v1.9.3