diff --git a/Service/Cloud/Msg/Host/Req/UploadSwapOrder.cs b/Service/Cloud/Msg/Host/Req/UploadSwapOrder.cs
index 776f6e5..8eec39a 100644
--- a/Service/Cloud/Msg/Host/Req/UploadSwapOrder.cs
+++ b/Service/Cloud/Msg/Host/Req/UploadSwapOrder.cs
@@ -145,7 +145,7 @@ namespace Service.Cloud.Msg.Host.Req
/// 车朝总里程
/// 单位:kWh, 保留两位小数
///
- public float vtm { get; set; }
+ public float? vtm { get; set; }
///
/// 车制累计换电次数
///
diff --git a/Service/Execute/Api/CloudApi.cs b/Service/Execute/Api/CloudApi.cs
index d36fdff..3719a1d 100644
--- a/Service/Execute/Api/CloudApi.cs
+++ b/Service/Execute/Api/CloudApi.cs
@@ -57,7 +57,8 @@ public abstract class CloudApi
///
///
///
- 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()
@@ -72,7 +73,7 @@ public abstract class CloudApi
dbid = swapOrderBattery.UpBatteryNo,
deno = swapOrderBattery.UpBatteryBinNo,
dsoc = swapOrderBattery.UpBatterySoc.ToInt(),
- // dsoe = swapOrderBattery.UpBatterySoe.ToInt(),
+ //dsoe = swapOrderBattery.UpBatterySoe.ToInt(),
et = swapOrder.SwapEndTime,
od = 0,
ot = swapOrder.VehicleLeaveTime,
@@ -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)}");
diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs
index d0ada65..1cf583e 100644
--- a/Service/Execute/Mgr/CommonMgr.cs
+++ b/Service/Execute/Mgr/CommonMgr.cs
@@ -73,7 +73,7 @@ public class CommonMgr
DownBatterySoe = inBin.Soe,
};
- _swapOrderBatteryRepository.Insert(swapOrderBattery);
+ _swapOrderBatteryRepository.Insert(swapOrderBattery);
}
///
@@ -189,7 +189,7 @@ public class CommonMgr
orderBatteryInfo.InBinInfo.BatteryNo = "-1";
orderBatteryInfo.InBinInfo.Soc = -1;
orderBatteryInfo.InBinInfo.Soe = -1;
- orderBatteryInfo.InBinInfo.Soh =-1;
+ orderBatteryInfo.InBinInfo.Soh = -1;
var carInfoBatteryInfos = machine.BoxCarInfoModel?.CarInfo?.BatteryInfos;
if (carInfoBatteryInfos != null && carInfoBatteryInfos.Count > 0)
{
@@ -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),
});
}
}
\ No newline at end of file