109 lines
4.1 KiB
C#
109 lines
4.1 KiB
C#
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;
|
||
using Infrastructure.Converter;
|
||
|
||
//创建时间:2024-11-19
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 工单修改日志表
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("mes/exception/ProWorkorderUpdateLog")]
|
||
public class ProWorkorderUpdateLogController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 工单修改日志表接口
|
||
/// </summary>
|
||
private readonly IProWorkorderUpdateLogService _ProWorkorderUpdateLogService;
|
||
|
||
public ProWorkorderUpdateLogController(IProWorkorderUpdateLogService ProWorkorderUpdateLogService)
|
||
{
|
||
_ProWorkorderUpdateLogService = ProWorkorderUpdateLogService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工单修改日志表列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpPost("list")]
|
||
[ActionPermissionFilter(Permission = "exceptionManagement:proworkorderupdatelog:list")]
|
||
public IActionResult QueryProWorkorderUpdateLog([FromBody] ProWorkorderUpdateLogQueryDto parm)
|
||
{
|
||
parm.SearchDateTimeArray[0]= DOANConvertDateTime.ConvertLocalDate(parm.SearchDateTimeArray[0]);
|
||
parm.SearchDateTimeArray[1]= DOANConvertDateTime.ConvertLocalDate(parm.SearchDateTimeArray[1]);
|
||
var response = _ProWorkorderUpdateLogService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工单修改日志表详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "exceptionManagement:proworkorderupdatelog:query")]
|
||
public IActionResult GetProWorkorderUpdateLog(string Id)
|
||
{
|
||
var response = _ProWorkorderUpdateLogService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<ProWorkorderUpdateLog>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加工单修改日志表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "exceptionManagement:proworkorderupdatelog:add")]
|
||
[Log(Title = "工单修改日志表", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProWorkorderUpdateLog([FromBody] ProWorkorderUpdateLogDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProWorkorderUpdateLog>().ToCreate(HttpContext);
|
||
|
||
var response = _ProWorkorderUpdateLogService.AddProWorkorderUpdateLog(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新工单修改日志表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "exceptionManagement:proworkorderupdatelog:edit")]
|
||
[Log(Title = "工单修改日志表", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProWorkorderUpdateLog([FromBody] ProWorkorderUpdateLogDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProWorkorderUpdateLog>().ToUpdate(HttpContext);
|
||
var response = _ProWorkorderUpdateLogService.UpdateProWorkorderUpdateLog(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除工单修改日志表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "exceptionManagement:proworkorderupdatelog:delete")]
|
||
[Log(Title = "工单修改日志表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProWorkorderUpdateLog(string ids)
|
||
{
|
||
string[] idsArr = Tools.SpitStrArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _ProWorkorderUpdateLogService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
}
|
||
} |