2024-04-26 11:22:33 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using ZR.Model.Dto;
|
|
|
|
|
|
using ZR.Service.Business.IBusinessService;
|
|
|
|
|
|
using ZR.Admin.WebApi.Extensions;
|
|
|
|
|
|
using ZR.Admin.WebApi.Filters;
|
|
|
|
|
|
using ZR.Model.MES.wms.Dto;
|
|
|
|
|
|
using ZR.Service.mes.wms.IService;
|
|
|
|
|
|
using ZR.Model.MES.wms;
|
2024-04-26 15:19:57 +08:00
|
|
|
|
using ZR.Model;
|
2024-04-26 11:22:33 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-04-26
|
|
|
|
|
|
namespace ZR.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 仓库批量查询综合接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
// [Verify]
|
|
|
|
|
|
[Route("/mes/wm/WmGoodsBatchSearch")]
|
|
|
|
|
|
public class WmGoodsBatchSearchController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 仓库操作
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IWmGoodsBatchSearchService _wmGoodsBatchSearchService;
|
|
|
|
|
|
|
|
|
|
|
|
public WmGoodsBatchSearchController(IWmGoodsBatchSearchService wmGoodsBatchSearchService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_wmGoodsBatchSearchService = wmGoodsBatchSearchService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 根据查询条件聚合批量查询出库数据,并生成树列表数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2024-04-26 17:59:59 +08:00
|
|
|
|
[HttpPost("getBatchTreeTableData")]
|
2024-04-26 11:22:33 +08:00
|
|
|
|
[Log(Title = "根据查询条件聚合批量查询出库数据,并生成树列表数据", BusinessType = BusinessType.QUERY)]
|
2024-04-26 17:59:59 +08:00
|
|
|
|
public IActionResult GetBatchTreeTableData([FromBody] WmGoodsBatchSearchDto parm)
|
2024-04-26 11:22:33 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (parm is null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException(nameof(parm));
|
|
|
|
|
|
}
|
2024-04-26 15:19:57 +08:00
|
|
|
|
PagedInfo<WmGoodsBatchTableDto> result = null;
|
2024-04-26 17:59:59 +08:00
|
|
|
|
// 入库
|
|
|
|
|
|
if (parm.Category == 1)
|
2024-04-26 11:22:33 +08:00
|
|
|
|
{
|
2024-04-26 17:59:59 +08:00
|
|
|
|
// 按批次号
|
|
|
|
|
|
// 树父列表
|
|
|
|
|
|
if (parm.Model == 1 && parm.Type == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchNowProductionByPackageCodeShort(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 树子列表
|
|
|
|
|
|
else if (parm.Model == 1 && parm.Type == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchNowProductionTreeLazyByPackageCodeShort(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 按零件号
|
|
|
|
|
|
else if (parm.Model == 2 && parm.Type == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchNowProductionByPartnumber(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (parm.Model == 2 && parm.Type == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchNowProductionTreeLazyByPartnumber(parm);
|
|
|
|
|
|
}
|
2024-04-26 11:22:33 +08:00
|
|
|
|
}
|
2024-04-26 17:59:59 +08:00
|
|
|
|
// 出库
|
|
|
|
|
|
else if (parm.Category == 2)
|
2024-04-26 11:22:33 +08:00
|
|
|
|
{
|
2024-04-26 17:59:59 +08:00
|
|
|
|
// 按批次号
|
|
|
|
|
|
// 树父列表
|
|
|
|
|
|
if (parm.Model == 1 && parm.Type == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordByPackageCodeShort(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 树子列表
|
|
|
|
|
|
else if (parm.Model == 1 && parm.Type == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordTreeLazyByPackageCodeShort(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
// 按零件号
|
|
|
|
|
|
else if (parm.Model == 2 && parm.Type == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordByPartnumber(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (parm.Model == 2 && parm.Type == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordTreeLazyByPartnumber(parm);
|
|
|
|
|
|
}
|
2024-04-29 17:00:38 +08:00
|
|
|
|
// 按出库单号
|
|
|
|
|
|
else if (parm.Model == 3 && parm.Type == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordByShipmentNum(parm);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (parm.Model == 3 && parm.Type == 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = _wmGoodsBatchSearchService.GetBatchOutRecordTreeLazyByShipmentNum(parm);
|
|
|
|
|
|
}
|
2024-04-26 11:22:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (result is null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(new ApiResult(500, "数据获取异常", result));
|
|
|
|
|
|
}
|
|
|
|
|
|
return ToResponse(new ApiResult(200, "ok", result));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|