|
|
@ -3,20 +3,44 @@ using Entity.DbModel.Station;
|
|
|
|
using log4net;
|
|
|
|
using log4net;
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
using Service.Cloud.Client;
|
|
|
|
using Service.Cloud.Msg.Cloud.Req;
|
|
|
|
using Service.Cloud.Msg.Cloud.Req;
|
|
|
|
|
|
|
|
using Service.Cloud.Msg.Cloud.Resp;
|
|
|
|
|
|
|
|
using Service.Cloud.Msg.Host.Req;
|
|
|
|
using Service.Execute.Model;
|
|
|
|
using Service.Execute.Model;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Execute.Api;
|
|
|
|
namespace Service.Execute.Api;
|
|
|
|
|
|
|
|
|
|
|
|
public class CloudApi
|
|
|
|
public class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private const int TimeSpan = 30;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 云平台车辆认证
|
|
|
|
/// 云平台车辆认证
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="rfidReadModel"></param>
|
|
|
|
/// <param name="rfidReadModel"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public static bool VehicleCheck(RfidReadModel rfidReadModel)
|
|
|
|
public static int VehicleCheck(RfidReadModel rfidReadModel, SwapOrder swapOrder)
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
VehicleCertification vehicleCertification = new()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ty = 1,
|
|
|
|
|
|
|
|
cn = rfidReadModel.VelNo,
|
|
|
|
|
|
|
|
vi = rfidReadModel.VelVin,
|
|
|
|
|
|
|
|
mac = rfidReadModel.VelMac,
|
|
|
|
|
|
|
|
en = 0,
|
|
|
|
|
|
|
|
dt = swapOrder.VehicleEnterTime,
|
|
|
|
|
|
|
|
mode = 0,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
VehicleCertificationResp? sendVehicleCertification =
|
|
|
|
|
|
|
|
CloudClientMgr.CloudClient?.SendVehicleCertification(vehicleCertification,
|
|
|
|
|
|
|
|
global::System.TimeSpan.FromSeconds(TimeSpan));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sendVehicleCertification == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return sendVehicleCertification.re;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -28,14 +52,13 @@ public class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 上报tbox数据
|
|
|
|
/// 上报车辆数据
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
|
public static void UploadTBoxCarInfo(SwapOrder swapOrder, TboxCarInfoModel model)
|
|
|
|
public static void UploadTBoxCarInfo(SwapOrder swapOrder, TboxCarInfoModel model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -46,7 +69,7 @@ public class CloudApi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return CloudClientMgr.CloudClient.CarCanStart;
|
|
|
|
return CloudClientMgr.CloudClient.CarCanStart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 清除下发的换电指令
|
|
|
|
/// 清除下发的换电指令
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -54,6 +77,6 @@ public class CloudApi
|
|
|
|
public static bool ClearCarCanStartInfo()
|
|
|
|
public static bool ClearCarCanStartInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CloudClientMgr.CloudClient.CarCanStart = null;
|
|
|
|
CloudClientMgr.CloudClient.CarCanStart = null;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|