Valeo_Line_MES_backend/RIZO.Admin.WebApi/Controllers/MES/alarm/AlarmProblemDictionaryController.cs
2026-01-20 09:23:56 +08:00

101 lines
3.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using RIZO.Model.MES.alarm;
using RIZO.Model.MES.alarm.Dto;
using RIZO.Service.MES.alarm.IService;
//创建时间2026-01-19
namespace RIZO.Admin.WebApi.Controllers.Mes.alarm
{
/// <summary>
/// PLC报警信息字典
/// </summary>
[Route("mes/AlarmProblemDictionary")]
[AllowAnonymous]
public class AlarmProblemDictionaryController : BaseController
{
/// <summary>
/// PLC报警信息字典接口
/// </summary>
private readonly IAlarmProblemDictionaryService _AlarmProblemDictionaryService;
public AlarmProblemDictionaryController(IAlarmProblemDictionaryService AlarmProblemDictionaryService)
{
_AlarmProblemDictionaryService = AlarmProblemDictionaryService;
}
/// <summary>
/// 查询PLC报警信息字典列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "alarmproblemdictionary:list")]
public IActionResult QueryAlarmProblemDictionary([FromQuery] AlarmProblemDictionaryQueryDto parm)
{
var response = _AlarmProblemDictionaryService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询PLC报警信息字典详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "alarmproblemdictionary:query")]
public IActionResult GetAlarmProblemDictionary(int Id)
{
var response = _AlarmProblemDictionaryService.GetInfo(Id);
var info = response.Adapt<AlarmProblemDictionaryDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加PLC报警信息字典
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "alarmproblemdictionary:add")]
[Log(Title = "PLC报警信息字典", BusinessType = BusinessType.INSERT)]
public IActionResult AddAlarmProblemDictionary([FromBody] AlarmProblemDictionaryDto parm)
{
var modal = parm.Adapt<AlarmProblemDictionary>().ToCreate(HttpContext);
var response = _AlarmProblemDictionaryService.AddAlarmProblemDictionary(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新PLC报警信息字典
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "alarmproblemdictionary:edit")]
[Log(Title = "PLC报警信息字典", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateAlarmProblemDictionary([FromBody] AlarmProblemDictionaryDto parm)
{
var modal = parm.Adapt<AlarmProblemDictionary>().ToUpdate(HttpContext);
var response = _AlarmProblemDictionaryService.UpdateAlarmProblemDictionary(modal);
return ToResponse(response);
}
/// <summary>
/// 删除PLC报警信息字典
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "alarmproblemdictionary:delete")]
[Log(Title = "PLC报警信息字典", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteAlarmProblemDictionary([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<int>(ids);
return ToResponse(_AlarmProblemDictionaryService.Delete(idArr));
}
}
}