|  |  |  | 
|---|
|  |  |  | #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));//获取到DataColumn列对象的列名 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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));  //获取到DataColumn列对象的列名 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #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));//获取到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; } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #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; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | [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}'"; | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region  产线查询 | 
|---|
|  |  |  | [Route("MaterOutEntryReport/Gy_SourceList")] | 
|---|
|  |  |  | [HttpGet] | 
|---|