From da5c19c0b36250c10ae52c32ec4d05478a97077b Mon Sep 17 00:00:00 2001
From: Rodney Chen <rodney.chen@hotmail.com>
Date: 星期四, 02 一月 2025 14:58:33 +0800
Subject: [PATCH] Merge branch 'master' of http://47.115.28.255:8110/r/TigerClouds-Tech/Server/TigerApi6_2024

---
 Tiger.Business.MES/BIZ/BizBasRule.cs |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/Tiger.Business.MES/BIZ/BizBasRule.cs b/Tiger.Business.MES/BIZ/BizBasRule.cs
index cce51a1..d93d1ed 100644
--- a/Tiger.Business.MES/BIZ/BizBasRule.cs
+++ b/Tiger.Business.MES/BIZ/BizBasRule.cs
@@ -14,6 +14,7 @@
 using Tiger.Model.Entitys.MES.BizMesWoBatch;
 using Tiger.Model.Entitys.MES.BizMesWo;
 using Tiger.Model.Entitys.MES.BizBasPkgRule;
+using Tiger.Model.Entitys.MES.Position;
 
 namespace Tiger.Business.MES
 {
@@ -109,5 +110,29 @@
             }
             return result;
         }
+
+        /// <summary>
+        /// 鑾峰彇绠卞彿
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        public async Task<ApiAction> GetCardOrBoxCode(GetCodeInput input)
+        {
+            var result = new ApiAction();
+            try
+            {
+                if (input.BatchNo.IsNullOrEmpty())
+                {
+                    result.IsSuccessed = false;
+                    result.LocaleMsg = new($"宸ュ崟鎵规鍙蜂笉鑳戒负绌猴紝鏄惁鏈壂鎻忓伐鍗曪紵");
+                }
+                result.Data = input.IsTry == "Y" ? Cache.CodeRule[input.Code]?.TryGenerate(input.Prefix, $"{input.BatchNo}-{input.Qty}-").Data.ToString() ?? "" : Cache.CodeRule[input.Code]?.Generate(input.Prefix, $"{input.BatchNo}-{input.Qty}-").Data.ToString() ?? "";
+            }
+            catch (Exception ex)
+            {
+                result.CatchExceptionWithLog(ex, "鑾峰彇绠卞彿寮傚父");
+            }
+            return result;
+        }
     }
 }

--
Gitblit v1.9.3