You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
297 lines
8.5 KiB
297 lines
8.5 KiB
using NFine.Application.SRM;
|
|
using NFine.Code;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
|
|
namespace NFine.Web.Areas.SRM.Controllers
|
|
{
|
|
public class ContainerController : ControllerBase
|
|
{
|
|
ContainerApp App = new ContainerApp();
|
|
//
|
|
// GET: /SRM/Container/
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSContainerAdd()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSContainerBinding()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSContainerLot()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSContainerLotBinding()
|
|
{
|
|
return View();
|
|
}
|
|
/// <summary>
|
|
/// 查询容器信息
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridJson(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson4(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridJson4(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 查询容器绑定
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJsonBinding(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetGridJsonBinding(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除包装、容器
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DeleteICSContainer(string keyValue)
|
|
{
|
|
string msg = App.DeleteICSContainer(keyValue);
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error(msg);
|
|
}
|
|
}
|
|
//获取父容器
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetContainerID()
|
|
{
|
|
DataTable dt = App.GetContainerID();
|
|
return Content(dt.ToJson());
|
|
}
|
|
//获取父容器
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetContainerType()
|
|
{
|
|
DataTable dt = App.GetContainerType();
|
|
return Content(dt.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 修改包装、容器
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult UpdateICSContainer(string keyValue)
|
|
{
|
|
string msg = App.UpdateICSContainer(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("修改成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 新增包装、容器
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult InsertICSContainerLot(string keyValue)
|
|
{
|
|
string msg = App.InsertICSContainerLot(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
//包装容器
|
|
public ActionResult GetSendContainer(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetSendContainer(ref pagination, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetBindContainerID(string SireCode)
|
|
{
|
|
DataTable ListData = App.GetBindContainerID(SireCode);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetContainerInfo(string Code)
|
|
{
|
|
DataTable ListData = App.GetContainerInfo(Code);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult BindingContainerID(string keyValue)
|
|
{
|
|
string msg = App.BindingContainerID(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("绑定成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 新增包装、容器
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult InsertICSContainer(string keyValue)
|
|
{
|
|
string msg = App.InsertICSContainer(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
//包装容器关联条码
|
|
public ActionResult GetSendContainerLot(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetSendContainerLot(ref pagination, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetContainerLotInfo(string LotNo)
|
|
{
|
|
DataTable ListData = App.GetContainerLotInfo(LotNo);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult BindingContainerLotID(string keyValue)
|
|
{
|
|
string msg = App.BindingContainerLotID(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("绑定成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 删除包装、容器关联
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DeleteICSContainerLot(string keyValue)
|
|
{
|
|
string msg = App.DeleteICSContainerLot(keyValue);
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error(msg);
|
|
}
|
|
}
|
|
}
|
|
}
|