This commit is contained in:
2022-07-11 22:12:19 +00:00
parent 74e4c2cc36
commit d404ae94eb
3 changed files with 34 additions and 1 deletions

View File

@@ -232,6 +232,7 @@
</Compile> </Compile>
<Compile Include="Timestamp.cs" /> <Compile Include="Timestamp.cs" />
<Compile Include="TravelRate.cs" /> <Compile Include="TravelRate.cs" />
<Compile Include="UnitMeterReading.cs" />
<Compile Include="UserType.cs" /> <Compile Include="UserType.cs" />
<Compile Include="util.cs" /> <Compile Include="util.cs" />
<Compile Include="Vendor.cs" /> <Compile Include="Vendor.cs" />

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AyaNovaQBI
{
public class UnitMeterReading
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public string Notes { get; set; }
public long Meter { get; set; }
public DateTime MeterDate { get; set; }
public long UnitId { get; set; }
public long? WorkOrderItemUnitId { get; set; }
public string UnitViz { get; set; }
public string WorkOrderViz { get; set; }
}//eoc
}

View File

@@ -6368,7 +6368,10 @@ namespace AyaNovaQBI
{ {
//todo: fetch full unit record here to get lastmeter from it //todo: fetch full unit record here to get lastmeter from it
// [HttpGet("unit/meter-reading/{id}")] // [HttpGet("unit/meter-reading/{id}")]
s = s.Replace("~UNIT_METER~", u.UnitLastMeterViz); var lastMeterResponse = await GetAsync($"unit/meter-reading/{u.UnitId}");
var lastMeterReading = woReponse.ObjectResponse["data"].ToObject<UnitMeterReading>();
if (lastMeterReading != null)
s = s.Replace("~UNIT_METER~", lastMeterReading.Meter.ToString());
} }
} }