154 lines
4.8 KiB
C#
154 lines
4.8 KiB
C#
using Infrastructure;
|
||
using Infrastructure.Attribute;
|
||
using Infrastructure.Controllers;
|
||
using Infrastructure.Enums;
|
||
using Infrastructure.Model;
|
||
using Mapster;
|
||
using MDM.Model.Process;
|
||
using MDM.Model.Process.Dto;
|
||
using MDM.Services.IProcessService;
|
||
using MDM.Services.Process;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Admin.WebApi.Filters;
|
||
using RIZO.Common;
|
||
using RIZO.ServiceCore.Middleware;
|
||
|
||
|
||
//创建时间:2025-11-15
|
||
namespace MDM.Controllers.Process
|
||
{
|
||
/// <summary>
|
||
/// 工序
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("MasterDataManagement/Process/ProcessOperation")]
|
||
[AllowAnonymous]
|
||
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);
|
||
}
|
||
|
||
|
||
//TODO 控制策略字典查询
|
||
|
||
|
||
/// <summary>
|
||
/// 控制策略字典查询
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("search_controlstrategy_dict")]
|
||
public IActionResult SearchControlstrategyDict([FromQuery] ProcessControlStrategyDictQueryDto parm)
|
||
{
|
||
var response = _ProcessOperationService.SearchControlstrategyDict(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 工序流转字典
|
||
|
||
/// <summary>
|
||
/// 工序流转字典
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("search_OprerationTransitionDict")]
|
||
|
||
public IActionResult QueryProcessOprerationTransitionDict([FromQuery] ProcessOprerationTransitionDictQueryDto parm)
|
||
{
|
||
var response = _ProcessOperationService.QueryProcessOprerationTransitionDict(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
} |