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