本地远程换电 判断修改

master
lxw 6 months ago
parent 83751b84ce
commit a95b50fc38

@ -86,7 +86,7 @@ public class CarPrepareState : IState
return new StateResult() return new StateResult()
{ {
SwappingState = SwappingState.SwapCanStart SwappingState = SwappingState.CarCtrl
}; };
} }
@ -143,25 +143,34 @@ public class CarPrepareState : IState
return Invoker.Invoke("cloud check vehicle", 500, 20, machine.IsCanceled, return Invoker.Invoke("cloud check vehicle", 500, 20, machine.IsCanceled,
() => machine.CloudVelCheckFlag, () => () => machine.CloudVelCheckFlag, () =>
{ {
int vehicleCheck = -1; if (StationConstant.StationModel.Remote ==
vehicleCheck= CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder); BaseEnumExtensions.GetEnumByCode<StationConstant.StationModel>(
StaticStationInfo.StationModel))
if (vehicleCheck != 0)
{ {
_log.Info("cloud check vehicle error"); int vehicleCheck = -1;
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成"); vehicleCheck = CloudApi.VehicleCheck(machine.RfidReadModel, machine.SwapOrder);
if (vehicleCheck != 0)
{
_log.Info("cloud check vehicle error");
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
}
else
{
machine.ExceptionReason = ExceptionReason.None;
_log.Info("cloud check vehicle done");
machine.CloudVelCheckFlag = true;
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
//TODO::
// machine.SwapOrder.CloudSn=
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag,
machine);
}
} }
else else
{ {
machine.ExceptionReason = ExceptionReason.None;
_log.Info("cloud check vehicle done");
machine.CloudVelCheckFlag = true; machine.CloudVelCheckFlag = true;
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
//TODO::
// machine.SwapOrder.CloudSn=
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag,
machine);
} }
}, () => }, () =>
{ {

@ -1,8 +1,10 @@
using Entity.Constant;
using Entity.DbModel.Station; using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.AutoTask; using HybirdFrameworkCore.AutoTask;
using log4net; using log4net;
using Repository.Station; using Repository.Station;
using Service.Init;
using Service.Mgr; using Service.Mgr;
namespace Service.MyTask; namespace Service.MyTask;
@ -34,9 +36,17 @@ public class SwapOrderReportCloudTask : ITask
{ {
try try
{ {
List<SwapOrderReportCloud> list = ReportCloudRepository.QueryListByClause(i => i.CloudReportStatus == 0); if (StationConstant.StationModel.Local ==
BaseEnumExtensions.GetEnumByCode<StationConstant.StationModel>(
StaticStationInfo.StationModel))
{
return;
}
SwapOrderMgr.UploadCloud(list,1); List<SwapOrderReportCloud>
list = ReportCloudRepository.QueryListByClause(i => i.CloudReportStatus == 0);
SwapOrderMgr.UploadCloud(list, 1);
} }
catch (Exception e) catch (Exception e)
{ {

Loading…
Cancel
Save