细节调整,预警列表,字段新加白名单,预警等级

This commit is contained in:
yanghongwei 2025-08-22 16:50:41 +08:00
parent dceaf4e424
commit b8279ad728
3 changed files with 5 additions and 3 deletions

View File

@ -21,6 +21,7 @@ namespace LY.App.Model
[JsonConverter(typeof(ValueToStringConverter))]
public long positionId { get; set; }
public string positionName { get; set; }
public int alarmLevel { get; set; }
//public long position_id { get; set; }
}

View File

@ -406,7 +406,7 @@ namespace LY.App.Service
var query = await _db.Queryable<Alarm>()
.Where(s => pageitem.Item2.Contains(s.BatchId)).SplitTable()
.GroupBy(s => new { s.BatchId, s.serial_number, s.device_type, s.positionId, s.PostionName, s.freq })
.GroupBy(s => new { s.BatchId, s.serial_number, s.device_type, s.positionId, s.PostionName, s.freq, s.alarmLevel })
.Select(st => new AlarmRepDto
{
batchId = st.BatchId.ToString(),
@ -416,7 +416,8 @@ namespace LY.App.Service
Frequency = SqlFunc.AggregateMax(st.freq),
duration = (SqlFunc.AggregateMax(st.CreateTime) - SqlFunc.AggregateMin(st.CreateTime)).TotalSeconds == 0 ? 1 : (SqlFunc.AggregateMax(st.CreateTime) - SqlFunc.AggregateMin(st.CreateTime)).TotalSeconds,
model = st.device_type,
IsWhitelist = SqlFunc.AggregateMax(st.IsWhitelist)
IsWhitelist = SqlFunc.AggregateMax(st.IsWhitelist),
alarmLevel = SqlFunc.AggregateMax(st.alarmLevel)
}).OrderByDescending(s => s.batchId).ToListAsync();
return new ApiResult()
{

View File

@ -8,7 +8,7 @@
"log2db": true, //
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=114.66.59.70;port=33306;database=lyapp;user=root;password=dklymysql;Pooling=true;"
"DefaultConnection": "server=110.42.35.89;port=13306;database=lyapp;user=root;password=dklymysql;Pooling=true;"
},
"Token": {
"SecretKey": "HWLSNPM+OhlFe4wwEV/teSWsxGjrWbxKnHonxW5Z+mFlQq3zonv5",