You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.7 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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();
}
/// <summary>
///
/// </summary>
/// <param name="menuName"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
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);
}
/// <summary>
/// 导出数据到Excel
/// BY NOAH
/// </summary>
/// <returns></returns>
public ActionResult exportData(string pdlineCode, string partNo, string partSpec, string serialNumber, string beginCreateTime, string endCreateTime)
{
List<ProductDeliveryResult> 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");
}
}
}