Commit 3a6bfe74 by jiawei.su

fixedbug

parent 103712a9
......@@ -241,7 +241,7 @@ namespace Siger.ApiACC.Controllers
//2.更新状态
taskObj.status = status;
taskObj.completetime = DateTime.Now;
_automationTaskList.Update(taskObj);
var monitor = _automationFixtureMonitor.Get(f => f.section == taskObj.sectionid);
var sectionProperty = _automationSectionProperty.Get(f => f.sectionid == taskObj.sectionid);
......@@ -300,6 +300,14 @@ namespace Siger.ApiACC.Controllers
location.route = route.id.ToString();
location.status = (int)LocationStatus.Out;
_automationLocation.Update(location);
//加工中心做完 下一站清洗机
var cleanMachine = _automationSectionProperty.Get(f => f.propertytype == 4);
if (cleanMachine!=null)
{
taskObj.extend1 = cleanMachine.sectionid.ToString();
}
}
}
//抽检台
......@@ -375,6 +383,8 @@ namespace Siger.ApiACC.Controllers
monitor.updatetime = DateTime.Now;
_automationFixtureMonitor.Update(monitor);
}
_automationTaskList.Update(taskObj);
}
}
......@@ -436,9 +446,13 @@ namespace Siger.ApiACC.Controllers
if (cleanMachine.status == (int)Automation.MachineStatus.Complated)
{
Logger.WriteLineError($"AutoProcess 有清洗机{ cleanMachine.section}完成,创建清洗机Task");
if (tasklist != null)
//取最近完成的 Task
var lastTask = _automationTaskList.GetList(f => f.extend1 == cleanMachine.section.ToString(),"id",true).FirstOrDefault();
if (lastTask != null)
{
CreateTask(cleanMachine.section, TaskActionType.Unload, TaskAction.Step_QXJ_LK, tasklist.fixtureguid, tasklist.ordercode, tasklist.sn, "无程序", tasklist.productid, tasklist.productcode, tasklist.locationid, tasklist.route);
lastTask.extend1 = string.Empty;
_automationTaskList.Update(lastTask) ;
CreateTask(cleanMachine.section, TaskActionType.Unload, TaskAction.Step_QXJ_LK, lastTask.fixtureguid, lastTask.ordercode, lastTask.sn, "无程序", lastTask.productid, lastTask.productcode, lastTask.locationid, lastTask.route);
return; //完成当前任务 退出
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment