From 5c6fc4e6d45641b5c32087777457c09078828850 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期四, 01 十二月 2022 15:47:29 +0800 Subject: [PATCH] 采购订单 --- WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs | 67 +++++++++++++++++++++++++++++---- 1 files changed, 59 insertions(+), 8 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs index e66f202..95cceb9 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -382,20 +383,30 @@ { //寰楀埌淇℃伅 - ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillQuerySub_Mould where hmainid= " + HProcExchHinteID , "h_v_Sc_ProcessExchangeBillQuerySub_Mould"); + ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub_Mould where hmainid= " + HProcExchHinteID , "h_v_Sc_ProcessExchangeBillQuerySub_Mould"); //鍐欏叆淇℃伅 - if (ds == null || ds.Tables[0].Rows.Count == 0) + //if (ds == null || ds.Tables[0].Rows.Count == 0) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏈煡璇㈠埌鍑虹珯鍗曟槑缁嗕俊鎭紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏈煡璇㈠埌鍑虹珯鍗曟槑缁嗕俊鎭紒"; - objJsonResult.data = null; - return objJsonResult; + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); } + objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; return objJsonResult; } catch (Exception e) @@ -658,5 +669,45 @@ } } #endregion + + #region[缂栬緫鏃惰幏鍙栬〃浣撴暟鎹�(宸ヨ壓鍙傛暟)] + [Route("Sc_ProcessExchangeBill/GetProcessExchangeBillSubTech")] + [HttpGet] + public object GetProcessExchangeBillSubTech(string HInterID) + { + DataSet ds; + try + { + List<object> columnNameList = new List<object>(); + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + string sql = string.Format(@"exec h_p_Sc_GetProcessExchangeBillSubTech "); + ds = oCN.RunProcReturn(sql + HInterID, "h_p_Sc_GetProcessExchangeBillSubTech"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.list = columnNameList; + objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1