108 lines
3.7 KiB
C#
108 lines
3.7 KiB
C#
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));
|
||
}
|
||
|
||
}
|
||
} |