From ef0e003a819cafd87d5ca118ce00985e5492ce37 Mon Sep 17 00:00:00 2001 From: lxw Date: Tue, 28 May 2024 21:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8D=A2=E7=94=B5=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E4=B8=8A=E6=8A=A5=E4=BA=91=E5=B9=B3=E5=8F=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Execute/Mgr/CommonMgr.cs | 18 ++++++++++++++++++ Service/Execute/Step/SwapDoneState.cs | 8 +++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index ba29432..1af1346 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -21,6 +21,8 @@ public class CommonMgr public BinInfoRepository _binInfoRepository { get; set; } public SwapAmtOrderRepository _amtOrderRepository { get; set; } public SwapOrderBatteryRepository _swapOrderBatteryRepository { get; set; } + + public SwapOrderReportCloudRepository _swapOrderReportCloudRepository { get; set; } /// /// 新增小步状态 @@ -233,5 +235,21 @@ public class CommonMgr } } + + /// + /// 换电完成新增上报云平台记录 + /// + /// + public void InsertCloudReportForSwapSuccess(SwappingStateMachine machine) + { + SwapOrder? machineSwapOrder = machine.SwapOrder; + _swapOrderReportCloudRepository.Insert(new SwapOrderReportCloud() + { + SwapOrderSn = machineSwapOrder.Sn, + SwapOrderId = machineSwapOrder.Id, + CloudReportStatus = 0, + Vin = machineSwapOrder.VehicleVin + }); + } } \ No newline at end of file diff --git a/Service/Execute/Step/SwapDoneState.cs b/Service/Execute/Step/SwapDoneState.cs index f88b64b..2e16866 100644 --- a/Service/Execute/Step/SwapDoneState.cs +++ b/Service/Execute/Step/SwapDoneState.cs @@ -37,7 +37,7 @@ public class SwapDoneState : IState { //上传云平台换电状态 machine.BusinessSwappingForCloudState = InfoEnum.BusinessSwappingForCloudState.SwapDoneWithVel; - // CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState); + // CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState); } //云平台没有匹配的失败状态 @@ -56,9 +56,11 @@ public class SwapDoneState : IState return SwappingStateMachine.ReturnWithInvokeErr(existRadar, ExceptionReason.None); } + //新增换电成功上报云平台数据 + _CommonMgr.InsertCloudReportForSwapSuccess(machine); //换电成功关于bininfo表的更新 _CommonMgr.UpdateBinInfoForSwapSuccess(machine); - + return new StateResult() { SwappingState = SwappingState.StationReady @@ -102,7 +104,7 @@ public class SwapDoneState : IState } }, () => { - // machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed()); + // machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed()); SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrLockCar); }, false, () => { machine.ExceptionReason = ExceptionReason.LockCarError; } , 10, InvokeStatus.None);