This commit is contained in:
@@ -198,8 +198,7 @@ namespace AyaNova.Biz
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<UnitMeterReadingBiz>();
|
||||
if (ServerBootConfig.SEEDING || ServerBootConfig.MIGRATING) return;
|
||||
log.LogDebug($"HandlePotentialNotificationEvent processing: [AyaType:{this.BizType}, AyaEvent:{ayaEvent}]");
|
||||
|
||||
await Task.CompletedTask;
|
||||
|
||||
//SPECIFIC EVENTS FOR THIS OBJECT
|
||||
|
||||
//UnitMeterReadingMultipleExceeded event
|
||||
@@ -222,7 +221,9 @@ namespace AyaNova.Biz
|
||||
var lastMeterReading = await ct.UnitMeterReading.AsNoTracking()
|
||||
.Where(x => x.UnitId == proposedObj.UnitId)
|
||||
.OrderByDescending(z => z.MeterDate)
|
||||
.Take(1).FirstOrDefaultAsync();
|
||||
.Skip(1)//because it's already saved this current reading by the time it gets here
|
||||
.Take(1)
|
||||
.FirstOrDefaultAsync();
|
||||
long lastReading = 0;
|
||||
if (lastMeterReading != null)
|
||||
lastReading = lastMeterReading.Meter;
|
||||
|
||||
Reference in New Issue
Block a user