zhuangpei-mesbackend/MDM/Controllers/Process/ProcessOperationController.cs
gcw_MV9p2JJN 3c07442a4e 1
2025-12-31 20:26:36 +08:00

265 lines
9.0 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 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;
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);
}
// 查询某个工序下的流程
[HttpGet("get_operation_flow_list")]
public IActionResult GetOperationFlowList(string routing_code, string operation_code)
{
var response = _ProcessOperationService.GetOperationFlowList(routing_code, operation_code);
return SUCCESS(response);
}
//TODO 新增工艺参数数采
[HttpPost("operation_add_datacollection")]
public IActionResult OperationAddDatacollection([FromBody]ProcessOperationCollectParameterDto parm)
{
var response = _ProcessOperationService.OperationAddDatacollection(parm);
return ToResponse(response);
}
//TODO 工艺参数数采删除
[HttpDelete("operation_delete_datacollection/{operation_datacollection_id}")]
public IActionResult OperationDeleteDatacollection(int operation_datacollection_id)
{
var response = _ProcessOperationService.OperationDeleteDatacollection(operation_datacollection_id);
return ToResponse(response);
}
/// <summary>
/// 查询物料防错规则字典
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("search_material_errorproof_dict")]
public IActionResult SearchMaterialErrorproofDict(string error_proof_rule_code)
{
var response = _ProcessOperationService.SearchMaterialErrorproofDict(error_proof_rule_code);
return SUCCESS(response);
}
/// <summary>
/// 搜素物料档案信息
/// </summary>
/// <param name="material_info">物料编码或者物料名称</param>
/// <returns></returns>
[HttpGet("search_material_info")]
public IActionResult SearchMaterialInfo(string material_info)
{
var response = _ProcessOperationService.SearchMaterialInfo(material_info);
return SUCCESS(response);
}
//TODO 新增物料信息
[HttpPost("operation_add_material_paramter")]
public IActionResult OperationAddMaterialParamter([FromBody] ProcessOperationFlowMaterialParamterDto parm)
{
var response = _ProcessOperationService.OperationAddMaterialParamter(parm);
return ToResponse(response);
}
//TODO 物料信息删除
[HttpDelete("operation_delete_material_paramter/{operation_material_paramter_id}")]
public IActionResult OperationDeleteMaterialParamter(int operation_material_paramter_id)
{
var response = _ProcessOperationService.OperationDeleteMaterialParamter(operation_material_paramter_id);
return ToResponse(response);
}
//TODO 分页查询配方参数
[HttpPost("operation_search_recipe")]
public IActionResult QueryProcessOperationRecipe([FromQuery] ProcessOperationQuery2Dto query)
{
var response = _ProcessOperationService.QueryProcessOperationRecipe(query);
return SUCCESS(response);
}
}
}