现场云平台更改提交

zw
CZ 5 months ago
parent 8d9642254b
commit c036718c69

@ -571,7 +571,7 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
ct = 0,
cn = orders.Count,
sfs = op,
vin = swapOrder.VehicleVin,
vin = swapOrder?.VehicleVin,
sfoc = 0,
};
foreach (ChargeOrder order in orders)

@ -14,6 +14,7 @@ public class ChargeOrderUploadTask : ITask
private volatile bool _stop;
public ChargeOrderRepository _chargeOrderRepository { get; set; }
public SwapOrderRepository _swapOrder { get; set; }
public int Interval()
{
@ -30,11 +31,10 @@ public class ChargeOrderUploadTask : ITask
Log.Info($"there are {chargeOrders?.Count ?? 0} to upload");
if (chargeOrders is { Count: > 0 })
{
var group = chargeOrders.GroupBy(it => it.CloudChargeOrder);
foreach (IGrouping<string, ChargeOrder> grouping in group)
Dictionary<string,List<ChargeOrder>> dictionary = chargeOrders.GroupBy(it => it.CloudChargeOrder).ToDictionary(i => i.Key, i=> i.ToList());
foreach (var (k, v) in dictionary)
{
List<ChargeOrder> orders = grouping.ToList();
CloudClientMgr.CloudClient?.PublishChargeOrder(orders, 1);
CloudClientMgr.CloudClient?.PublishChargeOrder(v, 1);
}
}
}

Loading…
Cancel
Save