From aa63e0401cea4e367c9d9fd620d996a688c0a01f Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 21 五月 2025 15:18:51 +0800
Subject: [PATCH] 添加PDA人工入库功能

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_ConveyorLine.cs |   17 ++++++++++++-----
 1 files changed, 12 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 518cc49..5f67e6c 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"
@@ -99,7 +99,14 @@
                 //}
                 var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode);
                 if (task == null) throw new Exception($"鏈壘鍒版墭鐩樺彿[{lineDTO.Barcode}]鐨勫叆搴撲换鍔�");
-                if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) return content;
+                if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt())
+                {
+                    task.NextAddress = "1004";
+                    task.CurrentAddress = lineDTO.stationCode;
+                    task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
+                    BaseDal.UpdateData(task);
+                    return content;
+                }
                 if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"鏈壘鍒版墭鐩樺彿[{lineDTO.Barcode}]鐨勫叆搴撲换鍔�");
 
                 //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"鎵樼洏鍙穂{lineDTO.Barcode}]鐨勫叆搴撲换鍔$姸鎬佷笉鍖归厤");
@@ -108,12 +115,12 @@
                 (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();
+                Dt_StockInfoDetail? stockInfoDetail = stockInfo.Details.FirstOrDefault();
 
                 if (/*lineDTO.Spec != 1 ||*/ lineDTO.Weight > 1500)//妫�娴嬫潯浠堕渶鏇存敼锛侊紒锛侊紒锛侊紒锛侊紒锛侊紒
                 {
                     //task.NextAddress = "101";
-                    task.TaskState = (int)InTaskStatusEnum.InException;
+                    //task.TaskState = (int)InTaskStatusEnum.InException;
                     task.Remark = $"鎵樼洏[{lineDTO.Barcode}]瓒呴噸";
                     //task.Remark = $"鎵樼洏[{lineDTO.Barcode}]淇℃伅涓嶅悎鏍�";
                     //stockInfo.StockStatus = StockStatusEmun.鍏ュ簱鎾ら攢.ObjToInt();
@@ -125,14 +132,14 @@
                     task.Remark = string.Empty;
                     task.TaskState = (int)InTaskStatusEnum.Line_InExecuting;
                     stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
-                    stockInfoDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
+                    if (stockInfoDetail != null) stockInfoDetail.Status = StockStatusEmun.鍏ュ簱纭.ObjToInt();
                 }
 
                 #region 浜嬪姟
                 Db.Ado.BeginTran();
                 BaseDal.UpdateData(task);
                 _stockService.StockInfoService.Repository.UpdateData(stockInfo);
-                _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
+                if (stockInfoDetail != null) _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
                 //Db.Updateable(stockInfo).ExecuteCommand();
                 Db.Ado.CommitTran();
                 #endregion

--
Gitblit v1.9.3