|
|
|
|
|
using System.Collections;
|
|
|
using Aspose.Cells;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Models;
|
|
|
using System.Text.Json;
|
|
|
using Estsh.Core.Controllers;
|
|
|
using Estsh.Core.Util;
|
|
|
using NPOI.HSSF.UserModel;
|
|
|
using Estsh.Core.Model.ExcelModel;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:条码追踪查询
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Web.Controllers
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 客户订单维护
|
|
|
/// </summary>
|
|
|
public class CartonTrackController : BaseController
|
|
|
{
|
|
|
|
|
|
private ICartonTrackService service;
|
|
|
|
|
|
public CartonTrackController(ICartonTrackService _service)
|
|
|
{
|
|
|
this.service = _service;
|
|
|
}
|
|
|
//
|
|
|
// GET: /CartonTrack/
|
|
|
public ActionResult Index()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取条码追踪查询列表数据
|
|
|
/// </summary>
|
|
|
/// <param name="CartonTrackName">菜单名称</param>
|
|
|
/// <param name="pager">分页</param>
|
|
|
/// <param name="direction">排序方式</param>
|
|
|
/// <param name="sort">排序列</param>
|
|
|
/// <returns></returns>
|
|
|
public ActionResult getCartonTrackListByPage(String cartonNo, String partNo,String partSpec,String locateType, String startTime, String endTime, Pager pager, String direction, String sort, String enabled = "Y")
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
result.Add("pager.pageNo", pager.pageNo);
|
|
|
Hashtable dataHt = this.service.getCartonTrackListByPage(cartonNo, partNo, partSpec, locateType, startTime, endTime, pager, direction, sort, enabled);
|
|
|
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 cartonNo, String partNo, String partSpec, String locateType, String startTime, String endTime, String enabled)
|
|
|
{
|
|
|
List<CartonTrack> listHt = this.service.getExportList(cartonNo, partNo, partSpec, locateType, startTime, endTime,enabled);
|
|
|
var memoryStream = ExcelHelper.ToExcel(listHt);
|
|
|
string dateTime = DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
|
return File(memoryStream.ToArray(), "application/ms-excel", "条码追踪查询" + dateTime + ".xls");
|
|
|
}
|
|
|
|
|
|
|
|
|
public ActionResult GetLocateType()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
List<KeyValueResult> menuList = this.service.GetLocateType();
|
|
|
result.Add("list", menuList);
|
|
|
return Json(result);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取下拉列表数据
|
|
|
/// </summary>
|
|
|
/// <rehuoturns></returns>
|
|
|
public ActionResult getSelectCartonTrack()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
List<KeyValueResult> CartonTrackList = this.service.getSelectCartonTrack();
|
|
|
result.Add("list", CartonTrackList);
|
|
|
return Json(result);
|
|
|
}
|
|
|
}
|
|
|
}
|