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;
/***************************************************************************************************
*
* 更新人:sitong.dong
* 描述:盘点单冻结与解冻
* 修改时间:2022.06.22
* 修改日志:系统迭代升级
*
**************************************************************************************************/
namespace Estsh.Core.Web.Controllers
{
///
/// 盘点单生产
///
public class CheckFreezeController : BaseController
{
private ICheckFreezeService service;
public CheckFreezeController(ICheckFreezeService _service)
{
this.service = _service;
}
//
// GET: /CheckFreeze/
public ActionResult Index()
{
return View();
}
///
/// 获取盘点单冻结与解冻列表数据
///
/// 菜单名称
/// 分页
/// 排序方式
/// 排序列
///
public ActionResult getCheckFreezeListByPage(Pager pager, String direction, String sort, string cbChkCommand)
{
if ((string.IsNullOrEmpty(cbChkCommand)) || cbChkCommand == "null")
{
return Json("");
}
string userId = CurrentEmp.EmpId.ToString();
Hashtable result = new Hashtable();
result.Add("pager.pageNo", pager.pageNo);
Hashtable dataHt = this.service.getCheckFreezeListByPage(cbChkCommand,Convert.ToInt32(userId));
result.Add("rows", dataHt["dataList"]);
result.Add("pager.totalRows", dataHt["totalCount"]);
result.Add("sort", sort);
result.Add("direction", direction);
return Json(result);
}
///
///盘点单集合
///
/// 数据集
public ActionResult GetChkCommandList()
{
Hashtable resault = new Hashtable();
List list = service.GetChkCommandList();
resault.Add("list", list);
return Json(resault);
}
///
/// 冻结
///
///
///
public ActionResult Freeze(string cbChkCommand)
{
Hashtable resault = new Hashtable();
string userId = CurrentEmp.EmpId.ToString();
List list = service.Freeze(cbChkCommand, userId);
string message = list[0].r_msg;
resault.Add("message", message);
return Json(resault);
}
///
/// 解冻
///
///
///
public ActionResult Thaw(string cbChkCommand)
{
Hashtable resault = new Hashtable();
string userId = CurrentEmp.EmpId.ToString();
List list = service.Thaw(cbChkCommand, userId);
string message = list[0].r_msg;
resault.Add("message", message);
return Json(resault);
}
}
}