报警等级下拉
This commit is contained in:
@@ -103,7 +103,16 @@ namespace ZR.Admin.WebApi.Controllers.andon
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询报警等级下拉列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getPullDowm")]
|
||||
public ApiResult GetPullDowm()
|
||||
{
|
||||
var response = _AndonAlarmLevelService.GetPullDowm();
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,10 @@ namespace ZR.Model.MES.andon.Dto
|
||||
|
||||
|
||||
}
|
||||
public class AlarmLevelPullDownDto
|
||||
{
|
||||
public string label { get; set; }
|
||||
public string value { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Model;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
@@ -80,5 +82,22 @@ namespace ZR.Service.mes.andon
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
public ApiResult GetPullDowm()
|
||||
{
|
||||
try
|
||||
{
|
||||
var response = Queryable()
|
||||
.Select(it => new AlarmLevelPullDownDto
|
||||
{
|
||||
label = it.LevelName,
|
||||
value = it.LightColor
|
||||
}).ToList();
|
||||
return ApiResult.Success("成功", response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ApiResult.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using ZR.Model;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
using Infrastructure.Model;
|
||||
|
||||
namespace ZR.Service.mes.andon.Iservice
|
||||
{
|
||||
@@ -18,6 +19,6 @@ namespace ZR.Service.mes.andon.Iservice
|
||||
AndonAlarmLevel AddAndonAlarmLevel(AndonAlarmLevel parm);
|
||||
|
||||
int UpdateAndonAlarmLevel(AndonAlarmLevel parm);
|
||||
|
||||
ApiResult GetPullDowm();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user