修改
This commit is contained in:
102
DOAN.Admin.WebApi/Controllers/PBL/Logging/AlarmLogController.cs
Normal file
102
DOAN.Admin.WebApi/Controllers/PBL/Logging/AlarmLogController.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.PBL.Dto;
|
||||
using DOAN.Model.PBL;
|
||||
using DOAN.Service.PBL.IPBLService;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
|
||||
//创建时间:2025-02-22
|
||||
namespace DOAN.Admin.WebApi.Controllers.PBL
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存报警日志
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("PBL/AlarmLog")]
|
||||
public class AlarmLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存报警日志接口
|
||||
/// </summary>
|
||||
private readonly IAlarmLogService _AlarmLogService;
|
||||
|
||||
public AlarmLogController(IAlarmLogService AlarmLogService)
|
||||
{
|
||||
_AlarmLogService = AlarmLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询库存报警日志列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "alarmlog:list")]
|
||||
public IActionResult QueryAlarmLog([FromQuery] AlarmLogQueryDto parm)
|
||||
{
|
||||
var response = _AlarmLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询库存报警日志详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "alarmlog:query")]
|
||||
public IActionResult GetAlarmLog(string Id)
|
||||
{
|
||||
var response = _AlarmLogService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<AlarmLogDto>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加库存报警日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "alarmlog:add")]
|
||||
[Log(Title = "库存报警日志", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddAlarmLog([FromBody] AlarmLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<AlarmLog>().ToCreate(HttpContext);
|
||||
|
||||
var response = _AlarmLogService.AddAlarmLog(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新库存报警日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "alarmlog:edit")]
|
||||
[Log(Title = "库存报警日志", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateAlarmLog([FromBody] AlarmLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<AlarmLog>().ToUpdate(HttpContext);
|
||||
var response = _AlarmLogService.UpdateAlarmLog(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除库存报警日志
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("delete/{ids}")]
|
||||
[ActionPermissionFilter(Permission = "alarmlog:delete")]
|
||||
[Log(Title = "库存报警日志", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteAlarmLog([FromRoute]string ids)
|
||||
{
|
||||
var idArr = Tools.SplitAndConvert<string>(ids);
|
||||
|
||||
return ToResponse(_AlarmLogService.Delete(idArr));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user