This commit is contained in:
2021-12-23 17:48:01 +00:00
parent 8753c41f6b
commit 04abe2adcb
34 changed files with 115 additions and 81 deletions

View File

@@ -938,7 +938,7 @@ namespace AyaNova.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
//REPORTING
//
public async Task<JArray> GetReportData(DataListSelectedRequest dataListSelectedRequest)
public async Task<JArray> GetReportData(DataListSelectedRequest dataListSelectedRequest, DateTime renderTimeOutExpiry)
{
// #if (DEBUG)
// var watch = System.Diagnostics.Stopwatch.StartNew();
@@ -952,6 +952,8 @@ namespace AyaNova.Biz
while (idList.Any())
{
if (DateTime.UtcNow > renderTimeOutExpiry)
throw new ReportRenderTimeOutException();
var batch = idList.Take(IReportAbleObject.REPORT_DATA_BATCH_SIZE);
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
List<WorkOrder> batchResults = new List<WorkOrder>();
@@ -960,6 +962,8 @@ namespace AyaNova.Biz
foreach (WorkOrder w in batchResults)
{
if (DateTime.UtcNow > renderTimeOutExpiry)
throw new ReportRenderTimeOutException();
var jo = JObject.FromObject(w);
//WorkOrder header custom fields
@@ -1108,11 +1112,11 @@ namespace AyaNova.Biz
// IMPORT EXPORT
//
public async Task<JArray> GetExportData(DataListSelectedRequest dataListSelectedRequest)
public async Task<JArray> GetExportData(DataListSelectedRequest dataListSelectedRequest, DateTime renderTimeOutExpiry)
{
//for now just re-use the report data code
//this may turn out to be the pattern for most biz object types but keeping it seperate allows for custom usage from time to time
return await GetReportData(dataListSelectedRequest);
return await GetReportData(dataListSelectedRequest, renderTimeOutExpiry);
}
////////////////////////////////////////////////////////////////////////////////////////////////