You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

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));
6 months ago
public ChargeOrderRepository _chargeOrderRepository { get; set; }
protected override int Interval()
{
return 1000 * 10;
}
protected override void Handle()
{
6 months ago
List<ChargeOrder>? chargeOrders = _chargeOrderRepository.QueryListByClause(it => it.CloudReportStatus ==0);
Log.Info($"there are {chargeOrders?.Count ?? 0} to upload");
if (chargeOrders is { Count: > 0 })
{
foreach (ChargeOrder chargeOrder in chargeOrders)
{
6 months ago
CloudClientMgr.CloudClient?.PublishChargeOrder(chargeOrder, 1);
}
}
}
protected override string Name()
{
return "ChargeOrderUploadTask";
}
}