using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
|
using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
|
using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks;
|
using CMS.Plugin.HIAWms.Application.Contracts.Services;
|
using CmsQueryExtensions.Entitys;
|
using Microsoft.AspNetCore.Mvc;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace CMS.Plugin.HIAWms.Controller
|
{
|
[ApiController]
|
[TypeFilter(typeof(CMSLanguageFilter))]
|
[TypeFilter(typeof(CMSUowActionFilter))]
|
[TypeFilter(typeof(CMSAuditActionFilter))]
|
[TypeFilter(typeof(CMSExceptionFilter))]
|
[Route("api/v{version:apiVersion}/HIAWms/[controller]")]
|
public class LMesOperateController : ControllerBase
|
{
|
private readonly ILMesOperateAppService _mesOperateAppService;
|
private readonly IWmsMaterialStockAppService _wmsmaterialstockAppService;
|
|
public LMesOperateController(ILMesOperateAppService mesOperateAppService, IWmsMaterialStockAppService wmsmaterialstockAppService)
|
{
|
_mesOperateAppService = mesOperateAppService;
|
_wmsmaterialstockAppService = wmsmaterialstockAppService;
|
}
|
|
/// <summary>
|
/// LMes叫料
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("LMesCallMaterial")]
|
public async Task<CmsApiResponse<List<CallMaterialOutput>>> LMesCallMaterialAsync(List<LMesCallMaterialInput> input)
|
{
|
try
|
{
|
var list = await _mesOperateAppService.LMesCallMaterialAsync(input);
|
return new CmsApiResponse<List<CallMaterialOutput>>()
|
{
|
Data = list,
|
Code = 200,
|
Message = "LMes叫料成功"
|
};
|
}
|
catch (Exception ex)
|
{
|
//throw; //不要抛出异常,否则对方会接收失败呢
|
return new CmsApiResponse<List<CallMaterialOutput>>()
|
{
|
Data = null,
|
Code = 500,
|
Message = ex.Message
|
};
|
}
|
|
}
|
|
|
/// <summary>
|
/// LMes组盘
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("LMesPick")]
|
public async Task<CmsApiResponse<WmsMaterialStockDto>> LMesPickAsync([FromBody] WmsMaterialStockCreateDto input)
|
{
|
try
|
{
|
var list = await _wmsmaterialstockAppService.CreateAsync(input);
|
return new CmsApiResponse<WmsMaterialStockDto>()
|
{
|
Data = list,
|
Code = 200,
|
Message = "LMes组盘成功"
|
};
|
}
|
catch (Exception ex)
|
{
|
//throw; //不要抛出异常,否则对方会接收失败呢
|
return new CmsApiResponse<WmsMaterialStockDto>()
|
{
|
Data = null,
|
Code = 500,
|
Message = ex.Message
|
};
|
}
|
|
}
|
}
|
}
|