|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
using Common.Const;
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
|
using HybirdFrameworkCore.AutoTask;
|
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
|
using HybirdFrameworkCore.Utils;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Repository.Station;
|
|
|
|
|
using Service.Charger.Client;
|
|
|
|
@ -20,6 +22,7 @@ public class AutoChargeTask : ITask
|
|
|
|
|
public BatteryOpModelRepository batteryOpModelRepository { get; set; }
|
|
|
|
|
public BatteryOpModelDetailRepository batteryOpModelDetailRepository { get; set; }
|
|
|
|
|
public BinInfoRepository binInfoRepository { get; set; }
|
|
|
|
|
public EquipInfoRepository EquipInfoRepository { get; set; }
|
|
|
|
|
|
|
|
|
|
public string Name()
|
|
|
|
|
{
|
|
|
|
@ -37,11 +40,6 @@ public class AutoChargeTask : ITask
|
|
|
|
|
{
|
|
|
|
|
DateTime now = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
if (StaticStationInfo.AutoChargeEnabled != 1)
|
|
|
|
|
{
|
|
|
|
|
Log.Info("AutoChargeEnabled = 0 continue");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<BinInfo> binInfos = binInfoRepository.Query();
|
|
|
|
|
if (binInfos.Count < 0)
|
|
|
|
@ -50,6 +48,17 @@ public class AutoChargeTask : ITask
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<EquipInfo> chargerList = EquipInfoRepository.QueryListByClause(it => it.TypeCode == (int)EquipmentType.Charger);
|
|
|
|
|
HashSet<string> autoChargeSet = chargerList.Where(it => it.AutoCharge == 1).Select(it => it.Code).ToHashSet();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binInfos = binInfos.Where(it => autoChargeSet.Contains(it.ChargerNo)).ToList();
|
|
|
|
|
|
|
|
|
|
if (ObjUtils.IsEmpty(binInfos))
|
|
|
|
|
{
|
|
|
|
|
Log.Info("there is no auto charger");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 电价模型
|
|
|
|
|
|
|
|
|
|