|
|
|
@ -63,63 +63,111 @@ namespace Service.Charger.Handler
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 充电机故障显示
|
|
|
|
|
//不准确,注释
|
|
|
|
|
//if(sn=="C2008")
|
|
|
|
|
|
|
|
|
|
//if (msg.TotalWarning||msg.TotalError)
|
|
|
|
|
{
|
|
|
|
|
var lstEquipAlarmDefine = EquipAlarmDefineRepository.QueryListByClause(i => i.EquipCode == "充电机");
|
|
|
|
|
|
|
|
|
|
List<string> lstAlarm = new List<string>();
|
|
|
|
|
|
|
|
|
|
if (msg.EmergencyStop)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="1").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.SmokeFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="2").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargeACInputCircuitBreakerFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="3").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusPositElecContactorRefuFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="4").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusNegatElecContactorRefuFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="5").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusPositElecFusesFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="6").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DDcBusNegatElecFusesFault)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="7").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargingInterfaceLockError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="8").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargerFanError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="9").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ArresterError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="10").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.InsulationDetectionAlarm)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="11").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.InsulationDetectionError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="12").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.BatteryPolarityReverseError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="13").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.VeConGuidanceFailure)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="14").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargingOverTempError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="15").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.InterfaceOverFaulty)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="16").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargingGunNotHomingError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="17").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.BmsConnError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="18").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargerInputOverVoltageError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="19").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargerInputUnderVoltageError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="20").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusOutputOverVoltageError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="21").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusOutputUnderVoltageError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="22").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.DcBusOutputOverCurrentError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="23").ToList()[0].ErrorCode);
|
|
|
|
|
if (!msg.VehicleConnStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="24").ToList()[0].ErrorCode);
|
|
|
|
|
if (!msg.ChargeStationGunHolderStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="25").ToList()[0].ErrorCode);
|
|
|
|
|
if (!msg.ChargingInterfaceLockStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="26").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.PositiveDcTransmissionContactorStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="27").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.NegativeDcTransmissionContactorStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="28").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.EntranceGuardError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="29").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.PConA3dhesionFailure)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="30").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.NConadhesionFailure)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="31").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ReliefCircuitError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="32").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ConActivated)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="33").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ConAdhesionFailure)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="34").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.AuxiliaryPowerError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="35").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ModuleOutputReverseError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="36").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.AcContactorStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="37").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargingGunOverTempWarning)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="38").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ChargerOverTempWarning)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="39").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.MeterConnError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="40").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.MeterDataError)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="41").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.WaterloggingWarning)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="42").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.ReversePowerWarning)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="43").ToList()[0].ErrorCode);
|
|
|
|
|
if (msg.BatteryPackAuxiliaryPowerStatus)lstAlarm.Add(sn+lstEquipAlarmDefine.Where(i=>i.ErrorCode=="44").ToList()[0].ErrorCode);
|
|
|
|
|
void Alarm(string number)
|
|
|
|
|
{
|
|
|
|
|
var alarm = lstEquipAlarmDefine.Where(i => i.ErrorCode == number);
|
|
|
|
|
if (alarm.Count() > 0)
|
|
|
|
|
lstAlarm.Add(sn + alarm.ToList()[0].ErrorCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (msg.EmergencyStop)
|
|
|
|
|
Alarm("1");
|
|
|
|
|
if (msg.SmokeFault)
|
|
|
|
|
Alarm("2");
|
|
|
|
|
if (msg.ChargeACInputCircuitBreakerFault)
|
|
|
|
|
Alarm("3");
|
|
|
|
|
if (msg.DcBusPositElecContactorRefuFault)
|
|
|
|
|
Alarm("4");
|
|
|
|
|
if (msg.DcBusNegatElecContactorRefuFault)
|
|
|
|
|
Alarm("5");
|
|
|
|
|
if (msg.DcBusPositElecFusesFault)
|
|
|
|
|
Alarm("6");
|
|
|
|
|
if (msg.DDcBusNegatElecFusesFault)
|
|
|
|
|
Alarm("7");
|
|
|
|
|
if (msg.ChargingInterfaceLockError)
|
|
|
|
|
Alarm("8");
|
|
|
|
|
if (msg.ChargerFanError)
|
|
|
|
|
Alarm("9");
|
|
|
|
|
if (msg.ArresterError)
|
|
|
|
|
Alarm("10");
|
|
|
|
|
if (msg.InsulationDetectionAlarm)
|
|
|
|
|
Alarm("11");
|
|
|
|
|
if (msg.InsulationDetectionError)
|
|
|
|
|
Alarm("12");
|
|
|
|
|
if (msg.BatteryPolarityReverseError)
|
|
|
|
|
Alarm("13");
|
|
|
|
|
if (msg.VeConGuidanceFailure)
|
|
|
|
|
Alarm("14");
|
|
|
|
|
if (msg.ChargingOverTempError)
|
|
|
|
|
Alarm("15");
|
|
|
|
|
if (msg.InterfaceOverFaulty)
|
|
|
|
|
Alarm("16");
|
|
|
|
|
if (msg.ChargingGunNotHomingError)
|
|
|
|
|
Alarm("17");
|
|
|
|
|
if (msg.BmsConnError)
|
|
|
|
|
Alarm("18");
|
|
|
|
|
if (msg.ChargerInputOverVoltageError)
|
|
|
|
|
Alarm("19");
|
|
|
|
|
if (msg.ChargerInputUnderVoltageError)
|
|
|
|
|
Alarm("20");
|
|
|
|
|
if (msg.DcBusOutputOverVoltageError)
|
|
|
|
|
Alarm("21");
|
|
|
|
|
if (msg.DcBusOutputUnderVoltageError)
|
|
|
|
|
Alarm("22");
|
|
|
|
|
if (msg.DcBusOutputOverCurrentError)
|
|
|
|
|
Alarm("23");
|
|
|
|
|
if (!msg.VehicleConnStatus)
|
|
|
|
|
Alarm("24");
|
|
|
|
|
if (!msg.ChargeStationGunHolderStatus)Alarm("25");
|
|
|
|
|
if (!msg.ChargingInterfaceLockStatus)Alarm("26");
|
|
|
|
|
if (msg.PositiveDcTransmissionContactorStatus)
|
|
|
|
|
Alarm("27");
|
|
|
|
|
if (msg.NegativeDcTransmissionContactorStatus)
|
|
|
|
|
Alarm("28");
|
|
|
|
|
if (msg.EntranceGuardError)
|
|
|
|
|
Alarm("29");
|
|
|
|
|
if (msg.PConA3dhesionFailure)
|
|
|
|
|
Alarm("30");
|
|
|
|
|
if (msg.NConadhesionFailure)
|
|
|
|
|
Alarm("31");
|
|
|
|
|
if (msg.ReliefCircuitError)
|
|
|
|
|
Alarm("32");
|
|
|
|
|
if (msg.ConActivated)
|
|
|
|
|
Alarm("33");
|
|
|
|
|
if (msg.ConAdhesionFailure)
|
|
|
|
|
Alarm("34");
|
|
|
|
|
if (msg.AuxiliaryPowerError)
|
|
|
|
|
Alarm("35");
|
|
|
|
|
if (msg.ModuleOutputReverseError)
|
|
|
|
|
Alarm("36");
|
|
|
|
|
if (msg.AcContactorStatus)
|
|
|
|
|
Alarm("37");
|
|
|
|
|
if (msg.ChargingGunOverTempWarning)
|
|
|
|
|
Alarm("38");
|
|
|
|
|
if (msg.ChargerOverTempWarning)
|
|
|
|
|
Alarm("39");
|
|
|
|
|
if (msg.MeterConnError)
|
|
|
|
|
Alarm("40");
|
|
|
|
|
if (msg.MeterDataError)
|
|
|
|
|
Alarm("41");
|
|
|
|
|
if (msg.WaterloggingWarning)
|
|
|
|
|
Alarm("42");
|
|
|
|
|
if (msg.ReversePowerWarning)
|
|
|
|
|
Alarm("43");
|
|
|
|
|
if (msg.BatteryPackAuxiliaryPowerStatus)
|
|
|
|
|
Alarm("44");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询当前充电机的实时报警信息
|
|
|
|
|
var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == sn);
|
|
|
|
|
var sqllstAlarm=lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList();//当前报警列表
|
|
|
|
|
var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表
|
|
|
|
|
|
|
|
|
|
// 找出实时报警中存在但数据库中不存在的元素
|
|
|
|
|
List<string> uniqueToList1 = lstAlarm.Except(sqllstAlarm).ToList();
|
|
|
|
@ -127,10 +175,12 @@ namespace Service.Charger.Handler
|
|
|
|
|
// 找出数据库中存在但实时报警中不存在的元素
|
|
|
|
|
List<string> uniqueToList2 = sqllstAlarm.Except(lstAlarm).ToList();
|
|
|
|
|
if (uniqueToList1.Count > 0)
|
|
|
|
|
{//这里要添加新的报警数据
|
|
|
|
|
{
|
|
|
|
|
//这里要添加新的报警数据
|
|
|
|
|
foreach (var errorCode in uniqueToList1)
|
|
|
|
|
{
|
|
|
|
|
EquipAlarmDefine? alarmDefine = EquipAlarmDefineRepository.QueryByClause(i=>i.ErrorCode==errorCode.Replace(sn,""));
|
|
|
|
|
EquipAlarmDefine? alarmDefine =
|
|
|
|
|
EquipAlarmDefineRepository.QueryByClause(i => i.ErrorCode == errorCode.Replace(sn, ""));
|
|
|
|
|
if (alarmDefine != null)
|
|
|
|
|
{
|
|
|
|
|
EquipAlarmRecord record = new EquipAlarmRecord()
|
|
|
|
@ -141,7 +191,7 @@ namespace Service.Charger.Handler
|
|
|
|
|
ErrorLevel = alarmDefine.ErrorLevel,
|
|
|
|
|
ErrorMsg = alarmDefine.ErrorMsg,
|
|
|
|
|
ProcessMethod = alarmDefine.ProcessMethod,
|
|
|
|
|
StartTime= DateTime.Now
|
|
|
|
|
StartTime = DateTime.Now
|
|
|
|
|
};
|
|
|
|
|
EquipAlarmRecordRepository.Insert(record);
|
|
|
|
|
}
|
|
|
|
@ -164,13 +214,37 @@ namespace Service.Charger.Handler
|
|
|
|
|
EquipAlarmProcessRecord.ErrorMsg = VARIABLE.ErrorMsg;
|
|
|
|
|
EquipAlarmProcessRecord.ProcessMethod = VARIABLE.ProcessMethod;
|
|
|
|
|
EquipAlarmProcessRecord.StartTime = VARIABLE.StartTime;
|
|
|
|
|
EquipAlarmProcessRecord.ProcessTime=DateTime.Now;
|
|
|
|
|
EquipAlarmProcessRecord.ProcessTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
EquipAlarmProcessRecordRepository.Insert(EquipAlarmProcessRecord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EquipAlarmRecordRepository.Delete(filteredObjectList);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
/*var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == sn);
|
|
|
|
|
if (lstNowEquipAlarmRecord.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var VARIABLE in lstNowEquipAlarmRecord)
|
|
|
|
|
{
|
|
|
|
|
EquipAlarmProcessRecord EquipAlarmProcessRecord = new EquipAlarmProcessRecord();
|
|
|
|
|
EquipAlarmProcessRecord.EquipTypeCode = VARIABLE.EquipTypeCode;
|
|
|
|
|
EquipAlarmProcessRecord.EquipCode = VARIABLE.EquipCode;
|
|
|
|
|
EquipAlarmProcessRecord.ErrorCode = VARIABLE.ErrorCode;
|
|
|
|
|
EquipAlarmProcessRecord.ErrorLevel = VARIABLE.ErrorLevel;
|
|
|
|
|
EquipAlarmProcessRecord.ErrorMsg = VARIABLE.ErrorMsg;
|
|
|
|
|
EquipAlarmProcessRecord.ProcessMethod = VARIABLE.ProcessMethod;
|
|
|
|
|
EquipAlarmProcessRecord.StartTime = VARIABLE.StartTime;
|
|
|
|
|
EquipAlarmProcessRecord.ProcessTime=DateTime.Now;
|
|
|
|
|
|
|
|
|
|
EquipAlarmProcessRecordRepository.Insert(EquipAlarmProcessRecord);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
EquipAlarmRecordRepository.Delete(i=>i.Id>0);*/
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|