故障修改提交

master
CZ 2 months ago
parent 3bb74c71f5
commit 9d2b48858f

@ -26,12 +26,13 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
public SummaryFailuresReqHandler(EquipAlarmDefineRepository equipAlarmDefineRepository, public SummaryFailuresReqHandler(EquipAlarmDefineRepository equipAlarmDefineRepository,
EquipAlarmRecordRepository equipAlarmRecordRepository, EquipAlarmRecordRepository equipAlarmRecordRepository,
EquipAlarmProcessRecordRepository equipAlarmProcessRecordRepository EquipAlarmProcessRecordRepository equipAlarmProcessRecordRepository
) )
{ {
EquipAlarmDefineRepository = equipAlarmDefineRepository; EquipAlarmDefineRepository = equipAlarmDefineRepository;
EquipAlarmRecordRepository = equipAlarmRecordRepository; EquipAlarmRecordRepository = equipAlarmRecordRepository;
EquipAlarmProcessRecordRepository = equipAlarmProcessRecordRepository; EquipAlarmProcessRecordRepository = equipAlarmProcessRecordRepository;
} }
private EquipAlarmDefineRepository EquipAlarmDefineRepository { get; set; } private EquipAlarmDefineRepository EquipAlarmDefineRepository { get; set; }
private EquipAlarmRecordRepository EquipAlarmRecordRepository { get; set; } private EquipAlarmRecordRepository EquipAlarmRecordRepository { get; set; }
private EquipAlarmProcessRecordRepository EquipAlarmProcessRecordRepository { get; set; } private EquipAlarmProcessRecordRepository EquipAlarmProcessRecordRepository { get; set; }
@ -42,30 +43,6 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
private static readonly ILog Log = LogManager.GetLogger(typeof(SummaryFailuresReqHandler)); private static readonly ILog Log = LogManager.GetLogger(typeof(SummaryFailuresReqHandler));
void Alarm(string number)
{
if (PlcConst.EquipAlarmDefines.Count>0)
{
EquipAlarmDefine alarm = PlcConst.EquipAlarmDefines.Where(i => i.ErrorCode == number).First();
if (alarm != null)
{
EquipAlarmRecordRepository.Insert(new EquipAlarmRecord()
{
EquipTypeCode = alarm.EquipTypeCode,
EquipCode = alarm.EquipCode,
ErrorCode = alarm.ErrorCode,
ErrorLevel = alarm.ErrorLevel,
ErrorMsg = alarm.ErrorMsg,
ProcessMethod = alarm.ProcessMethod,
StartTime = DateTime.Now,
});
}
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -73,15 +50,17 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
{ {
Log.Info("Summary of failures"); Log.Info("Summary of failures");
/*if (msg.Message.Length < 300) var lstEquipAlarmDefine = EquipAlarmDefineRepository.QueryListByClause(i => i.EquipCode == "plc");
{
Log.Error($"receive data err msg={JsonConvert.SerializeObject(msg)}");
return;
}*/
List<string> lstAlarm = new List<string>(); List<string> lstAlarm = new List<string>();
void Alarm(string number)
{
var alarm = lstEquipAlarmDefine.Where(i => i.ErrorCode == number);
if (alarm.Count() > 0)
lstAlarm.Add(alarm.ToList()[0].ErrorCode);
}
if (msg.ScreenEmergencyStop) if (msg.ScreenEmergencyStop)
Alarm("1"); Alarm("1");
if (msg.PassageEmergencyStop) if (msg.PassageEmergencyStop)
@ -228,7 +207,7 @@ public class SummaryFailuresReqHandler : SimpleChannelInboundHandler<SummaryFail
Alarm("72"); Alarm("72");
//查询当前PLC的实时报警信息 //查询当前充电机的实时报警信息
var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == "plc"); var lstNowEquipAlarmRecord = EquipAlarmRecordRepository.QueryListByClause(i => i.EquipCode == "plc");
var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表 var sqllstAlarm = lstNowEquipAlarmRecord.Select(obj => obj.ErrorCode).ToList(); //当前报警列表

Loading…
Cancel
Save