116 lines
3.9 KiB
C#
116 lines
3.9 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/PfRecipeIssueLog")]
|
||
[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;
|
||
}
|
||
|
||
}
|
||
} |