using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using VueWebCoreApi.DLL.BLL; using VueWebCoreApi.Tools; namespace VueWebCoreApi.Controllers { [ApiExplorerSettings(GroupName = "统计报表")] [ApiController] [Route("api/[controller]")] //[ChannelActionFilter] public class ReportManagerController : Controller { //定义全局信息返回变量 ToMessage mes = new ToMessage(); RedisHelper redis = new RedisHelper(); #region[生产进度报表] /// /// 生产进度报表 /// /// 工单状态 /// 工单编号 /// /// 车间编号 /// /// 车间名称 /// 产品编码 /// 产品名称 /// 规格型号 /// 单据日期 /// 页码 /// 每页显示条数 /// 排序字段 /// 排序规则 /// [Route(template: "ProductionScheduleReportSearch")] [HttpGet] public JsonResult ProductionScheduleReportSearch(int page, int rows, string prop, string order, string status = null, string wocode = null,string wkshopcode=null,string wkshopname=null, string partcode = null, string partname = null, string partspec = null, string lm_date = null) { string opendate = ""; //开始时间 string closedate = ""; //结束时间 if (lm_date != "" && lm_date != null) { opendate = lm_date.Split('~')[0].ToString(); closedate = lm_date.Split('~')[1].ToString(); } int startNum = rows * (page - 1) + 1; //起始记录rowNum int endNum = rows * page; //结束记录 rowNum mes = ReportManagerBLL.ProductionScheduleReportSearch(status, wocode, wkshopcode,wkshopname, partcode, partname, partspec, opendate, closedate, startNum, endNum, prop, order); return Json(mes); } #endregion #region[生产进度报表导出] /// /// 生产进度报表导出 /// /// 工单状态 /// 工单编号 /// /// 车间编号 /// /// 车间名称 /// 产品编码 /// 产品名称 /// 规格型号 /// 单据日期 /// [Route(template: "ProductionScheduleReportExcelSearch")] [HttpGet] public JsonResult ProductionScheduleReportExcelSearch(string status = null, string wocode = null, string wkshopcode = null, string wkshopname = null, string partcode = null, string partname = null, string partspec = null, string lm_date = null) { string opendate = ""; //开始时间 string closedate = ""; //结束时间 if (lm_date != "" && lm_date != null) { opendate = lm_date.Split('~')[0].ToString(); closedate = lm_date.Split('~')[1].ToString(); } mes = ReportManagerBLL.ProductionScheduleReportExcelSearch(status, wocode, wkshopcode, wkshopname, partcode, partname, partspec, opendate, closedate); return Json(mes); } #endregion } }