This commit is contained in:
2021-08-23 20:14:38 +00:00
parent 5b51d79897
commit 852d2ee21d
3 changed files with 19 additions and 18 deletions

View File

@@ -23,8 +23,8 @@ SERVER
- BUMP AyaNova.csproj version number
- BUILD RELEASE Run buildrelease.bat in server project folder
https://www.ayanova.com/Downloads/v8/ayanova8.alpha.124-win-x64.7z
https://www.ayanova.com/Downloads/v8/migrate124.7z **ARCHIVE IT, otherwise it could be false positived
https://www.ayanova.com/Downloads/v8/ayanova8.alpha.125-win-x64.7z
https://www.ayanova.com/Downloads/v8/migrate125.7z **ARCHIVE IT, otherwise it could be false positived
- COPY TO DEVOPS SERVER
NOTE: if need to replace "files" subfolder on server the rights need to be set to 775

View File

@@ -321,11 +321,11 @@ namespace AyaNova.Api.Controllers
/// <summary>
/// Get Unit Contract name/id if active and not expired
/// Get Unit info required for service workorder on selection
/// </summary>
/// <param name="id">UnitId</param>
/// <returns>Contract name and Id</returns>
[HttpGet("active-contract/{id}")]
/// <returns>Contract name and Id, meter reading status</returns>
[HttpGet("work-order-info/{id}")]
public async Task<IActionResult> GetUnitActiveContract([FromRoute] long id)
{
if (!serverState.IsOpen)
@@ -335,19 +335,20 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
var ret = new NameIdItem { Name = string.Empty, Id = 0 };
var UnitContractInfo = await ct.Unit.AsNoTracking().Where(x => x.Id == id).Select(x => new { x.ContractId, x.ContractExpires }).FirstOrDefaultAsync();
if (UnitContractInfo == null || UnitContractInfo.ContractExpires < DateTime.UtcNow)//none or expired
return Ok(ApiOkResponse.Response(ret));
//Get contract info
var retContract = new NameIdItem { Name = string.Empty, Id = 0 };
var UnitInfo = await ct.Unit.AsNoTracking().Where(x => x.Id == id).Select(x => new { x.ContractId, x.ContractExpires, x.Metered }).FirstOrDefaultAsync();
if (UnitInfo != null && UnitInfo.ContractExpires >= DateTime.UtcNow)//has valid contract
{
var c = await ct.Contract.AsNoTracking().FirstOrDefaultAsync(x => x.Id == UnitInfo.ContractId);
if (c != null && c.Active != false)
{
retContract.Name = c.Name;
retContract.Id = c.Id;
}
}
var c = await ct.Contract.AsNoTracking().FirstOrDefaultAsync(x => x.Id == UnitContractInfo.ContractId);
if (c == null || c.Active == false)
return Ok(ApiOkResponse.Response(ret));
ret.Name = c.Name;
ret.Id = c.Id;
return Ok(ApiOkResponse.Response(ret));
return Ok(ApiOkResponse.Response(new{contract=retContract,IsMetered=UnitInfo.Metered}));
}

View File

@@ -5,7 +5,7 @@ namespace AyaNova.Util
/// </summary>
internal static class AyaNovaVersion
{
public const string VersionString = "8.0.0-alpha.124";
public const string VersionString = "8.0.0-alpha.125";
public const string FullNameAndVersion = "AyaNova server " + VersionString;
}//eoc
}//eons