Commit 90d8ef8f by jiawei.su

someupdate

parent 9015d39e
...@@ -105,14 +105,15 @@ namespace Siger.ApiACC.Controllers ...@@ -105,14 +105,15 @@ namespace Siger.ApiACC.Controllers
Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典"); Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典");
throw new BadRequestException(AccEnum.AutomationDictNotfound); throw new BadRequestException(AccEnum.AutomationDictNotfound);
} }
if (_automationTaskList.CanTask(PID, machineAttr.station))
{
var uploadStation = stationDicts.Where(f => f.dkey == DictKeyValConst.UploadloadStation); var uploadStation = stationDicts.Where(f => f.dkey == DictKeyValConst.UploadloadStation);
var uploadStations = uploadStation.Select(f => f.dval.ToInt()).ToList(); var uploadStations = uploadStation.Select(f => f.dval.ToInt()).ToList();
if (!uploadStations.Contains(machineAttr.station)) if (!uploadStations.Contains(machineAttr.station))
{ {
var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status < (int)TaskResultStatus.Complated); var tasklist = _automationTaskList.GetList(f => f.projectId == PID && f.status < (int)TaskResultStatus.Complated);
if (!tasklist.Any()) if (!tasklist.Any())
{ {
var section = _sigerProjectLevelSection.Get(f => f.id == machineAttr.station); var section = _sigerProjectLevelSection.Get(f => f.id == machineAttr.station);
...@@ -125,6 +126,7 @@ namespace Siger.ApiACC.Controllers ...@@ -125,6 +126,7 @@ namespace Siger.ApiACC.Controllers
} }
} }
} }
}
return new ObjectResult(CommonEnum.Succefull); return new ObjectResult(CommonEnum.Succefull);
} }
else else
......
...@@ -34,6 +34,10 @@ namespace Siger.ApiACC.Tasks ...@@ -34,6 +34,10 @@ namespace Siger.ApiACC.Tasks
{ {
return; return;
} }
if (!dbhelper.CanTask(projectId))
{
return;
}
var tasks = tasklist.OrderBy(s => s.actiontype); var tasks = tasklist.OrderBy(s => s.actiontype);
var task = tasks.FirstOrDefault(); var task = tasks.FirstOrDefault();
......
...@@ -3,6 +3,7 @@ using Siger.Middlelayer.AccRepository.Entities; ...@@ -3,6 +3,7 @@ using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.CncRepository; using Siger.Middlelayer.CncRepository;
using Siger.Middlelayer.Repository; using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Entities; using Siger.Middlelayer.Repository.Entities;
using Siger.Middlelayer.Share.Enum.ModuleEnum;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -44,6 +45,13 @@ namespace Siger.ApiACC.Tasks ...@@ -44,6 +45,13 @@ namespace Siger.ApiACC.Tasks
select q; select q;
return query; return query;
} }
public bool CanTask(int projectId)
{
var query = from q in AccDbContext.siger_automation_task_list
where q.projectId == projectId && q.send==1 && q.status<(int)TaskResultStatus.Complated
select q;
return !query.Any();
}
public siger_automation_fixture_tools_monitor GetMonitor(int section) public siger_automation_fixture_tools_monitor GetMonitor(int section)
{ {
return AccDbContext.siger_automation_fixture_tools_moniter.FirstOrDefault(f => f.section == section); return AccDbContext.siger_automation_fixture_tools_moniter.FirstOrDefault(f => f.section == section);
......
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