From 1db2dcbec358ed43724e8621d7d99981ba4c1ad2 Mon Sep 17 00:00:00 2001
From: hudong <Administrator@PC-20250329JZUF>
Date: 星期五, 30 五月 2025 17:00:22 +0800
Subject: [PATCH] 1.其他出入库返回参数优化 2.生产订单接收返回参数修改 3.空托出入库逻辑修改(可以选择半托的托盘进行入库)

---
 /dev/null                    |  841 ----------------------------------------------------
 api/WmsSpaHelper.cs          |   65 +++
 wms/WMSHelper.cs             |    2 
 api/ApiModel.cs              |    1 
 models/TN_Material_KC.cs     |   17 +
 HH.WCS.Mobox3.pinggao.csproj |    1 
 6 files changed, 79 insertions(+), 848 deletions(-)

diff --git a/HH.WCS.Mobox3.pinggao.csproj b/HH.WCS.Mobox3.pinggao.csproj
index 5b83381..81102a3 100644
--- a/HH.WCS.Mobox3.pinggao.csproj
+++ b/HH.WCS.Mobox3.pinggao.csproj
@@ -198,6 +198,7 @@
     <Compile Include="models\TN_Location_Ext.cs" />
     <Compile Include="models\TN_Ll_detail.cs" />
     <Compile Include="models\TN_Ll_Order.cs" />
+    <Compile Include="models\TN_Material_KC.cs" />
     <Compile Include="models\TN_Supplier_detial.cs" />
     <Compile Include="models\WorkOrder.cs" />
     <Compile Include="models\TN_PRICE.cs" />
diff --git a/api/ApiModel.cs b/api/ApiModel.cs
index 5e134dd..22c399b 100644
--- a/api/ApiModel.cs
+++ b/api/ApiModel.cs
@@ -360,6 +360,7 @@
         public class KtSorting
         {
             public string cntr_code { get; set; }//瀹瑰櫒
+            public string item_code { get; set; }
 
             public string start { get; set; }//瀹瑰櫒
             public int? Type { get; set; }
diff --git a/api/WmsSpaHelper.cs b/api/WmsSpaHelper.cs
index 1db82f5..a884e93 100644
--- a/api/WmsSpaHelper.cs
+++ b/api/WmsSpaHelper.cs
@@ -45,6 +45,34 @@
 
         }
 
+        public static bool MaterPanduan(string ItemCode,double count) {
+            bool panduan = true;
+            var db = new SqlHelper<object>().GetInstance();
+
+            var po = db.Queryable<TN_Material_KC>().Where(a => a.S_ITEM_CODE == ItemCode).First();
+
+            var po1 = db.Queryable<CntrItemRel>().Where(a => a.S_ITEM_CODE == ItemCode).First();
+            if (po != null)
+            {
+                if (po1!=null)
+                {
+                    double sl= po1.F_QTY + count;
+                    if (sl>po.N_COUNT)
+                    {
+                        panduan = false;
+                    }
+                }
+                if (count > po.N_COUNT)
+                {
+                    panduan = false;
+                }
+            }
+            else
+            {
+                panduan = false;
+            }
+            return panduan;
+        }
         /// <summary>
         /// 鏁版嵁
         /// </summary>
@@ -423,6 +451,17 @@
                             }
                             foreach (var item in items.ITEM)
                             {
+                              //bool v=  MaterPanduan(item.WLBM, item.SL);
+                              //  if (!v)
+                              //  {
+                              //      result.resultMsg = "澶辫触";
+                              //      result.WLPZBH = items.HEAD.WLPZH;
+                              //      result.resultCode = 1;
+                              //      result.WLPZND = items.HEAD.WLPZND;
+                              //      result.resultMsg = $"鐗╂枡{item.WLBM}鏁伴噺瓒呰繃 搴撳瓨鎬绘暟";
+                              //      simpleResults.Add(result);
+                              //      continue;
+                              //  }
                                 ///鍒ゆ柇鏄惁閮芥湁鍐查攢鍑瘉缂栧彿
                                 if (string.IsNullOrEmpty(item.CXPZH))
                                 {
@@ -1854,13 +1893,17 @@
                         return result;
                     }
                     //鍒ゆ柇鎵樼洏鏄惁宸茬粡鐢熸垚浠诲姟锛屽鏋滄病鏈夊垯鐢熸垚
-                    var wmsTaskcs = WMSHelper.GetWmsTaskByCntr(model.cntr_code);
-                    if (wmsTaskcs != null)
+                    if (!string.IsNullOrEmpty(model.cntr_code))
                     {
-                        result.resultCode = 3;
-                        result.resultMsg = $"璧风偣{model.start} 鎵樼洏{model.cntr_code}宸茬粡鍒涘缓浠诲姟锛岃鍕块噸澶嶇敵璇�;
-                        return result;
+                        var wmsTaskcs = WMSHelper.GetWmsTaskByCntr(model.cntr_code);
+                        if (wmsTaskcs != null)
+                        {
+                            result.resultCode = 3;
+                            result.resultMsg = $"璧风偣{model.start} 鎵樼洏{model.cntr_code}宸茬粡鍒涘缓浠诲姟锛岃鍕块噸澶嶇敵璇�;
+                            return result;
+                        }
                     }
+                   
                     //鍑哄簱
                     if (model.Type==2)
                     {
@@ -1881,6 +1924,15 @@
                             {
                                 start= db.Queryable<Location>().Where(it => it.S_CODE == loc.S_LOC_CODE).First();
                             }
+                        }
+                        else if (!string.IsNullOrEmpty(model.item_code))
+                        {
+                            start = db.Queryable<LocCntrRel>()
+                                   .LeftJoin<CntrItemRel>((lcr, cir) => lcr.S_CNTR_CODE == cir.S_CNTR_CODE&&cir.S_CNTR_TYPE=="鍗婃墭")
+                                   .Where((lcr, cir) => cir.S_CNTR_CODE != null)  
+                                   .LeftJoin<Location>((lcr, cir, loc) => lcr.S_LOC_CODE == loc.S_CODE && loc.S_AREA_CODE == "HJQ")
+                                   .Select((lcr, cir, loc) => loc).ToList()  // 杩斿洖 Location 瀵硅薄
+                                   .FirstOrDefault();  // 鎴栬� Take(1).ToList()[0]
                         }
                         else
                         {
@@ -1908,7 +1960,7 @@
                             start = db.Queryable<LocCntrRel>()
                                     .LeftJoin<CntrItemRel>((lcr, cir) => lcr.S_CNTR_CODE == cir.S_CNTR_CODE)
                                     .Where((lcr, cir) => cir.S_CNTR_CODE == null)  // 鎵惧嚭鏈鍗犵敤鐨勫鍣�-                                    .LeftJoin<Location>((lcr, cir, loc) => lcr.S_LOC_CODE == loc.S_CODE&&loc.S_AREA_CODE== "HJQ")
+                                    .LeftJoin<Location>((lcr, cir, loc) => lcr.S_LOC_CODE == loc.S_CODE && loc.S_AREA_CODE == "HJQ")
                                     .Select((lcr, cir, loc) => loc).ToList()  // 杩斿洖 Location 瀵硅薄
                                     .FirstOrDefault();  // 鎴栬� Take(1).ToList()[0]
                         }
@@ -1952,6 +2004,7 @@
                         Location end = new Location();
                         if (!string.IsNullOrEmpty(model.cntr_code))
                         {
+                          
                             #region MyRegion
                             //var list = db.Queryable<CntrItemRel>().Select(s => s.S_CNTR_CODE).ToArray();
                             //var S_LOC_CODElist =   db.Queryable<LocCntrRel>().Where(s=>!list.Contains(s.S_CNTR_CODE)).Select(s=>s.S_LOC_CODE).ToArray();
diff --git a/enc_temp_folder/d910702ef84a263576574cba1cbe589/WebService.asmx.cs b/enc_temp_folder/d910702ef84a263576574cba1cbe589/WebService.asmx.cs
deleted file mode 100644
index 012bd87..0000000
--- a/enc_temp_folder/d910702ef84a263576574cba1cbe589/WebService.asmx.cs
+++ /dev/null
@@ -1,841 +0,0 @@
-锘縰sing pinggaoWebApi.Services;
-using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Configuration;
-using System.Linq;
-using System.Web;
-using System.Web.Services;
-using Newtonsoft.Json;
-using System.Web.Http;
-using System.Xml.Linq;
-using System.Xml.Serialization;
-using System.Net.Http;
-using System.Text;
-using System.Web.UI.WebControls;
-using pinggaoWebApi.Models;
-using static pinggaoWebApi.Controllers.SapRoot;
-using Newtonsoft.Json.Linq;
-using System.Web.Mvc;
-using System.Xml;
-using System.Data;
-using pinggaoWebApi.Controllers;
-using System.Threading.Tasks;
-using System.IO;
-using System.Data.SqlTypes;
-using System.Text.RegularExpressions;
-using System.Reflection;
-
-namespace pinggaoWebApi
-{
-
-    /// <summary>
-    /// WebService1 鐨勬憳瑕佽鏄�-    /// </summary>
-    [WebService(Namespace = "http://tempuri.org/")]
-    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
-    [System.ComponentModel.ToolboxItem(false)]
-    // 鑻ヨ鍏佽浣跨敤 ASP.NET AJAX 浠庤剼鏈腑璋冪敤姝�Web 鏈嶅姟锛岃鍙栨秷娉ㄩ噴浠ヤ笅琛屻� 
-    // [System.Web.Script.Services.ScriptService]
-
-    public class WebService : System.Web.Services.WebService
-    {
-        public static void EnsureArrayFormats(JObject json, string name)
-        {
-            foreach (var property in json.Properties())
-            {
-                // 濡傛灉褰撳墠灞炴�鍚嶄笌鎸囧畾鍚嶇О鍖归厤
-                if (property.Name.Equals(name))
-                {
-                    // 濡傛灉灞炴�鍊兼槸 JObject锛屼笖涓嶆槸 JArray锛屽垯灏嗗叾鍖呰鎴愭暟缁�-                    if (property.Value is JObject)
-                    {
-                        JArray newArray = new JArray(property.Value);
-                        property.Value = newArray;
-                    }
-                    // 濡傛灉灞炴�鍊煎凡缁忔槸 JArray锛屽垯涓嶉渶瑕佽繘涓�鎿嶄綔
-                    else if (property.Value is JArray)
-                    {
-                        // 宸茬粡鏄暟缁勶紝鏃犻渶鎿嶄綔
-                    }
-                    // 濡傛灉灞炴�鍊兼槸鍏朵粬绫诲瀷锛屽垯灏嗗叾杞崲涓哄崟涓厓绱犵殑鏁扮粍
-                    else
-                    {
-                        JArray newArray = new JArray(property.Value);
-                        property.Value = newArray;
-                    }
-                }
-                // 濡傛灉灞炴�鍊兼槸 JObject锛岄�褰掓鏌ュ叾瀛愬睘鎬�-                else if (property.Value is JObject)
-                {
-                    EnsureArrayFormats((JObject)property.Value, name);
-                }
-            }
-        }
-        /// <summary>
-        /// 鏁版嵁
-        /// </summary>
-        /// <param name="json"></param>
-        /// <param name="name"></param>
-        /// <param name="name1"></param>
-        public static void EnsureArrayFormat(JObject json, string name, string name1)
-        {
-            foreach (var property in json.Properties())
-            {
-                if (property.Name == name || property.Name == name1)
-                {
-                    if (property.Value is JObject && !(property.Value is JArray))
-                    {
-                        // 鑻ヤ负鍗曚釜瀵硅薄锛屽寘瑁呮垚鏁扮粍
-                        property.Value = new JArray(property.Value);
-                    }
-                }
-                if (property.Value is JObject)
-                {
-                    // 閫掑綊澶勭悊瀛愬璞�-                    EnsureArrayFormat((JObject)property.Value, name, name1);
-                }
-                else if (property.Value is JArray)
-                {
-                    // 閫掑綊澶勭悊鏁扮粍涓殑姣忎釜鍏冪礌
-                    foreach (var item in (JArray)property.Value)
-                    {
-                        if (item is JObject)
-                        {
-                            EnsureArrayFormat((JObject)item, name, name1);
-                        }
-                    }
-                }
-            }
-        }
-        public static void EnsureArrayFormat(JObject json, string propertyName)
-        {
-            // 鏌ユ壘鍚嶄负 propertyName 鐨勫睘鎬�-            JProperty property = json.Property(propertyName);
-
-            if (property != null)
-            {
-                // 妫�煡灞炴�鍊兼槸鍚︿负 JObject 绫诲瀷锛堝嵆鍗曚釜瀵硅薄锛�-                if (property.Value is JObject)
-                {
-                    // 灏嗗崟涓璞″寘瑁呮垚鏁扮粍
-                    JArray newArray = new JArray(property.Value);
-                    property.Value = newArray;
-                }
-                else if (property.Value is JArray)
-                {
-                    // 濡傛灉灞炴�鍊煎凡缁忔槸 JArray锛屽垯涓嶉渶瑕佸仛浠讳綍鎿嶄綔
-                    // 浣嗗鏋滈渶瑕侀�褰掓鏌ユ暟缁勪腑鐨勬瘡涓厓绱狅紝鍙互鍦ㄨ繖閲屽疄鐜�-                }
-            }
-        }
-        /// <summary>
-        /// 鏁版嵁
-        /// </summary>
-        /// <param name="json"></param>
-        /// <param name="name"></param>
-        /// <param name="name1"></param>
-        public static void EnsureArrayFormat(JObject json, string name, string name1, string name2)
-        {
-            foreach (var property in json.Properties())
-            {
-                if (property.Name == name || property.Name == name2)
-                {
-                    if (property.Value is JObject && !(property.Value is JArray))
-                    {
-                        // 鑻ヤ负鍗曚釜瀵硅薄锛屽寘瑁呮垚鏁扮粍
-                        property.Value = new JArray(property.Value);
-                    }
-                }
-                if (property.Value is JObject)
-                {
-                    // 閫掑綊澶勭悊瀛愬璞�-                    EnsureArrayFormat((JObject)property.Value, name, name1, name2);
-                }
-                else if (property.Value is JArray)
-                {
-                    // 閫掑綊澶勭悊鏁扮粍涓殑姣忎釜鍏冪礌
-                    foreach (var item in (JArray)property.Value)
-                    {
-                        if (item is JObject)
-                        {
-                            EnsureArrayFormat((JObject)item, name, name1, name2);
-                        }
-                    }
-                }
-            }
-        }    
-        public static void EnsureArrayFormats(JObject json, string name, string name1, string name2)
-        {
-            foreach (var property in json.Properties())
-            {
-                if (property.Name == name || property.Name == name2 || property.Name == name1)
-                {
-                    if (property.Value is JObject && !(property.Value is JArray))
-                    {
-                        // 鑻ヤ负鍗曚釜瀵硅薄锛屽寘瑁呮垚鏁扮粍
-                        property.Value = new JArray(property.Value);
-                    }
-                }
-                if (property.Value is JObject)
-                {
-                    // 閫掑綊澶勭悊瀛愬璞�-                    EnsureArrayFormat((JObject)property.Value, name, name1, name2);
-                }
-                else if (property.Value is JArray)
-                {
-                    // 閫掑綊澶勭悊鏁扮粍涓殑姣忎釜鍏冪礌
-                    foreach (var item in (JArray)property.Value)
-                    {
-                        if (item is JObject)
-                        {
-                            EnsureArrayFormat((JObject)item, name, name1, name2);
-                        }
-                    }
-                }
-            }
-        }
-
-        [WebMethod]
-        public string InWorkArea(string data)
-        {
-            var result = "";
-            LogHelper.Info($"鎺ュ彛 InWorkArea 杈撳叆鍙傛暟{data}");
-
-           
-            return result;
-        }
-        /// <summary>
-        /// 澶栭噰鏀惰揣
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string WCReceiveXmlData(string ROOT)
-        {
-
-            LogHelper.Info("澶栭噰鏀惰揣鎺ュ彛鍦板潃" + ConfigurationManager.AppSettings["URL"].ToString() + "WCReceiveXmlData");
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "WLPZ", "HEAD", "ITEM");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<Root>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "WCReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"WCReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-            var jsonObj = JsonConvert.DeserializeObject<WcReturnRoot.Root>(feedinfo);
-
-            var json = JsonConvert.SerializeObject(jsonObj);
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            LogHelper.Info("  澶栭噰鏀惰揣" + xml);
-            return xml;
-
-        }
-
-
-        /// <summary>
-        /// 鍐呴噰鏀惰揣
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public  string NCReceiveXmlData(string ROOT)
-        {
-            LogHelper.Info("杩涙潵浜� + ROOT);
-            LogHelper.Info("鍐呴噰鏀惰揣" + ConfigurationManager.AppSettings["URL"].ToString() + "NCReceiveXmlData");
-
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "WLPZ", "HEAD", "ITEM");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<NcDto.Root>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "NCReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"NCReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-            var jsonObj = JsonConvert.DeserializeObject<WcReturnRoot.Root>(feedinfo);
-
-            var json = JsonConvert.SerializeObject(jsonObj);
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            LogHelper.Info("  鍐呴噰鏀惰揣杩斿洖" + xml);
-            return xml;
-
-        }
-        /// <summary>
-        /// 鐢熶骇璁㈠崟棰嗘枡鍗�鐢熸垚棰嗘枡鍗�
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string LLDReceiveXmlData(string ROOT)
-        {
-
-            LogHelper.Info("鐢熶骇璁㈠崟棰嗘枡鍗�鐢熸垚棰嗘枡鍗�" + ConfigurationManager.AppSettings["URL"].ToString() + "LLDReceiveXmlData");
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "SCDDLL", "ITEM", "");
-            //EnsureArrayFormat(jsonObject["ROOT"]["SCDDLL"] as JObject, "ITEM");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<CKDdto.RootModel>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "LLDReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"LLDReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-            var jsonObj = JsonConvert.DeserializeObject<LLDReturnRoot.Root>(feedinfo);
-
-            var json = JsonConvert.SerializeObject(jsonObj);
-
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            LogHelper.Info("鐢熶骇璁㈠崟棰嗘枡鍗�鐢熸垚棰嗘枡鍗�" + xml);
-            return xml;
-
-        }
-
-        public static void EnsureArrayFormat2(JObject obj, string propertyName)
-        {
-            foreach (var prop in obj.Properties().ToList())
-            {
-                if (prop.Name == propertyName && prop.Value is JValue)
-                {
-                    obj[propertyName] = new JArray(prop.Value);
-                }
-                else if (prop.Value is JObject childObj)
-                {
-                    EnsureArrayFormat2(childObj, propertyName);
-                }
-                else if (prop.Value is JArray childArray)
-                {
-                    foreach (var item in childArray)
-                    {
-                        if (item is JObject itemObj)
-                        {
-                            EnsureArrayFormat2(itemObj, propertyName);
-                        }
-                    }
-                }
-            }
-        }
-        public class SingleOrArrayConverter<T> : JsonConverter
-        {
-            public override bool CanConvert(Type objectType)
-            {
-                return objectType == typeof(List<T>);
-            }
-
-            public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
-            {
-                // 鍏堟鏌ユ槸鍚︿负null
-                if (reader.TokenType == JsonToken.Null)
-                {
-                    return new List<T>();
-                }
-
-                // 澶勭悊绌烘暟缁勬儏鍐�-                if (reader.TokenType == JsonToken.StartArray)
-                {
-                    try
-                    {
-                        var list = new List<T>();
-                        while (reader.Read() && reader.TokenType != JsonToken.EndArray)
-                        {
-                            if (reader.TokenType == JsonToken.Null)
-                            {
-                                list.Add(default(T));
-                            }
-                            else
-                            {
-                                list.Add(serializer.Deserialize<T>(reader));
-                            }
-                        }
-                        return list;
-                    }
-                    catch (JsonSerializationException)
-                    {
-                        // 濡傛灉鏁扮粍瑙f瀽澶辫触锛岃繑鍥炵┖鍒楄〃
-                        return new List<T>();
-                    }
-                }
-
-                // 澶勭悊鍗曚釜鍊兼儏鍐�-                if (reader.TokenType == JsonToken.String ||
-                    reader.TokenType == JsonToken.Integer ||
-                    reader.TokenType == JsonToken.Float ||
-                    reader.TokenType == JsonToken.Boolean)
-                {
-                    try
-                    {
-                        return new List<T> { serializer.Deserialize<T>(reader) };
-                    }
-                    catch
-                    {
-                        return new List<T>();
-                    }
-                }
-
-                // 澶勭悊瀵硅薄鎯呭喌锛堝 { "XLH": "value" }锛�-                if (reader.TokenType == JsonToken.StartObject)
-                {
-                    reader.Read(); // 璺宠繃StartObject
-                    if (reader.TokenType == JsonToken.PropertyName)
-                    {
-                        reader.Read(); // 璺宠繃灞炴�鍚�-                        return ReadJson(reader, objectType, existingValue, serializer);
-                    }
-                }
-
-                // 鍏朵粬鎯呭喌杩斿洖绌哄垪琛�-                return new List<T>();
-            }
-
-            public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
-            {
-                serializer.Serialize(writer, value);
-            }
-        }
-        /// <summary>
-        /// 鍏朵粬鍑哄叆搴�-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string OtherReceiveXmlData(string ROOT)
-        {
-            try
-            {
-
-               
-                LogHelper.Info($"ROOT{ROOT}");
-                LogHelper.Info("鍏朵粬鍑哄叆搴� + ConfigurationManager.AppSettings["URL"].ToString() + "OtherReceiveXmlData");
-                var ss = ConfigurationManager.AppSettings["URL"].ToString();
-                //鎺ユ敹xml鏁版嵁
-                XmlDocument xmlDoc = new XmlDocument();
-                xmlDoc.LoadXml(ROOT.ToString());
-
-                //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-                JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-
-                LogHelper.Info($"jsonObject{JsonConvert.SerializeObject(jsonObject)}");
-
-           
-                // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-                EnsureArrayFormat(jsonObject, "WLPZ", "HEAD", "ITEM");
-
-
-                EnsureArrayFormat2(jsonObject, "XLH");
-                var settings = new JsonSerializerSettings
-                {
-                    Converters = { new SingleOrArrayConverter<string>() }
-                };
-
-                var result = JsonConvert.DeserializeObject<otherDto.Root>(jsonObject.ToString(), settings);
-
-                var sss = jsonObject.ToString();
-                ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-                var datas = JsonConvert.DeserializeObject<otherDto.Root>(jsonObject.ToString());
-
-
-
-                var sdada = JsonConvert.SerializeObject(datas);
-                LogHelper.Info($"111杩斿洖鍙傛暟{sdada}");
-
-                var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "OtherReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-                LogHelper.Info($"OtherReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-                var jsonObj = JsonConvert.DeserializeObject<OtherReturnRoot.Root>(feedinfo);
-
-                var json = JsonConvert.SerializeObject(jsonObj);
-                string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-                LogHelper.Info("鍏朵粬鍑哄叆搴撹繑鍥� + xml);
-                return xml;
-            }
-            catch (Exception e)
-            {
-                LogHelper.Info("鍏朵粬鍑哄叆搴撹繑鍥� + e.Message);
-                throw;
-            }
-          
-
-        }
-        ///// <summary>
-        ///// 澶栭噰鍐呴噰閫氱敤鏀惰揣
-        ///// </summary>
-        ///// <param name="ROOT"></param>
-        ///// <returns></returns>
-        //[WebMethod]
-        //[ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        //public string TYReceiveXmlData(string ROOT)
-        //{
-
-        //    LogHelper.Info("鏀惰揣鎺ュ彛鍦板潃" + ConfigurationManager.AppSettings["URL"].ToString() + "WCReceiveXmlData");
-        //    var ss = ConfigurationManager.AppSettings["URL"].ToString();
-        //    //鎺ユ敹xml鏁版嵁
-        //    XmlDocument xmlDoc = new XmlDocument();
-        //    xmlDoc.LoadXml(ROOT.ToString());
-
-        //    //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-        //    JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-        //    // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-        //    EnsureArrayFormat(jsonObject, "WLPZ", "HEAD", "ITEM");
-        //    ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-        //    var wcdatas = JsonConvert.DeserializeObject<Root>(jsonObject.ToString());
-
-        //    if (wcdatas.ROOT.WLPZ[0].HEAD.YDLX== "103"|| wcdatas.ROOT.WLPZ[0].HEAD.YDLX == "104")
-        //    {
-
-        //        var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "WCReceiveXmlData", JsonConvert.SerializeObject(wcdatas), "application/json");
-        //        LogHelper.Info($"WCReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-
-
-        //        var jsonObj = JsonConvert.DeserializeObject<WcReturnRoot.Root>(feedinfo);
-
-        //        var json = JsonConvert.SerializeObject(jsonObj);
-        //        string xml = JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-        //        return xml;
-        //    }
-        //    else
-        //    {
-        //        var ncdatas = JsonConvert.DeserializeObject<NcDto.Root>(jsonObject.ToString());
-        //        var sss = JsonConvert.SerializeObject(wcdatas);
-        //        var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "NCReceiveXmlData", JsonConvert.SerializeObject(ncdatas), "application/json");
-        //        LogHelper.Info($"NCReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-        //        var jsonObj = JsonConvert.DeserializeObject<WcReturnRoot.Root>(feedinfo);
-
-        //        var json = JsonConvert.SerializeObject(jsonObj);
-        //        string xml = JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-        //        return xml;
-        //    }
-
-        //}
-
-        ///// <summary>
-        /////鍐呴噰鏀惰揣
-        ///// </summary>
-        ///// <param name="ROOT"></param>
-        ///// <returns></returns>
-        //[WebMethod]
-        //public ReturrnBackNC.Root NCReceiveXmlData(NcDto.ROOT2 ROOT)
-        //{
-        //    string result;
-
-        //    LogHelper.Info("鍐呴噰鏀惰揣鎺ュ彛鍦板潃" + ConfigurationManager.AppSettings["URL"].ToString() + "NCReceiveXmlData");
-        //    var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "NCReceiveXmlData", JsonConvert.SerializeObject(ROOT), "application/json");
-        //    LogHelper.Info($"NCReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-        //    var data = JsonConvert.DeserializeObject<ReturrnBackNC.ITEM>(feedinfo);
-
-        //    // 鍋囪data鏄竴涓凡缁忓垵濮嬪寲鐨処TEM瀵硅薄
-        //    ReturrnBackNC.ITEM data1 = new ReturrnBackNC.ITEM
-        //    {
-        //        KEY = data?.WLPZBH,
-        //        WLPZBH = data?.WLPZBH,
-        //        WLPZND = data?.WLPZND,
-        //        MSGCODE = data?.MSGCODE,
-        //        MSGDESP = data?.WLPZBH
-        //    };
-        //    if (string.IsNullOrEmpty(feedinfo))
-        //    {
-        //        data1.WLPZBH = "";
-        //        data1.MSGCODE = "1";
-        //        data1.MSGDESP = "鏈皟閫�;
-        //    }
-        //    // 瀹炰緥鍖朢OOT瀵硅薄锛屽苟灏咺TEM瀵硅薄璧嬪�缁橰OOT鐨処tem灞炴�
-        //    ReturrnBackNC.ROOT root = new ReturrnBackNC.ROOT
-        //    {
-        //        ITEM = data
-        //    };
-        //    ReturrnBackNC.Root roots = new ReturrnBackNC.Root
-        //    {
-        //        ROOT = root
-        //    };
-        //    return roots;
-
-        //}
-
-
-
-
-        ///// <summary>
-        /////鍏朵粬鍑哄叆搴�-        ///// </summary>
-        ///// <param name="ROOT"></param>
-        ///// <returns></returns>
-        //[WebMethod]
-        //public ReturrnBack.Root OtherReceiveXmlData(otherDto.ROOT3 ROOT)
-        //{
-        //    string result;
-
-        //    LogHelper.Info("鍏朵粬鍑哄叆搴撴帴鍙e湴鍧� + ConfigurationManager.AppSettings["URL"].ToString() + "OtherReceiveXmlData");
-        //    var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "OtherReceiveXmlData", JsonConvert.SerializeObject(ROOT), "application/json");
-        //    LogHelper.Info($"OtherReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-        //    var data = JsonConvert.DeserializeObject<ReturrnBack.ITEM>(feedinfo);
-
-        //    // 鍋囪data鏄竴涓凡缁忓垵濮嬪寲鐨処TEM瀵硅薄
-        //    ReturrnBack.ITEM data1 = new ReturrnBack.ITEM
-        //    {
-        //        WLPZBH = data?.WLPZBH,
-        //        MSGCODE = data?.MSGCODE,
-        //        MSGDESP = data?.WLPZBH
-        //    };
-        //    if (string.IsNullOrEmpty(feedinfo))
-        //    {
-        //        data1.WLPZBH = "";
-        //        data1.MSGCODE = "1";
-        //        data1.MSGDESP = "鏈皟閫�;
-        //    }
-        //    // 瀹炰緥鍖朢OOT瀵硅薄锛屽苟灏咺TEM瀵硅薄璧嬪�缁橰OOT鐨処tem灞炴�
-        //    ReturrnBack.ROOT root = new ReturrnBack.ROOT
-        //    {
-        //        ITEM = data
-        //    };
-        //    ReturrnBack.Root roots = new ReturrnBack.Root
-        //    {
-        //        ROOT = root
-        //    };
-        //    return roots;
-
-        //}
-
-
-
-
-        /// <summary>
-        /// 鐢熶骇璁㈠崟淇℃伅鑾峰彇
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string OrderReceiveXmlData(string ROOT)
-        {
-
-            LogHelper.Info("鐢熶骇璁㈠崟淇℃伅鑾峰彇" + ConfigurationManager.AppSettings["URL"].ToString() + "OrderReceiveXmlData");
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "SCDD", "ITEM");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<OrderDto.Root>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "OrderReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"OtherReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-            var jsonObj = JsonConvert.DeserializeObject<Orderback.Root>(feedinfo);
-
-            var json = JsonConvert.SerializeObject(jsonObj);
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            return xml;
-
-        }
-        /// <summary>
-        ///鐢熶骇璁㈠崟淇℃伅鑾峰彇
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        //[WebMethod]
-        //public ReturrnBack.Root OrderReceiveXmlData(OrderDto.ROOT4 ROOT)
-        //{
-        //    string result;
-
-        //    LogHelper.Info("鐢熶骇璁㈠崟淇℃伅鑾峰彇鎺ュ彛鍦板潃" + ConfigurationManager.AppSettings["URL"].ToString() + "OrderReceiveXmlData");
-        //    var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "OrderReceiveXmlData", JsonConvert.SerializeObject(ROOT), "application/json");
-        //    LogHelper.Info($"OrderReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-        //    var data = JsonConvert.DeserializeObject<ReturrnBack.ITEM>(feedinfo);
-
-        //    // 鍋囪data鏄竴涓凡缁忓垵濮嬪寲鐨処TEM瀵硅薄
-        //    ReturrnBack.ITEM data1 = new ReturrnBack.ITEM
-        //    {
-        //        WLPZBH = data?.WLPZBH,
-        //        MSGCODE = data?.MSGCODE,
-        //        MSGDESP = data?.WLPZBH
-        //    };
-        //    if (string.IsNullOrEmpty(feedinfo))
-        //    {
-        //        data1.WLPZBH = "";
-        //        data1.MSGCODE = "1";
-        //        data1.MSGDESP = "鏈皟閫�;
-        //    }
-        //    // 瀹炰緥鍖朢OOT瀵硅薄锛屽苟灏咺TEM瀵硅薄璧嬪�缁橰OOT鐨処tem灞炴�
-        //    ReturrnBack.ROOT root = new ReturrnBack.ROOT
-        //    {
-        //        ITEM = data
-        //    };
-        //    ReturrnBack.Root roots = new ReturrnBack.Root
-        //    {
-        //        ROOT = root
-        //    };
-        //    return roots;
-
-        //}
-
-
-
-
-
-
-        /// <summary>
-        /// 涓荤墿鏂欎俊鎭幏鍙�-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string MaterReceiveXmlData(string ROOT)
-        {
-            try
-            {
-
-                LogHelper.Info("涓荤墿鏂欎俊鎭幏鍙栨帴鍙e湴鍧� + ConfigurationManager.AppSettings["URL"].ToString() + "MaterReceiveXmlData");
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "ITEM", "");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<MaterDto.Root6>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "MaterReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"MaterReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-            var jsonObj = JsonConvert.DeserializeObject<WLReturnRoot.Root>(feedinfo);
-          
-            var json = JsonConvert.SerializeObject(jsonObj);
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            return xml;
-            }
-            catch (Exception ex)
-            {
-                LogHelper.Info($"MaterReceiveXmlData 鎶ラ敊{ex.Message}");
-                throw;
-            }
-
-
-        }
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="ROOT"></param>
-        /// <returns></returns>
-        [WebMethod]
-        [ValidateInput(false)] // 绂佺敤璇锋眰楠岃瘉
-        public string GYSReceiveXmlData(string ROOT)
-        {
-
-            LogHelper.Info("渚涘簲鍟嗕俊鎭幏鍙栨帴鍙e湴鍧� + ConfigurationManager.AppSettings["URL"].ToString() + "GYSReceiveXmlData");
-            var ss = ConfigurationManager.AppSettings["URL"].ToString();
-            //鎺ユ敹xml鏁版嵁
-            XmlDocument xmlDoc = new XmlDocument();
-            xmlDoc.LoadXml(ROOT.ToString());
-
-            //灏�XmlDocument 杞崲涓�JSON 瀛楃涓�-            JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc));
-
-            // 澶勭悊鐗瑰畾瀛楁锛屽己鍒惰浆鎹负鏁扮粍
-            EnsureArrayFormat(jsonObject, "GYSXX", "", "GYSHB");
-            ///  鍙嶅簭鍒楀寲涓篟ootWithArray
-            var datas = JsonConvert.DeserializeObject<GYSDto.Root9>(jsonObject.ToString());
-            var sdada = JsonConvert.SerializeObject(datas);
-
-            var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "GYSReceiveXmlData", JsonConvert.SerializeObject(datas), "application/json");
-            LogHelper.Info($"MaterReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-
-            var jsonObj = JsonConvert.DeserializeObject<GYSReturnRoot.Root>(feedinfo);
-
-            var json = JsonConvert.SerializeObject(jsonObj);
-            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + JsonConvert.DeserializeXmlNode(json, "").OuterXml;
-
-            return xml;
-
-        }
-        ///// <summary>
-        /////涓荤墿鏂欎俊鎭幏鍙�-        ///// </summary>
-        ///// <param name="ROOT"></param>
-        ///// <returns></returns>
-        //[WebMethod]
-        //public ReturrnBack.Root MaterReceiveXmlData(MaterDto.ROOT5 ROOT)
-        //{
-        //    string result;
-
-        //    LogHelper.Info("涓荤墿鏂欎俊鎭幏鍙栨帴鍙e湴鍧� + ConfigurationManager.AppSettings["URL"].ToString() + "MaterReceiveXmlData");
-        //    var feedinfo = HttpHelper.WebPost(ConfigurationManager.AppSettings["URL"].ToString() + "MaterReceiveXmlData", JsonConvert.SerializeObject(ROOT), "application/json");
-        //    LogHelper.Info($"MaterReceiveXmlData mobox杩斿洖鍙傛暟{feedinfo}");
-        //    var data = JsonConvert.DeserializeObject<ReturrnBack.ITEM>(feedinfo);
-
-        //    // 鍋囪data鏄竴涓凡缁忓垵濮嬪寲鐨処TEM瀵硅薄
-        //    ReturrnBack.ITEM data1 = new ReturrnBack.ITEM
-        //    {
-        //        WLPZBH = data?.WLPZBH,
-        //        MSGCODE = data?.MSGCODE,
-        //        MSGDESP = data?.WLPZBH
-        //    };
-        //    if (string.IsNullOrEmpty(feedinfo))
-        //    {
-        //        data1.WLPZBH = "";
-        //        data1.MSGCODE = "1";
-        //        data1.MSGDESP = "鏈皟閫�;
-        //    }
-        //    // 瀹炰緥鍖朢OOT瀵硅薄锛屽苟灏咺TEM瀵硅薄璧嬪�缁橰OOT鐨処tem灞炴�
-        //    ReturrnBack.ROOT root = new ReturrnBack.ROOT
-        //    {
-        //        ITEM = data
-        //    };
-        //    ReturrnBack.Root roots = new ReturrnBack.Root
-        //    {
-        //        ROOT = root
-        //    };
-        //    return roots;
-
-        //}
-    }
-}
diff --git a/models/TN_Material_KC.cs b/models/TN_Material_KC.cs
new file mode 100644
index 0000000..4a3eae8
--- /dev/null
+++ b/models/TN_Material_KC.cs
@@ -0,0 +1,17 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HH.WCS.Mobox3.pinggao.models
+{
+    [SugarTable("TN_Material_KC")]
+    public class TN_Material_KC : BaseModel
+    {
+        public int N_COUNT { get; set; }
+        public string N_ROW_NO { get; set; }
+        public string S_ITEM_CODE { get; set; }
+    }
+}
diff --git a/wms/WMSHelper.cs b/wms/WMSHelper.cs
index ff45bca..dfd8b73 100644
--- a/wms/WMSHelper.cs
+++ b/wms/WMSHelper.cs
@@ -989,7 +989,7 @@
 
             return result;
         }
-
+    
         internal static WMSTask GetWmsTaskByCntr(string cntr, bool active = true)
         {
             WMSTask result = null;

--
Gitblit v1.9.1