任务明细 出库明细 库存分析 启动出库
This commit is contained in:
1 parent
eef6df7099
commit
f5423e78fe
28 files changed
+500
-77
No files matched your search
@@ -6,6 +6,8 @@ using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -44,6 +46,15 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search2(TaskDetailListVM2 vm)
|
||||
{
|
||||
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
@@ -160,7 +171,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
return PartialView("BatchEdit", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,7 +195,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
return PartialView("BatchDelete", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -194,7 +205,7 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<TaskDetailImportVM>();
|
||||
@@ -229,22 +240,30 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("TaskHeader.Cancel")]
|
||||
public ActionResult Cancel(string id)
|
||||
{
|
||||
var task = _unitwork.FindById<TaskDetail>(int.Parse(id));
|
||||
// 判断任务 是否能取消
|
||||
if (task.Status < TaskStatusEnum.已下发)
|
||||
{
|
||||
return FFResult().Alert($"此任务未下发,无需取消!");
|
||||
}
|
||||
var task = _unitwork.Find<TaskDetail>(x => x.ID == int.Parse(id))
|
||||
.Include(x => x.TaskHeader).FirstOrDefault();
|
||||
|
||||
if (task != null)
|
||||
{
|
||||
// 判断任务 是否能取消
|
||||
if (task.Status < TaskStatusEnum.已下发)
|
||||
{
|
||||
return FFResult().Alert($"此任务未下发,无需取消!");
|
||||
}
|
||||
else if (task.Status == TaskStatusEnum.完成)
|
||||
{
|
||||
return FFResult().Alert($"此任务已完成,无需取消!");
|
||||
}
|
||||
|
||||
var taskInfo = new TaskInfo
|
||||
{
|
||||
TaskId = $"{task.TaskHeader.TaskNo}-{task.FromLocation}",
|
||||
TaskType = 99,
|
||||
};
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
try
|
||||
{
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
|
||||
if ((bool)res?.Success)
|
||||
{
|
||||
// 删除任务,处理数据
|
||||
|
||||
@@ -309,9 +309,9 @@ namespace HHWMS.Web.Controllers
|
||||
taskInfo.EndPos = end;
|
||||
}
|
||||
|
||||
/* var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
try
|
||||
{
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
if ((bool)res?.Success)
|
||||
{
|
||||
// 删除已回传MES的任务
|
||||
@@ -321,7 +321,7 @@ namespace HHWMS.Web.Controllers
|
||||
catch (Exception ex)
|
||||
{
|
||||
return FFResult().Alert($"操作失败,{ex.Message}");
|
||||
}*/
|
||||
}
|
||||
return FFResult().RefreshGrid();
|
||||
}
|
||||
#endregion 任务下发
|
||||
@@ -331,9 +331,10 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Cancel(string id)
|
||||
{
|
||||
var task = _unitwork.FindById<TaskHeader>(int.Parse(id));
|
||||
|
||||
if (task != null) {
|
||||
if(task.Status < TaskStatusEnum.已下发)
|
||||
|
||||
if (task != null)
|
||||
{
|
||||
if (task.Status > TaskStatusEnum.已下发)
|
||||
{
|
||||
return FFResult().Alert($"此任务未下发,无需取消!");
|
||||
}
|
||||
@@ -347,9 +348,9 @@ namespace HHWMS.Web.Controllers
|
||||
TaskId = task.TaskNo,
|
||||
TaskType = 99,
|
||||
};
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
try
|
||||
{
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
if ((bool)res?.Success)
|
||||
{
|
||||
// 删除任务,处理数据
|
||||
|
||||
Reference in new issue
Block a user