From e4ccb1dbd2af10d3322cba90722baf059e5bc853 Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期三, 18 九月 2024 22:59:23 +0800
Subject: [PATCH] 优化工步信息机制

---
 Tiger.Business.MESTests/Transaction/PositionTests.cs   |   20 ++++++
 Tiger.Business.MES/Transaction/CollectNode.cs          |   20 +++---
 Tiger.Business.MESTests/Tiger.Business.MESTests.csproj |   27 +++++++++
 Tiger.Business.MES/Transaction/PackingNode.cs          |   22 +++---
 Tiger.Api.sln                                          |   13 ++++
 Tiger.Business.MES/Transaction/Position.cs             |   22 +++++-
 Tiger.Business.MESTests/MesTests.cs                    |   21 +++++++
 Tiger.Business.MES/Transaction/TestNode.cs             |   20 +++---
 8 files changed, 128 insertions(+), 37 deletions(-)

diff --git a/Tiger.Api.sln b/Tiger.Api.sln
index b4ff214..9e7b9d2 100644
--- a/Tiger.Api.sln
+++ b/Tiger.Api.sln
@@ -28,7 +28,9 @@
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tiger.Business.MengQi", "Tiger.Business.MengQi\Tiger.Business.MengQi.csproj", "{DD5B5282-B673-45CB-8608-3AAEB4A469B9}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiger.Business.WMS", "Tiger.Business.WMS\Tiger.Business.WMS.csproj", "{83F123C4-3E7A-485E-A99C-3FE66CA5867E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tiger.Business.WMS", "Tiger.Business.WMS\Tiger.Business.WMS.csproj", "{83F123C4-3E7A-485E-A99C-3FE66CA5867E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiger.Business.MESTests", "Tiger.Business.MESTests\Tiger.Business.MESTests.csproj", "{2E20369F-54FD-4197-B2F8-761F651143EC}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -94,6 +96,14 @@
 		{83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|Any CPU.Build.0 = Release|Any CPU
 		{83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|x86.ActiveCfg = Release|Any CPU
 		{83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|x86.Build.0 = Release|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Debug|x86.Build.0 = Debug|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Release|x86.ActiveCfg = Release|Any CPU
+		{2E20369F-54FD-4197-B2F8-761F651143EC}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -106,6 +116,7 @@
 		{3848BCAB-4E77-4D5E-8BF0-2A747981C1B4} = {70881CAB-17ED-4C46-895A-62F2CE39A607}
 		{DD5B5282-B673-45CB-8608-3AAEB4A469B9} = {70881CAB-17ED-4C46-895A-62F2CE39A607}
 		{83F123C4-3E7A-485E-A99C-3FE66CA5867E} = {70881CAB-17ED-4C46-895A-62F2CE39A607}
+		{2E20369F-54FD-4197-B2F8-761F651143EC} = {CF29B377-FE5A-488A-AF99-DF9D9C6FCA95}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {797A1D83-9F3C-4AEC-8A83-E3468102DBD1}
diff --git a/Tiger.Business.MES/Transaction/CollectNode.cs b/Tiger.Business.MES/Transaction/CollectNode.cs
index 3a9ca91..82ace7f 100644
--- a/Tiger.Business.MES/Transaction/CollectNode.cs
+++ b/Tiger.Business.MES/Transaction/CollectNode.cs
@@ -54,12 +54,12 @@
                         if (!action.IsSuccessed)
                         {
                             var info = WoContext.GetSnOperInfo(input.SN).Data;
-                            info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                            info.InputQty = CurOperInfo(input.Locale).InputQty;
                             action.Data.OperInfo = info;
                         }
                         else if (!IsFinishAllSteps)
                         {
-                            action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                            action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                         }
                     }
                     //褰撳墠宀椾綅鍦ㄥ綋鍓嶅伐鍗曚笉鏄绔欙紝鍒欐煡鎵炬潯鐮佸凡缁戝畾鐨勫伐鍗曞綋浣滃綋鍓嶅伐鍗�
@@ -101,12 +101,12 @@
                                 if (!action.IsSuccessed && !CurWipSNs.Any())
                                 {
                                     var info = WoContext.GetSnOperInfo(input.SN).Data;
-                                    info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                                    info.InputQty = CurOperInfo(input.Locale).InputQty;
                                     action.Data.OperInfo = info;
                                 }
                                 else if (!IsFinishAllSteps)
                                 {
-                                    action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                                    action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                                 }
                             }
                         }
@@ -144,7 +144,7 @@
                     if (submitStep.IsNullOrEmpty())
                     {
                         action = BeginNextActionStep(input);
-                        action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                        action.Data.OperInfo = CurOperInfo(input.Locale);
                     }
                     else
                     {
@@ -174,7 +174,7 @@
                         }
                         else
                         {
-                            result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                            result.Data.OperInfo = CurOperInfo(input.Locale);
                         }
                         return result;
                     }
@@ -183,7 +183,7 @@
                 else
                 {
                     action.Data.ShortMsg = new("閲嶇疆鎵弿", ShortMessage.Types.Error);
-                    action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                    action.Data.OperInfo = CurOperInfo(input.Locale);
                     ResetNode();
 	                action.IsSuccessed = false;
 	                //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE);
@@ -193,7 +193,7 @@
             catch (Exception ex)
             {
                 action.Data.ShortMsg = new("宸ュ簭寮傚父", ShortMessage.Types.Error);
-                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                action.Data.OperInfo = CurOperInfo(input.Locale);
                 ResetNode();
                 //action.CatchExceptionWithLog(ex, $"閲囬泦宸ュ簭锛氭彁浜ゆ搷浣滄暟鎹紓甯�");
                 action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.CollectNode.SubmitException"));
@@ -532,8 +532,8 @@
             SaveStepsCommitActionToDB();
 
             //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭�
-            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
-            action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], locale);
+            CurOperInfo(locale).InputQty += CurWipSNs.Count;
+            action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(locale));
             action.Data.ShortMsg = new("杩囩珯鎴愬姛", ShortMessage.Types.Success);
             //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
             action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
diff --git a/Tiger.Business.MES/Transaction/PackingNode.cs b/Tiger.Business.MES/Transaction/PackingNode.cs
index 93aa82c..0676096 100644
--- a/Tiger.Business.MES/Transaction/PackingNode.cs
+++ b/Tiger.Business.MES/Transaction/PackingNode.cs
@@ -55,7 +55,7 @@
                     //濡傛灉琛屼负琚爣璁版垚宸插畬鎴愶紝鍒欓噸缃伐搴�
                     if (TempPkgAction.IsFinished)
                     {
-                        action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                        action.Data.OperInfo = CurOperInfo(input.Locale);
                         ResetNode();
                     }
                 }
@@ -77,12 +77,12 @@
                             if (!action.IsSuccessed)
                             {
                                 var info = WoContext.GetSnOperInfo(input.SN).Data;
-                                info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                                info.InputQty = CurOperInfo(input.Locale).InputQty;
                                 action.Data.OperInfo = info;
                             }
                             else if (!IsFinishAllSteps)
                             {
-                                action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                                action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                             }
                         }
                         //褰撳墠宀椾綅鍦ㄥ綋鍓嶅伐鍗曚笉鏄绔欙紝鍒欐煡鎵炬潯鐮佸凡缁戝畾鐨勫伐鍗曞綋浣滃綋鍓嶅伐鍗�
@@ -142,12 +142,12 @@
                                     if (!action.IsSuccessed && !CurWipSNs.Any())
                                     {
                                         var info = WoContext.GetSnOperInfo(input.SN).Data;
-                                        info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                                        info.InputQty = CurOperInfo(input.Locale).InputQty;
                                         action.Data.OperInfo = info;
                                     }
                                     else if (!IsFinishAllSteps)
                                     {
-                                        action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                                        action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                                     }
                                 }
                             }
@@ -185,7 +185,7 @@
                         if (submitStep.IsNullOrEmpty())
                         {
                             action = BeginNextActionStep(input);
-                            action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                            action.Data.OperInfo = CurOperInfo(input.Locale);
                         }
                         else
                         {
@@ -215,7 +215,7 @@
                             }
                             else
                             {
-                                result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                                result.Data.OperInfo = CurOperInfo(input.Locale);
                             }
                             return result;
                         }
@@ -224,7 +224,7 @@
                     else
                     {
                         action.Data.ShortMsg = new("閲嶇疆鎵弿", ShortMessage.Types.Error);
-                        action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                        action.Data.OperInfo = CurOperInfo(input.Locale);
                         ResetNode();
 	                    action.IsSuccessed = false;
 	                    //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE);
@@ -235,7 +235,7 @@
             catch (Exception ex)
             {
                 action.Data.ShortMsg = new("宸ュ簭寮傚父", ShortMessage.Types.Error);
-                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                action.Data.OperInfo = CurOperInfo(input.Locale);
                 //action.CatchExceptionWithLog(ex, $"鍖呰宸ュ簭锛氭彁浜ゆ搷浣滄暟鎹紓甯�");
                 action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.SubmitException"));
             }
@@ -573,8 +573,8 @@
             SaveStepsCommitActionToDB();
 
             //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭�
-            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
-            action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], locale);
+            CurOperInfo(locale).InputQty += CurWipSNs.Count;
+            action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(locale));
             action.Data.ShortMsg = new("杩囩珯鎴愬姛", ShortMessage.Types.Success);
             //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
             action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs
index 5dcbd97..700e73a 100644
--- a/Tiger.Business.MES/Transaction/Position.cs
+++ b/Tiger.Business.MES/Transaction/Position.cs
@@ -73,8 +73,8 @@
         public bool NeedTemporaryStoreDBCommitAction { get; set; } = false;
         protected Dictionary<string, List<Action>> DBCommitList { get; set; } = new();
         protected List<Position> NodeCommitList { get; set; } = new();
-        protected Dictionary<string, OperInfo> OperInfoDic { get; set; } = new();
-        //protected OperInfo CurOperInfo { get; set; }
+        private Dictionary<string, OperInfo> OperInfoDic = new();
+
         #endregion Propertys & Variables
 
         #region Functions
@@ -196,22 +196,32 @@
             CurDefects.Clear();
         }
 
+        //鑾峰彇褰撳墠鐨勫伐搴忎俊鎭�
+        protected OperInfo CurOperInfo(string locale)
+        {
+            OperInfo info = new();
+            if (CurBatch?.Batch?.BATCH_NO != null)
+            {
+                info = OperInfoDic[CurBatch.Batch.BATCH_NO ];
+                info.StepsInfo = Steps.Select(q => q.GetInfo(locale)).ToList();
+            }
+            return info;
+        }
+
         /// <summary>
         /// 璁剧疆褰撳墠鏉$爜鐨勫伐搴忎俊鎭�
         /// </summary>
-        public OperInfo SetOperNodeInfo(OperInfo info, string locale)
+        public OperInfo SetOperNodeInfo(OperInfo info)
         {
             if (CurWipSNs.Any())
             {
                 info.CurNode = CurWipSNs.First().NODE_NAME;
                 info.NextNode = string.Join(",", CurBatch.GetNextNodes(CurWipSNs.First()).Select(q => q.NODE_NAME));
-                info.StepsInfo = Steps.Select(q => q.GetInfo(locale)).ToList();
             }
             else
             {
                 info.CurNode = "   鈥�   ";
                 info.NextNode = "   鈥�   ";
-                info.StepsInfo = new();
             }
             return info;
         }
@@ -424,6 +434,7 @@
             }
         }
 
+        #region 鎵撳嵃涓撶敤鏂规硶
         /// <summary>
         /// 鑾峰彇鎵撳嵃鏍囩妯℃澘杩囩▼鍙橀噺鍊�
         /// </summary>
@@ -549,6 +560,7 @@
             return result;
         }
 
+        #endregion
         #endregion Functions
 
         public override bool Close(bool needSaveHistoryLog = false)
diff --git a/Tiger.Business.MES/Transaction/TestNode.cs b/Tiger.Business.MES/Transaction/TestNode.cs
index b95ba93..4fd4de0 100644
--- a/Tiger.Business.MES/Transaction/TestNode.cs
+++ b/Tiger.Business.MES/Transaction/TestNode.cs
@@ -55,12 +55,12 @@
                         if (!action.IsSuccessed)
                         {
                             var info = WoContext.GetSnOperInfo(input.SN).Data;
-                            info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                            info.InputQty = CurOperInfo(input.Locale).InputQty;
                             action.Data.OperInfo = info;
                         }
                         else if (!IsFinishAllSteps)
                         {
-                            action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                            action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                         }
                     }
                     //褰撳墠宀椾綅鍦ㄥ綋鍓嶅伐鍗曚笉鏄绔欙紝鍒欐煡鎵炬潯鐮佸凡缁戝畾鐨勫伐鍗曞綋浣滃綋鍓嶅伐鍗�
@@ -102,12 +102,12 @@
                                 if (!action.IsSuccessed && !CurWipSNs.Any())
                                 {
                                     var info = WoContext.GetSnOperInfo(input.SN).Data;
-                                    info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
+                                    info.InputQty = CurOperInfo(input.Locale).InputQty;
                                     action.Data.OperInfo = info;
                                 }
                                 else if (!IsFinishAllSteps)
                                 {
-                                    action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], input.Locale);
+                                    action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale));
                                 }
                             }
                         }
@@ -145,7 +145,7 @@
                     if (submitStep.IsNullOrEmpty())
                     {
                         action = BeginNextActionStep(input);
-                        action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                        action.Data.OperInfo = CurOperInfo(input.Locale);
                     }
                     else
                     {
@@ -175,7 +175,7 @@
                         }
                         else
                         {
-                            result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
+                            result.Data.OperInfo = CurOperInfo(input.Locale);
                         }
                         return result;
                     }
@@ -184,7 +184,7 @@
                 else
                 {
                     action.Data.ShortMsg = new("閲嶇疆鎵弿", ShortMessage.Types.Error);
-                    action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                    action.Data.OperInfo = CurOperInfo(input.Locale);
                     ResetNode();
 	                action.IsSuccessed = false;
 	                //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE);
@@ -194,7 +194,7 @@
             catch (Exception ex)
             {
                 action.Data.ShortMsg = new("宸ュ簭寮傚父", ShortMessage.Types.Error);
-                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
+                action.Data.OperInfo = CurOperInfo(input.Locale);
                 //action.CatchExceptionWithLog(ex, $"娴嬭瘯宸ュ簭锛氭彁浜ゆ搷浣滄暟鎹紓甯�");
                 action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.TestNode.SubmitException"));
             }
@@ -532,8 +532,8 @@
             SaveStepsCommitActionToDB();
 
             //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭�
-            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
-            action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO], locale);
+            CurOperInfo(locale).InputQty += CurWipSNs.Count;
+            action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(locale));
             action.Data.ShortMsg = new("杩囩珯鎴愬姛", ShortMessage.Types.Success);
             //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
             action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME, CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
diff --git a/Tiger.Business.MESTests/MesTests.cs b/Tiger.Business.MESTests/MesTests.cs
new file mode 100644
index 0000000..6a2ea24
--- /dev/null
+++ b/Tiger.Business.MESTests/MesTests.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tiger.Business.MESTests
+{
+    [TestClass()]
+    public class MesTests
+    {
+        [TestMethod()]
+        public void CommonTest()
+        {
+            var date = new DateTime(2022,1,1);
+            int week = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Sunday);
+            ;
+        }
+    }
+}
diff --git a/Tiger.Business.MESTests/Tiger.Business.MESTests.csproj b/Tiger.Business.MESTests/Tiger.Business.MESTests.csproj
new file mode 100644
index 0000000..4aae2e0
--- /dev/null
+++ b/Tiger.Business.MESTests/Tiger.Business.MESTests.csproj
@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+
+    <IsPackable>false</IsPackable>
+    <IsTestProject>true</IsTestProject>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="coverlet.collector" Version="6.0.0" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
+    <PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
+    <PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Tiger.Business.MES\Tiger.Business.MES.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
+  </ItemGroup>
+
+</Project>
diff --git a/Tiger.Business.MESTests/Transaction/PositionTests.cs b/Tiger.Business.MESTests/Transaction/PositionTests.cs
new file mode 100644
index 0000000..fea1a13
--- /dev/null
+++ b/Tiger.Business.MESTests/Transaction/PositionTests.cs
@@ -0,0 +1,20 @@
+锘縰sing Microsoft.VisualStudio.TestTools.UnitTesting;
+using Tiger.Business.MES.Transaction;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tiger.Business.MES.Transaction.Tests
+{
+    [TestClass()]
+    public class PositionTests
+    {
+        [TestMethod()]
+        public void GetPrintProcessValueTest()
+        {
+            Assert.Fail();
+        }
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3