|
|
@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
|
|
|
using log4net;
|
|
|
|
|
|
|
|
using Repository.Station;
|
|
|
|
|
|
|
|
using Service.BusinessTask;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Cloud.Client.MyTask;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
|
|
|
|
public class ChargeOrderUploadTask : AbstractTaskHandler
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
private static readonly ILog Log = LogManager.GetLogger(typeof(ChargeOrderUploadTask));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly ChargeOrderRepository _chargeOrderRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChargeOrderUploadTask(ChargeOrderRepository chargeOrderRepository)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_chargeOrderRepository = chargeOrderRepository;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override int Interval()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return 1000 * 10;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Handle()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<ChargeOrder>? chargeOrders = _chargeOrderRepository.QueryListByClause(it => it.CloudReportStatus != 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.Info($"there are {chargeOrders?.Count ?? 0} to upload");
|
|
|
|
|
|
|
|
if (chargeOrders is { Count: > 0 })
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (ChargeOrder chargeOrder in chargeOrders)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//TODO
|
|
|
|
|
|
|
|
//CloudClientMgr.CloudClient?.Publish();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override string Name()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return "ChargeOrderUploadTask";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|