From 096f0a528fc003ad60d50155af11a40d14b9f0d9 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期二, 12 十二月 2023 13:34:14 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/MateOutController.cs | 346 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 331 insertions(+), 15 deletions(-) diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs index bf15653..e0da45a 100644 --- a/WebAPI/Controllers/MateOutController.cs +++ b/WebAPI/Controllers/MateOutController.cs @@ -1341,6 +1341,7 @@ public string HProductName; public string HProductModel; public string RandomSearch; + public string OtherSearch; } #region 鐧藉澂鍙戝竷姹囨�绘姤琛� @@ -1356,9 +1357,17 @@ string sql = "" + "( (鏃ユ湡 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + "and (浜у搧浠g爜=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + - "and (鍗曟嵁鍙�=''" + com.HBillNo + "'' or ''"+ com.HBillNo + "''='''') " + + "and (鍗曟嵁鍙�=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + "and (浜у搧鍚嶇О=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + - "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; + "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch + + " " + com.OtherSearch; + + //string sql = "" + + // "( (鏃ユ湡 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + + // "and (浜у搧浠g爜=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + + // "and (鍗曟嵁鍙�=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + + // "and (浜у搧鍚嶇О=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + + // "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; ds = oCN.RunProcReturn($"exec h_p_Kf_MaterOutSumReport_Cloth_New '{sql}'" , "h_p_Kf_MaterOutSumReport_Cloth_New"); @@ -1480,7 +1489,15 @@ "and (浜у搧浠g爜=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + "and (鐢熶骇璁㈠崟鍙�=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + "and (浜у搧鍚嶇О=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + - "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; + "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch + + " " + com.OtherSearch; + + //string sql = "" + + // "( (鐢熶骇璁㈠崟鏃ユ湡 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + + // "and (浜у搧浠g爜=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + + // "and (鐢熶骇璁㈠崟鍙�=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + + // "and (浜у搧鍚嶇О=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + + // "and (瑙勬牸鍨嬪彿=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; ds = oCN.RunProcReturn($"exec h_p_Kf_ProdProcessSumReport_DyeColor '{sql}'", "h_p_Kf_ProdProcessSumReport_DyeColor"); @@ -1758,17 +1775,142 @@ #endregion + #region 鍘嬫按鍑虹珯 姣涘皷鍑虹珯 + [Route("ProdProcessSumReport/Kf_PressurizedWaterOutReport")] + [HttpGet] + public object Kf_PressurizedWaterOutReport(string sWhere,string HBillType) + { + try + { + switch (HBillType) + { + case "Kf_PressurizedWaterOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_PressurizedWaterOutReport where 1=1 " + sWhere, "h_v_Kf_PressurizedWaterOutReport"); + break; + case "Kf_HairtipReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_HairtipReport where 1=1 " + sWhere, "h_v_Kf_HairtipReport"); + break; + case "Kf_DigitalSprayPaintingReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_DigitalSprayPaintingReport where 1=1 " + sWhere, "h_v_Kf_DigitalSprayPaintingReport"); + break; + case "Kf_ShrinkBrushReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushReport"); + break; + case "Kf_FinalizeTheDesignOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_FinalizeTheDesignOutReport where 1=1 " + sWhere, "h_v_Kf_FinalizeTheDesignOutReport"); + break; + case "Kf_LustringOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_LustringOutReport where 1=1 " + sWhere, "h_v_Kf_LustringOutReport"); + break; + case "Kf_ShrinkBrushOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushOutReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushOutReport"); + break; + case "Kf_FinalizeOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_FinalizeOutReport where 1=1 " + sWhere, "h_v_Kf_FinalizeOutReport"); + break; + case "Kf_LustringReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_LustringReport where 1=1 " + sWhere, "h_v_Kf_LustringReport"); + break; + case "Kf_ShrinkBrushTeReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_ShrinkBrushTeReport where 1=1 " + sWhere, "h_v_Kf_ShrinkBrushTeReport"); + break; + case "Kf_EmbossingOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_EmbossingOutReport where 1=1 " + sWhere, "h_v_Kf_EmbossingOutReport"); + break; + case "Kf_StereoscopicFlowerOutReport": + ds = oCN.RunProcReturn($"select * from h_v_Kf_StereoscopicFlowerOutReport where 1=1 " + sWhere, "h_v_Kf_StereoscopicFlowerOutReport"); + break; + } + + + //鑾峰彇鍒楀悕 + 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 = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + 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 棰嗘枡缁熻鎶ヨ〃 + /// <summary> + /// 棰嗘枡缁熻鎶ヨ〃 + /// </summary> + /// <returns></returns> + [Route("MateOutController/GetKf_MateOutSumReport_QiaoYi_Json")] + [HttpGet] + public object GetKf_MateOutSumReport_QiaoYi_Json(string sWhere) + { + try + { + ds = oCN.RunProcReturn("exec h_p_Kf_MateOutSumReport_QiaoYi " + sWhere, "h_p_Kf_MateOutSumReport_QiaoYi"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + 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 + #endregion #region (鐢熶骇璁㈠崟缁村害)瀹㈡埛璁㈠崟鎶ヨ〃 [Route("MaterOutEntryReport/sc_ICOMReportList")] [HttpGet] - public object sc_ICOMReportList(string sWhere) + public object sc_ICOMReportList(string sWhere,string HBeginDate,string HEndDate) { try { - string sql = "exec h_p_sc_ICOMReport '"+ sWhere + "'"; + string sql = "exec h_p_sc_ICOMReport '"+ sWhere + "','"+ HBeginDate + "','"+ HEndDate + "'"; ds = oCN.RunProcReturn(sql, "h_p_sc_ICOMReport"); @@ -1884,13 +2026,109 @@ } #endregion + #region 涓嶈壇鍘熷洜鍒嗘瀽鎶ヨ〃 + /// <summary> + /// 杩斿洖涓嶈壇鍘熷洜鍒嗘瀽鎶ヨ〃鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_BadReasonReport/list")] + [HttpGet] + public object list(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + if (sWhere == null || sWhere.Equals("")) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "璇烽�夋嫨鏈夋晥骞翠唤"; + return objJsonResult; + } + else + { + ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonReport '" + sWhere + "'", "h_p_Sc_BadReasonReport"); + } + + //娣诲姞鍒楀悕 + 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("MaterOutEntryReport/sc_ICOMRKBanReport")] + [HttpGet] + public object sc_ICOMRKBanReport(string sWhere) + { + try + { + string sql = "select * from h_v_sc_ICOMRKBanReport where 1=1 " + sWhere + " order by 鏃ユ湡 "; + + ds = oCN.RunProcReturn(sql, "h_v_sc_ICOMRKBanReport"); + + DataTable dt = ds.Tables[0]; + + //鑾峰彇鍒楀悕 + 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 = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = dt; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 鐢熶骇鏃ヨ鎶ヨ〃 - public class DayRkReport { - public string HBeginDate { get; set; } - public string HEndDate { get; set; } - public string HMaterNumber { get; set; } - public string HCustomerName { get; set; } - public string HProductName { get; set; } + public class DayRkReport { + public string HBeginDate { get; set; } + public string HEndDate { get; set; } + public string HMaterNumber { get; set; } + public string HCustomerName { get; set; } + public string HProductName { get; set; } + public string HOtherSearch { get; set; } + public string HEmpName { get; set; } + public string sWheres { get; set; } } [Route("MaterOutEntryReport/SC_DayRkReport")] [HttpGet] @@ -1899,9 +2137,87 @@ try { DayRkReport DayRkReportList = JsonConvert.DeserializeObject<DayRkReport>(sWhere); - + string sql = $"exec h_p_Gy_DayRkReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + - $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; + $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}','{DayRkReportList.HEmpName}','{DayRkReportList.sWheres}'"; + //string sql = $"exec h_p_Gy_DayRkReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + + // $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; + + ds = oCN.RunProcReturn(sql, "h_p_Gy_DayRkReport"); + + DataTable dt = null; + if (num == 1) + { + dt = ds.Tables[0]; + } + else if (num == 2) + { + dt = ds.Tables[1]; + } + + //鑾峰彇鍒楀悕 + List<object> columnNameList = new List<object>(); + if (num == 1) + { + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + } + else if (num == 2) + { + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[1].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.list = columnNameList; + objJsonResult.data = dt; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍗婃垚鍝佹姤琛� + public class SemiFinishedProductsReport + { + public string HBeginDate { get; set; } + public string HEndDate { get; set; } + public string HMaterNumber { get; set; } + public string HCustomerName { get; set; } + public string HProductName { get; set; } + public string HOtherSearch { get; set; } + } + [Route("MaterOutEntryReport/SemiFinishedProductsReportList")] + [HttpGet] + public object SemiFinishedProductsReportList(string sWhere, int num) + { + try + { + SemiFinishedProductsReport DayRkReportList = JsonConvert.DeserializeObject<SemiFinishedProductsReport>(sWhere); + + string sql = $"exec h_p_sc_SemiFinishedProductsReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + + $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}'"; + //string sql = $"exec h_p_sc_SemiFinishedProductsReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + + // $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; ds = oCN.RunProcReturn(sql, "h_p_Gy_DayRkReport"); DataTable dt = null; @@ -1958,11 +2274,11 @@ #region 浜х嚎鏌ヨ [Route("MaterOutEntryReport/Gy_SourceList")] [HttpGet] - public object Gy_SourceList(string HOrgid) + public object Gy_SourceList(string HOrgid,string sWhere) { try { - string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Source where HUSEORGID="+ HOrgid + " order by hnumber"); + string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Source where HUSEORGID="+ HOrgid + " "+ sWhere + " order by hnumber"); ds = oCN.RunProcReturn(sql1, "Gy_Source"); -- Gitblit v1.9.1