From e070b26178e324ea7afecccb4c5ff41f96d2dd8d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 26 三月 2025 18:25:16 +0800 Subject: [PATCH] 一些更改 --- 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