| | |
| | | } |
| | | #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));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | 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));//获取到DataColumn列对象的列名 |
| | | } |
| | | } |
| | | 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));//获取到DataColumn列对象的列名 |
| | | } |
| | | } |
| | | |
| | | 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 |
| | | |
| | | } |