109 lines
3.5 KiB
C#
109 lines
3.5 KiB
C#
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/QcGp12BaseGroup")]
|
||
public class QcGp12BaseGroupController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 质量GP12班组接口
|
||
/// </summary>
|
||
private readonly IQcGp12BaseGroupService _QcGp12BaseGroupService;
|
||
|
||
public QcGp12BaseGroupController(IQcGp12BaseGroupService QcGp12BaseGroupService)
|
||
{
|
||
_QcGp12BaseGroupService = QcGp12BaseGroupService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12班组列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basegroup:list")]
|
||
public IActionResult QueryQcGp12BaseGroup([FromQuery] QcGp12BaseGroupQueryDto parm)
|
||
{
|
||
var response = _QcGp12BaseGroupService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12班组详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basegroup:query")]
|
||
public IActionResult GetQcGp12BaseGroup(int Id)
|
||
{
|
||
var response = _QcGp12BaseGroupService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<QcGp12BaseGroup>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加质量GP12班组
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basegroup:add")]
|
||
[Log(Title = "质量GP12班组", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddQcGp12BaseGroup([FromBody] QcGp12BaseGroupDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12BaseGroup>().ToCreate(HttpContext);
|
||
|
||
var response = _QcGp12BaseGroupService.AddQcGp12BaseGroup(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新质量GP12班组
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basegroup:edit")]
|
||
[Log(Title = "质量GP12班组", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateQcGp12BaseGroup([FromBody] QcGp12BaseGroupDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12BaseGroup>().ToUpdate(HttpContext);
|
||
var response = _QcGp12BaseGroupService.UpdateQcGp12BaseGroup(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除质量GP12班组
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basegroup:delete")]
|
||
[Log(Title = "质量GP12班组", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteQcGp12BaseGroup(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _QcGp12BaseGroupService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |