using Apache.NMS.ActiveMQ.Commands;
|
using Microsoft.AspNetCore.Mvc;
|
using Rhea.Common;
|
using System;
|
using System.Collections.Generic;
|
using System.Threading.Tasks;
|
using Tiger.IBusiness;
|
using Tiger.Model.Entitys.MES;
|
using Tiger.Model.Entitys.WMS.DTOS;
|
|
namespace Tiger.Api.Controllers.WMS
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public partial class WMSController : ControllerBase
|
{
|
private static readonly object _locker = new object();
|
private static readonly object _locker1 = new object();
|
|
/// <summary>
|
/// 存储T100推送过来的其他出库单信息
|
/// </summary>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/OthOutInfo/SaveData")]
|
public IActionResult OthOutInfo([FromBody] List<otherOutInfoDTO> input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_otherBus.SaveOthOutInfo(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 存储T100传递过来的调拨单信息
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/TrasferInfo/SaveData")]
|
public IActionResult TrasferInfo([FromBody] List<TrasferInfoDTO> input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_trasferBus.SaveTrasferInfo(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 从T100获取物料库存信息
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/StockInfo/GetData")]
|
public IActionResult SaleOutInfo([FromBody] StockInputDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_stockBus.GetStockInfo(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// SMT退料——对接MES
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/Product/SMTReturnFormMES")]
|
public IActionResult SMTReturnFormMES([FromBody] SMTReturnDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_inputBus.SMTReturnFormMES(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品入库——对接T100过账接口
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductInput/PostingToT100")]
|
public IActionResult ProductInputPostingToT100([FromBody] ProductInputDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_inputBus.GetProductInputPostingToT100(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品入库——对接T100,存储T100推送过来的表头表身数据
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductInput/SaveDataFormT100")]
|
public IActionResult ProductInputSaveDataFormT100([FromBody] ProduceInputDataDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_inputBus.GetProductInputInfoFromT100(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品入库
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductInput/Save")]
|
public IActionResult ProductInputSaveData([FromBody] ProductInputDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
lock (_locker)
|
{
|
response = response.GetResponse(_inputBus.GetProductInputInfo(input));
|
}
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品入库结果查询
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductInput/GetProdctResult")]
|
public Task<List<C_Stock_Pallet_T>> ProductInputResultData([FromBody] ProductInputResultDTO input)
|
{
|
return _inputBus.GetProductInputResultInfoAsync(input);
|
}
|
|
/// <summary>
|
/// 成品入库状态复原
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductInput/StatusRestored")]
|
public IActionResult ProductInputStatusRestored([FromBody] ProductInputResultDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_inputBus.ProductInputStatusRestoredAsync(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品出库
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/ProductOutput/Save")]
|
public IActionResult ProductOutputSaveData([FromBody] ProductOutputDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_outputBus.GetProductOutputInfo(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品分合箱
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/SplitBox/Save")]
|
public IActionResult SplitBoxSaveData([FromBody] SplitBoxDTO input)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(_boxBus.SaveSplitBoxData(input));
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 成品门重工
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/Rework/ReworkData")]
|
public IActionResult ReworkData([FromBody] List<string> input)
|
{
|
ApiAction response = new();
|
try
|
{
|
lock (_locker1)
|
{
|
response = response.GetResponse(_reworkBux.ReworkData(input));
|
}
|
}
|
catch (Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
}
|
}
|