| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO.CalcOut; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | object lockObj = new object(); |
| | | |
| | | [HttpPost, Route("CompleteOutboundWithBarcode"), AllowAnonymous] |
| | | public WebResponseContent CompleteOutboundWithBarcode([FromBody] OutboundCompleteRequestDTO request) |
| | | { |
| | | try |
| | | { |
| | | if (!ModelState.IsValid) |
| | | return WebResponseContent.Instance.Error(string.Join("; ", ModelState.Values |
| | | .SelectMany(v => v.Errors) |
| | | .Select(e => e.ErrorMessage))); |
| | | lock (lockObj) |
| | | { |
| | | if (!ModelState.IsValid) |
| | | return WebResponseContent.Instance.Error(string.Join("; ", ModelState.Values |
| | | .SelectMany(v => v.Errors) |
| | | .Select(e => e.ErrorMessage))); |
| | | |
| | | return _outboundService.CompleteOutboundWithBarcode(request); |
| | | return _outboundService.CompleteOutboundWithBarcode(request); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"鍑哄簱鎵弿鎿嶄綔澶辫触: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, Route("CompleteOutboundWithPallet"), AllowAnonymous] |
| | | public WebResponseContent CompleteOutboundWithPallet([FromBody] OutboundCompletePalletRequestDTO request) |
| | | { |
| | | try |
| | | { |
| | | lock (lockObj) |
| | | { |
| | | if (!ModelState.IsValid) |
| | | return WebResponseContent.Instance.Error(string.Join("; ", ModelState.Values |
| | | .SelectMany(v => v.Errors) |
| | | .Select(e => e.ErrorMessage))); |
| | | |
| | | return _outboundService.CompleteOutboundWithPallet(request); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error($"鏁寸鍑哄簱鎿嶄綔澶辫触: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return _outboundService.QueryPickedList(orderNo, palletCode); |
| | | } |
| | | |
| | | [HttpPost, Route("EmptyBox"), AllowAnonymous] |
| | | public async Task<WebResponseContent> EmptyBox([FromBody] ReturnToWarehouseDTO returnToWarehouse) |
| | | { |
| | | return await _outboundService.EmptyBox(returnToWarehouse.palletCode); |
| | | } |
| | | |
| | | [HttpPost, Route("ReturnToWarehouse"), AllowAnonymous] |
| | | public async Task<WebResponseContent> ReturnToWarehouse([FromBody]ReturnToWarehouseDTO returnToWarehouse) |
| | | { |
| | | return await _outboundService.ReturnToWarehouse(returnToWarehouse.palletCode, returnToWarehouse.orderNo, returnToWarehouse.station); |
| | | } |
| | | } |
| | | } |