Selaa lähdekoodia

Merge branch 'feature/snapshot' into test

qinchaoyue 3 kuukautta sitten
vanhempi
commit
4a83cac1c4
1 muutettua tiedostoa jossa 8 lisäystä ja 5 poistoa
  1. 8 5
      src/Hotline.Api/Controllers/OrderController.cs

+ 8 - 5
src/Hotline.Api/Controllers/OrderController.cs

@@ -3579,12 +3579,15 @@ public class OrderController : BaseController
 
         if (_systemSettingCacheManager.Snapshot)
         {
-            var snapshot = await _orderSnapshotRepository.Queryable()
+            await _orderSnapshotRepository.Queryable()
                 .Where(m => m.Id == order.Id)
                 .Select(m => new { m.IndustryId, m.IndustryName })
-                .FirstAsync(HttpContext.RequestAborted);
-            dto.IndustryName = snapshot.IndustryName;
-            dto.IndustryId = snapshot.IndustryId;
+                .FirstAsync(HttpContext.RequestAborted)
+                .Then(async snapshot =>
+                {
+                    dto.IndustryName = snapshot.IndustryName;
+                    dto.IndustryId = snapshot.IndustryId;
+                });
         }
         dto.IsReTransact = await _orderSpecialRepository.Queryable()
             .Where(x => x.OrderId == dto.Id && x.SpecialType == ESpecialType.ReTransact).AnyAsync();
@@ -4997,7 +5000,7 @@ public class OrderController : BaseController
                 dto.Handler = handler;
             }
         }
-         
+
         if (oneSendBack || twoSendBack)
         {
             var sendBack = await _orderSendBackAuditRepository.Queryable()