135 lines
4.5 KiB
C#
135 lines
4.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Dto;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using DOAN.Service.MES.process.IService;
|
||
using DOAN.Model.MES.process;
|
||
using DOAN.Model.MES.process.Dto;
|
||
using DOAN.Service.Business;
|
||
|
||
//创建时间:2025-09-20
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 工序表
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("mes/process/ProcessmodelOperation")]
|
||
public class ProcessmodelOperationController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 工序表接口
|
||
/// </summary>
|
||
private readonly IProcessmodelOperationService _ProcessmodelOperationService;
|
||
|
||
public ProcessmodelOperationController(IProcessmodelOperationService ProcessmodelOperationService)
|
||
{
|
||
_ProcessmodelOperationService = ProcessmodelOperationService;
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工艺路线父子表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list_parent")]
|
||
public IActionResult QueryProcessmodelRouting([FromQuery] ProcessmodelRoutingQueryDto parm)
|
||
{
|
||
var response = _ProcessmodelOperationService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工序表列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:list")]
|
||
public IActionResult QueryProcessmodelOperation([FromQuery] ProcessmodelOperationQueryDto parm)
|
||
{
|
||
var response = _ProcessmodelOperationService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工序表详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:query")]
|
||
public IActionResult GetProcessmodelOperation(int Id)
|
||
{
|
||
var response = _ProcessmodelOperationService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<ProcessmodelOperation>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加工序表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:add")]
|
||
[Log(Title = "工序表", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProcessmodelOperation([FromBody] ProcessmodelOperationDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessmodelOperation>().ToCreate(HttpContext);
|
||
|
||
var response = _ProcessmodelOperationService.AddProcessmodelOperation(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新工序表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:edit")]
|
||
[Log(Title = "工序表", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProcessmodelOperation([FromBody] ProcessmodelOperationDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessmodelOperation>().ToUpdate(HttpContext);
|
||
var response = _ProcessmodelOperationService.UpdateProcessmodelOperation(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除工序表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:delete")]
|
||
[Log(Title = "工序表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProcessmodelOperation(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _ProcessmodelOperationService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询工艺路线列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet("modelRoutingList")]
|
||
[ActionPermissionFilter(Permission = "process:processmodeloperation:modelRoutingList")]
|
||
public IActionResult GetModelRoutingList()
|
||
{
|
||
var response = _ProcessmodelOperationService.GetModelRoutingList();
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
}
|
||
} |