Commit 8199fca5 by jiawei.su

fixedbug

parent 2d5fcb24
......@@ -527,9 +527,9 @@ namespace Siger.ApiACC.Controllers
}
var machineStatus = _automationMachineStatus.Get(f => f.machineid == machineAttr.machine);
if (machineStatus.status != (int)Automation.MachineStatus.Complated)
if (machineStatus.status != (int)Automation.MachineStatus.Waiting)
{
throw new BadRequestException(AccEnum.MachineDisable);
throw new BadRequestException(AccEnum.MachineBusy);
}
var unixtime = UnixTimeHelper.GetNow();
......
......@@ -343,7 +343,7 @@ namespace Siger.ApiACC.Controllers
no = taskNo,
action = Automation.TaskAction.Step_CJT_SXLW,
actiontype = Automation.ExcueType.None,
triggertime = DateTime.MinValue,
triggertime = DateTime.Now,
tasktype = Automation.TaskActionType.Unload,
operater = UserId,
operatetime = DateTime.Now,
......@@ -352,6 +352,7 @@ namespace Siger.ApiACC.Controllers
status = 1,
completetime = DateTime.MinValue,
trigger = Automation.TaskTrigerType.Manual,
projectId = ProjectId,
productid = productid,
sn = sn,
......
......@@ -50,7 +50,7 @@ namespace Siger.ApiACC.Tasks
//抽检台-》上料位特殊逻辑
if (task.action== Automation.TaskAction.Step_CJT_SXLW)
{
section = task.extend1.ToInt();
section = dbhelper.GetPreStation(task);
}
var levelsction = dbhelper.GetLevelsection(section);
if (levelsction == null)
......
......@@ -70,6 +70,15 @@ namespace Siger.ApiACC.Tasks
{
return AccDbContext.siger_project_machine_attribution.FirstOrDefault(f => f.station==section && f.status==1);
}
public int GetPreStation(siger_automation_task_list task )
{
//取抽检工位发起的上料位ID
var preTask = AccDbContext.siger_automation_task_list.Where(f => f.sn == task.sn && f.extend1 == task.sectionid.ToString() && f.action == TaskAction.Step_LK_CJT).OrderByDescending(d => d.id).FirstOrDefault();
if (preTask != null)
return preTask.sectionid;
else
return 0;
}
public siger_automation_fixture_tools GetFixture(string guid)
{
return AccDbContext.siger_automation_fixture_tools.FirstOrDefault(f => f.guid==guid && f.status == 1);
......
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