using System.Collections; using Microsoft.AspNetCore.Mvc; using Estsh.Core.Services.IServices; using Estsh.Core.Model.Result; using Estsh.Core.Controllers; using Estsh.Core.Util; using Estsh.Core.Models; using Estsh.Core.Model.ExcelModel; /*************************************************************************************************** * * 更新人:sitong.dong * 描述:成品库存查询 * 修改时间:2022.06.22 * 修改日志:系统迭代升级 * **************************************************************************************************/ namespace Estsh.Core.Web.Controllers { /// /// 收货查询补打模块的控制类 /// public class FinishedInventoryQueryController : BaseController { private IFinishedInventoryQueryService service; public FinishedInventoryQueryController(IFinishedInventoryQueryService _service) { service = _service; } public ActionResult Index() { return View(); } /// /// 根据分页条件获取用户列表 /// /// /// /// /// /// public ActionResult getListByPage(string mtoc, Pager pager, String direction, String sort, string enabled = "Y") { Hashtable result = new Hashtable(); Hashtable dataHt = this.service.getListByPage(mtoc, enabled, pager, direction, sort); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); return Json(result); } public ActionResult getTrayNoListByPage(string mtoc, string trayNo, Pager pager, String direction, String sort, string enabled = "Y") { Hashtable result = new Hashtable(); Hashtable dataHt = this.service.getTrayNoListByPage(mtoc, trayNo, enabled, pager, direction, sort); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); return Json(result); } public ActionResult getCartonNoListByPage(string mtoc, string trayNo, Pager pager, String direction, String sort, string enabled = "Y") { Hashtable result = new Hashtable(); Hashtable dataHt = this.service.getCartonNoListByPage(mtoc, trayNo, enabled, pager, direction, sort); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); return Json(result); } public ActionResult exportData(string mtoc) { List listHt = this.service.getMtocDetailsList(mtoc); var memoryStream = ExcelHelper.ToExcel(listHt); string dateTime = DateTime.Now.ToString("yyyyMMddHHmmss"); return File(memoryStream.ToArray(), "application/ms-excel", "成品库存查询" + dateTime + ".xls"); } } }