2025-11-04 16:17:31 +08:00

100 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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));
}
}
}