Valeo_Line_MES_backend/RIZO.Admin.WebApi/PLC/Controllers/PlcProductionDataController.cs
2026-01-19 13:46:29 +08:00

99 lines
3.5 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 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/PlcProductionData")]
public class PlcProductionDataController : BaseController
{
/// <summary>
/// 产线PLC生产参数数据表接口
/// </summary>
private readonly IPlcProductionDataService _PlcProductionDataService;
public PlcProductionDataController(IPlcProductionDataService PlcProductionDataService)
{
_PlcProductionDataService = PlcProductionDataService;
}
/// <summary>
/// 查询产线PLC生产参数数据表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "plcproductiondata:list")]
public IActionResult QueryPlcProductionData([FromQuery] PlcProductionDataQueryDto parm)
{
var response = _PlcProductionDataService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询产线PLC生产参数数据表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "plcproductiondata:query")]
public IActionResult GetPlcProductionData(int Id)
{
var response = _PlcProductionDataService.GetInfo(Id);
var info = response.Adapt<PlcProductionDataDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加产线PLC生产参数数据表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "plcproductiondata:add")]
[Log(Title = "产线PLC生产参数数据表", BusinessType = BusinessType.INSERT)]
public IActionResult AddPlcProductionData([FromBody] PlcProductionDataDto parm)
{
var modal = parm.Adapt<PlcProductionData>().ToCreate(HttpContext);
var response = _PlcProductionDataService.AddPlcProductionData(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新产线PLC生产参数数据表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "plcproductiondata:edit")]
[Log(Title = "产线PLC生产参数数据表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdatePlcProductionData([FromBody] PlcProductionDataDto parm)
{
var modal = parm.Adapt<PlcProductionData>().ToUpdate(HttpContext);
var response = _PlcProductionDataService.UpdatePlcProductionData(modal);
return ToResponse(response);
}
/// <summary>
/// 删除产线PLC生产参数数据表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "plcproductiondata:delete")]
[Log(Title = "产线PLC生产参数数据表", BusinessType = BusinessType.DELETE)]
public IActionResult DeletePlcProductionData([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<int>(ids);
return ToResponse(_PlcProductionDataService.Delete(idArr));
}
}
}