Commit 224581c4 by jiawei.su

fixedbug

parent 677e6875
......@@ -334,6 +334,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MachineDisable);
}
if (machineStatus!=null)
{
machineStatus.status = (int)Automation.MachineStatus.Waiting;
......
......@@ -320,12 +320,11 @@ namespace Siger.ApiACC.Controllers
private void CreateTaskList(int section, int productid, string productcode, string sn, int routeid)
{
if (section <= 0 || string.IsNullOrEmpty(sn) || string.IsNullOrEmpty(productcode) || productid <= 0)
var monitor = _fixtureMonitor.Get(f => f.section == section);
if (monitor==null)
{
return;
Logger.WriteLineInfo($"检验工站{section} monitor 为空");
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
_automationTaskList.Insert(new siger_automation_task_list
......@@ -353,6 +352,7 @@ namespace Siger.ApiACC.Controllers
programnumber = "",
remark = "质量检验",
});
monitor.taskno = taskNo;
_unitOfWork.Commit();
}
......
......@@ -64,8 +64,7 @@ namespace Siger.ApiACC.Controllers
[HttpGet]
public IActionResult GetSn(int sectionid)
{
var monitor = _fixtureMonitor.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && q.section == sectionid).OrderByDescending(q => q.updatetime).
FirstOrDefault();
var monitor = _fixtureMonitor.Get(sectionid);
return new ObjectResult(monitor?.sn ?? "");
}
}
......
......@@ -51,7 +51,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
public int locationId { get; set; }
public int unixtime { get; set; }
/// <summary>
/// 当任务
/// 当任务
/// </summary>
public string taskno { get; set; }
}
......
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