107 lines
3.6 KiB
C#
107 lines
3.6 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.MES.recipe;
|
||
using DOAN.Model.MES.recipe.Dto;
|
||
using DOAN.Service.MES.recipe.IService;
|
||
|
||
//创建时间:2025-12-04
|
||
namespace DOAN.WebApi.Controllers.MES.recipe
|
||
{
|
||
/// <summary>
|
||
/// 配方参数明细表
|
||
/// </summary>
|
||
[Route("mes/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 = "business: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 = "business:pfrecipeparameters:query")]
|
||
public IActionResult GetPfRecipeParameters(int ParamId)
|
||
{
|
||
var response = _PfRecipeParametersService.GetInfo(ParamId);
|
||
|
||
var info = response.Adapt<PfRecipeParameters>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加配方参数明细表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business: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 = "business: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>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:pfrecipeparameters:delete")]
|
||
[Log(Title = "配方参数明细表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeletePfRecipeParameters(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _PfRecipeParametersService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |