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

109 lines
3.8 KiB
C#
Raw Normal View History

2025-01-03 16:43:02 +08:00
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/QcGp12RecordLabelScan")]
public class QcGp12RecordLabelScanController : BaseController
{
/// <summary>
/// 质量GP12扫码标签记录接口
/// </summary>
private readonly IQcGp12RecordLabelScanService _QcGp12RecordLabelScanService;
public QcGp12RecordLabelScanController(IQcGp12RecordLabelScanService QcGp12RecordLabelScanService)
{
_QcGp12RecordLabelScanService = QcGp12RecordLabelScanService;
}
/// <summary>
/// 查询质量GP12扫码标签记录列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:qcgp12recordlabelscan:list")]
public IActionResult QueryQcGp12RecordLabelScan([FromQuery] QcGp12RecordLabelScanQueryDto parm)
{
var response = _QcGp12RecordLabelScanService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询质量GP12扫码标签记录详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:qcgp12recordlabelscan:query")]
public IActionResult GetQcGp12RecordLabelScan(string Id)
{
var response = _QcGp12RecordLabelScanService.GetInfo(Id);
var info = response.Adapt<QcGp12RecordLabelScan>();
return SUCCESS(info);
}
/// <summary>
/// 添加质量GP12扫码标签记录
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:qcgp12recordlabelscan:add")]
[Log(Title = "质量GP12扫码标签记录", BusinessType = BusinessType.INSERT)]
public IActionResult AddQcGp12RecordLabelScan([FromBody] QcGp12RecordLabelScanDto parm)
{
var modal = parm.Adapt<QcGp12RecordLabelScan>().ToCreate(HttpContext);
var response = _QcGp12RecordLabelScanService.AddQcGp12RecordLabelScan(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新质量GP12扫码标签记录
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:qcgp12recordlabelscan:edit")]
[Log(Title = "质量GP12扫码标签记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateQcGp12RecordLabelScan([FromBody] QcGp12RecordLabelScanDto parm)
{
var modal = parm.Adapt<QcGp12RecordLabelScan>().ToUpdate(HttpContext);
var response = _QcGp12RecordLabelScanService.UpdateQcGp12RecordLabelScan(modal);
return ToResponse(response);
}
/// <summary>
/// 删除质量GP12扫码标签记录
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:qcgp12recordlabelscan:delete")]
[Log(Title = "质量GP12扫码标签记录", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteQcGp12RecordLabelScan(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _QcGp12RecordLabelScanService.Delete(idsArr);
return ToResponse(response);
}
}
}