110 lines
4.1 KiB
C#
110 lines
4.1 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Admin.WebApi.Extensions;
|
||
using ZR.Admin.WebApi.Filters;
|
||
using ZR.Model.MES.andon;
|
||
using ZR.Model.MES.andon.Dto;
|
||
using ZR.Service.mes.andon.Iservice;
|
||
|
||
//创建时间:2025-12-23
|
||
namespace ZR.Admin.WebApi.Controllers.andon
|
||
{
|
||
/// <summary>
|
||
/// 安灯报警联系人手表IP字典
|
||
/// </summary>
|
||
[Route("mes/AndonAlarmReceiverWatchDic")]
|
||
[AllowAnonymous]
|
||
|
||
public class AndonAlarmReceiverWatchDicController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 安灯报警联系人手表IP字典接口
|
||
/// </summary>
|
||
private readonly IAndonAlarmReceiverWatchDicService _AndonAlarmReceiverWatchDicService;
|
||
|
||
public AndonAlarmReceiverWatchDicController(IAndonAlarmReceiverWatchDicService AndonAlarmReceiverWatchDicService)
|
||
{
|
||
_AndonAlarmReceiverWatchDicService = AndonAlarmReceiverWatchDicService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询安灯报警联系人手表IP字典列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmreceiverwatchdic:list")]
|
||
public IActionResult QueryAndonAlarmReceiverWatchDic([FromQuery] AndonAlarmReceiverWatchDicQueryDto parm)
|
||
{
|
||
var response = _AndonAlarmReceiverWatchDicService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询安灯报警联系人手表IP字典详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmreceiverwatchdic:query")]
|
||
public IActionResult GetAndonAlarmReceiverWatchDic(int Id)
|
||
{
|
||
var response = _AndonAlarmReceiverWatchDicService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<AndonAlarmReceiverWatchDic>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加安灯报警联系人手表IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmreceiverwatchdic:add")]
|
||
[Log(Title = "安灯报警联系人手表IP字典", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddAndonAlarmReceiverWatchDic([FromBody] AndonAlarmReceiverWatchDicDto parm)
|
||
{
|
||
var modal = parm.Adapt<AndonAlarmReceiverWatchDic>().ToCreate(HttpContext);
|
||
|
||
var response = _AndonAlarmReceiverWatchDicService.AddAndonAlarmReceiverWatchDic(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新安灯报警联系人手表IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmreceiverwatchdic:edit")]
|
||
[Log(Title = "安灯报警联系人手表IP字典", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateAndonAlarmReceiverWatchDic([FromBody] AndonAlarmReceiverWatchDicDto parm)
|
||
{
|
||
var modal = parm.Adapt<AndonAlarmReceiverWatchDic>().ToUpdate(HttpContext);
|
||
var response = _AndonAlarmReceiverWatchDicService.UpdateAndonAlarmReceiverWatchDic(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除安灯报警联系人手表IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmreceiverwatchdic:delete")]
|
||
[Log(Title = "安灯报警联系人手表IP字典", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteAndonAlarmReceiverWatchDic(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _AndonAlarmReceiverWatchDicService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |