1
huangxiaoqiang
2025-12-18 9753fb2756f6b4e30ff79d901a7bb86145517c8b
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_DTO.CalcOut;
@@ -40,21 +41,47 @@
            }
        }
        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}");
            }
        }
@@ -69,5 +96,17 @@
        {
            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);
        }
    }
}