99 lines
3.5 KiB
C#
99 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Admin.WebApi.PLC.Model;
|
||
using RIZO.Admin.WebApi.PLC.Model.Dto;
|
||
using RIZO.Admin.WebApi.PLC.Service.IService;
|
||
//创建时间:2026-01-17
|
||
namespace RIZO.Admin.WebApi.PLC.Controllers
|
||
{
|
||
/// <summary>
|
||
/// PLC返回的工位工序结果
|
||
/// </summary>
|
||
[Route("mes/PlcOperationResult")]
|
||
public class PlcOperationResultController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// PLC返回的工位工序结果接口
|
||
/// </summary>
|
||
private readonly IPlcOperationResultService _PlcOperationResultService;
|
||
|
||
public PlcOperationResultController(IPlcOperationResultService PlcOperationResultService)
|
||
{
|
||
_PlcOperationResultService = PlcOperationResultService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询PLC返回的工位工序结果列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "plcoperationresult:list")]
|
||
public IActionResult QueryPlcOperationResult([FromQuery] PlcOperationResultQueryDto parm)
|
||
{
|
||
var response = _PlcOperationResultService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询PLC返回的工位工序结果详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "plcoperationresult:query")]
|
||
public IActionResult GetPlcOperationResult(int Id)
|
||
{
|
||
var response = _PlcOperationResultService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<PlcOperationResultDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加PLC返回的工位工序结果
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "plcoperationresult:add")]
|
||
[Log(Title = "PLC返回的工位工序结果", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddPlcOperationResult([FromBody] PlcOperationResultDto parm)
|
||
{
|
||
var modal = parm.Adapt<PlcOperationResult>().ToCreate(HttpContext);
|
||
|
||
var response = _PlcOperationResultService.AddPlcOperationResult(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新PLC返回的工位工序结果
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "plcoperationresult:edit")]
|
||
[Log(Title = "PLC返回的工位工序结果", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdatePlcOperationResult([FromBody] PlcOperationResultDto parm)
|
||
{
|
||
var modal = parm.Adapt<PlcOperationResult>().ToUpdate(HttpContext);
|
||
var response = _PlcOperationResultService.UpdatePlcOperationResult(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除PLC返回的工位工序结果
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "plcoperationresult:delete")]
|
||
[Log(Title = "PLC返回的工位工序结果", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeletePlcOperationResult([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||
|
||
return ToResponse(_PlcOperationResultService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |