138 lines
4.7 KiB
C#
138 lines
4.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.MES.recipe;
|
||
using DOAN.Model.MES.recipe.Dto;
|
||
using DOAN.Service.MES.recipe.IService;
|
||
|
||
//创建时间: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));
|
||
}
|
||
|
||
|
||
/// <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;
|
||
}
|
||
|
||
[HttpGet("latestVersion")]
|
||
[ActionPermissionFilter(Permission = "pfrecipeversion:list")]
|
||
public ApiResult QuerylatestVersion([FromQuery] PfRecipeVersionQueryDto parm)
|
||
{
|
||
var response = _PfRecipeVersionService.QuerylatestVersion(parm);
|
||
return response;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加配方版本控制表和参数信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delPfRecipeVersion")]
|
||
[Log(Title = "配方版本控制表删除", BusinessType = BusinessType.DELETE)]
|
||
public ApiResult DELPfRecipeVersion([FromBody] PfRecipeVersionDto parm)
|
||
{
|
||
|
||
var response = _PfRecipeVersionService.DELPfRecipeVersion(parm);
|
||
|
||
return response;
|
||
}
|
||
}
|
||
} |