using Microsoft.AspNetCore.Mvc;
using DOAN.Model.BZFM.Dto;
using DOAN.Model.BZFM;
using DOAN.Service.BZFM.IBZFMService;
using DOAN.Admin.WebApi.Filters;
//创建时间:2025-12-24
namespace DOAN.Admin.WebApi.Controllers.BZFM
{
///
/// 库存表
///
[Verify]
[Route("mes/productionMaterial/MmInventory")]
public class MmInventoryController : BaseController
{
///
/// 库存表接口
///
private readonly IMmInventoryService _MmInventoryService;
public MmInventoryController(IMmInventoryService MmInventoryService)
{
_MmInventoryService = MmInventoryService;
}
///
/// 查询库存表列表
///
///
///
[HttpGet("list")]
[ActionPermissionFilter(Permission = "mminventory:list")]
public IActionResult QueryMmInventory([FromQuery] MmInventoryQueryDto parm)
{
var response = _MmInventoryService.GetList(parm);
return SUCCESS(response);
}
///
/// 查询库存表详情
///
///
///
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "mminventory:query")]
public IActionResult GetMmInventory(int Id)
{
var response = _MmInventoryService.GetInfo(Id);
var info = response.Adapt();
return SUCCESS(info);
}
///
/// 添加库存表
///
///
[HttpPost]
[ActionPermissionFilter(Permission = "mminventory:add")]
[Log(Title = "库存表", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmInventory([FromBody] MmInventoryDto parm)
{
var modal = parm.Adapt().ToCreate(HttpContext);
var response = _MmInventoryService.AddMmInventory(modal);
return SUCCESS(response);
}
///
/// 更新库存表
///
///
[HttpPut]
[ActionPermissionFilter(Permission = "mminventory:edit")]
[Log(Title = "库存表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmInventory([FromBody] MmInventoryDto parm)
{
var modal = parm.Adapt().ToUpdate(HttpContext);
var response = _MmInventoryService.UpdateMmInventory(modal);
return ToResponse(response);
}
///
/// 删除库存表
///
///
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "mminventory:delete")]
[Log(Title = "库存表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteMmInventory([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert(ids);
return ToResponse(_MmInventoryService.Delete(idArr));
}
}
}