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.

104 lines
3.8 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 NPOI.HSSF.UserModel;
using System.Collections;
using System.Text.RegularExpressions;
/***************************************************************************************************
*
* 更新人sitong.dong
* 描述:事物查询
* 修改时间2022.06.22
* 修改日志:系统迭代升级
*
**************************************************************************************************/
namespace Estsh.Core.Web.Controllers
{
public class InventTransQueryController : BaseController
{
private IInventTransQueryService service;
public InventTransQueryController(IInventTransQueryService _service)
{
service = _service;
}
//
// GET: /Menu/
public ActionResult Index()
{
return View();
}
/// <summary>
/// 获取事物查询列表数据
/// </summary>
/// <param name="partNo"></param>
/// <param name="pager"></param>
/// <param name="direction"></param>
/// <param name="sort"></param>
/// <returns></returns>
public ActionResult getDPSListByPage(String partNo, String partSpec, String cartonNo,String refOrderNo,String transType, String destErpWarehouse, string startTime
, string endTime, Pager pager, String direction, String sort)
{
Hashtable result = new Hashtable();
result.Add("pager.pageNo", pager.pageNo);
Hashtable dataHt = this.service.getDPSListByPage(partNo, partSpec, cartonNo, refOrderNo, transType, destErpWarehouse
, startTime, endTime, 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
/// </summary>
/// <returns></returns>
public ActionResult exportData(String partNo, String partSpec, String cartonNo, String refOrderNo, String transType, String destErpWarehouse, string startTime
, string endTime)
{
List<InventTransQuery> listHt = this.service.getExportList(partNo, partSpec, cartonNo, refOrderNo, transType, destErpWarehouse, startTime, endTime);
var memoryStream = ExcelHelper.ToExcel(listHt);
string dateTime = DateTime.Now.ToString("yyyyMMddHHmmss");
return File(memoryStream.ToArray(), "application/ms-excel", "事务信息" + dateTime + ".xls");
}
public ActionResult GetStockTransType()
{
Hashtable resault = new Hashtable();
List<KeyValueResult> pdlineList = service.GetStockTransType();
resault.Add("list", pdlineList);
return Json(resault);
}
public ActionResult GetErpwarehouse()
{
Hashtable resault = new Hashtable();
List<KeyValueResult> pdlineList = service.GetErpwarehouse();
resault.Add("list", pdlineList);
return Json(resault);
}
public ActionResult GetSrcLocate()
{
Hashtable resault = new Hashtable();
List<KeyValueResult> pdlineList = service.GetSrcLocate();
resault.Add("list", pdlineList);
return Json(resault);
}
public ActionResult Getuserinfo()
{
Hashtable resault = new Hashtable();
List<KeyValueResult> pdlineList = service.Getuserinfo();
resault.Add("list", pdlineList);
return Json(resault);
}
}
}