From 4848a8724265619a07ff6ef5370988556dba2efc Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期一, 17 二月 2025 17:02:24 +0800 Subject: [PATCH] 检验方案 表头增加字段 生产资源HSoucID --- WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs | 524 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 523 insertions(+), 1 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs index 00411ab..2d997d5 100644 --- a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs +++ b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs @@ -18,6 +18,70 @@ private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); + + #region 鐢熶骇璁㈠崟鍏ㄧ▼璺熻釜鎶ヨ〃 鏌ヨ鍏ㄩ儴閿�鍞鍗曞彿鏍规嵁鐢熶骇璁㈠崟鐨勯攢鍞鍗曞彿 + [Route("Mes_OrderProcFlowAllReport/getHSeOrderBillNo")] + [HttpGet] + public object getHSeOrderBillNo() + { + try + { + ds = oCN.RunProcReturn($"select DISTINCT HSeOrderBillNo from Sc_ICMOBillSub ", "Sc_ICMOBillSub"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鐢熶骇璁㈠崟鍏ㄧ▼璺熻釜鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/OrderProcFlowAllReportICMOList")] + [HttpGet] + public object OrderProcFlowAllReportICMOList(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn($"exec h_p_Mes_OrderProcFlowAllReport_ICMO " + sWhere + "", "h_p_Mes_OrderProcFlowAllReport_ICMO"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion #region 杞﹂棿宸ュ簭鍏ㄧ▼璺熻釜鎶ヨ〃 鏌ヨ [Route("Mes_OrderProcFlowAllReport/OrderProcFlowAllReportList")] @@ -130,7 +194,8 @@ } #endregion - #region 涓嶈壇鏄庣粏鑹巼鎶ヨ〃 鏌ヨ + + #region 杞﹂棿鐢熶骇姹囨姤缁熻琛� 鏌ヨ [Route("Mes_OrderProcFlowAllReport/StationOutSumReportList")] [HttpGet] public object StationOutSumReportList(string sWhere) @@ -166,5 +231,462 @@ } } #endregion + + + #region 璁′欢宸ヨ祫鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePiecePayReport")] + [HttpGet] + public object EmployeePiecePayReport(string sWhere, string user) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "璁′欢宸ヨ祫鎶ヨ〃"); + + if (sql_splice != "") + { + sWhere += sql_splice; + } + else + { + string czymc = ""; + ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + user + "'", "gy_czygl"); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + czymc += Convert.ToString(ds.Tables[0].Rows[i]["czymc"]) + ","; + } + sWhere += ",''"; + } + } + } + + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePayReport " + sWhere + "", "h_p_Sc_EmployeePiecePayReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 璁′欢宸ヨ祫姹囨�绘姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePiecePaySumReport")] + [HttpGet] + public object EmployeePiecePaySumReport(string sWhere, string user) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "璁′欢宸ヨ祫姹囨�绘姤琛�"); + + if (sql_splice != "") + { + sWhere += sql_splice; + } + else + { + string czymc = ""; + ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + user + "'", "gy_czygl"); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + czymc += Convert.ToString(ds.Tables[0].Rows[i]["czymc"]) + ","; + } + sWhere += ",''"; + } + } + } + + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePaySumReport " + sWhere + "", "h_p_Sc_EmployeePiecePaySumReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 宸ヨ祫姹囨姤鏃ユ姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/EmployeePieceWorkReport")] + [HttpGet] + public object EmployeePieceWorkReport(string sWhere, string user) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭姹囨姤鏃ユ姤琛�"); + + if (sql_splice != "") + { + sWhere += sql_splice; + } + else + { + string czymc = ""; + ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + user + "'", "gy_czygl"); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + czymc += Convert.ToString(ds.Tables[0].Rows[i]["czymc"]) + ","; + } + sWhere += ",''"; + } + } + } + + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePieceWorkReport " + sWhere + "", "h_p_Sc_EmployeePieceWorkReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 鐢熶骇杞﹂棿宸ュ簭鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPReport")] + [HttpGet] + public object WorkShopProcessWIPReport(string sWhere,string user) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "鐢熶骇杞﹂棿宸ュ簭鎶ヨ〃"); + + if(sql_splice != "") + { + sWhere += sql_splice; + } + else + { + string czymc = ""; + ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + user + "'", "gy_czygl"); + for(int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + czymc += Convert.ToString(ds.Tables[0].Rows[i]["czymc"])+","; + } + sWhere += ",''"; + } + } + } + + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 宸ュ簭鍦ㄥ埗鍝佹姤琛� 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPSumReport")] + [HttpGet] + public object WorkShopProcessWIPSumReport(string sWhere, string user) + { + try + { + //鑾峰彇绯荤粺鍙傛暟 + string Ret = ""; + if (oSystemParameter.ShowBill(ref Ret)) + { + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓� + string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "宸ュ簭鍦ㄥ埗鍝佹姤琛�"); + + if (sql_splice != "") + { + sWhere += sql_splice; + } + else + { + string czymc = ""; + ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + user + "'", "gy_czygl"); + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + czymc += Convert.ToString(ds.Tables[0].Rows[i]["czymc"]) + ","; + } + sWhere += ",''"; + } + } + } + + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPSumReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPSumReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 浜у搧宸ヨ壓璺嚎灞曞紑鎶ヨ〃 鏌ヨ + [Route("Mes_OrderProcFlowAllReport/RoutingBillMulLevBOMReportList")] + [HttpGet] + public object RoutingBillMulLevBOMReportList(string sWhere) + { + try + { + //鍙嶅簭鍒楀寲浼犻�掔殑鍊� + + ds = oCN.RunProcReturn($"exec h_p_Sc_RoutingBillMulLevBOMReport " + sWhere + "", "h_p_Sc_RoutingBillMulLevBOMReport"); + + List<object> listCol = new List<object>(); + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + listCol.Add(JsonConvert.DeserializeObject(str)); + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = listCol; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + + #region 宸ュ簭寮傚父杩囩珯鎶ヨ〃 + /// <summary> + /// 宸ュ簭寮傚父杩囩珯鎶ヨ〃 + /// </summary> + /// <returns></returns> + [Route("Mes_OrderProcFlowAllReportController/GetSc_ProcessErrStationReport_Json")] + [HttpGet] + public object GetSc_ProcessErrStationReport_Json(string sWhere,string user) + { + try + { + if (!DBUtility.ClsPub.Security_Log("Sc_ProcessErrStationReport", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn("exec h_p_Sc_ProcessErrStationReport " + sWhere, "h_p_Sc_ProcessErrStationReport"); + 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 = "鏌ヨ宸ュ簭寮傚父杩囩珯鎶ヨ〃淇℃伅澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 杞﹂棿妯″潡 鐢熶骇鏃ラ渶姹傛ā鍏锋姤琛� 鏌ヨ + + [Route("Mes_OrderProcFlowAllReport/getSc_MouldRequirementDay")] + [HttpGet] + public object getSc_MouldRequirementDay(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_MouldRequirementDay order by 鏃ユ湡 desc", "h_v_Sc_MouldRequirementDay"); + } + else + { + string sql1 = "select * from h_v_Sc_MouldRequirementDay where 1 = 1 "; + string sql = sql1 + sWhere + " order by 鏃ユ湡 "; + ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRequirementDay"); + } + + //娣诲姞鍒楀悕 + 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 } } \ No newline at end of file -- Gitblit v1.9.1