1
wtt
4 天以前 797e02f68d79c931233f25af1d39bc136ce6185d
WebAPI/Controllers/CJGL/Sc_OEEReportController.cs
@@ -83,7 +83,7 @@
        /// </summary>
        [Route("Sc_OEEReport/getSc_OEEReportDetailist")]
        [HttpGet]
        public object getSc_OEEReportDetailist(string sWhere, string user)
        public object getSc_OEEReportDetailist(string HSourceCode, string HDate, string HType, string user)
        {
            try
            {
@@ -98,7 +98,7 @@
                    return objJsonResult;
                }
                string sql = "exec h_p_SB_getLatestDataOfOEEDataDetailist " + sWhere;
                string sql = "exec h_p_SB_getLatestDataOfOEEDataDetailist '" + HSourceCode + "','" + HDate + "','" + HType + "'";
                ds = oCN.RunProcReturn(sql, "h_p_SB_getLatestDataOfOEEDataDetailist");
                //添加列名
@@ -126,5 +126,108 @@
            }
        }
        #endregion
        #region OEE报表 查询(班次)
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_OEEReport/getSc_OEEReport_WorkShift")]
        [HttpGet]
        public object getSc_OEEReport_WorkShift(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_Sc_OEEReport_WorkShift " + sWhere;
                ds = oCN.RunProcReturn(sql, "h_p_Sc_OEEReport_WorkShift");
                //添加列名
                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
        #region OEE报表 查询明细(班次)
        /// <summary>
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_OEEReport/getSc_OEEReportDetailist_WorkShift")]
        [HttpGet]
        public object getSc_OEEReportDetailist_WorkShift(string HSourceCode, string HDate, string HType, 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_WorkShift '" + HSourceCode + "','" + HDate + "','" + HType + "'";
                ds = oCN.RunProcReturn(sql, "h_p_SB_getLatestDataOfOEEDataDetailist_WorkShift");
                //添加列名
                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
    }
}