预警列表调整
This commit is contained in:
parent
8c4fca828d
commit
23a128ef0f
|
|
@ -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; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
/// 每页条数
|
||||
/// </summary>
|
||||
public int pageSize { get; set; } = 10;
|
||||
public long? positionId { get; set; }
|
||||
public long? positionId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ namespace LY.App.Service
|
|||
var pageitem = await _db.Ado.SqlQueryAsync<int, long>(string.Format(coutsql, tablesql) + string.Format(page, tablesql, (input.pageNum - 1) * input.pageSize, input.pageSize));
|
||||
|
||||
var temp = await _db.Queryable<Alarm>()
|
||||
.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<Alarm>()
|
||||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue