From c827fe7b0c5b3b444d76ba0d96a2649c764630dd Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 14 十一月 2024 16:36:08 +0800
Subject: [PATCH] 修改WCS、WMS出入库逻辑

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

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
index 402308f..9623a53 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs"
@@ -97,7 +97,7 @@
         /// <returns></returns>
         public WebResponseContent TransmissionlineRequest(ConveyorLineDTO lineDTO)
         {
-            WebResponseContent content = new WebResponseContent();
+            WebResponseContent content = new WebResponseContent().OK();
             try
             {
                 //if (BaseDal.QueryFirst(x => (x.SourceAddress == lineDTO.stationCode || x.CurrentAddress == lineDTO.stationCode) && x.TaskStatus == InTaskStatusEnum.AGV_InFinish.ObjToInt()) != null)
@@ -106,31 +106,37 @@
                 //}
                 var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt());
                 if (task == null) throw new Exception($"鏈壘鍒版墭鐩樺彿[{lineDTO.Barcode}]鐨勫叆搴撲换鍔�");
-                if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"鎵樼洏鍙穂{lineDTO.Barcode}]鐨勫叆搴撲换鍔$姸鎬佷笉鍖归厤");
+                //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"鎵樼洏鍙穂{lineDTO.Barcode}]鐨勫叆搴撲换鍔$姸鎬佷笉鍖归厤");
 
                 Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(lineDTO.Barcode);
                 (bool, string) result = CheckRequestInbound(lineDTO.stationCode, lineDTO.Barcode, true, stockInfo);
                 if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
+
+                Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault();
 
                 if (lineDTO.Spec != 1 || lineDTO.Weight != 500)//妫�娴嬫潯浠堕渶鏇存敼锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
                 {
                     task.NextAddress = "101";
                     task.TaskState = (int)InTaskStatusEnum.InException;
                     task.Remark = $"鎵樼洏[{lineDTO.Barcode}]淇℃伅涓嶅悎鏍�";
-                    stockInfo.StockStatus = StockStatusEmun.鍏ュ簱鎾ら攢.ObjToInt();
+                    //stockInfo.StockStatus = StockStatusEmun.鍏ュ簱鎾ら攢.ObjToInt();
                 }
                 else
                 {
                     task.NextAddress = "104";
                     task.CurrentAddress = lineDTO.stationCode;
+                    task.Remark=string.Empty;
                     task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
                     stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
+                    stockInfoDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
                 }
 
                 #region 浜嬪姟
                 Db.Ado.BeginTran();
                 BaseDal.UpdateData(task);
-                Db.Updateable(stockInfo);
+                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+                _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
+                //Db.Updateable(stockInfo).ExecuteCommand();
                 Db.Ado.CommitTran();
                 #endregion
                 if (!string.IsNullOrEmpty(task.Remark)) throw new Exception(task.Remark);
@@ -177,7 +183,7 @@
                     TaskState = InTaskStatusEnum.InNew.ObjToInt(),
                     TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                 };
-                dt_Task.Dispatchertime = DateTime.Now;
+                dt_Task.Dispatchertime = dt_Task.CreateDate;
                 Db.Ado.BeginTran();
                 BaseDal.AddData(dt_Task);
                 task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode && x.TaskType == TaskTypeEnum.Inbound.ObjToInt());

--
Gitblit v1.9.3