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.
61 lines
1.2 KiB
61 lines
1.2 KiB
6 months ago
|
using Entity.DbModel.Station;
|
||
6 months ago
|
using HybirdFrameworkCore.Autofac.Attribute;
|
||
|
using HybirdFrameworkCore.AutoTask;
|
||
6 months ago
|
using log4net;
|
||
6 months ago
|
using Repository.Station;
|
||
6 months ago
|
using Service.Mgr;
|
||
6 months ago
|
|
||
6 months ago
|
namespace Service.MyTask;
|
||
6 months ago
|
|
||
|
/// <summary>
|
||
|
/// 充电结束上报云平台task
|
||
|
/// </summary>
|
||
6 months ago
|
[Scope]
|
||
|
public class SwapOrderReportCloudTask : ITask
|
||
6 months ago
|
{
|
||
6 months ago
|
private static readonly ILog Log = LogManager.GetLogger(typeof(SwapOrderReportCloudTask));
|
||
6 months ago
|
|
||
6 months ago
|
private volatile bool _stop;
|
||
|
public SwapOrderReportCloudRepository? ReportCloudRepository { get; set; }
|
||
6 months ago
|
|
||
6 months ago
|
public SwapOrderMgr? SwapOrderMgr { get; set; }
|
||
6 months ago
|
|
||
6 months ago
|
public string Name()
|
||
6 months ago
|
{
|
||
6 months ago
|
return "SwapOrderReportCloudTask";
|
||
6 months ago
|
}
|
||
|
|
||
6 months ago
|
public int Interval()
|
||
6 months ago
|
{
|
||
6 months ago
|
return 1000 * 20;
|
||
|
}
|
||
6 months ago
|
|
||
6 months ago
|
public void Handle()
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
List<SwapOrderReportCloud> list = ReportCloudRepository.QueryListByClause(i => i.CloudReportStatus == 0);
|
||
|
|
||
|
SwapOrderMgr.UploadCloud(list);
|
||
|
}
|
||
|
catch (Exception e)
|
||
|
{
|
||
|
Log.Error($" SwapOrderReportCloudTask err e={e}");
|
||
|
}
|
||
6 months ago
|
}
|
||
|
|
||
6 months ago
|
public bool Stoped()
|
||
6 months ago
|
{
|
||
6 months ago
|
return _stop;
|
||
|
}
|
||
|
|
||
|
public void Stop()
|
||
|
{
|
||
|
_stop = true;
|
||
|
}
|
||
|
|
||
|
public void ResetStop()
|
||
|
{
|
||
|
_stop = false;
|
||
6 months ago
|
}
|
||
|
}
|