using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.exception;
using DOAN.Model.MES.exception.Dto;
using DOAN.Service.exception.IService;
//创建时间:2024-11-19
namespace DOAN.Admin.WebApi.Controllers
{
///
/// 工单修改日志表
///
[Verify]
[Route("business/ProWorkorderUpdateLog")]
public class ProWorkorderUpdateLogController : BaseController
{
///
/// 工单修改日志表接口
///
private readonly IProWorkorderUpdateLogService _ProWorkorderUpdateLogService;
public ProWorkorderUpdateLogController(IProWorkorderUpdateLogService ProWorkorderUpdateLogService)
{
_ProWorkorderUpdateLogService = ProWorkorderUpdateLogService;
}
///
/// 查询工单修改日志表列表
///
///
///
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:list")]
public IActionResult QueryProWorkorderUpdateLog([FromQuery] ProWorkorderUpdateLogQueryDto parm)
{
var response = _ProWorkorderUpdateLogService.GetList(parm);
return SUCCESS(response);
}
///
/// 查询工单修改日志表详情
///
///
///
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:query")]
public IActionResult GetProWorkorderUpdateLog(string Id)
{
var response = _ProWorkorderUpdateLogService.GetInfo(Id);
var info = response.Adapt();
return SUCCESS(info);
}
///
/// 添加工单修改日志表
///
///
[HttpPost]
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:add")]
[Log(Title = "工单修改日志表", BusinessType = BusinessType.INSERT)]
public IActionResult AddProWorkorderUpdateLog([FromBody] ProWorkorderUpdateLogDto parm)
{
var modal = parm.Adapt().ToCreate(HttpContext);
var response = _ProWorkorderUpdateLogService.AddProWorkorderUpdateLog(modal);
return SUCCESS(response);
}
///
/// 更新工单修改日志表
///
///
[HttpPut]
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:edit")]
[Log(Title = "工单修改日志表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateProWorkorderUpdateLog([FromBody] ProWorkorderUpdateLogDto parm)
{
var modal = parm.Adapt().ToUpdate(HttpContext);
var response = _ProWorkorderUpdateLogService.UpdateProWorkorderUpdateLog(modal);
return ToResponse(response);
}
///
/// 删除工单修改日志表
///
///
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:delete")]
[Log(Title = "工单修改日志表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteProWorkorderUpdateLog(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _ProWorkorderUpdateLogService.Delete(idsArr);
return ToResponse(response);
}
}
}