From c7964cefb465dfa8e33d96eae2de331e1e9772a2 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 19 十月 2022 10:55:34 +0800 Subject: [PATCH] 动态列 --- WebAPI/Controllers/CJGL/Cj_StationInBillController.cs | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs index 6b5ed79..9820ef3 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -122,6 +123,7 @@ string HSourceName = list[0].HSourceName;//鐢熶骇璧勬簮鍚嶇О long HCenterID = list[0].HCenterID;//宸ヤ綔涓績ID string HOrderProcNO = list[0].HOrderProcNO;//璁㈠崟璺熻釜鍙� + long HPRDOrgID = list[0].HPRDOrgID;//缁勭粐ID //鍗曟嵁瀹屾暣鎬у垽鏂� if (HMaterID <= 0) { @@ -188,7 +190,7 @@ ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" + ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" + ",HSupID,HQty,HPrice,HMoney,HPieceQty,HSourceName,HCenterID" + - ",HProcNo,HOrderProcNO,HMainInterID" + + ",HProcNo,HOrderProcNO,HMainInterID,HPRDOrgID" + ") " + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + "," + HYear + "," + HPeriod + ",'" + HRemark + "'" + @@ -196,7 +198,7 @@ ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID + "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" + "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID + - ",'" + HProcNo + "','" + HOrderProcNO + "'," + HMainInterID + + ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID + ") "); } else if ("Modify".Equals(eventType)) @@ -461,6 +463,7 @@ { try { + List<object> columnNameList = new List<object>(); //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Query", 1, false, user)) { @@ -482,12 +485,21 @@ ds = oCN.RunProcReturn(sql, "h_v_MES_StationInBillList"); } + //娣诲姞鍒楀悕 + 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.Tables[0].Rows.Count != 0 || ds != null) //{ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; return objJsonResult; //} //else -- Gitblit v1.9.1