This commit is contained in:
@@ -296,6 +296,18 @@ namespace AyaNova.Biz
|
||||
if (o.ContractId != null)
|
||||
o.ContractViz = await ct.Contract.AsNoTracking().Where(x => x.Id == o.ContractId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
|
||||
if (o.Metered)
|
||||
{
|
||||
|
||||
var lastMeter = await ct.UnitMeterReading.AsNoTracking().OrderByDescending(m => m.MeterDate).FirstOrDefaultAsync(x => x.UnitId == o.Id);
|
||||
if (lastMeter != null)
|
||||
{
|
||||
o.LastMeterViz = lastMeter.Meter;
|
||||
o.LastMeterDateViz = lastMeter.MeterDate;
|
||||
o.LastMeterNotesViz = lastMeter.Notes;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -434,7 +446,7 @@ namespace AyaNova.Biz
|
||||
public async Task HandlePotentialNotificationEvent(AyaEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
|
||||
{
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<UnitBiz>();
|
||||
if(ServerBootConfig.SEEDING || ServerBootConfig.MIGRATING) return;
|
||||
if (ServerBootConfig.SEEDING || ServerBootConfig.MIGRATING) return;
|
||||
log.LogDebug($"HandlePotentialNotificationEvent processing: [AyaType:{this.BizType}, AyaEvent:{ayaEvent}]");
|
||||
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
Reference in New Issue
Block a user