194 lines
6.2 KiB
C#
194 lines
6.2 KiB
C#
using DOAN.Admin.WebApi.Filters;
|
||
using DOAN.Common;
|
||
using DOAN.ServiceCore.Middleware;
|
||
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.Models.Process;
|
||
using MDM.Models.Process.Dto;
|
||
using MDM.Services.IProcessService;
|
||
using MDM.Services.Process;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
|
||
//创建时间:2025-11-15
|
||
namespace MDM.Controllers.Process
|
||
{
|
||
/// <summary>
|
||
/// 工序
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("MasterDataManagement/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);
|
||
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <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);
|
||
}
|
||
|
||
|
||
//TODO 获取并筛选流程
|
||
|
||
[HttpGet("get_flow")]
|
||
public IActionResult GetFlow(string flow_type_code)
|
||
{
|
||
var response = _ProcessOperationService.GetFlow(flow_type_code);
|
||
return SUCCESS(response);
|
||
}
|
||
//TODO 工序绑定流程 废弃
|
||
|
||
[HttpPost("bind_flow")]
|
||
public IActionResult BindFlow([FromBody] ProcessOperationBindFlowDto parm)
|
||
{
|
||
var response = _ProcessOperationService.BindFlow(parm);
|
||
return ToResponse(response);
|
||
}
|
||
//TODO 工序增加流程
|
||
|
||
[HttpPost("operation_add_flow")]
|
||
public IActionResult OperationAddFlow([FromBody] ProcessOperationFlowDto parm)
|
||
{
|
||
var response = _ProcessOperationService.OperationAddFlow(parm);
|
||
return ToResponse(response);
|
||
|
||
}
|
||
|
||
//TODO 工序删除流程
|
||
[HttpDelete("operation_delete_flow/{operation_flow_id}")]
|
||
public IActionResult OperationDeleteFlow(int operation_flow_id)
|
||
{
|
||
var response = _ProcessOperationService.OperationDeleteFlow(operation_flow_id);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
//TODO 新增工艺参数数采
|
||
[HttpPost("operation_add_datacollection")]
|
||
public IActionResult OperationAddDatacollection([FromBody]ProcessOperationCollectParameterDto parm)
|
||
{
|
||
var response = _ProcessOperationService.OperationAddDatacollection(parm);
|
||
return ToResponse(response);
|
||
|
||
}
|
||
|
||
|
||
|
||
}
|
||
} |