Commit 8199fca5 by jiawei.su

fixedbug

parent 2d5fcb24
...@@ -527,9 +527,9 @@ namespace Siger.ApiACC.Controllers ...@@ -527,9 +527,9 @@ namespace Siger.ApiACC.Controllers
} }
var machineStatus = _automationMachineStatus.Get(f => f.machineid == machineAttr.machine); 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(); var unixtime = UnixTimeHelper.GetNow();
......
...@@ -343,7 +343,7 @@ namespace Siger.ApiACC.Controllers ...@@ -343,7 +343,7 @@ namespace Siger.ApiACC.Controllers
no = taskNo, no = taskNo,
action = Automation.TaskAction.Step_CJT_SXLW, action = Automation.TaskAction.Step_CJT_SXLW,
actiontype = Automation.ExcueType.None, actiontype = Automation.ExcueType.None,
triggertime = DateTime.MinValue, triggertime = DateTime.Now,
tasktype = Automation.TaskActionType.Unload, tasktype = Automation.TaskActionType.Unload,
operater = UserId, operater = UserId,
operatetime = DateTime.Now, operatetime = DateTime.Now,
...@@ -352,6 +352,7 @@ namespace Siger.ApiACC.Controllers ...@@ -352,6 +352,7 @@ namespace Siger.ApiACC.Controllers
status = 1, status = 1,
completetime = DateTime.MinValue, completetime = DateTime.MinValue,
trigger = Automation.TaskTrigerType.Manual, trigger = Automation.TaskTrigerType.Manual,
projectId = ProjectId, projectId = ProjectId,
productid = productid, productid = productid,
sn = sn, sn = sn,
......
...@@ -50,7 +50,7 @@ namespace Siger.ApiACC.Tasks ...@@ -50,7 +50,7 @@ namespace Siger.ApiACC.Tasks
//抽检台-》上料位特殊逻辑 //抽检台-》上料位特殊逻辑
if (task.action== Automation.TaskAction.Step_CJT_SXLW) if (task.action== Automation.TaskAction.Step_CJT_SXLW)
{ {
section = task.extend1.ToInt(); section = dbhelper.GetPreStation(task);
} }
var levelsction = dbhelper.GetLevelsection(section); var levelsction = dbhelper.GetLevelsection(section);
if (levelsction == null) if (levelsction == null)
......
...@@ -70,6 +70,15 @@ namespace Siger.ApiACC.Tasks ...@@ -70,6 +70,15 @@ namespace Siger.ApiACC.Tasks
{ {
return AccDbContext.siger_project_machine_attribution.FirstOrDefault(f => f.station==section && f.status==1); 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) public siger_automation_fixture_tools GetFixture(string guid)
{ {
return AccDbContext.siger_automation_fixture_tools.FirstOrDefault(f => f.guid==guid && f.status == 1); 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