|
|
|
@ -44,10 +44,10 @@ public class CloudClientMgr
|
|
|
|
|
private static DateTime _dateTime5 = DateTime.Now.AddMinutes(-15);//15分钟
|
|
|
|
|
private static DateTime _dateTime6 = DateTime.Now.AddMinutes(-15);//15分钟
|
|
|
|
|
private static DateTime _dateTime7 = DateTime.Today.AddHours(DateTime.Now.Hour-1);//小时
|
|
|
|
|
private static DateTime _dateTime8 = DateTime.Now.AddDays(-1).Date;//天
|
|
|
|
|
private static DateTime _dateTime8 = DateTime.Now.AddDays(-1).Date.AddHours(2);//天,每天两点
|
|
|
|
|
private static DateTime _dateTime9 = DateTime.Today.AddHours(DateTime.Now.Hour - 1);//小时
|
|
|
|
|
private static DateTime _dateTime10 = DateTime.Now.AddDays(-1).Date;//天
|
|
|
|
|
private static DateTime _dateTime11 = DateTime.Now.AddDays(-1).Date;//天
|
|
|
|
|
private static DateTime _dateTime10 = DateTime.Now.AddDays(-1).Date.AddHours(2);//天,每天两点
|
|
|
|
|
private static DateTime _dateTime11 = DateTime.Now.AddDays(-1).Date.AddHours(2);//天,每天两点
|
|
|
|
|
private static DateTime _dateTime12 = DateTime.Now.AddSeconds(-30);
|
|
|
|
|
private static DateTime _dateTime13 = DateTime.Now.AddSeconds(-30);
|
|
|
|
|
private static DateTime _dateTime14 = DateTime.Now.AddSeconds(-30);
|
|
|
|
@ -213,6 +213,7 @@ public class CloudClientMgr
|
|
|
|
|
{
|
|
|
|
|
if (CloudClient.Connected)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (StationConstant.StationModel.Remote == BaseEnumExtensions.GetEnumByCode<StationConstant.StationModel>(
|
|
|
|
|
StaticStationInfo.StationModel))
|
|
|
|
|
{
|
|
|
|
@ -379,7 +380,7 @@ public class CloudClientMgr
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
powerTotal.meter = new List<meter>();
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergy.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter meter = new()
|
|
|
|
|
{
|
|
|
|
@ -390,7 +391,7 @@ public class CloudClientMgr
|
|
|
|
|
};
|
|
|
|
|
powerTotal.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0;i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergyChange.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter meter = new()
|
|
|
|
|
{
|
|
|
|
@ -401,7 +402,8 @@ public class CloudClientMgr
|
|
|
|
|
};
|
|
|
|
|
powerTotal.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CloudApi.SendPowerTotal(powerTotal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -437,7 +439,8 @@ public class CloudClientMgr
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
staChargingTotal.meter = new List<meter2>();
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < emeterEnergy.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -450,7 +453,7 @@ public class CloudClientMgr
|
|
|
|
|
};
|
|
|
|
|
staChargingTotal.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergyChange.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -478,7 +481,7 @@ public class CloudClientMgr
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_dateTime7 = DateTime.Now;
|
|
|
|
|
_dateTime7 = DateTime.Today.AddHours(DateTime.Now.Hour);
|
|
|
|
|
|
|
|
|
|
var emeterEnergy = emeterHourEnergyService.QueryListByClause(u => u.UploadFlag == 0, 14, i => i.Time,
|
|
|
|
|
OrderByType.Desc);
|
|
|
|
@ -494,7 +497,7 @@ public class CloudClientMgr
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter = new List<meter2>();
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergy1.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -509,7 +512,7 @@ public class CloudClientMgr
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergy2.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -519,8 +522,8 @@ public class CloudClientMgr
|
|
|
|
|
mk = emeterEnergy2[i].Value,
|
|
|
|
|
//st = DateTime.Now.AddMinutes(-15),
|
|
|
|
|
//et = DateTime.Now,
|
|
|
|
|
st = Convert.ToDateTime(emeterEnergy1[i].Time),
|
|
|
|
|
et = Convert.ToDateTime(emeterEnergy1[i].Time).AddHours(1),
|
|
|
|
|
st = Convert.ToDateTime(emeterEnergy2[i].Time),
|
|
|
|
|
et = Convert.ToDateTime(emeterEnergy2[i].Time).AddHours(1),
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
@ -543,7 +546,7 @@ public class CloudClientMgr
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
_dateTime8 = DateTime.Now;
|
|
|
|
|
_dateTime8 = DateTime.Now.Date.AddHours(2);
|
|
|
|
|
|
|
|
|
|
EmeterDayEnergyService emeterDayEnergyService = AppInfo.Container.Resolve<EmeterDayEnergyService>();
|
|
|
|
|
|
|
|
|
@ -561,7 +564,7 @@ public class CloudClientMgr
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter = new List<meter2>();
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergy1.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -576,7 +579,7 @@ public class CloudClientMgr
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter.Add(meter);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
for (int i = 0; i < emeterEnergy2.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
meter2 meter = new()
|
|
|
|
|
{
|
|
|
|
@ -586,8 +589,8 @@ public class CloudClientMgr
|
|
|
|
|
mk = emeterEnergy2[i].Value,
|
|
|
|
|
//st = DateTime.Now.AddDays(-1),
|
|
|
|
|
//et = DateTime.Now,
|
|
|
|
|
st = Convert.ToDateTime(emeterEnergy1[i].Time).AddDays(-1),
|
|
|
|
|
et = Convert.ToDateTime(emeterEnergy1[i].Time),
|
|
|
|
|
st = Convert.ToDateTime(emeterEnergy2[i].Time).AddDays(-1),
|
|
|
|
|
et = Convert.ToDateTime(emeterEnergy2[i].Time),
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
meterEnergyKwh.meter.Add(meter);
|
|
|
|
@ -612,7 +615,7 @@ public class CloudClientMgr
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
_dateTime9 = DateTime.Now;
|
|
|
|
|
_dateTime9 = DateTime.Today.AddHours(DateTime.Now.Hour);
|
|
|
|
|
|
|
|
|
|
var emeterEnergy = emeterHourEnergyService.QueryListByClause(u => u.Type == 1, 7, i => i.Time,
|
|
|
|
|
OrderByType.Desc);
|
|
|
|
@ -645,7 +648,7 @@ public class CloudClientMgr
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
_dateTime10 = DateTime.Now;
|
|
|
|
|
_dateTime10 = DateTime.Now.Date.AddHours(2);
|
|
|
|
|
|
|
|
|
|
var emeterEnergy = emeterDayEnergyService.QueryListByClause(u => u.Type == 1, 7, i => i.Time,
|
|
|
|
|
OrderByType.Desc);
|
|
|
|
@ -680,33 +683,36 @@ public class CloudClientMgr
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
_dateTime11 = DateTime.Now;
|
|
|
|
|
_dateTime11 = DateTime.Now.Date.AddHours(2);
|
|
|
|
|
|
|
|
|
|
ExStationDayRunResultService exStationDayRunResultService = AppInfo.Container.Resolve<ExStationDayRunResultService>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var exStationDayRunResult = exStationDayRunResultService.QueryByClause(u => u.Id !=0, i => i.CreatedTime,
|
|
|
|
|
OrderByType.Desc);
|
|
|
|
|
|
|
|
|
|
StaDayOpeEnergyVal staDayOpeEnergyVal = new()
|
|
|
|
|
if (exStationDayRunResult!=null)
|
|
|
|
|
{
|
|
|
|
|
sn = StaticStationInfo.StationNo,
|
|
|
|
|
sm = StaticStationInfo.StationName,
|
|
|
|
|
st = Convert.ToDateTime(exStationDayRunResult?.RunStartTime),
|
|
|
|
|
et = Convert.ToDateTime(exStationDayRunResult?.RunEndTime),
|
|
|
|
|
tt = Convert.ToInt32(exStationDayRunResult?.ToltalTimeCount),
|
|
|
|
|
//tt = 24 * 60,
|
|
|
|
|
ft = exStationDayRunResult?.FristSwapTime,
|
|
|
|
|
sp = exStationDayRunResult?.StopTime,
|
|
|
|
|
ts = Convert.ToSingle(exStationDayRunResult?.ToltalSwapAllTime * 60),
|
|
|
|
|
tc = exStationDayRunResult.ToltalSwapCount,
|
|
|
|
|
cc = exStationDayRunResult.ChgCount,
|
|
|
|
|
os = Convert.ToByte(exStationDayRunResult.State),
|
|
|
|
|
at = Convert.ToSingle(exStationDayRunResult?.AvgRepTime),
|
|
|
|
|
ct = Convert.ToSingle(exStationDayRunResult?.AvgChgTime),
|
|
|
|
|
dt = Convert.ToDateTime(exStationDayRunResult?.SwapDate),
|
|
|
|
|
};
|
|
|
|
|
StaDayOpeEnergyVal staDayOpeEnergyVal = new()
|
|
|
|
|
{
|
|
|
|
|
sn = StaticStationInfo.StationNo,
|
|
|
|
|
sm = StaticStationInfo.StationName,
|
|
|
|
|
st = Convert.ToDateTime(exStationDayRunResult?.RunStartTime),
|
|
|
|
|
et = Convert.ToDateTime(exStationDayRunResult?.RunEndTime),
|
|
|
|
|
tt = Convert.ToInt32(exStationDayRunResult?.ToltalTimeCount),
|
|
|
|
|
ft = exStationDayRunResult?.FristSwapTime,
|
|
|
|
|
sp = exStationDayRunResult?.StopTime,
|
|
|
|
|
ts = Convert.ToSingle(exStationDayRunResult?.ToltalSwapAllTime * 60),
|
|
|
|
|
tc = Convert.ToInt32(exStationDayRunResult?.ToltalSwapCount),
|
|
|
|
|
cc = Convert.ToInt32(exStationDayRunResult?.ChgCount),
|
|
|
|
|
os = Convert.ToByte(exStationDayRunResult?.State),
|
|
|
|
|
at = Convert.ToSingle(exStationDayRunResult?.AvgRepTime),
|
|
|
|
|
ct = Convert.ToSingle(exStationDayRunResult?.AvgChgTime),
|
|
|
|
|
dt = Convert.ToDateTime(exStationDayRunResult?.SwapDate),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CloudApi.SendStaDayOpeEnergyVal(staDayOpeEnergyVal);
|
|
|
|
|
CloudApi.SendStaDayOpeEnergyVal(staDayOpeEnergyVal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -849,6 +855,7 @@ public class CloudClientMgr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static List<EquipInfo> equipInfos;
|
|
|
|
|
static bool variation = false;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 换电站设备状态开始和结束日志信息
|
|
|
|
|
/// </summary>
|
|
|
|
@ -863,7 +870,7 @@ public class CloudClientMgr
|
|
|
|
|
EquipInfoRepository equipInfoRepository = AppInfo.Container.Resolve<EquipInfoRepository>();
|
|
|
|
|
var equipList = equipInfoRepository.Query();
|
|
|
|
|
if (equipInfos == null) { equipInfos = equipList; }
|
|
|
|
|
bool variation = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (variation)
|
|
|
|
|
{
|
|
|
|
@ -881,6 +888,8 @@ public class CloudClientMgr
|
|
|
|
|
ke= (int)(equipList[i].UpdatedTime- equipInfos[i].UpdatedTime).TotalSeconds,
|
|
|
|
|
cm = 1,
|
|
|
|
|
};
|
|
|
|
|
CloudApi.SendEndLogMessage(req);
|
|
|
|
|
variation = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|