|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|