Commit 0b279d64 by jiawei.su

fixedbug

parent 971259e2
......@@ -82,70 +82,53 @@ namespace Siger.ApiACC.Controllers
Logger.WriteLineInfo($"GetloadStation 未配置设备类型字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var loadStation=new List<string>();
//上下料
if (type==0)
{
var dictLoad = stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation);
if (!dictLoad.Any())
var sectionProperty = _sectionPropertyRepository.GetList(f => f.propertytype == 1);
var sections = sectionProperty.Select(s => s.sectionid).ToList();
var levelSection = _sigerProjectLevelSection.GetList(f => f.parentid == line && sections.Contains(f.id));
if (!levelSection.Any())
{
Logger.WriteLineInfo($"GetloadStation 未配置上下料工站字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
loadStation = dictLoad.Select(s => s.dval).ToList();
}else
{
var dictLoad = stationDicts.Where(s => s.dkey == DictKeyValConst.CleanStation);
if (!dictLoad.Any())
var result = new List<ResponseLoadStation>();
foreach (var lv in levelSection)
{
Logger.WriteLineInfo($"GetloadStation 未配置清洗工站字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
result.Add(new ResponseLoadStation
{
section=lv.id,
status=1,
title=lv.title,
});
}
loadStation = dictLoad.Select(s => s.dval).ToList();
return new ObjectResult(result);
//检验
}
var data = new List<ResponseLoadStation>();
foreach (var station in loadStation)
else
{
var section = _sigerProjectLevelSection.Get(f => f.id == station.ToInt() && f.parentid==line && f.status == (int)RowState.Valid);
if (section == null)
continue;
var machintAttr = _sigerProjectMachineAttribution.Get(f => f.station == section.id);
if(machintAttr==null)
var sectionProperty = _sectionPropertyRepository.GetList(f => f.propertytype == 3);
var sections = sectionProperty.Select(s => s.sectionid).ToList();
var levelSection = _sigerProjectLevelSection.GetList(f => f.parentid == line && sections.Contains(f.id));
if (!levelSection.Any())
{
Logger.WriteLineInfo($"GetloadStation 未配置工站字典");
continue;
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var loadStatus = (int)Automation.MachineStatus.Waiting;
var machineStatus = _automationMachineStatus.Get(f => f.section == section.id);
if (machineStatus==null)
var result = new List<ResponseLoadStation>();
foreach (var lv in levelSection)
{
_automationMachineStatus.Insert(new siger_automation_machine_status
result.Add(new ResponseLoadStation
{
projectId=ProjectId,
enable=1,
machineid=machintAttr.machine,
section=section.id,
updatetime=DateTime.Now
});
}else
{
section = lv.id,
status = 1,
title = lv.title,
loadStatus = machineStatus.status;
});
}
data.Add(new ResponseLoadStation {
section=section.id,
title=section.title,
status=loadStatus
});
return new ObjectResult(result);
}
_unitOfWork.Commit();
return new ObjectResult(data);
}
......
......@@ -15,7 +15,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public int sectionid { get; set; }
/// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:装配工位5:存储工位
/// 1:上下料工位2:加工工位3:检验工位4:清洗5:存储工位
/// </summary>
public int propertytype { get; set; }
/// <summary>
......
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