109 lines
3.7 KiB
C#
109 lines
3.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Model.Dto;
|
||
using ZR.Model.Business;
|
||
using ZR.Service.Business.IBusinessService;
|
||
using ZR.Admin.WebApi.Extensions;
|
||
using ZR.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2025-01-02
|
||
namespace ZR.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 质量GP12工单操作日志
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("/mes/qc/gp12/QcGp12LogWorkorder")]
|
||
public class QcGp12LogWorkorderController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 质量GP12工单操作日志接口
|
||
/// </summary>
|
||
private readonly IQcGp12LogWorkorderService _QcGp12LogWorkorderService;
|
||
|
||
public QcGp12LogWorkorderController(IQcGp12LogWorkorderService QcGp12LogWorkorderService)
|
||
{
|
||
_QcGp12LogWorkorderService = QcGp12LogWorkorderService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12工单操作日志列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12logworkorder:list")]
|
||
public IActionResult QueryQcGp12LogWorkorder([FromQuery] QcGp12LogWorkorderQueryDto parm)
|
||
{
|
||
var response = _QcGp12LogWorkorderService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12工单操作日志详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12logworkorder:query")]
|
||
public IActionResult GetQcGp12LogWorkorder(string Id)
|
||
{
|
||
var response = _QcGp12LogWorkorderService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<QcGp12LogWorkorder>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加质量GP12工单操作日志
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12logworkorder:add")]
|
||
[Log(Title = "质量GP12工单操作日志", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddQcGp12LogWorkorder([FromBody] QcGp12LogWorkorderDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12LogWorkorder>().ToCreate(HttpContext);
|
||
|
||
var response = _QcGp12LogWorkorderService.AddQcGp12LogWorkorder(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新质量GP12工单操作日志
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12logworkorder:edit")]
|
||
[Log(Title = "质量GP12工单操作日志", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateQcGp12LogWorkorder([FromBody] QcGp12LogWorkorderDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12LogWorkorder>().ToUpdate(HttpContext);
|
||
var response = _QcGp12LogWorkorderService.UpdateQcGp12LogWorkorder(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除质量GP12工单操作日志
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12logworkorder:delete")]
|
||
[Log(Title = "质量GP12工单操作日志", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteQcGp12LogWorkorder(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _QcGp12LogWorkorderService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |