using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.mm;
using DOAN.Model.MES.mm.Dto;
using DOAN.Service.MES.mm.IService;
//创建时间:2024-11-16
namespace DOAN.Admin.WebApi.Controllers
{
///
/// 线边库出入库日志
///
[Verify]
[Route("mes/materialManagement/MmLinesidebarInventoryOutboundAndInbound")]
public class MmLinesidebarInventoryOutboundAndInboundController : BaseController
{
///
/// 线边库出入库日志接口
///
private readonly IMmLinesidebarInventoryOutboundAndInboundService _MmLinesidebarInventoryOutboundAndInboundService;
public MmLinesidebarInventoryOutboundAndInboundController(IMmLinesidebarInventoryOutboundAndInboundService MmLinesidebarInventoryOutboundAndInboundService)
{
_MmLinesidebarInventoryOutboundAndInboundService = MmLinesidebarInventoryOutboundAndInboundService;
}
///
/// 查询线边库出入库日志列表
///
///
///
[HttpGet("list")]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:list")]
public IActionResult QueryMmLinesidebarInventoryOutboundAndInbound([FromQuery] MmLinesidebarInventoryOutboundAndInboundQueryDto parm)
{
var response = _MmLinesidebarInventoryOutboundAndInboundService.GetList(parm);
return SUCCESS(response);
}
///
/// 查询线边库出入库日志详情
///
///
///
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:query")]
public IActionResult GetMmLinesidebarInventoryOutboundAndInbound(string Id)
{
var response = _MmLinesidebarInventoryOutboundAndInboundService.GetInfo(Id);
var info = response.Adapt();
return SUCCESS(info);
}
///
/// 添加线边库出入库日志
///
///
[HttpPost]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:add")]
[Log(Title = "线边库出入库日志", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmLinesidebarInventoryOutboundAndInbound([FromBody] MmLinesidebarInventoryOutboundAndInboundDto parm)
{
var modal = parm.Adapt().ToCreate(HttpContext);
var response = _MmLinesidebarInventoryOutboundAndInboundService.AddMmLinesidebarInventoryOutboundAndInbound(modal);
return SUCCESS(response);
}
///
/// 更新线边库出入库日志
///
///
[HttpPut]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:edit")]
[Log(Title = "线边库出入库日志", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLinesidebarInventoryOutboundAndInbound([FromBody] MmLinesidebarInventoryOutboundAndInboundDto parm)
{
var modal = parm.Adapt().ToUpdate(HttpContext);
var response = _MmLinesidebarInventoryOutboundAndInboundService.UpdateMmLinesidebarInventoryOutboundAndInbound(modal);
return ToResponse(response);
}
///
/// 删除线边库出入库日志
///
///
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:delete")]
[Log(Title = "线边库出入库日志", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteMmLinesidebarInventoryOutboundAndInbound(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _MmLinesidebarInventoryOutboundAndInboundService.Delete(idsArr);
return ToResponse(response);
}
}
}