Commit 897c6dff by jiawei.su

someupdate

parent 70a1d7ff
...@@ -296,10 +296,7 @@ namespace Siger.ApiACC.Controllers ...@@ -296,10 +296,7 @@ namespace Siger.ApiACC.Controllers
} }
//下料 //下料
var unload = _automationFixtureToolsProduct.GetPlanFixtureInfoByLocation(ProjectId, id); var unload = _automationFixtureToolsProduct.GetPlanFixtureInfoByLocation(ProjectId, id);
if (unload == null)
{
throw new BadRequestException(AccEnum.FixtureOrderNulll);
}
return new ObjectResult(unload); return new ObjectResult(unload);
} }
...@@ -531,7 +528,7 @@ namespace Siger.ApiACC.Controllers ...@@ -531,7 +528,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(AccEnum.MachineDisable); throw new BadRequestException(AccEnum.MachineDisable);
} }
var unixtime = UnixTimeHelper.GetNow(); var unixtime = UnixTimeHelper.GetNow();
//TODO //TODO
//1. 有检验状态 (立库-》检验工位) //1. 有检验状态 (立库-》检验工位)
...@@ -548,6 +545,12 @@ namespace Siger.ApiACC.Controllers ...@@ -548,6 +545,12 @@ namespace Siger.ApiACC.Controllers
} }
section = sectionProperty.sectionid; section = sectionProperty.sectionid;
} }
var tasklst = _automationTaskList.GetList(f => f.sectionid == unloading.section && f.action == action && f.status!=(int)TaskResultStatus.Complated);
if (tasklst.Any())
{
throw new BadRequestException(AccEnum.TaskProcessing);
}
_automationTaskList.Insert(new siger_automation_task_list _automationTaskList.Insert(new siger_automation_task_list
{ {
no = taskNo, no = taskNo,
...@@ -610,12 +613,20 @@ namespace Siger.ApiACC.Controllers ...@@ -610,12 +613,20 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(AccEnum.MachineDisable); throw new BadRequestException(AccEnum.MachineDisable);
} }
if (tasklist.status==(int)TaskResultStatus.Complated)
{
throw new BadRequestException(AccEnum.AutoTaskDone);
}
var location = _automationLocation.Get(f => f.locationid == monitor.locationId); var location = _automationLocation.Get(f => f.locationid == monitor.locationId);
if (location==null) if (location==null)
{ {
throw new BadRequestException(AccEnum.LocationNoSn); throw new BadRequestException(AccEnum.LocationNoSn);
} }
if (location.status!=1)
{
throw new BadRequestException(AccEnum.LocationNoSn);
}
//TODO 任务完成时做
if (location!=null) if (location!=null)
{ {
location.sn = ""; location.sn = "";
......
...@@ -229,7 +229,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -229,7 +229,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join l in _context.siger_automation_location on t.guid equals l.fixturetools join l in _context.siger_automation_location on t.guid equals l.fixturetools
join pd in _context.siger_project_product on p.product_id equals pd.id join pd in _context.siger_project_product on p.product_id equals pd.id
where q.projectId == projectId && l.id == id where q.projectId == projectId && l.id == id
&& q.status == (int)RowState.Valid && t.status == (int)RowState.Valid && l.status == (int)RowState.Valid && q.status == (int)RowState.Valid && t.status == (int)RowState.Valid
select new ResponsePlanlFixtureInfo select new ResponsePlanlFixtureInfo
{ {
OrderNumber = d.OrderNumber, OrderNumber = d.OrderNumber,
......
...@@ -183,7 +183,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -183,7 +183,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
} }
else else
{ {
var entities = query.Where(expression).Skip((page - 1) * pagesize).Take(pagesize).OrderByDescending(d=>d.id).AsNoTracking(); var entities = query.Where(expression).OrderByDescending(d => d.id).Skip((page - 1) * pagesize).Take(pagesize).AsNoTracking();
var totalCount = query.Where(expression).Count(); var totalCount = query.Where(expression).Count();
return new PagedCollectionResult<ResponseAutomationTasklist>(entities, totalCount); return new PagedCollectionResult<ResponseAutomationTasklist>(entities, totalCount);
} }
......
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