119 lines
4.0 KiB
C#
Raw Normal View History

2025-03-21 11:14:59 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Admin.WebApi.Filters;
2025-03-21 11:23:00 +08:00
using DOAN.Model.MES.mm.line;
using DOAN.Model.MES.mm.line.Dto;
using DOAN.Service.MES.mm.line.IService;
2025-03-21 11:14:59 +08:00
//创建时间2025-03-21
2025-03-21 11:23:00 +08:00
namespace DOAN.WebApi.Controllers.MES.mm.line
2025-03-21 11:14:59 +08:00
{
/// <summary>
/// mm_line_inventory
/// </summary>
[Verify]
2025-03-21 11:23:00 +08:00
[Route("mes/materialManagement/MmLineInventory")]
2025-03-21 11:14:59 +08:00
public class MmLineInventoryController : BaseController
{
/// <summary>
/// mm_line_inventory接口
/// </summary>
private readonly IMmLineInventoryService _MmLineInventoryService;
public MmLineInventoryController(IMmLineInventoryService MmLineInventoryService)
{
_MmLineInventoryService = MmLineInventoryService;
}
/// <summary>
/// 查询mm_line_inventory列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:mmlineinventory:list")]
public IActionResult QueryMmLineInventory([FromQuery] MmLineInventoryQueryDto parm)
{
var response = _MmLineInventoryService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询mm_line_inventory详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:mmlineinventory:query")]
public IActionResult GetMmLineInventory(string Id)
{
var response = _MmLineInventoryService.GetInfo(Id);
var info = response.Adapt<MmLineInventory>();
return SUCCESS(info);
}
/// <summary>
/// 添加mm_line_inventory
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:mmlineinventory:add")]
[Log(Title = "mm_line_inventory", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmLineInventory([FromBody] MmLineInventoryDto parm)
{
var modal = parm.Adapt<MmLineInventory>().ToCreate(HttpContext);
var response = _MmLineInventoryService.AddMmLineInventory(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新mm_line_inventory
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:mmlineinventory:edit")]
[Log(Title = "mm_line_inventory", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLineInventory([FromBody] MmLineInventoryDto parm)
{
var modal = parm.Adapt<MmLineInventory>().ToUpdate(HttpContext);
var response = _MmLineInventoryService.UpdateMmLineInventory(modal);
return ToResponse(response);
}
/// <summary>
/// 删除mm_line_inventory
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:mmlineinventory:delete")]
[Log(Title = "mm_line_inventory", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteMmLineInventory(string ids)
{
2025-03-31 14:13:56 +08:00
string[] idsArr = Tools.SpitStrArrary(ids);
2025-03-21 11:14:59 +08:00
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _MmLineInventoryService.Delete(idsArr);
return ToResponse(response);
}
2025-03-31 15:56:38 +08:00
/// <summary>
/// 盘点
/// </summary>
/// <returns></returns>
[HttpGet("stocktakeLineMaterial")]
[AllowAnonymous]
public IActionResult putInLineMaterial([FromQuery] string Id, decimal newStocktakingNum)
{
var response = _MmLineInventoryService.stocktakeLineMaterial(Id, newStocktakingNum);
var info = response.Adapt<MmLineInventory>();
return SUCCESS(info);
}
}
2025-03-21 11:14:59 +08:00
}