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.

53 lines
1.4 KiB

using Autofac;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac;
using log4net;
using Repository.Station;
using Service.Execute.Api;
namespace Service.BusinessTask.MyTask;
/// <summary>
/// 充电结束上报云平台task
/// </summary>
public class SwapOrderReportCloudTask : AbstractTaskHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(SwapOrderReportCloudTask));
private readonly SwapOrderReportCloudRepository _reportCloudRepository =
AppInfo.Container.Resolve<SwapOrderReportCloudRepository>();
private readonly SwapOrderRepository _swapOrderRepository =
AppInfo.Container.Resolve<SwapOrderRepository>();
private readonly SwapOrderBatteryRepository _swapOrderBatteryRepository =
AppInfo.Container.Resolve<SwapOrderBatteryRepository>();
protected override int Interval()
{
return 20 * 1000;
}
protected override void Handle()
{
List<SwapOrderReportCloud> list = _reportCloudRepository.QueryListByClause(i => i.CloudReportStatus == 0);
if (list.Count <= 0)
{
return;
}
List<long?> swapOrderIds = list.Select(i => i.SwapOrderId).ToList();
List<SwapOrder> swapOrders = _swapOrderRepository.QueryListByClause(i => swapOrderIds.Contains(i.Id));
}
protected override string Name()
{
return "SwapOrderReportCloudTask";
}
}