106 lines
3.5 KiB
C#
106 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Model.MES.recipe;
|
||
using RIZO.Model.MES.recipe.Dto;
|
||
using RIZO.Service.MES.recipe.IService;
|
||
using Infrastructure.Controllers;
|
||
using Infrastructure.Enums;
|
||
using RIZO.ServiceCore.Middleware;
|
||
using Mapster;
|
||
using Infrastructure;
|
||
using Infrastructure.Attribute;
|
||
|
||
//创建时间:2025-12-05
|
||
namespace RIZO.WebApi.Controllers.MES.recipe
|
||
{
|
||
/// <summary>
|
||
/// 配方模板表
|
||
/// </summary>
|
||
[Route("mes/PfRecipeTemplate")]
|
||
public class PfRecipeTemplateController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 配方模板表接口
|
||
/// </summary>
|
||
private readonly IPfRecipeTemplateService _PfRecipeTemplateService;
|
||
|
||
public PfRecipeTemplateController(IPfRecipeTemplateService PfRecipeTemplateService)
|
||
{
|
||
_PfRecipeTemplateService = PfRecipeTemplateService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询配方模板表列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "pfrecipetemplate:list")]
|
||
public IActionResult QueryPfRecipeTemplate([FromQuery] PfRecipeTemplateQueryDto parm)
|
||
{
|
||
var response = _PfRecipeTemplateService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询配方模板表详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "pfrecipetemplate:query")]
|
||
public IActionResult GetPfRecipeTemplate(int Id)
|
||
{
|
||
var response = _PfRecipeTemplateService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<PfRecipeTemplateDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加配方模板表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "pfrecipetemplate:add")]
|
||
[Log(Title = "配方模板表", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddPfRecipeTemplate([FromBody] PfRecipeTemplateDto parm)
|
||
{
|
||
var modal = parm.Adapt<PfRecipeTemplate>().ToCreate(HttpContext);
|
||
|
||
var response = _PfRecipeTemplateService.AddPfRecipeTemplate(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新配方模板表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "pfrecipetemplate:edit")]
|
||
[Log(Title = "配方模板表", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdatePfRecipeTemplate([FromBody] PfRecipeTemplateDto parm)
|
||
{
|
||
var modal = parm.Adapt<PfRecipeTemplate>().ToUpdate(HttpContext);
|
||
var response = _PfRecipeTemplateService.UpdatePfRecipeTemplate(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除配方模板表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "pfrecipetemplate:delete")]
|
||
[Log(Title = "配方模板表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeletePfRecipeTemplate([FromRoute]string ids)
|
||
{
|
||
var idArr = int.Parse(ids);
|
||
|
||
return ToResponse(_PfRecipeTemplateService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |