1
wtt
2024-09-29 19d0afadbe1c90e227b852db0a97ae413e90691f
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -34,12 +34,21 @@
        {
            try
            {
                List<object> a = new List<object>();
                foreach (DataColumn col in ds.Tables[0].Columns)//遍历ds中第一个表(Tables[0])的所有列(Columns)每次循环中,col变量会持有当前列的引用
                {
                    Type dataType = col.DataType; //获取当前数据类型传入 自定义变量datadataType
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //字符串拼接         // 将列名和数据类型信息拼接成一个JSON格式的字符串
                    a.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //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 = a;
                return objJsonResult;
                //}
                //else
@@ -2075,6 +2084,7 @@
            DataSet ds;
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessPlan_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -2095,6 +2105,7 @@
                    string sql = sql1 + sWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList");
                }
            }
            catch (Exception e)
            {
@@ -6716,6 +6727,45 @@
        }
        #endregion
        #region 不良品评审处理单 出站单下推查询
        [Route("Sc_ProcessMangement/Get_Sc_StationOutBill")]
        [HttpGet]
        public object Get_Sc_StationOutBill(string HID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_MES_StationOutBillList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_MES_StationOutBillList");
                //添加列名
                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));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region 不良品评审处理验收单