|
|
|
@ -29,7 +29,8 @@ namespace Sln.Iot.Serial
|
|
|
|
IBaseAlarmRuleService _alarmRuleService = service.GetService<IBaseAlarmRuleService>();
|
|
|
|
IBaseAlarmRuleService _alarmRuleService = service.GetService<IBaseAlarmRuleService>();
|
|
|
|
|
|
|
|
|
|
|
|
WebSocketBusiness webSocket = service.GetService<WebSocketBusiness>();
|
|
|
|
WebSocketBusiness webSocket = service.GetService<WebSocketBusiness>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var logger = service.GetService<SerilogHelper>();
|
|
|
|
var logger = service.GetService<SerilogHelper>();
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -108,7 +109,7 @@ namespace Sln.Iot.Serial
|
|
|
|
|
|
|
|
|
|
|
|
logger.Info($"物联网数据保存{(inRes ? "成功" : "失败")}");
|
|
|
|
logger.Info($"物联网数据保存{(inRes ? "成功" : "失败")}");
|
|
|
|
|
|
|
|
|
|
|
|
ParamAlarmFilter(iotEnvInstants,_alarmRuleService,logger, webSocket);
|
|
|
|
ParamAlarmFilter(iotEnvInstants,_alarmRuleService,logger, webSocket,stringChange);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -127,7 +128,7 @@ namespace Sln.Iot.Serial
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void ParamAlarmFilter(List<RecordIotEnvInstant> iotEnvInstants, IBaseAlarmRuleService _alarmRuleService, SerilogHelper _logger, WebSocketBusiness _webSocket)
|
|
|
|
private static void ParamAlarmFilter(List<RecordIotEnvInstant> iotEnvInstants, IBaseAlarmRuleService _alarmRuleService, SerilogHelper _logger, WebSocketBusiness _webSocket,StringChange stringChange)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (iotEnvInstants == null)
|
|
|
|
if (iotEnvInstants == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -178,9 +179,10 @@ namespace Sln.Iot.Serial
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MonitorAlarmDto monitorAlarmDto = new MonitorAlarmDto()
|
|
|
|
MonitorAlarmDto monitorAlarmDto = new MonitorAlarmDto()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
monitorId = item.monitorId,
|
|
|
|
monitorId = stringChange.ParseToInt(stringChange.TransformString(item.monitorId)),
|
|
|
|
isFlag = ruleRes.Count() > 0 ? 1 : 0,
|
|
|
|
isFlag = ruleRes.Count() > 0 ? 1 : 0,
|
|
|
|
deviceParam = item,
|
|
|
|
deviceParam = item,
|
|
|
|
alarmRules = ruleRes,
|
|
|
|
alarmRules = ruleRes,
|
|
|
|
|