zhuangpei-mesbackend/MDM/Controllers/Recipe/PfRecipeVersionController.cs

146 lines
4.9 KiB
C#
Raw Normal View History

2025-12-05 11:41:06 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.MES.recipe;
using DOAN.Model.MES.recipe.Dto;
using DOAN.Service.MES.recipe.IService;
2025-12-29 16:58:36 +08:00
using Infrastructure.Controllers;
using Microsoft.AspNetCore.Authorization;
using Mapster;
using Infrastructure;
using Infrastructure.Enums;
using Infrastructure.Attribute;
using DOAN.ServiceCore.Middleware;
using Infrastructure.Model;
2025-12-05 11:41:06 +08:00
//创建时间2025-12-05
namespace DOAN.WebApi.Controllers.MES.recipe
{
/// <summary>
/// 配方版本控制表
/// </summary>
[Route("mes/PfRecipeVersion")]
[AllowAnonymous]
public class PfRecipeVersionController : BaseController
{
/// <summary>
/// 配方版本控制表接口
/// </summary>
private readonly IPfRecipeVersionService _PfRecipeVersionService;
public PfRecipeVersionController(IPfRecipeVersionService PfRecipeVersionService)
{
_PfRecipeVersionService = PfRecipeVersionService;
}
/// <summary>
/// 查询配方版本控制表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "pfrecipeversion:list")]
public IActionResult QueryPfRecipeVersion([FromQuery] PfRecipeVersionQueryDto parm)
{
var response = _PfRecipeVersionService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询配方版本控制表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "pfrecipeversion:query")]
public IActionResult GetPfRecipeVersion(int Id)
{
var response = _PfRecipeVersionService.GetInfo(Id);
var info = response.Adapt<PfRecipeVersionDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加配方版本控制表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "pfrecipeversion:add")]
[Log(Title = "配方版本控制表", BusinessType = BusinessType.INSERT)]
public IActionResult AddPfRecipeVersion([FromBody] PfRecipeVersionDto parm)
{
var modal = parm.Adapt<PfRecipeVersion>().ToCreate(HttpContext);
var response = _PfRecipeVersionService.AddPfRecipeVersion(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新配方版本控制表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "pfrecipeversion:edit")]
[Log(Title = "配方版本控制表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdatePfRecipeVersion([FromBody] PfRecipeVersionDto parm)
{
var modal = parm.Adapt<PfRecipeVersion>().ToUpdate(HttpContext);
var response = _PfRecipeVersionService.UpdatePfRecipeVersion(modal);
return ToResponse(response);
}
/// <summary>
/// 删除配方版本控制表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "pfrecipeversion:delete")]
[Log(Title = "配方版本控制表", BusinessType = BusinessType.DELETE)]
public IActionResult DeletePfRecipeVersion([FromRoute]string ids)
{
var idArr = int.Parse(ids);
return ToResponse(_PfRecipeVersionService.Delete(idArr));
}
2025-12-06 09:42:18 +08:00
/// <summary>
/// 添加配方版本控制表和参数信息
/// </summary>
/// <returns></returns>
[HttpPost("createPfRecipeVersionAndParameters")]
[ActionPermissionFilter(Permission = "pfrecipeversion:add")]
[Log(Title = "配方版本控制表和参数新增", BusinessType = BusinessType.INSERT)]
public ApiResult CreatePfRecipeVersionAndParameters([FromBody] PfRecipeVersionDto parm)
{
var response = _PfRecipeVersionService.CreatePfRecipeVersionAndParameters(parm);
return response;
}
2025-12-07 16:48:42 +08:00
[HttpGet("latestVersion")]
[ActionPermissionFilter(Permission = "pfrecipeversion:list")]
public ApiResult QuerylatestVersion([FromQuery] PfRecipeVersionQueryDto parm)
{
var response = _PfRecipeVersionService.QuerylatestVersion(parm);
return response;
}
2025-12-08 16:21:05 +08:00
/// <summary>
/// 添加配方版本控制表和参数信息
/// </summary>
/// <returns></returns>
[HttpPost("delPfRecipeVersion")]
[Log(Title = "配方版本控制表删除", BusinessType = BusinessType.DELETE)]
public ApiResult DELPfRecipeVersion([FromBody] PfRecipeVersionDto parm)
{
var response = _PfRecipeVersionService.DELPfRecipeVersion(parm);
return response;
}
2025-12-05 11:41:06 +08:00
}
}