2025-10-27 17:02:32 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2025-11-11 08:35:41 +08:00
|
|
|
|
using RIZO.Model;
|
2025-11-11 09:50:52 +08:00
|
|
|
|
using RIZO.Model.Mes.Dto.Process;
|
|
|
|
|
|
using RIZO.Model.Mes.Process;
|
|
|
|
|
|
using RIZO.Service.Mes.IMesService.Process;
|
|
|
|
|
|
|
2025-10-27 17:02:32 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-11-04
|
2025-11-11 09:50:52 +08:00
|
|
|
|
namespace RIZO.Admin.WebApi.Controllers.Mes.Process
|
2025-10-27 17:02:32 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工序表
|
|
|
|
|
|
/// </summary>
|
2025-11-11 09:50:52 +08:00
|
|
|
|
[Route("mes/OperationInfo")]
|
2025-11-11 08:35:41 +08:00
|
|
|
|
[AllowAnonymous]
|
2025-10-27 17:02:32 +08:00
|
|
|
|
public class OperationInfoController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工序表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IOperationInfoService _OperationInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
public OperationInfoController(IOperationInfoService OperationInfoService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_OperationInfoService = OperationInfoService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询工序表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "operationinfo:list")]
|
|
|
|
|
|
public IActionResult QueryOperationInfo([FromQuery] OperationInfoQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _OperationInfoService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询工序表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "operationinfo:query")]
|
|
|
|
|
|
public IActionResult GetOperationInfo(long Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _OperationInfoService.GetInfo(Id);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<OperationInfoDto>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加工序表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "operationinfo:add")]
|
|
|
|
|
|
[Log(Title = "工序表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddOperationInfo([FromBody] OperationInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<OperationInfo>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _OperationInfoService.AddOperationInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新工序表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "operationinfo:edit")]
|
|
|
|
|
|
[Log(Title = "工序表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateOperationInfo([FromBody] OperationInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<OperationInfo>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _OperationInfoService.UpdateOperationInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除工序表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("delete/{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "operationinfo:delete")]
|
|
|
|
|
|
[Log(Title = "工序表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteOperationInfo([FromRoute]string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<long>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_OperationInfoService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-11 08:35:41 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过工艺路线编码分页查询工序表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="processCode">工艺路线编码</param>
|
|
|
|
|
|
[HttpPost("getOperationInfoByProcessCode")]
|
|
|
|
|
|
//[ActionPermissionFilter(Permission = "operationinfo:query")]
|
|
|
|
|
|
public IActionResult GetOperationInfoByProcessCode([FromBody] OperationInfoQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
// 校验参数
|
|
|
|
|
|
if (parm == null || !parm.processCode.Any())
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(new PagedInfo<OperationInfoDto>()); // 非法参数返回空分页
|
|
|
|
|
|
}
|
|
|
|
|
|
// 调用服务层分页查询(需同步修改服务层方法)
|
|
|
|
|
|
var pagedResult = _OperationInfoService.GetOperationInfoByProcessCode(parm);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(pagedResult);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 17:02:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|