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.

110 lines
3.5 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 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
{
/// <summary>
/// 盘点单生产
/// </summary>
public class CheckFreezeController : BaseController
{
private ICheckFreezeService service;
public CheckFreezeController(ICheckFreezeService _service)
{
this.service = _service;
}
//
// GET: /CheckFreeze/
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 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);
}
/// <summary>
///盘点单集合
/// </summary>
/// <returns>数据集</returns>
public ActionResult GetChkCommandList()
{
Hashtable resault = new Hashtable();
List<KeyValueResult> list = service.GetChkCommandList();
resault.Add("list", list);
return Json(resault);
}
/// <summary>
/// 冻结
/// </summary>
/// <param name="cbChkCommand"></param>
/// <returns></returns>
public ActionResult Freeze(string cbChkCommand)
{
Hashtable resault = new Hashtable();
string userId = CurrentEmp.EmpId.ToString();
List<dynamic> list = service.Freeze(cbChkCommand, userId);
string message = list[0].r_msg;
resault.Add("message", message);
return Json(resault);
}
/// <summary>
/// 解冻
/// </summary>
/// <param name="cbChkCommand"></param>
/// <returns></returns>
public ActionResult Thaw(string cbChkCommand)
{
Hashtable resault = new Hashtable();
string userId = CurrentEmp.EmpId.ToString();
List<dynamic> list = service.Thaw(cbChkCommand, userId);
string message = list[0].r_msg;
resault.Add("message", message);
return Json(resault);
}
}
}