1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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
- {
- /// <summary>
- /// 产量视图查询
- /// </summary>
- [Route("eap/api/[controller]/[action]")]
- [ApiController]
- [Authorize]
- public class OutPutDataController : ControllerBase
- {
- /// <summary>
- /// 产量视图查询
- /// </summary>
- /// <param name="fcode"></param>
- /// <param name="start"></param>
- /// <param name="end"></param>
- /// <param name="recipe"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- [HttpGet]
- public LayuiModel<OutPutData> 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);
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="fcode"></param>
- /// <param name="start"></param>
- /// <param name="end"></param>
- /// <param name="recipe"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- [HttpGet]
- public LayuiModel<OutPutData> 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);
- }
- }
- }
- }
|