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 { /// /// PLC报警信息字典 /// [Route("mes/AlarmProblemDictionary")] [AllowAnonymous] public class AlarmProblemDictionaryController : BaseController { /// /// PLC报警信息字典接口 /// private readonly IAlarmProblemDictionaryService _AlarmProblemDictionaryService; public AlarmProblemDictionaryController(IAlarmProblemDictionaryService AlarmProblemDictionaryService) { _AlarmProblemDictionaryService = AlarmProblemDictionaryService; } /// /// 查询PLC报警信息字典列表 /// /// /// [HttpGet("list")] [ActionPermissionFilter(Permission = "alarmproblemdictionary:list")] public IActionResult QueryAlarmProblemDictionary([FromQuery] AlarmProblemDictionaryQueryDto parm) { var response = _AlarmProblemDictionaryService.GetList(parm); return SUCCESS(response); } /// /// 查询PLC报警信息字典详情 /// /// /// [HttpGet("{Id}")] [ActionPermissionFilter(Permission = "alarmproblemdictionary:query")] public IActionResult GetAlarmProblemDictionary(int Id) { var response = _AlarmProblemDictionaryService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加PLC报警信息字典 /// /// [HttpPost] [ActionPermissionFilter(Permission = "alarmproblemdictionary:add")] [Log(Title = "PLC报警信息字典", BusinessType = BusinessType.INSERT)] public IActionResult AddAlarmProblemDictionary([FromBody] AlarmProblemDictionaryDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _AlarmProblemDictionaryService.AddAlarmProblemDictionary(modal); return SUCCESS(response); } /// /// 更新PLC报警信息字典 /// /// [HttpPut] [ActionPermissionFilter(Permission = "alarmproblemdictionary:edit")] [Log(Title = "PLC报警信息字典", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateAlarmProblemDictionary([FromBody] AlarmProblemDictionaryDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _AlarmProblemDictionaryService.UpdateAlarmProblemDictionary(modal); return ToResponse(response); } /// /// 删除PLC报警信息字典 /// /// [HttpPost("delete/{ids}")] [ActionPermissionFilter(Permission = "alarmproblemdictionary:delete")] [Log(Title = "PLC报警信息字典", BusinessType = BusinessType.DELETE)] public IActionResult DeleteAlarmProblemDictionary([FromRoute]string ids) { var idArr = Tools.SplitAndConvert(ids); return ToResponse(_AlarmProblemDictionaryService.Delete(idArr)); } } }