2024-11-16 11:04:07 +08:00
|
|
|
|
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-18 09:50:07 +08:00
|
|
|
|
using Infrastructure.Converter;
|
2024-11-16 11:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间: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)
|
|
|
|
|
|
{
|
2024-11-18 09:50:07 +08:00
|
|
|
|
parm.SearchDate=DOANConvertDateTime.ConvertLocalDate(parm.SearchDate);
|
2024-11-16 11:04:07 +08:00
|
|
|
|
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)
|
|
|
|
|
|
{
|
2024-11-18 09:50:07 +08:00
|
|
|
|
string[] idsArr = Tools.SpitStrArrary(ids);
|
2024-11-16 11:04:07 +08:00
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
|
|
|
|
|
var response = _MmLinesidebarInventoryService.Delete(idsArr);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|