From 9f12ec67045443d165eae2670bfb22e17e4186ad Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期二, 26 十一月 2024 21:54:02 +0800
Subject: [PATCH] 优化了一些已知问题

---
 Tiger.Business.MES/Transaction/YadaPacking.cs  |   34 ++++++++++++++++++----------------
 Tiger.Dependencies/Tiger.Dependencies.csproj   |    8 ++++----
 Tiger.Business.MES/WorkAction/PackingAction.cs |    2 +-
 3 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/Tiger.Business.MES/Transaction/YadaPacking.cs b/Tiger.Business.MES/Transaction/YadaPacking.cs
index 5f40414..2efbd3f 100644
--- a/Tiger.Business.MES/Transaction/YadaPacking.cs
+++ b/Tiger.Business.MES/Transaction/YadaPacking.cs
@@ -413,23 +413,25 @@
                     }
                     ShippingOrder = IsPrintCustomerLabel ? ship?.ShipDoc ?? "" : "";
                     //缂撳瓨鍑鸿揣鏁伴噺
-                    if (Context.ContainsKey("CurShipQty"))
-                    {
-                        Context["CurShipQty"] = CurShipQty;
-                    }
-                    else
-                    {
-                        Context.Add("CurShipQty", CurShipQty);
-                    }
+                    Context.SetOrAdd("CurShipQty", CurShipQty);
+                    //if (Context.ContainsKey("CurShipQty"))
+                    //{
+                    //    Context["CurShipQty"] = CurShipQty;
+                    //}
+                    //else
+                    //{
+                    //    Context.Add("CurShipQty", CurShipQty);
+                    //}
                     //缂撳瓨鍑鸿揣绠辨暟
-                    if (Context.ContainsKey("CurWaitShipmentCarton"))
-                    {
-                        Context["CurWaitShipmentCarton"] = WaitShipmentCarton;
-                    }
-                    else
-                    {
-                        Context.Add("CurWaitShipmentCarton", WaitShipmentCarton);
-                    }
+                    Context.SetOrAdd("CurWaitShipmentCarton", WaitShipmentCarton);
+                    //if (Context.ContainsKey("CurWaitShipmentCarton"))
+                    //{
+                    //    Context["CurWaitShipmentCarton"] = WaitShipmentCarton;
+                    //}
+                    //else
+                    //{
+                    //    Context.Add("CurWaitShipmentCarton", WaitShipmentCarton);
+                    //}
 
                     curtime = DateTime.Now;  Logger.Console.Info($"{CurSN} : ***** 12 : {(curtime - prevtime).TotalSeconds}s", ConsoleColor.Green); prevtime = curtime;
                     //缁戝畾鏉$爜鍒板伐鍗�
diff --git a/Tiger.Business.MES/WorkAction/PackingAction.cs b/Tiger.Business.MES/WorkAction/PackingAction.cs
index 34d5977..3a12771 100644
--- a/Tiger.Business.MES/WorkAction/PackingAction.cs
+++ b/Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -84,7 +84,7 @@
                         IS_MIN_PKG = max.PkgType.IS_MIN_PKG,
                         PKG_LEVEL = max.PKG_LEVEL,
                         PKG_QTY = max.PKG_QTY,
-                        LABEL_CODE = LabelDic.Count >= max.PKG_LEVEL ? LabelDic[max.PKG_LEVEL]?.LABEL_CODE : null,
+                        LABEL_CODE = LabelDic?.GetValueOrDefault(max.PKG_LEVEL, null)?.LABEL_CODE,//LabelDic.Count >= max.PKG_LEVEL ? LabelDic[max.PKG_LEVEL]?.LABEL_CODE : null,
                         SN = CurPosition.GenerateSN(max.SN_RULE, this),
                     }
                 };
diff --git a/Tiger.Dependencies/Tiger.Dependencies.csproj b/Tiger.Dependencies/Tiger.Dependencies.csproj
index 51c837f..737c2f7 100644
--- a/Tiger.Dependencies/Tiger.Dependencies.csproj
+++ b/Tiger.Dependencies/Tiger.Dependencies.csproj
@@ -10,17 +10,17 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Autofac" Version="8.1.0" />
+    <PackageReference Include="Autofac" Version="8.1.1" />
     <PackageReference Include="Autofac.Configuration" Version="7.0.0" />
     <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
     <PackageReference Include="FluentScheduler" Version="5.5.1" />
-    <PackageReference Include="MailKit" Version="4.7.1.1" />
+    <PackageReference Include="MailKit" Version="4.8.0" />
     <PackageReference Include="NLog" Version="5.3.4" />
     <PackageReference Include="NLog.Database" Version="5.3.4" />
-    <PackageReference Include="Rhea.Common" Version="6.1.7.1359" />
+    <PackageReference Include="Rhea.Common" Version="6.1.7.1360" />
     <PackageReference Include="SharpZipLib" Version="1.4.2" />
     <PackageReference Include="Sundial" Version="2.64.0" />
-    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="7.1.0" />
   </ItemGroup>
 
 </Project>

--
Gitblit v1.9.3