100 lines
3.2 KiB
C#
Raw Normal View History

2025-10-27 17:02:32 +08:00
using Microsoft.AspNetCore.Mvc;
using RIZO.Model.Business.Dto;
using RIZO.Model.Business;
using RIZO.Service.Business.IBusinessService;
//创建时间2025-11-04
namespace RIZO.Admin.WebApi.Controllers.Business
{
/// <summary>
/// 工序表
/// </summary>
[Route("business/OperationInfo")]
public class OperationInfoController : BaseController
{
/// <summary>
/// 工序表接口
/// </summary>
private readonly IOperationInfoService _OperationInfoService;
public OperationInfoController(IOperationInfoService OperationInfoService)
{
_OperationInfoService = OperationInfoService;
}
/// <summary>
/// 查询工序表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "operationinfo:list")]
public IActionResult QueryOperationInfo([FromQuery] OperationInfoQueryDto parm)
{
var response = _OperationInfoService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询工序表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "operationinfo:query")]
public IActionResult GetOperationInfo(long Id)
{
var response = _OperationInfoService.GetInfo(Id);
var info = response.Adapt<OperationInfoDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加工序表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "operationinfo:add")]
[Log(Title = "工序表", BusinessType = BusinessType.INSERT)]
public IActionResult AddOperationInfo([FromBody] OperationInfoDto parm)
{
var modal = parm.Adapt<OperationInfo>().ToCreate(HttpContext);
var response = _OperationInfoService.AddOperationInfo(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新工序表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "operationinfo:edit")]
[Log(Title = "工序表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateOperationInfo([FromBody] OperationInfoDto parm)
{
var modal = parm.Adapt<OperationInfo>().ToUpdate(HttpContext);
var response = _OperationInfoService.UpdateOperationInfo(modal);
return ToResponse(response);
}
/// <summary>
/// 删除工序表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "operationinfo:delete")]
[Log(Title = "工序表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteOperationInfo([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<long>(ids);
return ToResponse(_OperationInfoService.Delete(idArr));
}
}
}