From 7069549e172944909b5d900ea6b676f2a99092b9 Mon Sep 17 00:00:00 2001 From: lxw Date: Tue, 11 Jun 2024 17:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=9B=E9=BB=9E=E4=B8=BB=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=9B=B4=E8=A9=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Execute/Api/CloudApi.cs | 9 +++------ Service/Execute/Mgr/CommonMgr.cs | 2 ++ Service/Execute/Step/CarPrepareState.cs | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Service/Execute/Api/CloudApi.cs b/Service/Execute/Api/CloudApi.cs index 6379679..09111d0 100644 --- a/Service/Execute/Api/CloudApi.cs +++ b/Service/Execute/Api/CloudApi.cs @@ -22,7 +22,7 @@ public abstract class CloudApi /// /// /// - public static int VehicleCheck(RfidReadModel rfidReadModel, SwapOrder swapOrder) + public static VehicleCertificationResp? VehicleCheck(RfidReadModel rfidReadModel, SwapOrder swapOrder) { VehicleCertification vehicleCertification = new() @@ -45,12 +45,9 @@ public abstract class CloudApi Log.Info( $" CloudApi VehicleCheck SendVehicleCertification resp={JsonConvert.SerializeObject(sendVehicleCertification)}"); - if (sendVehicleCertification == null) - { - return -1; - } + - return sendVehicleCertification.re; + return sendVehicleCertification; } /// diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index 139d8e5..5a95fa2 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -49,6 +49,8 @@ public class CommonMgr { swapOrder.SwapWay = (int)StationConstant.StationWay.Auto; swapOrder.CloudReportStatus = 0; + swapOrder.SwapWay = 1; + swapOrder.CreatedTime=DateTime.Now; _swapOrderRepository.Insert(swapOrder); return swapOrder; } diff --git a/Service/Execute/Step/CarPrepareState.cs b/Service/Execute/Step/CarPrepareState.cs index 56ec08a..9b00f0c 100644 --- a/Service/Execute/Step/CarPrepareState.cs +++ b/Service/Execute/Step/CarPrepareState.cs @@ -7,6 +7,7 @@ using Entity.Dto; using HybirdFrameworkCore.Autofac; using log4net; using Repository.Station; +using Service.Cloud.Msg.Cloud.Resp; using Service.Execute.Api; using Service.Execute.Model; using Service.Execute.StaticTools; @@ -147,10 +148,9 @@ public class CarPrepareState : IState BaseEnumExtensions.GetEnumByCode( StaticStationInfo.StationModel)) { - int vehicleCheck = -1; - vehicleCheck = CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder); + VehicleCertificationResp? vehicleCertificationResp = CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder); - if (vehicleCheck != 0) + if (vehicleCertificationResp==null || vehicleCertificationResp.re!=0) { _log.Info("cloud check vehicle error"); // machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成"); @@ -162,8 +162,7 @@ public class CarPrepareState : IState machine.CloudVelCheckFlag = true; // machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成"); - //TODO:: - // machine.SwapOrder.CloudSn= + machine.SwapOrder.CloudSn = vehicleCertificationResp.on; _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag, machine); }