修改任务明细为子任务
This commit is contained in:
1 parent
820d9d065b
commit
f8ee359644
19 files changed
+142
-64
No files matched your search
@@ -250,26 +250,39 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Assign(string id)
|
||||
{
|
||||
var task = _unitwork.Find<TaskHeader>(x => x.ID == int.Parse(id)).Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if(task == null)
|
||||
var tt = task.TaskDetails.ToList().Exists(x => x.ContainerCode == "123");
|
||||
if (task == null)
|
||||
return FFResult().RefreshGrid().Alert($"操作失败,此任务不存在!");
|
||||
var taskInfo = new TaskInfo();
|
||||
|
||||
var beginlocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation));
|
||||
var endLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation));
|
||||
var start = new CoordPos();
|
||||
var end = new CoordPos();
|
||||
if ((int)task.TaskType == 3 || (int)task.TaskType == 4)
|
||||
|
||||
if (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库)
|
||||
{
|
||||
// 盘料起点终点 与普通任务起点终点不一样,编码未在location中保存
|
||||
var taskdel = task.TaskDetails.FirstOrDefault(x => x.Status.Equals(TaskStatusEnum.新建));
|
||||
start.X = int.Parse(taskdel.Batch.Split("-")[0]);
|
||||
start.Y = int.Parse(taskdel.Batch.Split("-")[1]);
|
||||
start.Z = int.Parse(taskdel.Batch.Split("-")[2]);
|
||||
start.X = beginlocation.Line;
|
||||
end.X = endLocation.Line;
|
||||
if (task.TaskType == TaskTypeEnum.盘料入库)
|
||||
{
|
||||
start.Y = 2;
|
||||
start.Z = int.Parse(taskdel.FromLocation);
|
||||
|
||||
end.X = int.Parse(taskdel.Lot.Split("-")[0]);
|
||||
end.Y = int.Parse(taskdel.Lot.Split("-")[1]);
|
||||
end.Z = int.Parse(taskdel.Lot.Split("-")[2]);
|
||||
end.Y = int.Parse(taskdel.ToLocation);
|
||||
end.Z = 2;
|
||||
}
|
||||
else if (task.TaskType == TaskTypeEnum.盘料出库)
|
||||
{
|
||||
start.Y = int.Parse(taskdel.FromLocation);
|
||||
start.Z = 2;
|
||||
|
||||
taskInfo.TaskId = taskdel.TaskHeader.TaskNo;
|
||||
end.Y = 2;
|
||||
end.Z = int.Parse(taskdel.FromLocation);
|
||||
}
|
||||
taskInfo.TaskId = $"{taskdel.TaskHeader.TaskNo}-{taskdel.FromLocation}";
|
||||
taskInfo.TaskType = (int)task.TaskType;
|
||||
taskInfo.ObjId = taskdel.ContainerCode;
|
||||
taskInfo.StartType = int.Parse(task.Station);
|
||||
@@ -295,8 +308,8 @@ namespace HHWMS.Web.Controllers
|
||||
taskInfo.EndType = int.Parse(task.Station);
|
||||
taskInfo.EndPos = end;
|
||||
}
|
||||
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
|
||||
/* var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, taskInfo).Result.Data;
|
||||
try
|
||||
{
|
||||
if ((bool)res?.Success)
|
||||
@@ -308,7 +321,7 @@ namespace HHWMS.Web.Controllers
|
||||
catch (Exception ex)
|
||||
{
|
||||
return FFResult().Alert($"操作失败,{ex.Message}");
|
||||
}
|
||||
}*/
|
||||
return FFResult().RefreshGrid();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user