From 3f386cbcc5f488fcea63463cc5fcdede4fdcfb24 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期三, 21 八月 2024 01:45:13 +0800
Subject: [PATCH] 一些更改

---
 Tiger.Business.MES/WorkAction/PackingAction.cs |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Tiger.Business.MES/WorkAction/PackingAction.cs b/Tiger.Business.MES/WorkAction/PackingAction.cs
index 88f623c..e6db837 100644
--- a/Tiger.Business.MES/WorkAction/PackingAction.cs
+++ b/Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -560,10 +560,14 @@
 
         private List<MES_WIP_PKG> GetPackageList(WipPkgItem parent)
         {
-            List<MES_WIP_PKG> list = new() { parent.Package };
+            List<MES_WIP_PKG> list = new();
+            if (!parent.Package.IsNullOrEmpty())
+            {
+                list.Add(parent.Package);
+            }
             foreach (var item in parent.Items)
             {
-                item.Package.PARENT_SN = parent.Package.SN;
+                item.Package.PARENT_SN = parent.Package?.SN;
                 list.AddRange(GetPackageList(item));
             }
             return list;
@@ -659,7 +663,7 @@
                 }
                 if (_pkgList.Any())
                 {
-                    db.Insertable(_pkgList, CurPosition.UserCode).ExecuteCommand();
+                    db.Storageable(_pkgList, CurPosition.UserCode).ExecuteCommand();
                     foreach (var pkg in _pkgList)
                     {
                         //鍖呰淇℃伅淇濆瓨鍒板湪鍒跺搧淇℃伅琛�
@@ -685,6 +689,8 @@
                 CurPosition.NeedTemporaryStoreDBCommitAction = false;
                 //鍒犻櫎宸ュ簭涓婁笅鏂囦腑鐨勫寘瑁呰褰�
                 CurPosition.Context.Remove("CurPackage");
+                //action.LocaleMsg = new($"鏉$爜[{CurPkg.Item.Package?.SN}]鍖呰瀹屾垚");
+                action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPkg.Item.Package.SN);
             }
             else
             {
@@ -699,12 +705,13 @@
                 {
                     CurPosition.Context.Add("CurPackage", CurPkg);
                 }
+                //action.LocaleMsg = new($"鏉$爜[{CurPosition.CurSN}]鍖呰瀹屾垚");
+                action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPosition.CurSN);
             }
 
             IsFinished = true;
             action.Data.ShortMsg = new("鍖呰瀹屾垚", ShortMessage.Types.Success);
-            action.LocaleMsg = new($"鏉$爜[{CurPkg.Item.Package.SN}]鍖呰瀹屾垚");
-            action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPkg.Item.Package.SN);
+            
             return action;
         }
 

--
Gitblit v1.9.3