using Cksoft.Data; using Cksoft.Data.Repository; using DllEapDal.OFILM; using DllEapEntity.Dtos; using DllEapEntity.OFILM; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Text; namespace DllEapBll.Controllers { /// /// 产量视图查询 /// [Route("eap/api/[controller]/[action]")] [ApiController] [Authorize] public class OutPutDataController : ControllerBase { /// /// 产量视图查询 /// /// /// /// /// /// /// /// [HttpGet] public LayuiModel Get(string fcode, DateTime? start, DateTime? end, string recipe, int pageIndex = 1, int pageSize = 20) { if (!end.HasValue) { end = DateTime.Now; } if (!start.HasValue) { start = DateTime.Parse(end.Value.ToString("yyyy-MM-dd 00:00:00")); } using (IDatabase db = DbFactory.Base("eap")) { var dal = new OutPutDataDal(db); return dal.Get(fcode, start.Value, end.Value, recipe, pageIndex, pageSize); } } /// /// /// /// /// /// /// /// /// /// [HttpGet] public LayuiModel GetCount(string fcode, DateTime? start, DateTime? end, string recipe, int pageIndex = 1, int pageSize = 20) { /*var dall = new MacOutPutTimeDal(); dall.SetData();*/ if (!end.HasValue) { end = DateTime.Now; } if (!start.HasValue) { start = DateTime.Parse(end.Value.ToString("yyyy-MM-dd 00:00:00")); } using (IDatabase db = DbFactory.Base("eap")) { var dal = new OutPutDataDal(db); return dal.GetCount(fcode, start.Value, end.Value, recipe, pageIndex, pageSize); } } } }