Valeo_Line_MES_backend/MDM/Controllers/Recipe/PfRecipeIssueLogController.cs

124 lines
4.2 KiB
C#
Raw Normal View History

2026-01-10 13:47:54 +08:00
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 RIZO.ServiceCore.Middleware;
using Infrastructure.Enums;
using Mapster;
using Infrastructure;
using Infrastructure.Attribute;
using Infrastructure.Model;
//创建时间2025-12-05
namespace RIZO.WebApi.Controllers.MES.recipe
{
/// <summary>
/// 配方下达记录表
/// </summary>
2026-01-10 16:42:55 +08:00
[Route("MasterDataManagement/Recipe/PfRecipeIssueLog")]
2026-01-10 13:47:54 +08:00
[AllowAnonymous]
public class PfRecipeIssueLogController : BaseController
{
/// <summary>
/// 配方下达记录表接口
/// </summary>
private readonly IPfRecipeIssueLogService _PfRecipeIssueLogService;
public PfRecipeIssueLogController(IPfRecipeIssueLogService PfRecipeIssueLogService)
{
_PfRecipeIssueLogService = PfRecipeIssueLogService;
}
/// <summary>
/// 查询配方下达记录表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:list")]
public IActionResult QueryPfRecipeIssueLog([FromQuery] PfRecipeIssueLogQueryDto parm)
{
var response = _PfRecipeIssueLogService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询配方下达记录表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:query")]
public IActionResult GetPfRecipeIssueLog(int Id)
{
var response = _PfRecipeIssueLogService.GetInfo(Id);
var info = response.Adapt<PfRecipeIssueLogDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加配方下达记录表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:add")]
[Log(Title = "配方下达记录表", BusinessType = BusinessType.INSERT)]
public IActionResult AddPfRecipeIssueLog([FromBody] PfRecipeIssueLogDto parm)
{
var modal = parm.Adapt<PfRecipeIssueLog>().ToCreate(HttpContext);
var response = _PfRecipeIssueLogService.AddPfRecipeIssueLog(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新配方下达记录表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:edit")]
[Log(Title = "配方下达记录表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdatePfRecipeIssueLog([FromBody] PfRecipeIssueLogDto parm)
{
var modal = parm.Adapt<PfRecipeIssueLog>().ToUpdate(HttpContext);
var response = _PfRecipeIssueLogService.UpdatePfRecipeIssueLog(modal);
return ToResponse(response);
}
/// <summary>
/// 删除配方下达记录表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:delete")]
[Log(Title = "配方下达记录表", BusinessType = BusinessType.DELETE)]
public IActionResult DeletePfRecipeIssueLog([FromRoute]string ids)
{
var idArr = int.Parse(ids);
return ToResponse(_PfRecipeIssueLogService.Delete(idArr));
}
/// <summary>
/// 添加配方下达记录表
/// </summary>
/// <returns></returns>
[HttpPost("issueRecipe")]
[ActionPermissionFilter(Permission = "pfrecipeissuelog:add")]
[Log(Title = "配方下达", BusinessType = BusinessType.INSERT)]
public ApiResult IssueRecipe([FromBody] PfRecipeIssueLogDto parm)
{
var modal = parm.Adapt<PfRecipeIssueLog>().ToCreate(HttpContext);
var response = _PfRecipeIssueLogService.IssueRecipe(modal);
return response;
}
}
}