From 8ca32345fb7f2a74d3818e36d4996e83a15838f2 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 24 三月 2023 09:57:50 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/LMESController.cs |  101 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 79 insertions(+), 22 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 212335f..bdd3b1a 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -81,23 +81,13 @@
                     string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                     columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
+                
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "Sucess锛�";
                 objJsonResult.list = columnNameList;
                 objJsonResult.data = ds.Tables[0];
                 return objJsonResult;
-                //}
-                //else
-                //{
-                //objJsonResult.code = "0";
-                //objJsonResult.count = 0;
-                //objJsonResult.Message = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
             }
             catch (Exception e)
             {
@@ -568,6 +558,83 @@
             return GetObjectJson(ds);
         }
 
+        #region 鍒ゆ柇涓嬫帹鐨勭敓浜ц鍗曟槸鍚﹀鏍�
+        [Route("LEMS/ICMOBillCheck")]
+        [HttpGet]
+        public object ICMOBillCheck(string hmainid,string HEntryID,int OrganizationID)
+        {
+            DataSet ds;
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1  and hmainid=" + hmainid + " and  HEntryID=" + HEntryID + " order by 鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
+                string HNumber = ds.Tables[0].Rows[0]["浜у搧浠g爜"].ToString();
+
+                if (ds.Tables[0].Rows[0]["瀹℃牳浜�"].ToString() == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌敓浜ц鍗曚负鏈鏍哥姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["鍏抽棴浜�"].ToString() != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌敓浜ц鍗曚负宸插叧闂姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (ds.Tables[0].Rows[0]["浣滃簾浜�"].ToString() != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌敓浜ц鍗曚负宸蹭綔搴熺姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("select * from h_v_S_Sc_ICMOBillList where hmainid=" + hmainid + " and HEntryID=" + HEntryID + " and HSTOCKINORGID='" + OrganizationID + "'", "h_v_S_Sc_ICMOBillList");
+
+                if (double.Parse(ds.Tables[0].Rows[0]["娴佽浆鍗℃暟閲�"].ToString()) == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌敓浜ц鍗曞凡鍏ㄩ儴涓嬫帹鐢熸垚宸ュ簭娴佽浆鍗★紝鍓╀綑鍙笅鎺ㄦ暟閲忎负0锛屼笉鍏佽涓嬫帹鐢熸垚宸ュ簭娴佽浆鍗★紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("select top 1000 * from h_v_Gy_RoutingBillList where 鐗╂枡浠g爜='" + HNumber + "'", "h_v_Gy_RoutingBillList");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎵�閫夌敓浜ц鍗曞搴旂墿鏂欐湭璁剧疆瀵瑰簲鐨勫伐鑹鸿矾绾匡紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         /// <summary>
         /// 杩斿洖宸ュ簭濮斿鎺ユ敹鍗曞垪琛�
         ///鍙傛暟锛歴tring sql銆�
@@ -610,8 +677,7 @@
             try
             {
                 List<object> columnNameList = new List<object>();
-                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
-                //{
+               
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
                 {
@@ -626,15 +692,6 @@
                 objJsonResult.list = columnNameList;
                 objJsonResult.data = ds.Tables[0];
                 return objJsonResult;
-                //}
-                //else
-                //{
-                //objJsonResult.code = "0";
-                //objJsonResult.count = 0;
-                //objJsonResult.Message = "鏃犳暟鎹�";
-                //objJsonResult.data = null;
-                //return objJsonResult;
-                //}
             }
             catch (Exception e)
             {

--
Gitblit v1.9.1