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.
70 lines
2.1 KiB
70 lines
2.1 KiB
using Autofac;
|
|
using Entity.Constant;
|
|
using Entity.DbModel.Station;
|
|
using HybirdFrameworkCore.Autofac;
|
|
using log4net;
|
|
using Repository.Station;
|
|
using Service.Execute;
|
|
using Service.Execute.Api;
|
|
using Service.Execute.Model;
|
|
|
|
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));*/
|
|
|
|
/*//TODO::给前端测试 实时步骤变更
|
|
Array enumValues = Enum.GetValues(typeof(InfoEnum.BusinessSwappingStep));
|
|
foreach (InfoEnum.BusinessSwappingStep info in enumValues)
|
|
{
|
|
StepModel resp = new()
|
|
{
|
|
StepName = BaseEnumExtensions.GetDescription(info),
|
|
StepNo = (int)info,
|
|
StartTime = DateTime.Now
|
|
};
|
|
|
|
StationSoftMgr.SwappingStateMachine.StepModel = new List<StepModel>();
|
|
StationSoftMgr.SwappingStateMachine.StepModel.Add(resp);
|
|
Thread.Sleep(60000);
|
|
}*/
|
|
|
|
|
|
}
|
|
|
|
protected override string Name()
|
|
{
|
|
return "SwapOrderReportCloudTask";
|
|
}
|
|
} |