124 lines
3.9 KiB
C#
124 lines
3.9 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 MDM.Services.IProcessService;
|
||
using MDM.Model.Process.Dto;
|
||
using MDM.Model.Process;
|
||
|
||
//创建时间:2025-11-15
|
||
namespace MDM.Controllers.Process
|
||
{
|
||
/// <summary>
|
||
/// 工艺路线
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("MasterDataManagement/Process/ProcessRouting")]
|
||
public class ProcessRoutingController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 工艺路线接口
|
||
/// </summary>
|
||
private readonly IProcessRoutingService _ProcessRoutingService;
|
||
|
||
public ProcessRoutingController(IProcessRoutingService ProcessRoutingService)
|
||
{
|
||
_ProcessRoutingService = ProcessRoutingService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工艺路线列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:processrouting:list")]
|
||
public IActionResult QueryProcessRouting([FromQuery] ProcessRoutingQueryDto parm)
|
||
{
|
||
var response = _ProcessRoutingService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 查询工艺路线绑定工序
|
||
[HttpGet("queryProcess")]
|
||
public IActionResult QueryProcess(string RoutingCode)
|
||
{
|
||
var response = _ProcessRoutingService.QueryProcess(RoutingCode);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工艺路线详情
|
||
/// </summary>
|
||
/// <param name="RoutingId"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{RoutingId}")]
|
||
[ActionPermissionFilter(Permission = "business:processrouting:query")]
|
||
public IActionResult GetProcessRouting(int RoutingId)
|
||
{
|
||
var response = _ProcessRoutingService.GetInfo(RoutingId);
|
||
|
||
var info = response.Adapt<ProcessRouting>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加工艺路线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:processrouting:add")]
|
||
[Log(Title = "工艺路线", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProcessRouting([FromBody] ProcessRoutingDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessRouting>().ToCreate(HttpContext);
|
||
|
||
var response = _ProcessRoutingService.AddProcessRouting(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新工艺路线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:processrouting:edit")]
|
||
[Log(Title = "工艺路线", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProcessRouting([FromBody] ProcessRoutingDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessRouting>().ToUpdate(HttpContext);
|
||
var response = _ProcessRoutingService.UpdateProcessRouting(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除工艺路线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:processrouting:delete")]
|
||
[Log(Title = "工艺路线", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProcessRouting(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _ProcessRoutingService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |