报警等级下拉

This commit is contained in:
quowingwang
2025-12-11 16:19:02 +08:00
parent 8b0ddc865e
commit d4228b34cd
4 changed files with 37 additions and 2 deletions

View File

@@ -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;
}
}
}

View File

@@ -37,4 +37,10 @@ namespace ZR.Model.MES.andon.Dto
}
public class AlarmLevelPullDownDto
{
public string label { get; set; }
public string value { get; set; }
}
}

View File

@@ -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);
}
}
}
}

View File

@@ -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();
}
}