2025-11-15 14:33:00 +08:00
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
2025-12-29 16:58:36 +08:00
|
|
|
|
using DOAN.Common;
|
2025-11-15 14:33:00 +08:00
|
|
|
|
using DOAN.ServiceCore.Middleware;
|
|
|
|
|
|
using Infrastructure;
|
|
|
|
|
|
using Infrastructure.Attribute;
|
2025-12-29 16:58:36 +08:00
|
|
|
|
using Infrastructure.Controllers;
|
|
|
|
|
|
using Infrastructure.Enums;
|
2025-11-15 14:33:00 +08:00
|
|
|
|
using Infrastructure.Model;
|
2025-12-29 16:58:36 +08:00
|
|
|
|
using Mapster;
|
2025-11-16 15:16:51 +08:00
|
|
|
|
using MDM.Model.Process;
|
2025-12-29 16:58:36 +08:00
|
|
|
|
using MDM.Model.Process.Dto;
|
|
|
|
|
|
using MDM.Models.Process;
|
|
|
|
|
|
using MDM.Models.Process.Dto;
|
|
|
|
|
|
using MDM.Services.IProcessService;
|
2025-11-19 14:56:43 +08:00
|
|
|
|
using MDM.Services.Process;
|
2025-12-29 16:58:36 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2025-11-16 15:16:51 +08:00
|
|
|
|
|
2025-11-15 14:33:00 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-11-15
|
2025-11-16 15:16:51 +08:00
|
|
|
|
namespace MDM.Controllers.Process
|
2025-11-15 14:33:00 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
2025-11-16 15:16:51 +08:00
|
|
|
|
[Route("MasterDataManagement/Process/ProcessOperation")]
|
2025-11-15 14:33:00 +08:00
|
|
|
|
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);
|
2025-12-29 16:58:36 +08:00
|
|
|
|
|
2025-12-31 15:24:31 +08:00
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
2025-11-15 14:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-19 14:56:43 +08:00
|
|
|
|
//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")]
|
2025-12-29 16:58:36 +08:00
|
|
|
|
|
2025-11-19 14:56:43 +08:00
|
|
|
|
public IActionResult QueryProcessOprerationTransitionDict([FromQuery] ProcessOprerationTransitionDictQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessOperationService.QueryProcessOprerationTransitionDict(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-29 16:58:36 +08:00
|
|
|
|
//TODO 获取并筛选流程
|
2025-11-19 14:56:43 +08:00
|
|
|
|
|
2025-12-29 16:58:36 +08:00
|
|
|
|
[HttpGet("get_flow")]
|
2025-12-31 15:57:20 +08:00
|
|
|
|
public IActionResult GetFlow(string flow_type_code)
|
2025-12-29 16:58:36 +08:00
|
|
|
|
{
|
2025-12-31 15:57:20 +08:00
|
|
|
|
var response = _ProcessOperationService.GetFlow(flow_type_code);
|
2025-12-29 16:58:36 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-12-31 10:27:05 +08:00
|
|
|
|
//TODO 工序绑定流程 废弃
|
2025-11-19 14:56:43 +08:00
|
|
|
|
|
2025-12-29 16:58:36 +08:00
|
|
|
|
[HttpPost("bind_flow")]
|
|
|
|
|
|
public IActionResult BindFlow([FromBody] ProcessOperationBindFlowDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessOperationService.BindFlow(parm);
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
2025-12-31 10:27:05 +08:00
|
|
|
|
//TODO 工序增加流程
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost("operation_add_flow")]
|
|
|
|
|
|
public IActionResult OperationAddFlow([FromBody] ProcessOperationFlowDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessOperationService.OperationAddFlow(parm);
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 工序删除流程
|
2025-12-31 15:16:17 +08:00
|
|
|
|
[HttpDelete("operation_delete_flow/{operation_flow_id}")]
|
2025-12-31 10:27:05 +08:00
|
|
|
|
public IActionResult OperationDeleteFlow(int operation_flow_id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessOperationService.OperationDeleteFlow(operation_flow_id);
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-31 15:16:17 +08:00
|
|
|
|
//TODO 新增工艺参数数采
|
2025-12-31 15:40:54 +08:00
|
|
|
|
[HttpPost("operation_add_datacollection")]
|
|
|
|
|
|
public IActionResult OperationAddDatacollection([FromBody]ProcessOperationCollectParameterDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessOperationService.OperationAddDatacollection(parm);
|
|
|
|
|
|
return ToResponse(response);
|
2025-12-31 15:24:31 +08:00
|
|
|
|
|
2025-12-31 15:40:54 +08:00
|
|
|
|
}
|
2025-12-31 15:16:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-12-31 10:27:05 +08:00
|
|
|
|
|
2025-11-15 14:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|