Commit e565bb4a by jiawei.su

someupdate

parent a8725391
...@@ -597,17 +597,7 @@ namespace Siger.ApiACC.Controllers ...@@ -597,17 +597,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(AccEnum.LineModeNotfound); throw new BadRequestException(AccEnum.LineModeNotfound);
} }
var machineAttr = _sigerProjectMachineAttribution.Get(f => f.station == unloading.section && f.status == (int)RowState.Valid);
if (machineAttr == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var machineStatus = _automationMachineStatus.Get(f => f.machineid == machineAttr.machine);
if (machineStatus.status != (int)Automation.MachineStatus.Waiting)
{
throw new BadRequestException(AccEnum.MachineBusy);
}
var unixtime = UnixTimeHelper.GetNow(); var unixtime = UnixTimeHelper.GetNow();
//TODO //TODO
...@@ -624,16 +614,40 @@ namespace Siger.ApiACC.Controllers ...@@ -624,16 +614,40 @@ namespace Siger.ApiACC.Controllers
var toSection = upload.sectionid; var toSection = upload.sectionid;
if (lineMode.inspect==1) if (lineMode.inspect==1)
{ {
//下料 去抽检台
var QcProperty = _sectionPropertyRepository.Get(f => f.propertytype == 3); var QcProperty = _sectionPropertyRepository.Get(f => f.propertytype == 3);
if(QcProperty == null) if(QcProperty == null)
{ {
throw new BadRequestException(AccEnum.SectionPropertyNull); throw new BadRequestException(AccEnum.SectionPropertyNull);
} }
toSection = QcProperty.sectionid; toSection = QcProperty.sectionid;
var machineQCAttr = _sigerProjectMachineAttribution.Get(f => f.station == toSection && f.status == (int)RowState.Valid);
if (machineQCAttr == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var machineQCStatus = _automationMachineStatus.Get(f => f.machineid == machineQCAttr.machine);
if (machineQCStatus.status != (int)Automation.MachineStatus.Waiting)
{
Logger.WriteLineError($"抽检台正在生产中");
throw new BadRequestException(AccEnum.MachineBusy);
} }
}else // 正常下料
{
var machineAttr = _sigerProjectMachineAttribution.Get(f => f.station == unloading.section && f.status == (int)RowState.Valid);
if (machineAttr == null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var machineStatus = _automationMachineStatus.Get(f => f.machineid == machineAttr.machine);
if (machineStatus.status != (int)Automation.MachineStatus.Waiting)
{
Logger.WriteLineError($"上下料位正在生产中");
throw new BadRequestException(AccEnum.MachineBusy);
}
}
var tasklst = _automationTaskList.GetList(f => f.sectionid == unloading.section && f.action == action && f.status!=(int)TaskResultStatus.Complated); var tasklst = _automationTaskList.GetList(f => f.sectionid == unloading.section && f.action == action && f.status!=(int)TaskResultStatus.Complated);
if (tasklst.Any()) if (tasklst.Any())
......
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