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

114 lines
3.9 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 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("MasterDataManagement/Recipe/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);
}
}
}