Commit 897c6dff by jiawei.su

someupdate

parent 70a1d7ff
......@@ -296,10 +296,7 @@ namespace Siger.ApiACC.Controllers
}
//下料
var unload = _automationFixtureToolsProduct.GetPlanFixtureInfoByLocation(ProjectId, id);
if (unload == null)
{
throw new BadRequestException(AccEnum.FixtureOrderNulll);
}
return new ObjectResult(unload);
}
......@@ -531,7 +528,7 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.MachineDisable);
}
var unixtime = UnixTimeHelper.GetNow();
//TODO
//1. 有检验状态 (立库-》检验工位)
......@@ -548,6 +545,12 @@ namespace Siger.ApiACC.Controllers
}
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
{
no = taskNo,
......@@ -610,12 +613,20 @@ namespace Siger.ApiACC.Controllers
{
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);
if (location==null)
{
throw new BadRequestException(AccEnum.LocationNoSn);
}
if (location.status!=1)
{
throw new BadRequestException(AccEnum.LocationNoSn);
}
//TODO 任务完成时做
if (location!=null)
{
location.sn = "";
......
......@@ -229,7 +229,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
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
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
{
OrderNumber = d.OrderNumber,
......
......@@ -183,7 +183,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
}
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();
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