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 { /// /// /// public partial class WMSController : ControllerBase { private static readonly object _locker = new object(); private static readonly object _locker1 = new object(); /// /// 存储T100推送过来的其他出库单信息 /// /// [HttpPost] [Route("api/[controller]/OthOutInfo/SaveData")] public IActionResult OthOutInfo([FromBody] List input) { ApiAction response = new(); try { response = response.GetResponse(_otherBus.SaveOthOutInfo(input)); } catch (Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 存储T100传递过来的调拨单信息 /// /// /// [HttpPost] [Route("api/[controller]/TrasferInfo/SaveData")] public IActionResult TrasferInfo([FromBody] List input) { ApiAction response = new(); try { response = response.GetResponse(_trasferBus.SaveTrasferInfo(input)); } catch (Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 从T100获取物料库存信息 /// /// /// [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); } /// /// SMT退料——对接MES /// /// /// [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); } /// /// 成品入库——对接T100过账接口 /// /// /// [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); } /// /// 成品入库——对接T100,存储T100推送过来的表头表身数据 /// /// /// [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); } /// /// 成品入库 /// /// /// [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); } /// /// 成品入库结果查询 /// /// /// [HttpPost] [Route("api/[controller]/ProductInput/GetProdctResult")] public Task> ProductInputResultData([FromBody] ProductInputResultDTO input) { return _inputBus.GetProductInputResultInfoAsync(input); } /// /// 成品入库状态复原 /// /// /// [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); } /// /// 成品出库 /// /// /// [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); } /// /// 成品分合箱 /// /// /// [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); } /// /// 成品门重工 /// /// /// [HttpPost] [Route("api/[controller]/Rework/ReworkData")] public IActionResult ReworkData([FromBody] List input) { ApiAction response = new(); try { lock (_locker1) { response = response.GetResponse(_reworkBux.ReworkData(input)); } } catch (Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } }