Files
shanghaigangxiangtuzhuangMES/ZR.Admin.WebApi/Controllers/mes/qc/GP12/QcGp12ServiceWorkorderController.cs

109 lines
3.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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/QcGp12ServiceWorkorder")]
public class QcGp12ServiceWorkorderController : BaseController
{
/// <summary>
/// 质量GP12工单业务模块接口
/// </summary>
private readonly IQcGp12ServiceWorkorderService _QcGp12ServiceWorkorderService;
public QcGp12ServiceWorkorderController(IQcGp12ServiceWorkorderService QcGp12ServiceWorkorderService)
{
_QcGp12ServiceWorkorderService = QcGp12ServiceWorkorderService;
}
/// <summary>
/// 查询质量GP12工单业务模块列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:qcgp12serviceworkorder:list")]
public IActionResult QueryQcGp12ServiceWorkorder([FromQuery] QcGp12ServiceWorkorderQueryDto parm)
{
var response = _QcGp12ServiceWorkorderService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询质量GP12工单业务模块详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:qcgp12serviceworkorder:query")]
public IActionResult GetQcGp12ServiceWorkorder(string Id)
{
var response = _QcGp12ServiceWorkorderService.GetInfo(Id);
var info = response.Adapt<QcGp12ServiceWorkorder>();
return SUCCESS(info);
}
/// <summary>
/// 添加质量GP12工单业务模块
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:qcgp12serviceworkorder:add")]
[Log(Title = "质量GP12工单业务模块", BusinessType = BusinessType.INSERT)]
public IActionResult AddQcGp12ServiceWorkorder([FromBody] QcGp12ServiceWorkorderDto parm)
{
var modal = parm.Adapt<QcGp12ServiceWorkorder>().ToCreate(HttpContext);
var response = _QcGp12ServiceWorkorderService.AddQcGp12ServiceWorkorder(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新质量GP12工单业务模块
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:qcgp12serviceworkorder:edit")]
[Log(Title = "质量GP12工单业务模块", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateQcGp12ServiceWorkorder([FromBody] QcGp12ServiceWorkorderDto parm)
{
var modal = parm.Adapt<QcGp12ServiceWorkorder>().ToUpdate(HttpContext);
var response = _QcGp12ServiceWorkorderService.UpdateQcGp12ServiceWorkorder(modal);
return ToResponse(response);
}
/// <summary>
/// 删除质量GP12工单业务模块
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:qcgp12serviceworkorder:delete")]
[Log(Title = "质量GP12工单业务模块", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteQcGp12ServiceWorkorder(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _QcGp12ServiceWorkorderService.Delete(idsArr);
return ToResponse(response);
}
}
}