zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/MES/mm/line_sider/MmLinesidebarInventoryController.cs
2024-11-18 09:50:07 +08:00

108 lines
3.8 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;
using Infrastructure.Converter;
//创建时间2024-11-16
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 线边库库存
/// </summary>
[Verify]
[Route("mes/materialManagement/MmLinesidebarInventory")]
public class MmLinesidebarInventoryController : BaseController
{
/// <summary>
/// 线边库库存接口
/// </summary>
private readonly IMmLinesidebarInventoryService _MmLinesidebarInventoryService;
public MmLinesidebarInventoryController(IMmLinesidebarInventoryService MmLinesidebarInventoryService)
{
_MmLinesidebarInventoryService = MmLinesidebarInventoryService;
}
/// <summary>
/// 查询线边库库存列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:mmlinesidebarinventory:list")]
public IActionResult QueryMmLinesidebarInventory([FromQuery] MmLinesidebarInventoryQueryDto parm)
{
parm.SearchDate=DOANConvertDateTime.ConvertLocalDate(parm.SearchDate);
var response = _MmLinesidebarInventoryService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询线边库库存详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:mmlinesidebarinventory:query")]
public IActionResult GetMmLinesidebarInventory(string Id)
{
var response = _MmLinesidebarInventoryService.GetInfo(Id);
var info = response.Adapt<MmLinesidebarInventory>();
return SUCCESS(info);
}
/// <summary>
/// 添加线边库库存
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:mmlinesidebarinventory:add")]
[Log(Title = "线边库库存", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmLinesidebarInventory([FromBody] MmLinesidebarInventoryDto parm)
{
var modal = parm.Adapt<MmLinesidebarInventory>().ToCreate(HttpContext);
var response = _MmLinesidebarInventoryService.AddMmLinesidebarInventory(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新线边库库存
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:mmlinesidebarinventory:edit")]
[Log(Title = "线边库库存", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLinesidebarInventory([FromBody] MmLinesidebarInventoryDto parm)
{
var modal = parm.Adapt<MmLinesidebarInventory>().ToUpdate(HttpContext);
var response = _MmLinesidebarInventoryService.UpdateMmLinesidebarInventory(modal);
return ToResponse(response);
}
/// <summary>
/// 删除线边库库存
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:mmlinesidebarinventory:delete")]
[Log(Title = "线边库库存", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteMmLinesidebarInventory(string ids)
{
string[] idsArr = Tools.SpitStrArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _MmLinesidebarInventoryService.Delete(idsArr);
return ToResponse(response);
}
}
}