zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/MES/mm/line_sider/MmLinesidebarInventoryCheckController.cs
qianhao.xu c10ccd7310 校正
2024-11-18 14:43:41 +08:00

82 lines
2.4 KiB
C#

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;
using MapsterMapper;
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 线边库盘点
/// </summary>
[Verify]
[Route("mes/materialManagement/MmLinesidebarInventoryCheck")]
public class MmLinesidebarInventoryCheckController: BaseController
{
private readonly IMmLinesidebarInventoryCheckService _mmLinesidebarInventoryCheckService;
public MmLinesidebarInventoryCheckController(IMmLinesidebarInventoryCheckService mmLinesidebarInventoryCheckService)
{
this._mmLinesidebarInventoryCheckService = mmLinesidebarInventoryCheckService;
}
//TODO 查询盘点记录
[HttpGet("list")]
public IActionResult QueryMmLinesidebarInventory([FromQuery] MmInventoryCheckLogQueryDto parm)
{
var response = _mmLinesidebarInventoryCheckService.GetList(parm);
return SUCCESS(response);
}
//TODO 获取盘点详情
[HttpGet("get_detail")]
public IActionResult GetDetail(string id)
{
if(string.IsNullOrEmpty(id)) throw new CustomException("id is empty");
var response = _mmLinesidebarInventoryCheckService.GetDetail(id);
return SUCCESS(response);
}
//TODO 校正
[HttpGet("correcting")]
public IActionResult Correcting(string ids)
{
string[] idsArr = Tools.SpitStrArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _mmLinesidebarInventoryCheckService.Correcting(idsArr);
return SUCCESS(response);
}
//TODO 修改 用于填写实际数量,和异常原因备注
[HttpPut]
[Log(Title = "线边库库存盘点", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLinesidebarInventoryCheck([FromBody] MmInventoryCheckLogDto parm)
{
var modal = parm.Adapt<MmInventoryCheckLog>().ToUpdate(HttpContext);
var response = _mmLinesidebarInventoryCheckService.UpdateMmInventoryCheckLog(modal);
return ToResponse(response);
}
}
}