添加工序配置
修改入库页面,任务完成,库存页面等
This commit is contained in:
1 parent
c2b039ea47
commit
5a04ca9d59
41 files changed
+1151
-84
No files matched your search
@@ -226,7 +226,7 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
#region InvOut 出库
|
||||
[ActionDescription("TaskType.Out")]
|
||||
/*[ActionDescription("TaskType.Out")]
|
||||
public ActionResult InvOut(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<InventoryVM>(id);
|
||||
@@ -234,54 +234,67 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
return FFResult().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("TaskType.Out")]
|
||||
public ActionResult InvOut(InventoryVM vm)
|
||||
{
|
||||
var id = vm.Entity.ID;
|
||||
// 校验参数
|
||||
if (string.IsNullOrWhiteSpace(vm.OutPort))
|
||||
// 判断是否存在出口配置
|
||||
var processConfig = _unitWork.FindSingle<ProcessConfig>(m =>
|
||||
m.Name == vm.Entity.Lot);
|
||||
if (processConfig == null)
|
||||
{
|
||||
return FFResult().Alert("出口必选,请选择后重试!");
|
||||
return FFResult().Alert("所选库存下道工序出口未配置!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
return PartialView(vm);
|
||||
}*/
|
||||
|
||||
[ActionDescription("TaskType.Out")]
|
||||
public ActionResult InvOut(string id)
|
||||
{
|
||||
// var vm = Wtm.CreateVM<InventoryVM>(id);
|
||||
// 校验参数
|
||||
// if (string.IsNullOrWhiteSpace(vm.OutPort))
|
||||
// {
|
||||
// return FFResult().Alert("出口必选,请选择后重试!");
|
||||
// }
|
||||
// 校验库存
|
||||
var inv = _unitWork.FindSingle<Inventory>(x => x.ID == id);
|
||||
var inv = _unitWork.FindSingle<Inventory>(x => x.ID == int.Parse(id));
|
||||
if (inv == null)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("所选库存不存在,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("所选库存不存在,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
if (inv.TaskStatus == InventoryTaskStatusEnum.Locked)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("所选库存已被锁定!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
|
||||
// 校验容器
|
||||
var container = _unitWork.FindSingle<Container>(x => x.Code == inv.ContainerCode);
|
||||
if (container == null)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("所选库存的容器不存在,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("所选库存的容器不存在,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
|
||||
if (container.IsLock == ContainerLockEnum.任务锁)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("库存所在容器已被锁定!,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("库存所在容器已被锁定!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
|
||||
// 校验库位
|
||||
var location = _unitWork.FindSingle<Location>(x => x.Code == inv.LocationCode);
|
||||
if (location == null)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("所选库存不在库内,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("所选库存不在库内,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
|
||||
if (location.Status == LocationStatusEnum.锁定)
|
||||
{
|
||||
return FFResult().CloseDialog().Alert("库存所在仓位已被锁定!,请检查后重试!").RefreshGrid();
|
||||
return FFResult().Alert("库存所在仓位已被锁定!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
|
||||
// 判断是否存在出口配置
|
||||
var processConfig = _unitWork.FindSingle<ProcessConfig>(m =>
|
||||
m.Name == inv.Lot);
|
||||
if (processConfig == null)
|
||||
{
|
||||
return FFResult().Alert("所选库存下道工序出口未配置!,请检查后重试!").RefreshGrid();
|
||||
}
|
||||
// 创建任务
|
||||
var task = new TaskHeader()
|
||||
{
|
||||
@@ -289,7 +302,7 @@ namespace HHWMS.Web.Controllers
|
||||
ZoneId = inv.ZoneId,
|
||||
TaskType = TaskTypeEnum.出库,
|
||||
FromLocation = inv.LocationCode,
|
||||
ToLocation = vm.OutPort,
|
||||
ToLocation = processConfig.Port,
|
||||
ContainerCode = inv.ContainerCode,
|
||||
RoadWay = 1,
|
||||
Status = TaskStatusEnum.新建,
|
||||
@@ -335,12 +348,12 @@ namespace HHWMS.Web.Controllers
|
||||
location.UpdateTime = DateTime.Now;
|
||||
_unitWork.Update(location);
|
||||
|
||||
return FFResult().CloseDialog().Message("出库任务创建成功").RefreshGrid();
|
||||
return FFResult().Message("出库任务创建成功").RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
// WCS任务下发失败
|
||||
return FFResult().CloseDialog().Message(wcsResult?.Msg ?? "WCS任务下发失败").RefreshGrid();
|
||||
return FFResult().Message(wcsResult?.Msg ?? "WCS任务下发失败").RefreshGrid();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -358,6 +371,11 @@ namespace HHWMS.Web.Controllers
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 成品出库
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionDescription("TaskType.Out")]
|
||||
public ActionResult InvOut2(InventoryVM vm)
|
||||
|
||||
Reference in new issue
Block a user