From 36edb698388e79272608312820d869ab6f7cb304 Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期二, 31 三月 2026 09:18:08 +0800
Subject: [PATCH] 1

---
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index 9eccfaa..97ca58c 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -617,7 +617,7 @@
                                 return WebResponseContent.Instance.Error($"鏈壘鍒板搴旂殑鍏ュ簱鍗曟槑缁�");
                             }
 
-                            // 鏇存柊鍏ュ簱鍗曟槑缁嗙姸鎬�
+                            // 鏇存柊鍏ュ簱鍗曟槑缁嗙姸鎬�  
                             foreach (var inboundOrderDetail in inboundOrderDetails)
                             {
                                 // 妫�鏌ヨ鏄庣粏鏄惁宸插叏閮ㄥ叆搴�
@@ -901,7 +901,7 @@
                                          .ToList();
 
                                     Dt_InboundOrder? dt_InboundOrder = _inboundService.InbounOrderService.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderNo == inboundOrder.OrderNo).Includes(x => x.Details).First();
-                                    if (StockInfos.Count  == 0) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�");
+                                    if (StockInfos.Count == 0) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�");
 
                                     var houseSyncretism = new NewHouseInboundPassBack
                                     {
@@ -1783,7 +1783,7 @@
                                        .Where(x => x.OrderId == outboundOrder.Id)
                                        .ToList();
                             }
-                            if ((outboundOrderDetails == null && outboundOrderDetails1 == null) || (outboundOrderDetails.Count == 0  && outboundOrderDetails1.Count == 0))
+                            if ((outboundOrderDetails == null && outboundOrderDetails1 == null) || (outboundOrderDetails.Count == 0 && outboundOrderDetails1.Count == 0))
                             {
                                 throw new Exception($"鏈壘鍒版墭鐩� {stockInfo.PalletCode} 鍦ㄨ揣浣� {stockInfo.LocationCode} 涓婄殑鍑哄簱鍗曟槑缁�");
                             }
@@ -2275,10 +2275,14 @@
                         {
                             Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>()
                            .Where(x => x.OrderId == inboundOrder.Id && x.BatchNo == detail.BatchNo).First();
-                            outboundOrderDetails.Add(outboundOrderDetail);
+                            if (outboundOrderDetail != null)
+                            {
+                                outboundOrderDetails.Add(outboundOrderDetail);
+                            }
+                         
                         }
 
-                        for (var i = 0; i<outboundOrderDetails.Count; i++)
+                        for (var i = 0; i < outboundOrderDetails.Count; i++)
                         {
                             if (outboundOrderDetails[i].LocationName != null && outboundOrderDetails[i].LocationName != "")
                             {
@@ -3589,12 +3593,11 @@
         {
             Console.WriteLine($"馃搫 姝e湪鎵撳嵃鍒� {printerName}: {Path.GetFileName(filePath)}");
 
-            string command = $"lpr -P {printerName} \"{filePath}\"";
+            // 浣跨敤 lp 鍛戒护锛屾坊鍔� -o raw 閫夐」
+            string command = $"lp -d {printerName} -o raw \"{filePath}\"";
 
             ExecuteShellCommand(command);
         }
-
-
         /// <summary>
         /// 鎵ц Shell 鍛戒护
         /// </summary>

--
Gitblit v1.9.3