114 lines
3.9 KiB
C#
114 lines
3.9 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Model.MES.recipe;
|
||
using RIZO.Model.MES.recipe.Dto;
|
||
using RIZO.Service.MES.recipe.IService;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Infrastructure.Controllers;
|
||
using Mapster;
|
||
using Infrastructure;
|
||
using Infrastructure.Attribute;
|
||
using RIZO.ServiceCore.Middleware;
|
||
using Infrastructure.Enums;
|
||
|
||
//创建时间:2025-12-05
|
||
namespace RIZO.WebApi.Controllers.MES.recipe
|
||
{
|
||
/// <summary>
|
||
/// 产品配方关联表
|
||
/// </summary>
|
||
[Route("mes/PfRefProductRecipe")]
|
||
[AllowAnonymous]
|
||
public class PfRefProductRecipeController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 产品配方关联表接口
|
||
/// </summary>
|
||
private readonly IPfRefProductRecipeService _PfRefProductRecipeService;
|
||
|
||
public PfRefProductRecipeController(IPfRefProductRecipeService PfRefProductRecipeService)
|
||
{
|
||
_PfRefProductRecipeService = PfRefProductRecipeService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询产品配方关联表列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "pfrefproductrecipe:list")]
|
||
public IActionResult QueryPfRefProductRecipe([FromQuery] PfRefProductRecipeQueryDto parm)
|
||
{
|
||
var response = _PfRefProductRecipeService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询产品配方关联表详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "pfrefproductrecipe:query")]
|
||
public IActionResult GetPfRefProductRecipe(int Id)
|
||
{
|
||
var response = _PfRefProductRecipeService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<PfRefProductRecipeDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加产品配方关联表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "pfrefproductrecipe:add")]
|
||
[Log(Title = "产品配方关联表", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddPfRefProductRecipe([FromBody] PfRefProductRecipeDto parm)
|
||
{
|
||
var modal = parm.Adapt<PfRefProductRecipe>().ToCreate(HttpContext);
|
||
|
||
var response = _PfRefProductRecipeService.AddPfRefProductRecipe(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新产品配方关联表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "pfrefproductrecipe:edit")]
|
||
[Log(Title = "产品配方关联表", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdatePfRefProductRecipe([FromBody] PfRefProductRecipeDto parm)
|
||
{
|
||
var modal = parm.Adapt<PfRefProductRecipe>().ToUpdate(HttpContext);
|
||
var response = _PfRefProductRecipeService.UpdatePfRefProductRecipe(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除产品配方关联表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "pfrefproductrecipe:delete")]
|
||
[Log(Title = "产品配方关联表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeletePfRefProductRecipe([FromRoute]string ids)
|
||
{
|
||
var idArr = int.Parse(ids);
|
||
|
||
return ToResponse(_PfRefProductRecipeService.Delete(idArr));
|
||
}
|
||
|
||
[HttpGet("getRecipeCodePullDown")]
|
||
public IActionResult GetRecipeCodePullDown()
|
||
{
|
||
var response = _PfRefProductRecipeService.GetRecipeCodePullDown();
|
||
return SUCCESS(response);
|
||
}
|
||
}
|
||
} |