yangle
2024-12-26 2bf556382264cef4ad559c12b09556c74a188f3e
OEE报表 查询明细
1个文件已修改
51 ■■■■■ 已修改文件
WebAPI/Controllers/CJGL/Sc_OEEReportController.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_OEEReportController.cs
@@ -75,5 +75,56 @@
            }
        }
        #endregion
        #region OEE报表 查询明细
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_OEEReport/getSc_OEEReportDetailist")]
        [HttpGet]
        public object getSc_OEEReportDetailist(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ////查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_OEEReport", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql = "exec h_p_SB_getLatestDataOfOEEDataDetailist " + sWhere;
                ds = oCN.RunProcReturn(sql, "h_p_SB_getLatestDataOfOEEDataDetailist");
                //添加列名
                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 e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}