Commit 224581c4 by jiawei.su

fixedbug

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