Commit 96f66c8a by jiawei.su

someupdate

parent f45b4e53
...@@ -39,7 +39,7 @@ namespace Siger.ApiACC.Controllers ...@@ -39,7 +39,7 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(1); return new ObjectResult(1);
} }
[HttpGet] [HttpGet]
public IActionResult GetloadStation(int line) public IActionResult GetloadStation(int line,int type)
{ {
var stationDicts = _sigerDict.GetDataByCat(AccDictCost.Automation, ProjectId); var stationDicts = _sigerDict.GetDataByCat(AccDictCost.Automation, ProjectId);
if (!stationDicts.Any()) if (!stationDicts.Any())
...@@ -48,21 +48,30 @@ namespace Siger.ApiACC.Controllers ...@@ -48,21 +48,30 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
var dictLoad = stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation); var loadStation=new List<string>();
if (!dictLoad.Any())
{
Logger.WriteLineInfo($"AutoProcess 未配置上下料工站字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var loadStation = dictLoad.Select(s => s.dval).ToList();
var objs = _sigerProjectLevelSection.GetAccStationByline(ProjectId, line); if (type==0)
if (!objs.Any())
{ {
throw new BadRequestException(CommonEnum.RecordNotFound); var dictLoad = stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation);
if (!dictLoad.Any())
{
Logger.WriteLineInfo($"AutoProcess 未配置上下料工站字典");
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())
{
Logger.WriteLineInfo($"AutoProcess 未配置清洗工站字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
loadStation = dictLoad.Select(s => s.dval).ToList();
} }
var data = new List<ResponseLoadStation>();
var data = new List<ResponseLoadStation>();
foreach (var station in loadStation) foreach (var station in loadStation)
{ {
......
...@@ -38,37 +38,7 @@ namespace Siger.ApiConfig.Controller ...@@ -38,37 +38,7 @@ namespace Siger.ApiConfig.Controller
throw new BadRequestException(CommonEnum.RecordNotFound); throw new BadRequestException(CommonEnum.RecordNotFound);
} }
[HttpGet]
public IActionResult GetloadStation(int line)
{
var stationDicts = _sigerDict.GetDataByCat(AccDictCost.Automation,ProjectId);
if (!stationDicts.Any())
{
Logger.WriteLineInfo($"AutoProcess 未配置设备类型字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var dictLoad = stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation);
if (!dictLoad.Any())
{
Logger.WriteLineInfo($"AutoProcess 未配置上下料工站字典");
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var loadStation = dictLoad.Select(s => s.dval).ToList();
var objs = _projectLevelSection.GetAccStationByline(ProjectId, line);
if (!objs.Any())
{
throw new BadRequestException(CommonEnum.RecordNotFound);
}
var data = new List<ResponseLoadStation>();
foreach(var station in objs)
{
}
return new ObjectResult(data);
}
} }
} }
\ No newline at end of file
...@@ -67,7 +67,7 @@ namespace Siger.Middlelayer.Common ...@@ -67,7 +67,7 @@ namespace Siger.Middlelayer.Common
/// <summary> /// <summary>
/// MES 自动线类型 /// MES 自动线类型
/// </summary> /// </summary>
public const string Automation = "automation"; public const string Automation = "Automation";
} }
......
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