From 8658c02633f9746781d2e6f5da9998eef8c0e0a7 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期五, 28 十月 2022 16:31:52 +0800 Subject: [PATCH] 动态列(点检项目、维修项目、维修检验项目、保养项目、产品与器具清单及维护、工作中心、工序、生产资源、生产班组、不良原因、故障原因、检验项目、检验项目分类、工序工价及维护、系统上机日志查询、系统参数查询、系统模块信息查询、系统单据类型、会计期间、公告信息维护) --- WebAPI/Controllers/BaseSet/Gy_GroupController.cs | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs index fd38cb0..f00f177 100644 --- a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs @@ -1,4 +1,5 @@ -锘縰sing Newtonsoft.Json.Linq; +锘縰sing Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Pub_Class; using System; using System.Collections; @@ -30,16 +31,16 @@ { try { - //鏌ョ湅鏉冮檺 - if (!DBUtility.ClsPub.Security_Log("Gy_Group_Query", 1, false, user)) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; - objJsonResult.data = null; - return objJsonResult; - } - + List<object> columnNameList = new List<object>(); + ////鏌ョ湅鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Gy_Group_Query", 1, false, user)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("select * from h_v_GroupList " + sWhere+ " order by 鐝粍浠g爜 ", "h_v_GroupList"); @@ -51,12 +52,22 @@ ds = oCN.RunProcReturn(sql, "h_v_GroupList"); } + //娣诲姞鍒楀悕 + 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 @@ -286,6 +297,7 @@ var HBarCodeForBase = list[0].HBarCodeForBase; var HDeptID = list[0].HDeptID; long HProcID = list[0].HProcID; + int HUSEORGID = list[0].HUSEORGID; var HDeptNumber = ""; //var HEndFlag = 0; long HLevel = 1; @@ -326,10 +338,10 @@ oCN.RunProc("Insert into Gy_Group " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HEmpQty,HDeptID,HDeptNumber,HProcID" + - ",HLevel,HEndFlag,HStopflag,HRemark,HBarCodeForBase) " + + ",HLevel,HEndFlag,HStopflag,HRemark,HBarCodeForBase,HUSEORGID) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + "," + HEmpQty.ToString() + "," + HDeptID.ToString() + ",'" + HDeptNumber + "'," + HProcID.ToString() + - "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + HBarCodeForBase + "')", ref DBUtility.ClsPub.sExeReturnInfo); + "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + HBarCodeForBase + "',"+ HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); -- Gitblit v1.9.1