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 { /// /// 力矩检测表 /// [Verify] [Route("mes/qualityManagement/IPQC/QcTorquedetection")] public class QcTorquedetectionController : BaseController { /// /// 力矩检测表接口 /// private readonly IQcTorquedetectionService _QcTorquedetectionService; public QcTorquedetectionController(IQcTorquedetectionService QcTorquedetectionService) { _QcTorquedetectionService = QcTorquedetectionService; } /// /// 查询力矩检测表列表 /// /// /// [HttpGet("list")] [ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:list")] public IActionResult QueryQcTorquedetection([FromQuery] QcTorquedetectionQueryDto parm) { var response = _QcTorquedetectionService.GetList(parm); return SUCCESS(response); } /// /// 查询力矩检测表详情 /// /// /// [HttpGet("{Id}")] [ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:query")] public IActionResult GetQcTorquedetection(int Id) { var response = _QcTorquedetectionService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加力矩检测表 /// /// [HttpPost] [ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:add")] [Log(Title = "力矩检测表", BusinessType = BusinessType.INSERT)] public IActionResult AddQcTorquedetection([FromBody] QcTorquedetectionDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _QcTorquedetectionService.AddQcTorquedetection(modal); return SUCCESS(response); } /// /// 更新力矩检测表 /// /// [HttpPut] [ActionPermissionFilter(Permission = "qualityManagement:qctorquedetection:edit")] [Log(Title = "力矩检测表", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateQcTorquedetection([FromBody] QcTorquedetectionDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _QcTorquedetectionService.UpdateQcTorquedetection(modal); return ToResponse(response); } /// /// 删除力矩检测表 /// /// [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); } } }