106 lines
3.8 KiB
C#
106 lines
3.8 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;
|
|||
|
|
|
|||
|
|
//创建时间:2024-11-19
|
|||
|
|
namespace DOAN.Admin.WebApi.Controllers
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 工单修改日志表
|
|||
|
|
/// </summary>
|
|||
|
|
[Verify]
|
|||
|
|
[Route("business/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>
|
|||
|
|
[HttpGet("list")]
|
|||
|
|
[ActionPermissionFilter(Permission = "business:proworkorderupdatelog:list")]
|
|||
|
|
public IActionResult QueryProWorkorderUpdateLog([FromQuery] ProWorkorderUpdateLogQueryDto parm)
|
|||
|
|
{
|
|||
|
|
var response = _ProWorkorderUpdateLogService.GetList(parm);
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询工单修改日志表详情
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="Id"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("{Id}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "business: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 = "business: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 = "business: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 = "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);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|