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 |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/wms/WMSHelper.cs b/wms/WMSHelper.cs
index 6591b02..7f9bb6e 100644
--- a/wms/WMSHelper.cs
+++ b/wms/WMSHelper.cs
@@ -1,11 +1,40 @@
 锘縰sing System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Security.Cryptography;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace HH.WCS.Mobox3.DSZSH.wms {
-    public class WMSHelper {
+using HH.WCS.Mobox3.DSZSH.models;
+using HH.WCS.Mobox3.DSZSH.util;
 
+using Newtonsoft.Json;
+
+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