总里程上报云端

master
lxw 5 months ago
parent 743e41c8f2
commit 4b0e88efbd

@ -145,7 +145,7 @@ namespace Service.Cloud.Msg.Host.Req
/// 车朝总里程
/// 单位:kWh, 保留两位小数
/// </summary>
public float vtm { get; set; }
public float? vtm { get; set; }
/// <summary>
/// 车制累计换电次数
/// </summary>

@ -57,7 +57,8 @@ public abstract class CloudApi
/// <param name="rfidReadModel"></param>
/// <param name="swapOrder"></param>
/// <returns></returns>
public static int UploadSwapOrder(SwapOrder swapOrder, int seq, SwapOrderBattery swapOrderBattery, int uploadType)
public static int UploadSwapOrder(SwapOrder swapOrder, int seq, SwapOrderBattery swapOrderBattery, int uploadType
,SwapOrderReportCloud orderReportCloud)
{
UploadSwapOrder uploadSwapOrder = new()
@ -86,6 +87,7 @@ public abstract class CloudApi
vin = swapOrder.VehicleVin,
wt = new TimeSpan((swapOrder.SwapEndTime.ToDateTime().Ticks - swapOrder.SwapBeginTime.ToDateTime().Ticks))
.TotalSeconds.ToInt(),
vtm=orderReportCloud.Vtm,
};
Log.Info(
$" CloudApi UploadSwapOrder seq={seq} SendUploadPowerChangeOrder param={JsonConvert.SerializeObject(uploadSwapOrder)}");

@ -267,12 +267,14 @@ 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
Vin = machineSwapOrder.VehicleVin,
Vtm = Convert.ToSingle(machine.BoxCarInfoModel?.ElecMsg?.TotalMile),
});
}
}
Loading…
Cancel
Save