From 36293cb9ce2ff1881cc9082f4b330f3ea3c162ab Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期二, 30 七月 2024 14:00:56 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/生产管理/质量汇报单/Sc_QualityReportBillController.cs | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 111 insertions(+), 0 deletions(-) diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" index 528228b..42b323e 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" @@ -1825,6 +1825,117 @@ } #endregion + #region 鐗╂枡鐢熶骇鑹巼缁熻(鏂帿灏�) 鏌ヨ + + [Route("Sc_QualityReportBill/getSc_HMaterYieldStatistics")] + [HttpGet] + public object getSc_HMaterYieldStatistics(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_HMater_Yield_Statistics_Query order by 鍗曟嵁鍙� desc", "h_v_Sc_HMater_Yield_Statistics_Query"); + } + else + { + string sql1 = "select * from h_v_Sc_HMater_Yield_Statistics_Query where 1 = 1 "; + string sql = sql1 + sWhere + " order by 鏃ユ湡 desc"; + ds = oCN.RunProcReturn(sql, "h_v_Sc_HMater_Yield_Statistics_Query"); + } + + //娣诲姞鍒楀悕 + 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 浠诲姟鍗曢�氳繃鐜�(鏂帿灏�) 鏌ヨ + + [Route("Sc_QualityReportBill/getSc_HICMMaterStatistics")] + [HttpGet] + public object getSc_HICMMaterStatistics(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鏌ョ湅鏉冮檺 + if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_Sc_HICMMater_Statistics_Query order by 鍗曟嵁鍙� desc", "h_v_Sc_HICMMater_Statistics_Query"); + } + else + { + string sql1 = "select * from h_v_Sc_HICMMater_Statistics_Query where 1 = 1 "; + string sql = sql1 + sWhere + " order by 鏃ユ湡 desc"; + ds = oCN.RunProcReturn(sql, "h_v_Sc_HICMMater_Statistics_Query"); + } + + //娣诲姞鍒楀悕 + 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