109 lines
3.6 KiB
C#
109 lines
3.6 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Dto;
|
||
using DOAN.Model.MES.quality;
|
||
using DOAN.Model.MES.quality.Dto;
|
||
using DOAN.Service.MES.quality;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2024-09-30
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 缺陷收集
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("mes/productManagement/QcDefectCollection")]
|
||
public class QcDefectCollectionController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 缺陷收集接口
|
||
/// </summary>
|
||
private readonly IQcDefectCollectionService _QcDefectCollectionService;
|
||
|
||
public QcDefectCollectionController(IQcDefectCollectionService QcDefectCollectionService)
|
||
{
|
||
_QcDefectCollectionService = QcDefectCollectionService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询缺陷收集列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:list")]
|
||
public IActionResult QueryQcDefectCollection([FromQuery] QcDefectCollectionQueryDto parm)
|
||
{
|
||
var response = _QcDefectCollectionService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询缺陷收集详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:query")]
|
||
public IActionResult GetQcDefectCollection(string Id)
|
||
{
|
||
var response = _QcDefectCollectionService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<QcDefectCollection>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加缺陷收集
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:add")]
|
||
[Log(Title = "缺陷收集", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddQcDefectCollection([FromBody] QcDefectCollectionDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcDefectCollection>().ToCreate(HttpContext);
|
||
|
||
var response = _QcDefectCollectionService.AddQcDefectCollection(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新缺陷收集
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:edit")]
|
||
[Log(Title = "缺陷收集", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateQcDefectCollection([FromBody] QcDefectCollectionDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcDefectCollection>().ToUpdate(HttpContext);
|
||
var response = _QcDefectCollectionService.UpdateQcDefectCollection(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除缺陷收集
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:delete")]
|
||
[Log(Title = "缺陷收集", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteQcDefectCollection(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _QcDefectCollectionService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |