Valeo_Line_MES_backend/MDM/Controllers/Recipe/PfRecipeParametersController.cs
quowingwang 8595507315 配方
2026-01-10 16:42:55 +08:00

108 lines
3.7 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 RIZO.Model.MES.recipe;
using RIZO.Model.MES.recipe.Dto;
using RIZO.Service.MES.recipe.IService;
using RIZO.ServiceCore.Middleware;
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Controllers;
using Infrastructure.Enums;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
//创建时间2025-12-05
namespace RIZO.WebApi.Controllers.MES.recipe
{
/// <summary>
/// 配方参数明细表
/// </summary>
[Route("MasterDataManagement/Recipe/PfRecipeParameters")]
[AllowAnonymous]
public class PfRecipeParametersController : BaseController
{
/// <summary>
/// 配方参数明细表接口
/// </summary>
private readonly IPfRecipeParametersService _PfRecipeParametersService;
public PfRecipeParametersController(IPfRecipeParametersService PfRecipeParametersService)
{
_PfRecipeParametersService = PfRecipeParametersService;
}
/// <summary>
/// 查询配方参数明细表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "pfrecipeparameters:list")]
public IActionResult QueryPfRecipeParameters([FromQuery] PfRecipeParametersQueryDto parm)
{
var response = _PfRecipeParametersService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询配方参数明细表详情
/// </summary>
/// <param name="ParamId"></param>
/// <returns></returns>
[HttpGet("{ParamId}")]
[ActionPermissionFilter(Permission = "pfrecipeparameters:query")]
public IActionResult GetPfRecipeParameters(int ParamId)
{
var response = _PfRecipeParametersService.GetInfo(ParamId);
var info = response.Adapt<PfRecipeParametersDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加配方参数明细表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "pfrecipeparameters:add")]
[Log(Title = "配方参数明细表", BusinessType = BusinessType.INSERT)]
public IActionResult AddPfRecipeParameters([FromBody] PfRecipeParametersDto parm)
{
var modal = parm.Adapt<PfRecipeParameters>().ToCreate(HttpContext);
var response = _PfRecipeParametersService.AddPfRecipeParameters(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新配方参数明细表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "pfrecipeparameters:edit")]
[Log(Title = "配方参数明细表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdatePfRecipeParameters([FromBody] PfRecipeParametersDto parm)
{
var modal = parm.Adapt<PfRecipeParameters>().ToUpdate(HttpContext);
var response = _PfRecipeParametersService.UpdatePfRecipeParameters(modal);
return ToResponse(response);
}
/// <summary>
/// 删除配方参数明细表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "pfrecipeparameters:delete")]
[Log(Title = "配方参数明细表", BusinessType = BusinessType.DELETE)]
public IActionResult DeletePfRecipeParameters([FromRoute]string ids)
{
var idArr = int.Parse(ids);
return ToResponse(_PfRecipeParametersService.Delete(idArr));
}
}
}