|
|
|
|
|
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.Model.ExcelModel;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:半成品库存查询
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Web.Controllers
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 收货查询补打模块的控制类
|
|
|
/// </summary>
|
|
|
public class FinishedHalfInventoryQueryController : BaseController
|
|
|
{
|
|
|
private IFinishedHalfInventoryQueryService service;
|
|
|
private ICommonService commonService;
|
|
|
public FinishedHalfInventoryQueryController(IFinishedHalfInventoryQueryService _service, ICommonService _commonService)
|
|
|
{
|
|
|
service = _service;
|
|
|
this.commonService = _commonService;
|
|
|
|
|
|
}
|
|
|
public ActionResult Index()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取用户列表
|
|
|
/// </summary>
|
|
|
/// <param name="account"></param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction"></param>
|
|
|
/// <param name="sort"></param>
|
|
|
/// <returns></returns>
|
|
|
public ActionResult getListByPage(string partNo, string partSpec, Pager pager, String direction, String sort, string enabled = "Y")
|
|
|
{
|
|
|
int factoryId = CurrentEmp.FactoryId;
|
|
|
Hashtable result = new Hashtable();
|
|
|
result.Add("pager.pageNo", pager.pageNo);
|
|
|
Hashtable dataHt = this.service.getListByPage(partNo, partSpec, enabled, factoryId, 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 partNo, string partSpec, string enabled = "Y")
|
|
|
{
|
|
|
List<FinishedHalfInventory> listHt = this.service.getExportList(partNo, partSpec, enabled, CurrentEmp.FactoryId.ToString());
|
|
|
var memoryStream = ExcelHelper.ToExcel(listHt);
|
|
|
string dateTime = DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
|
return File(memoryStream.ToArray(), "application/ms-excel", "半成品库存查询" + dateTime + ".xls");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|