服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2025-04-06 d2f14f6bb44c6dd19cc0816a033452b6de56184b
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;
        }
    }
}