zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/MES/mm/line_sider/MmLinesidebarInventoryOutboundAndInboundController.cs
2024-11-16 11:04:07 +08:00

106 lines
4.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
{
/// <summary>
/// 线边库出入库日志
/// </summary>
[Verify]
[Route("mes/materialManagement/MmLinesidebarInventoryOutboundAndInbound")]
public class MmLinesidebarInventoryOutboundAndInboundController : BaseController
{
/// <summary>
/// 线边库出入库日志接口
/// </summary>
private readonly IMmLinesidebarInventoryOutboundAndInboundService _MmLinesidebarInventoryOutboundAndInboundService;
public MmLinesidebarInventoryOutboundAndInboundController(IMmLinesidebarInventoryOutboundAndInboundService MmLinesidebarInventoryOutboundAndInboundService)
{
_MmLinesidebarInventoryOutboundAndInboundService = MmLinesidebarInventoryOutboundAndInboundService;
}
/// <summary>
/// 查询线边库出入库日志列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:list")]
public IActionResult QueryMmLinesidebarInventoryOutboundAndInbound([FromQuery] MmLinesidebarInventoryOutboundAndInboundQueryDto parm)
{
var response = _MmLinesidebarInventoryOutboundAndInboundService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询线边库出入库日志详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:query")]
public IActionResult GetMmLinesidebarInventoryOutboundAndInbound(string Id)
{
var response = _MmLinesidebarInventoryOutboundAndInboundService.GetInfo(Id);
var info = response.Adapt<MmLinesidebarInventoryOutboundAndInbound>();
return SUCCESS(info);
}
/// <summary>
/// 添加线边库出入库日志
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:add")]
[Log(Title = "线边库出入库日志", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmLinesidebarInventoryOutboundAndInbound([FromBody] MmLinesidebarInventoryOutboundAndInboundDto parm)
{
var modal = parm.Adapt<MmLinesidebarInventoryOutboundAndInbound>().ToCreate(HttpContext);
var response = _MmLinesidebarInventoryOutboundAndInboundService.AddMmLinesidebarInventoryOutboundAndInbound(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新线边库出入库日志
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "materialManagement:mmlinesidebarinventoryoutboundandinbound:edit")]
[Log(Title = "线边库出入库日志", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLinesidebarInventoryOutboundAndInbound([FromBody] MmLinesidebarInventoryOutboundAndInboundDto parm)
{
var modal = parm.Adapt<MmLinesidebarInventoryOutboundAndInbound>().ToUpdate(HttpContext);
var response = _MmLinesidebarInventoryOutboundAndInboundService.UpdateMmLinesidebarInventoryOutboundAndInbound(modal);
return ToResponse(response);
}
/// <summary>
/// 删除线边库出入库日志
/// </summary>
/// <returns></returns>
[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);
}
}
}