109 lines
3.7 KiB
C#
Raw Normal View History

2025-06-13 13:58:43 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Admin.WebApi.Filters;
using DOAN.Service.MES.quality.IPQC.IService;
using DOAN.Model.MES.quality.IPQC.Dto;
using DOAN.Model.MES.quality.IPQC;
//创建时间2025-06-13
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 力矩检测表
/// </summary>
[Verify]
2025-06-16 09:30:19 +08:00
[Route("mes/qualityManagement/IPQC/QcTorquedetection")]
2025-06-13 13:58:43 +08:00
public class QcTorquedetectionController : BaseController
{
/// <summary>
/// 力矩检测表接口
/// </summary>
private readonly IQcTorquedetectionService _QcTorquedetectionService;
public QcTorquedetectionController(IQcTorquedetectionService QcTorquedetectionService)
{
_QcTorquedetectionService = QcTorquedetectionService;
}
/// <summary>
/// 查询力矩检测表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:list")]
public IActionResult QueryQcTorquedetection([FromQuery] QcTorquedetectionQueryDto parm)
{
var response = _QcTorquedetectionService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询力矩检测表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:query")]
public IActionResult GetQcTorquedetection(int Id)
{
var response = _QcTorquedetectionService.GetInfo(Id);
var info = response.Adapt<QcTorquedetection>();
return SUCCESS(info);
}
/// <summary>
/// 添加力矩检测表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:add")]
[Log(Title = "力矩检测表", BusinessType = BusinessType.INSERT)]
public IActionResult AddQcTorquedetection([FromBody] QcTorquedetectionDto parm)
{
var modal = parm.Adapt<QcTorquedetection>().ToCreate(HttpContext);
var response = _QcTorquedetectionService.AddQcTorquedetection(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新力矩检测表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:edit")]
[Log(Title = "力矩检测表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateQcTorquedetection([FromBody] QcTorquedetectionDto parm)
{
var modal = parm.Adapt<QcTorquedetection>().ToUpdate(HttpContext);
var response = _QcTorquedetectionService.UpdateQcTorquedetection(modal);
return ToResponse(response);
}
/// <summary>
/// 删除力矩检测表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:delete")]
[Log(Title = "力矩检测表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteQcTorquedetection(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _QcTorquedetectionService.Delete(idsArr);
return ToResponse(response);
}
}
}