using Estsh.Core.Controllers; using Estsh.Core.Model.ExcelModel; using Estsh.Core.Model.Result; using Estsh.Core.Models; using Estsh.Core.Services.IServices; using Estsh.Core.Util; using Microsoft.AspNetCore.Mvc; using System.Collections; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:成品发运结果查询 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Web.Controllers { public class ProductDeliveryResultController : BaseController { private IProductDeliveryResultService service; public ProductDeliveryResultController(IProductDeliveryResultService _service) { service = _service; } // // GET: /Menu/ public ActionResult Index() { return View(); } /// /// /// /// /// /// /// /// public ActionResult getInQCListByPage(string pdlineCode, string partNo,string partSpec,string serialNumber, string beginCreateTime, string endCreateTime, Pager pager, String direction, String sort) { int factoryId = CurrentEmp.FactoryId; Hashtable result = new Hashtable(); result.Add("pager.pageNo", pager.pageNo); Hashtable dataHt = this.service.getInQCListByPage(pdlineCode, partNo, partSpec, serialNumber, beginCreateTime, endCreateTime, pager, direction, sort); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); result.Add("sort", sort); result.Add("direction", direction); return Json(result); } /// /// 导出数据到Excel /// BY NOAH /// /// public ActionResult exportData(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime) { List listHt = this.service.getSearchDataList(pdlineCode, partNo, partSpec, serialNumber, beginCreateTime, endCreateTime); var memoryStream = ExcelHelper.ToExcel(listHt); string dateTime = DateTime.Now.ToString("yyyyMMddHHmmss"); return File(memoryStream.ToArray(), "application/ms-excel", "成品发运结果查询" + dateTime + ".xls"); } } }