From 63e94e068622d4ef843cee0d19d4f2d231316304 Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期五, 25 七月 2025 17:20:38 +0800 Subject: [PATCH] 完善查询语句, 日志记录的封装 --- wms/WMSHelper.cs | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/wms/WMSHelper.cs b/wms/WMSHelper.cs index 8bdebba..7f9bb6e 100644 --- a/wms/WMSHelper.cs +++ b/wms/WMSHelper.cs @@ -13,7 +13,28 @@ using static HH.WCS.Mobox3.DSZSH.api.ApiModel; namespace HH.WCS.Mobox3.DSZSH.wms { + /// <summary> + /// [ 鍏蜂綋涓氬姟 ] 甯姪绫�+ /// </summary> public class WMSHelper { + /// <summary> + /// 妫�煡瀹瑰櫒绫诲瀷 + /// </summary> + /// <param name="cntrCode"></param> + /// <param name="cntrType"></param> + /// <param name="cntr"></param> + /// <returns></returns> + public static (bool, string) CheckCntrType(string cntrCode, string cntrType, out TN_Container cntr) { + var db = new SqlHelper<object>().GetInstance(); + cntr = db.Queryable<TN_Container>().Where(c => c.S_CODE == cntrCode).First(); + if (cntr == null) { + return (false, $"瀹瑰櫒'{cntrCode}'鍦╗瀹瑰櫒琛╙涓笉瀛樺湪,璇峰湪鍓嶅彴椤甸潰涓淮鎶�!"); + } + if (cntr.S_TYPE != cntrType) { + return (false, $"瀹瑰櫒'{cntrCode}'鍦╗瀹瑰櫒琛╙涓殑绫诲瀷涓�{cntr.S_TYPE}',涓庡綋鍓嶆祦绋嬫墍闇�鍣ㄧ被鍨�{cntrType}'涓嶅悓!!"); + } + return (true, "妫�煡瀹瑰櫒绫诲瀷鎴愬姛!!"); + } } } -- Gitblit v1.9.1