109 lines
3.9 KiB
C#
109 lines
3.9 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/AndonAlarmAreaLightDic")]
|
||
[AllowAnonymous]
|
||
public class AndonAlarmAreaLightDicController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 安灯警报区三色灯IP字典接口
|
||
/// </summary>
|
||
private readonly IAndonAlarmAreaLightDicService _AndonAlarmAreaLightDicService;
|
||
|
||
public AndonAlarmAreaLightDicController(IAndonAlarmAreaLightDicService AndonAlarmAreaLightDicService)
|
||
{
|
||
_AndonAlarmAreaLightDicService = AndonAlarmAreaLightDicService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询安灯警报区三色灯IP字典列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmarealightdic:list")]
|
||
public IActionResult QueryAndonAlarmAreaLightDic([FromQuery] AndonAlarmAreaLightDicQueryDto parm)
|
||
{
|
||
var response = _AndonAlarmAreaLightDicService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询安灯警报区三色灯IP字典详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmarealightdic:query")]
|
||
public IActionResult GetAndonAlarmAreaLightDic(int Id)
|
||
{
|
||
var response = _AndonAlarmAreaLightDicService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<AndonAlarmAreaLightDic>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加安灯警报区三色灯IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmarealightdic:add")]
|
||
[Log(Title = "安灯警报区三色灯IP字典", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddAndonAlarmAreaLightDic([FromBody] AndonAlarmAreaLightDicDto parm)
|
||
{
|
||
var modal = parm.Adapt<AndonAlarmAreaLightDic>().ToCreate(HttpContext);
|
||
|
||
var response = _AndonAlarmAreaLightDicService.AddAndonAlarmAreaLightDic(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新安灯警报区三色灯IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmarealightdic:edit")]
|
||
[Log(Title = "安灯警报区三色灯IP字典", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateAndonAlarmAreaLightDic([FromBody] AndonAlarmAreaLightDicDto parm)
|
||
{
|
||
var modal = parm.Adapt<AndonAlarmAreaLightDic>().ToUpdate(HttpContext);
|
||
var response = _AndonAlarmAreaLightDicService.UpdateAndonAlarmAreaLightDic(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除安灯警报区三色灯IP字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:andonalarmarealightdic:delete")]
|
||
[Log(Title = "安灯警报区三色灯IP字典", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteAndonAlarmAreaLightDic(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _AndonAlarmAreaLightDicService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |