From 829eabf256e29392ca63f6da48829dba3b075dfe Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期五, 24 一月 2025 08:59:53 +0800
Subject: [PATCH] 资料,优化程序

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs |   90 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 86 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
index 1fb3e85..48b9dfe 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
@@ -440,9 +440,9 @@
                                 {
                                     string[] targetCodesst = dt_StockInfo.PalletCode.Split("*");
                                     Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodesst[0]);
-                                    if (dt_Inbound.Startingcolumn != 0 || dt_Inbound.Startingcolumn != 0)
+                                    if (dt_Inbound.Startingcolumn != 0 || dt_Inbound.Terminationcolumn != 0)
                                     {
-                                        newLocation = _basicService.LocationInfoService.GetLocation2(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Startingcolumn);
+                                        newLocation = _basicService.LocationInfoService.GetLocation2(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Terminationcolumn);
                                     }
                                     else
                                     {
@@ -489,6 +489,7 @@
                                     loca.Add(newLocation);
                                     loca.Add(locationInfos);
                                     _basicService.LocationInfoService.UpdateData(loca);
+                                    BaseDal.AddData(dt_Task);
                                     _unitOfWorkManage.CommitTran();
                                     return content = WebResponseContent.Instance.OK(data: dt_Task);
                                 }
@@ -927,7 +928,7 @@
                     }
                     else
                     {
-                        return content = WebResponseContent.Instance.Error($"鍑哄簱澶辫触锛屾湭鎵惧埌瀵瑰簲鐨勫簱瀛樹俊鎭紝搴撳瓨缂栧彿锛歿pallid}");
+                        return content = WebResponseContent.Instance.Error($"淇敼澶辫触锛屾湭鎵惧埌瀵瑰簲鐨勫簱瀛樹俊鎭紝搴撳瓨缂栧彿锛歿pallid}");
 
                     }
                 }
@@ -943,7 +944,51 @@
             catch (Exception ex)
             {
                 _unitOfWorkManage.RollbackTran();
-                return content = WebResponseContent.Instance.Error($"鍑哄簱澶辫触锛屾姤閿欎俊鎭細{ex.Message}");
+                return content = WebResponseContent.Instance.Error($"淇敼澶辫触锛屾姤閿欎俊鎭細{ex.Message}");
+                throw;
+            }
+        }
+
+        public WebResponseContent ManualOutbound4(SaveModel saveModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>();
+
+
+                List<Dt_StockInfo> stocktData = _stockService.StockInfoService.Repository.QueryData(x => x.StockStatus == (int)StockStatusEmun.宸插叆搴�);
+                string json = saveModel.DelKeys[0].ToString();
+                List<int> palletCodes = JsonConvert.DeserializeObject<List<int>>(json);
+
+                foreach (int pallid in palletCodes)
+                {
+                    Dt_StockInfo stockt = stocktData.FirstOrDefault(x => x.Id == pallid);
+                    if (stockt != null)
+                    {
+
+                        stockt.Mgeneratetime = DateTime.Parse(saveModel.DelKeys[1].ToString());
+                        dtstockt.Add(stockt);
+                    }
+                    else
+                    {
+                        return content = WebResponseContent.Instance.Error($"淇敼澶辫触锛屾湭鎵惧埌瀵瑰簲鐨勫簱瀛樹俊鎭紝搴撳瓨缂栧彿锛歿pallid}");
+
+                    }
+                }
+                _unitOfWorkManage.BeginTran();
+                if (dtstockt.Count > 0)
+                {
+                    _stockService.StockInfoService.Repository.UpdateData(dtstockt);
+                }
+                _unitOfWorkManage.CommitTran();
+                content = WebResponseContent.Instance.OK($"淇敼鎴愬姛");
+                return content;
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return content = WebResponseContent.Instance.Error($"淇敼澶辫触锛屾姤閿欎俊鎭細{ex.Message}");
                 throw;
             }
         }
@@ -1241,6 +1286,7 @@
                     BaseDal.DeleteData(task);
                     BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎);
                     WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍑哄簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷");
+                    WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎");
                     return content = WebResponseContent.Instance.Error($"鍑哄簱浠诲姟鍙栨秷鎴愬姛");
 
                 }
@@ -1263,6 +1309,42 @@
                     BaseDal.DeleteData(task);
                     BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎);
                     WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷");
+                    WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎");
+                    return content = WebResponseContent.Instance.Error($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛");
+                }
+                else if (task.TaskType == (int)TaskTypeEnum.RelocationIn)    //搴撳唴绉诲簱
+                {
+                    //澶勭悊鍑哄簱鐨勯�昏緫
+                    Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+                    if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt() || locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt())
+                    {
+                        locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                    }
+                    _basicService.LocationInfoService.Repository.UpdateData(locationinfo);
+
+                    Dt_LocationInfo locationinfo2 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+                    if (locationinfo2.LocationStatus == LocationStatusEnum.Lock.ObjToInt())
+                    {
+                        locationinfo2.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+                    }
+                    if (locationinfo2.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt())
+                    {
+                        locationinfo2.LocationStatus = LocationStatusEnum.Pallet.ObjToInt();
+                    }
+                    _basicService.LocationInfoService.Repository.UpdateData(locationinfo2);
+                    Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode);
+                    stockInfo.StockStatus = (int)StockStatusEmun.宸插叆搴�;
+                    _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+                    Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id);
+                    if (stocktdetail != null)
+                    {
+                        stocktdetail.Status = (int)StockStatusEmun.宸插叆搴�;
+                        _stockService.StockInfoDetailService.Repository.UpdateData(stocktdetail);
+                    }
+                    BaseDal.DeleteData(task);
+                    BaseDal.DeleteAndMoveIntoHty(task, OperateType.浜哄伐鍒犻櫎);
+                    WriteLog.GetLog("浠诲姟鏃ュ織").Write($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛锛屾墭鐩樻潯鐮侊細{task.PalletCode}", $"浠诲姟鍙栨秷");
+                    WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "浠诲姟鍒犻櫎");
                     return content = WebResponseContent.Instance.Error($"鍏ュ簱浠诲姟鍙栨秷鎴愬姛");
                 }
                 else

--
Gitblit v1.9.3