117 lines
3.7 KiB
C#
117 lines
3.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using Infrastructure.Controllers;
|
||
using DOAN.ServiceCore.Middleware;
|
||
using Mapster;
|
||
using Infrastructure.Enums;
|
||
using Infrastructure;
|
||
using Infrastructure.Attribute;
|
||
using DOAN.Common;
|
||
using Infrastructure.Model;
|
||
using MES_Model.Services.IProcessService;
|
||
using MES_Model.Model.Process.Dto;
|
||
using MES_Model.Model.Process;
|
||
|
||
//创建时间:2025-11-15
|
||
namespace MES_Model.Controllers.Process
|
||
{
|
||
/// <summary>
|
||
/// 工序
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("MESMODEL/Process/ProcessOperation")]
|
||
public class ProcessOperationController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 工序接口
|
||
/// </summary>
|
||
private readonly IProcessOperationService _ProcessOperationService;
|
||
|
||
public ProcessOperationController(IProcessOperationService ProcessOperationService)
|
||
{
|
||
_ProcessOperationService = ProcessOperationService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工序列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:processoperation:list")]
|
||
public IActionResult QueryProcessOperation([FromQuery] ProcessOperationQueryDto parm)
|
||
{
|
||
var response = _ProcessOperationService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工序详情
|
||
/// </summary>
|
||
/// <param name="OperationId"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{OperationId}")]
|
||
[ActionPermissionFilter(Permission = "business:processoperation:query")]
|
||
public IActionResult GetProcessOperation(int OperationId)
|
||
{
|
||
var response = _ProcessOperationService.GetInfo(OperationId);
|
||
|
||
var info = response.Adapt<ProcessOperation>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加工序
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:processoperation:add")]
|
||
[Log(Title = "工序", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProcessOperation([FromBody] ProcessOperationDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessOperation>().ToCreate(HttpContext);
|
||
|
||
var response = _ProcessOperationService.AddProcessOperation(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新工序
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:processoperation:edit")]
|
||
[Log(Title = "工序", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProcessOperation([FromBody] ProcessOperationDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessOperation>().ToUpdate(HttpContext);
|
||
var response = _ProcessOperationService.UpdateProcessOperation(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除工序
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:processoperation:delete")]
|
||
[Log(Title = "工序", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProcessOperation(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _ProcessOperationService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |