From 4ce092fc322e4f2ee1545089930fa8a61622c271 Mon Sep 17 00:00:00 2001 From: CZ Date: Sat, 15 Jun 2024 13:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=20=E6=8D=A2=E7=94=B5?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E9=87=8D=E7=BD=AE=E4=BA=86=E4=BA=91=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=B8=8A=E6=8A=A5=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Execute/Mgr/CommonMgr.cs | 2 ++ Service/Execute/Step/CancelState.cs | 5 +++-- Service/Execute/Step/ManualSuccState.cs | 5 +++-- Service/Mgr/SwapOrderMgr.cs | 7 +++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index 3528001..5c1e9b7 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -203,6 +203,8 @@ public class CommonMgr /// public void UpdateSwapOrder(SwappingStateMachine machine) { + SwapOrder swapOrder = _swapOrderRepository.QueryById(machine.SwapOrder.Id); + machine.SwapOrder.CloudReportStatus = swapOrder.CloudReportStatus; _swapOrderRepository.Update(machine.SwapOrder); } diff --git a/Service/Execute/Step/CancelState.cs b/Service/Execute/Step/CancelState.cs index a36ce40..bfa31d7 100644 --- a/Service/Execute/Step/CancelState.cs +++ b/Service/Execute/Step/CancelState.cs @@ -4,13 +4,14 @@ using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac; using log4net; using Repository.Station; +using Service.Execute.Utils; using Service.Mgr; namespace Service.Execute.Step; public class CancelState : IState { - private readonly SwapOrderRepository _swapOrderRepository = AppInfo.Container.Resolve(); + private readonly CommonMgr _CommonMgr = AppInfo.Container.Resolve(); private readonly SwapAmtOrderRepository _swapAmtOrderRepository = AppInfo.Container.Resolve(); @@ -37,7 +38,7 @@ public class CancelState : IState if (machine.SwapOrder != null) { machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Fail; - _swapOrderRepository.Update(machine.SwapOrder); + _CommonMgr.UpdateSwapOrder(machine); } _manualOperationRecordRepository.Insert(new ManualOperationRecord() diff --git a/Service/Execute/Step/ManualSuccState.cs b/Service/Execute/Step/ManualSuccState.cs index 91ad0e6..be10007 100644 --- a/Service/Execute/Step/ManualSuccState.cs +++ b/Service/Execute/Step/ManualSuccState.cs @@ -4,6 +4,7 @@ using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac; using log4net; using Repository.Station; +using Service.Execute.Utils; using Service.Mgr; namespace Service.Execute.Step; @@ -13,11 +14,11 @@ namespace Service.Execute.Step; /// public class ManualSuccState : IState { - private readonly SwapOrderRepository _swapOrderRepository = AppInfo.Container.Resolve(); private readonly SwapAmtOrderRepository _swapAmtOrderRepository = AppInfo.Container.Resolve(); + private readonly CommonMgr _CommonMgr = AppInfo.Container.Resolve(); private static readonly ILog _log = LogManager.GetLogger(typeof(CancelState)); private static readonly ManualOperationRecordRepository _manualOperationRecordRepository = AppInfo.Container.Resolve(); @@ -37,7 +38,7 @@ public class ManualSuccState : IState { machine.SwapOrder.SwapResult = (byte)InfoEnum.SwapOrderResult.Success; machine.SwapOrder.VehicleLeaveTime = DateTime.Now; - _swapOrderRepository.Update(machine.SwapOrder); + _CommonMgr.UpdateSwapOrder(machine); } _manualOperationRecordRepository.Insert(new ManualOperationRecord() diff --git a/Service/Mgr/SwapOrderMgr.cs b/Service/Mgr/SwapOrderMgr.cs index 967544a..7c24e6a 100644 --- a/Service/Mgr/SwapOrderMgr.cs +++ b/Service/Mgr/SwapOrderMgr.cs @@ -78,16 +78,19 @@ public class SwapOrderMgr { swapOrder.CloudReportStatus = 1; updateDbOrder.Add(swapOrder); - value.CloudReportStatus = 1000; value.UploadTime = DateTime.Now; - updateDbCloudReport.Add(value); + + } else { //当 cloudReportStatus >=100 就不需要上传了 value.CloudReportStatus++; + } + updateDbCloudReport.Add(value); + } if (updateDbOrder.Count > 0)