From 7a716274b90df3f2b0745d15156308c69ebe54c2 Mon Sep 17 00:00:00 2001 From: llj <132905093+newwwwwwtree@users.noreply.github.com> Date: 星期一, 04 八月 2025 10:31:07 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Sc_OEEReportController.cs | 193 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 193 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Sc_OEEReportController.cs b/WebAPI/Controllers/CJGL/Sc_OEEReportController.cs index e648bcb..2ec2e65 100644 --- a/WebAPI/Controllers/CJGL/Sc_OEEReportController.cs +++ b/WebAPI/Controllers/CJGL/Sc_OEEReportController.cs @@ -75,5 +75,198 @@ } } #endregion + + #region OEE鎶ヨ〃 鏌ヨ鏄庣粏 + /// <summary> + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_OEEReport/getSc_OEEReportDetailist")] + [HttpGet] + public object getSc_OEEReportDetailist(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 '" + HSourceCode + "','" + HDate + "','" + HType + "'"; + 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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> + ///鍙傛暟锛歴tring 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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> + ///鍙傛暟锛歴tring 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));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + 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鎶ヨ〃 鏌ヨ杩愯鏃ュ織 + [Route("Sc_OEEReport/GetOEERunLogs")] + [HttpGet] + public object GetOEERunLogs(string sWhere, string user) + { + try + { + Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); + + string HEquipID = dic["HEquipID"].ToString();//璁惧 + string HBeginDate = dic["HBeginDate"].ToString();//寮�濮嬫棩鏈� + string HEndDate = dic["HEndDate"].ToString();//缁撴潫鏃ユ湡 + + ds = oCN.RunProcReturn("exec h_p_SB_OEERunLogs '" + HEquipID.ToString() + "','" + HBeginDate + "','" + HEndDate + "'", "h_p_SB_OEERunLogs"); + List<object> columnNameList = new List<object>(); + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎴愬姛锛�"; + 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 } } \ No newline at end of file -- Gitblit v1.9.1