This commit is contained in:
@@ -829,7 +829,10 @@ namespace AyaNova.Biz
|
|||||||
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
||||||
batchResults.Clear();
|
batchResults.Clear();
|
||||||
foreach (long batchId in batch)
|
foreach (long batchId in batch)
|
||||||
|
{
|
||||||
|
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||||
batchResults.Add(await PMGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
batchResults.Add(await PMGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (PM w in batchResults)
|
foreach (PM w in batchResults)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -805,7 +805,10 @@ namespace AyaNova.Biz
|
|||||||
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
||||||
batchResults.Clear();
|
batchResults.Clear();
|
||||||
foreach (long batchId in batch)
|
foreach (long batchId in batch)
|
||||||
|
{
|
||||||
|
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||||
batchResults.Add(await QuoteGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
batchResults.Add(await QuoteGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Quote w in batchResults)
|
foreach (Quote w in batchResults)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using EnumsNET;
|
|||||||
using PuppeteerSharp;
|
using PuppeteerSharp;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace AyaNova.Biz
|
namespace AyaNova.Biz
|
||||||
{
|
{
|
||||||
@@ -460,7 +461,13 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//Get data
|
//Get data
|
||||||
log.LogDebug("Getting report data now");
|
log.LogDebug("Getting report data now");
|
||||||
|
// var watch = new Stopwatch();
|
||||||
|
// watch.Start();
|
||||||
var ReportData = await GetReportData(reportRequest, job.GId, RequestIsCustomerWorkOrderReport);
|
var ReportData = await GetReportData(reportRequest, job.GId, RequestIsCustomerWorkOrderReport);
|
||||||
|
// watch.Stop();
|
||||||
|
// log.LogInformation($"GetReportData took {watch.ElapsedMilliseconds}ms to execute");
|
||||||
|
|
||||||
|
|
||||||
//THIS is here to catch scenario where report data returned null because it expired, not because of an issue
|
//THIS is here to catch scenario where report data returned null because it expired, not because of an issue
|
||||||
if (!ReportRenderManager.KeepGoing(job.GId))
|
if (!ReportRenderManager.KeepGoing(job.GId))
|
||||||
return;
|
return;
|
||||||
@@ -490,7 +497,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt");
|
var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt");
|
||||||
|
|
||||||
|
|
||||||
//Keep for debugging headfully
|
//Keep for debugging headfully
|
||||||
//var lo = new LaunchOptions { Headless = false };
|
//var lo = new LaunchOptions { Headless = false };
|
||||||
var lo = new LaunchOptions { Headless = true };
|
var lo = new LaunchOptions { Headless = true };
|
||||||
@@ -516,7 +523,7 @@ namespace AyaNova.Biz
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
log.LogDebug($"Windows: Calling browserFetcher download async now:");
|
||||||
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision);
|
||||||
}
|
}
|
||||||
@@ -760,7 +767,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(report.MarginOptionsTop))
|
if (!string.IsNullOrWhiteSpace(report.MarginOptionsTop))
|
||||||
PdfOptions.MarginOptions.Top = report.MarginOptionsTop;
|
PdfOptions.MarginOptions.Top = report.MarginOptionsTop;
|
||||||
|
|
||||||
PdfOptions.PreferCSSPageSize = report.PreferCSSPageSize;
|
PdfOptions.PreferCSSPageSize = report.PreferCSSPageSize;
|
||||||
PdfOptions.PrintBackground = report.PrintBackground;
|
PdfOptions.PrintBackground = report.PrintBackground;
|
||||||
//Defaults to 1. Scale amount must be between 0.1 and 2.
|
//Defaults to 1. Scale amount must be between 0.1 and 2.
|
||||||
|
|||||||
@@ -1035,8 +1035,6 @@ namespace AyaNova.Biz
|
|||||||
//order the results back into original
|
//order the results back into original
|
||||||
var orderedList = from id in batch join z in batchResults on id equals z.Id select z;
|
var orderedList = from id in batch join z in batchResults on id equals z.Id select z;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
batchResults = null;
|
batchResults = null;
|
||||||
foreach (var w in orderedList)
|
foreach (var w in orderedList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -939,10 +939,7 @@ namespace AyaNova.Biz
|
|||||||
//REPORTING
|
//REPORTING
|
||||||
//
|
//
|
||||||
public async Task<JArray> GetReportData(DataListSelectedRequest dataListSelectedRequest, Guid jobId)
|
public async Task<JArray> GetReportData(DataListSelectedRequest dataListSelectedRequest, Guid jobId)
|
||||||
{
|
{
|
||||||
// #if (DEBUG)
|
|
||||||
// var watch = System.Diagnostics.Stopwatch.StartNew();
|
|
||||||
// #endif
|
|
||||||
//workorder reports for entire workorder or just sub parts all go through here
|
//workorder reports for entire workorder or just sub parts all go through here
|
||||||
//if the ayatype is a descendant of the workorder then only the portion of the workorder from that descendant directly up to the header will be populated and returned
|
//if the ayatype is a descendant of the workorder then only the portion of the workorder from that descendant directly up to the header will be populated and returned
|
||||||
//however if the report template has includeWoItemDescendants=true then the woitems is fully populated
|
//however if the report template has includeWoItemDescendants=true then the woitems is fully populated
|
||||||
@@ -952,19 +949,19 @@ namespace AyaNova.Biz
|
|||||||
List<WorkOrder> batchResults = new List<WorkOrder>();
|
List<WorkOrder> batchResults = new List<WorkOrder>();
|
||||||
while (idList.Any())
|
while (idList.Any())
|
||||||
{
|
{
|
||||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||||
var batch = idList.Take(IReportAbleObject.REPORT_DATA_BATCH_SIZE);
|
var batch = idList.Take(IReportAbleObject.REPORT_DATA_BATCH_SIZE);
|
||||||
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
idList = idList.Skip(IReportAbleObject.REPORT_DATA_BATCH_SIZE).ToArray();
|
||||||
batchResults.Clear();
|
batchResults.Clear();
|
||||||
foreach (long batchId in batch)
|
foreach (long batchId in batch)
|
||||||
{
|
{
|
||||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||||
batchResults.Add(await WorkOrderGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
batchResults.Add(await WorkOrderGetPartialAsync(dataListSelectedRequest.AType, batchId, dataListSelectedRequest.IncludeWoItemDescendants, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (WorkOrder w in batchResults)
|
foreach (WorkOrder w in batchResults)
|
||||||
{
|
{
|
||||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||||
var jo = JObject.FromObject(w);
|
var jo = JObject.FromObject(w);
|
||||||
|
|
||||||
//WorkOrder header custom fields
|
//WorkOrder header custom fields
|
||||||
|
|||||||
Reference in New Issue
Block a user