From 68389acdc272b78f1cc4d80180d4650e6254edcf Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期三, 17 十二月 2025 17:04:59 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs"
index dab5a3a..8535a25 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundController.cs"
@@ -40,17 +40,22 @@
             }
         }
 
+        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)
             {

--
Gitblit v1.9.3