From 23a128ef0f1ff6b82b9de96b4658c17ac4f17e25 Mon Sep 17 00:00:00 2001 From: yanghongwei Date: Sat, 23 Aug 2025 01:38:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=88=97=E8=A1=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/AlarmRepDto.cs | 1 + Model/AlarmReq.cs | 2 +- Service/AlarmService.cs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Model/AlarmRepDto.cs b/Model/AlarmRepDto.cs index f3bc244..4f212e9 100644 --- a/Model/AlarmRepDto.cs +++ b/Model/AlarmRepDto.cs @@ -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; } } diff --git a/Model/AlarmReq.cs b/Model/AlarmReq.cs index ab3c06a..e45ab02 100644 --- a/Model/AlarmReq.cs +++ b/Model/AlarmReq.cs @@ -37,7 +37,7 @@ /// 每页条数 /// public int pageSize { get; set; } = 10; - public long? positionId { get; set; } + public long? positionId { get; set; } } } diff --git a/Service/AlarmService.cs b/Service/AlarmService.cs index 95d1e1a..f048174 100644 --- a/Service/AlarmService.cs +++ b/Service/AlarmService.cs @@ -423,7 +423,7 @@ namespace LY.App.Service var pageitem = await _db.Ado.SqlQueryAsync(string.Format(coutsql, tablesql) + string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize)); var temp = await _db.Queryable() - .Where(s => pageitem.Item2.Contains(s.BatchId)).SplitTable().Select(s => new { s.BatchId, s.freq, s.Id,s.positionId,s.PostionName }).ToListAsync(); + .Where(s => pageitem.Item2.Contains(s.BatchId)).SplitTable().Select(s => new { s.BatchId, s.freq, s.Id,s.positionId,s.PostionName,s.alarmLevel }).ToListAsync(); var query = await _db.Queryable() @@ -447,6 +447,7 @@ namespace LY.App.Service s.Frequency = temp.Where(m => m.BatchId == long.Parse(s.batchId)).OrderByDescending(o => o.Id).FirstOrDefault().freq; s.positionId=temp.Where(m => m.BatchId == long.Parse(s.batchId)).OrderByDescending(o => o.Id).FirstOrDefault().positionId; s.positionName = temp.Where(m => m.BatchId == long.Parse(s.batchId)).OrderByDescending(o => o.Id).FirstOrDefault().PostionName; + s.alarmLevel = temp.Where(m => m.BatchId == long.Parse(s.batchId)).Any(o => o.alarmLevel == 1) ? 1 : 0; }); return new ApiResult() {