From 0ce9810f76ceb670fab4482aafa06e8bd80ad22c Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期一, 24 五月 2021 10:10:50 +0800
Subject: [PATCH] nothing

---
 WebAPI/Controllers/WebAPIController.cs |  309 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 309 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 8e6f6a2..0ed6fa9 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -704,6 +704,111 @@
                 return objjson;
             }
         }
+
+        /// <summary>
+        /// 鑾峰彇鐗╂枡鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetMaterialList_Json")]
+        [HttpGet]
+        public object GetMaterialList_Json(string Material)
+        {
+            sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (Material != "")
+            {
+                sWhere = sWhere + " and ( HNumber like '%" + Material + "%' or HName like '%" + Material + "%' ) ";
+            }
+            try
+            {
+                ds = webserver.GetMaterialList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇鍗曚綅鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetUnitList_Json")]
+        [HttpGet]
+        public object GetUnitList_Json(string Unit)
+        {
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (Unit != "")
+            {
+                sWhere = sWhere + " and ( HNumber like '%" + Unit + "%' or HName like '%" + Unit + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName  from Gy_Unit where HStopflag=0 Order by HItemID ", "Gy_Unit");
+                }
+                else
+                {
+                    string sql1 = "Select HItemID,HNumber ,HName  from Gy_Unit where HStopflag=0 and HEndFlag=1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "Gy_Unit");
+                }
+
+                //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
         /// <summary>
         /// 鑾峰彇瀹㈡埛鍒楄〃
         /// </summary>
@@ -750,6 +855,55 @@
         }
 
         /// <summary>
+        /// 鑾峰彇宸ュ簭鍒楄〃
+        /// <summary>
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Web/GetProcList_Json")]
+        [HttpGet]
+        public object GetProcList_Json(string sWhere)
+        {
+            DataSet ds;
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (sWhere != "")
+            {
+                sWhere = sWhere + " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ds = oCN.RunProcReturn("Select HItemID,HNumber 宸ュ簭浠g爜,HName 宸ュ簭 from Gy_Process where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Process");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
         /// 鑾峰彇褰撳墠鏁版嵁搴撳悕
         /// </summary>
         /// <returns></returns>
@@ -779,6 +933,161 @@
                 return objjson; ;
             }
         }
+
+        /// <summary>
+        /// 鑾峰彇涓嶈壇鍘熷洜鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetBadReasonList_Json")]
+        [HttpGet]
+        public object GetBadReasonList_Json(string BadReason)
+        {
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (BadReason != "")
+            {
+                sWhere = sWhere + " and ( HNumber like '%" + BadReason + "%' or HName like '%" + BadReason + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+
+                {
+                    ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName  from Gy_BadReason where HStopflag=0 Order by HItemID ", "Gy_BadReason");
+                }
+                else
+                {
+                    string sql1 = "Select HItemID,HNumber ,HName  from Gy_BadReason where HStopflag=0 and HEndFlag=1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "Gy_BadReason");
+                }
+
+                //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+
+        /// <summary>
+        /// 鑾峰彇宸ュ簭璁″垝鍗曞垪琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetPlanList_Json")]
+        [HttpGet]
+        public object GetPlanList_Json(string Billno)
+        {
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
+            if (Billno != "")
+            {
+                sWhere = sWhere + " and ( 鍗曟嵁鍙� like '%" + Billno + "%' ) ";
+            }
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+
+                {
+                    ds = oCN.RunProcReturn("select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList", "h_v_Sc_ProcessPlanList");
+                }
+                else
+                {
+                    string sql1 = "select hmainid,hsubid,鍗曟嵁鍙�,HMaterID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,HCenterID,宸ヤ綔涓績,瑙勬牸鍨嬪彿,璁″垝鏁伴噺 from h_v_Sc_ProcessPlanList where 1=1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList");
+                }
+
+                //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛!";
+                    objjson.data = ds.Tables[0];
+                    return objjson;
+                }
+            }
+            catch (Exception ex)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇鐧诲綍椤电粍缁囧垪
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/GetOrganizations")]
+        [HttpGet]
+        public object GetOrganizations()
+        {
+            try
+            {
+                ClsCN oCn = new ClsCN();
+                DataSet oDs = new DataSet();
+                //==========
+                oDs = oCn.RunProcReturn("select HItemID ID,Hname Name,HStopflag Stopflag from Xt_ORGANIZATIONS", "Xt_ORGANIZATIONS");
+                objjson.code = "1";
+                objjson.count = 1;
+                objjson.Message = "鑾峰彇鎴愬姛锛�";
+                objjson.data = oDs.Tables[0];
+                return objjson; ;
+            }
+            catch (Exception e)
+            {
+
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触锛佸紓甯�" + e.ToString();
+                objjson.data = null;
+                return objjson; ;
+            }
+        }
+
+
+
         #endregion
     }
 

--
Gitblit v1.9.1