From 3c1f1bdf22437cf7382cab1aa5b99700c3a5b479 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期五, 03 二月 2023 09:57:35 +0800 Subject: [PATCH] 动态列 --- WebAPI/Controllers/BarCodeController.cs | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/BarCodeController.cs b/WebAPI/Controllers/BarCodeController.cs index 48470e2..02b6bc0 100644 --- a/WebAPI/Controllers/BarCodeController.cs +++ b/WebAPI/Controllers/BarCodeController.cs @@ -1,4 +1,5 @@ 锘縰sing DBUtility; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SQLHelper; using System; @@ -1368,6 +1369,14 @@ Int64 RowTotal = Common.GetRowTotal("h_v_SRM_BarCodeBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo); //鑾峰彇杩斿洖鏁版嵁 ds = oCn.RunProcReturn("exec h_p_SRM_BarCodeBillList '" + PcWhere + "'", "h_v_SRM_BarCodeBillList"); + //娣诲姞鍒楀悕 + List<object> columnNameList = new List<object>(); + 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鍒楀璞$殑鍒楀悕 + } if (ds == null || ds.Tables[0].Rows.Count == 0) { objjson.code = "0"; @@ -1381,6 +1390,7 @@ objjson.code = "0"; objjson.count = 10000; objjson.Message = "鑾峰彇鎴愬姛"; + objjson.list = columnNameList; objjson.data = ds.Tables[0]; return objjson; } -- Gitblit v1.9.1