From 308263701da4760b517c116ffef4f9b1ca842261 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期一, 17 七月 2023 10:54:27 +0800 Subject: [PATCH] 瑞琪的,报废的生成入库单的时候把传的值 之前是=KCZT08_SYS 现在改成=KCZT001 乔一入库报表,生产报表 过滤条件 按照排产日期查询,加一个自定义条件 --- WebAPI/Controllers/MateOutController.cs | 209 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 203 insertions(+), 6 deletions(-) diff --git a/WebAPI/Controllers/MateOutController.cs b/WebAPI/Controllers/MateOutController.cs index 881202f..05a6442 100644 --- a/WebAPI/Controllers/MateOutController.cs +++ b/WebAPI/Controllers/MateOutController.cs @@ -534,8 +534,8 @@ List<Model.ClsKf_MateOutBillMain> lsmain = new List<Model.ClsKf_MateOutBillMain>(); ListModels oListModels = new ListModels(); lsmain = oListModels.getMateOutBillMainByJson(msg1); - lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); - lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); string sSourceBillType = lsmain[0].HBillType;//婧愬崟绫诲瀷 WebAPI.WebS.ClsKf_MateOutBillMain websLsmain = new WebS.ClsKf_MateOutBillMain(); @@ -553,7 +553,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鐢熸垚棰嗘枡鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + //objJsonResult.Message = "鐢熸垚棰嗘枡鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�"; objJsonResult.data = null; return objJsonResult; } @@ -561,7 +562,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } @@ -618,7 +620,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鐢熸垚閫�鏂欏崟鎴愬姛锛佸崟鎹彿涓猴細"; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛� + //objJsonResult.Message = "鐢熸垚閫�鏂欏崟鎴愬姛锛佸崟鎹彿涓猴細"; objJsonResult.data = null; return objJsonResult; } @@ -626,7 +629,8 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; + objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛� + //objJsonResult.Message = "涓婁紶澶辫触锛�" + DBUtility.ClsPub.sErrInfo; objJsonResult.data = null; return objJsonResult; } @@ -1612,6 +1616,199 @@ #endregion + #region (鐢熶骇璁㈠崟缁村害)瀹㈡埛璁㈠崟鎶ヨ〃 + [Route("MaterOutEntryReport/sc_ICOMReportList")] + [HttpGet] + public object sc_ICOMReportList(string sWhere) + { + try + { + string sql = "exec h_p_sc_ICOMReport '"+ sWhere + "'"; + + ds = oCN.RunProcReturn(sql, "h_p_sc_ICOMReport"); + + 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 瀹㈡埛璁㈠崟鏄庣粏鎶ヨ〃 + [Route("MaterOutEntryReport/Sc_ICOMProBarCodeReport")] + [HttpGet] + public object Sc_ICOMProBarCodeReport(string sWhere) + { + try + { + string sql = "select * from h_v_sc_ICOMProBarCodeReport where 1=1 " + sWhere; + + ds = oCN.RunProcReturn(sql, "h_v_sc_ICOMProBarCodeReport"); + + 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 鐢熶骇鍏ュ簱鎶ヨ〃 + [Route("MaterOutEntryReport/sc_ICOMRKReport")] + [HttpGet] + public object sc_ICOMRKReport(string sWhere) + { + try + { + string sql = "select * from h_v_sc_ICOMRKReport where 1=1 " + sWhere + " order by 鏃ユ湡 "; + + ds = oCN.RunProcReturn(sql, "h_v_sc_ICOMRKReport"); + + 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; } + } + [Route("MaterOutEntryReport/SC_DayRkReport")] + [HttpGet] + public object SC_DayRkReport(string sWhere,int num) + { + try + { + DayRkReport DayRkReportList = JsonConvert.DeserializeObject<DayRkReport>(sWhere); + + 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 #endregion -- Gitblit v1.9.1