Qualche ottimizzazione + FIX x stampa
This commit is contained in:
Vendored
+1
-1
@@ -7,7 +7,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=86']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=87']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'LPA'
|
||||
|
||||
+65
-35
@@ -76,7 +76,7 @@ namespace LPA
|
||||
/// <summary>
|
||||
/// Variabile appoggio semaforo divieto print x evitare accodamenti... 15 sec da last check...
|
||||
/// </summary>
|
||||
protected DateTime vetoPrint;
|
||||
protected static DateTime vetoPrint;
|
||||
/// <summary>
|
||||
/// Modalità demo/test printing locale
|
||||
/// </summary>
|
||||
@@ -132,7 +132,7 @@ namespace LPA
|
||||
/// </summary>
|
||||
private void checkShowTray()
|
||||
{
|
||||
if(memLayer.ML.CRB("startOnTray"))
|
||||
if (memLayer.ML.CRB("startOnTray"))
|
||||
{
|
||||
|
||||
WindowState = FormWindowState.Minimized;
|
||||
@@ -878,7 +878,8 @@ namespace LPA
|
||||
{
|
||||
// verifico ed aggiorno quantità coda
|
||||
int numTot = 0;
|
||||
string urlApiQueue = $"{serverBaseAddr}/api/PrintQueueLen";
|
||||
string urlApiQueue = $"{serverBaseAddr}/api/PrintQueue";
|
||||
string urlApiQueueLen = $"{serverBaseAddr}/api/PrintQueueLen";
|
||||
// verifico il modo di controllo code: SE è signle --> chiamo metodo con le SOLE code gestite...
|
||||
if (!string.IsNullOrEmpty(memLayer.ML.CRS("queueCheckMode")))
|
||||
{
|
||||
@@ -895,10 +896,10 @@ namespace LPA
|
||||
// aggiungo "|" finale;
|
||||
listManQueue += "|";
|
||||
}
|
||||
urlApiQueue = $"{serverBaseAddr}/api/PrintQueueLen?queueList={listManQueue}";
|
||||
urlApiQueueLen = $"{serverBaseAddr}/api/PrintQueueLen?queueList={listManQueue}";
|
||||
}
|
||||
}
|
||||
string rawData = callUrl(urlApiQueue);
|
||||
string rawData = callUrl(urlApiQueueLen);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
try
|
||||
@@ -911,7 +912,7 @@ namespace LPA
|
||||
// se ho stampe in coda --> verifico code gestite
|
||||
foreach (var coda in queueSetupConf)
|
||||
{
|
||||
string urlSingleQueue = $"{serverBaseAddr}/api/PrintQueue/{coda.Key}";
|
||||
string urlSingleQueue = $"{urlApiQueue}/{coda.Key}";
|
||||
rawData = callUrl(urlSingleQueue);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
@@ -928,35 +929,8 @@ namespace LPA
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (vetoPrint < adesso)
|
||||
{
|
||||
vetoPrint = adesso.AddSeconds(300);
|
||||
foreach (var item in report2print)
|
||||
{
|
||||
reportPrinter rPrint = new reportPrinter();
|
||||
bool fatto = false;
|
||||
bool fattoPdf = false;
|
||||
// se ho almeno 1 stampa --> lancio!
|
||||
queueConf confCoda = listQueue.Find(conf => conf.name == coda.Key);
|
||||
if (confCoda != null)
|
||||
{
|
||||
fatto = rPrint.printReport(confCoda.template, localReportPath, coda.Value.Printer, item.rdsData, confCoda.deviceInfoParam, true);
|
||||
}
|
||||
// fatta stampa aggiorno server con indicazione ceh ho stampato
|
||||
if (fatto)
|
||||
{
|
||||
coda.Value.NumWaiting--;
|
||||
coda.Value.NumDone++;
|
||||
// compongo payload...
|
||||
printTask printResult = new printTask()
|
||||
{
|
||||
ticketNum = item.ticketNum,
|
||||
newStatus = 1,
|
||||
message = ""
|
||||
};
|
||||
string payload = JsonConvert.SerializeObject(printResult);
|
||||
// chiamo in put print result!
|
||||
postUrl(urlApiQueue, payload);
|
||||
}
|
||||
}
|
||||
vetoPrint = adesso.AddSeconds(20);
|
||||
printSingleQueue(urlApiQueue, coda, report2print);
|
||||
vetoPrint = adesso;
|
||||
}
|
||||
}
|
||||
@@ -972,6 +946,62 @@ namespace LPA
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Effettua la stampa di una singola coda...
|
||||
/// </summary>
|
||||
/// <param name="urlApiQueue"></param>
|
||||
/// <param name="coda"></param>
|
||||
/// <param name="report2print"></param>
|
||||
private void printSingleQueue(string urlApiQueue, KeyValuePair<string, printQueue> coda, List<reportData> report2print)
|
||||
{
|
||||
// metodi thread da rivedere... ma si "Pestano i piedi" in scarico
|
||||
////Task.Run(() => Method1()).Wait();
|
||||
////t.Wait();
|
||||
///
|
||||
//List<Task> tasks = new List<Task>();
|
||||
//Task t = Task.Run(() => printSingleQueue(urlApiQueue, coda, report2print));
|
||||
//tasks.Add(t);
|
||||
//Task.WaitAll(tasks.ToArray());
|
||||
|
||||
|
||||
// oggetto x stampa report...
|
||||
reportPrinter rPrint = new reportPrinter();
|
||||
// array dei task di stampa...
|
||||
List<Task> tasks = new List<Task>();
|
||||
foreach (var item in report2print)
|
||||
{
|
||||
bool fatto = false;
|
||||
// se ho almeno 1 stampa --> lancio!
|
||||
queueConf confCoda = listQueue.Find(conf => conf.name == coda.Key);
|
||||
if (confCoda != null)
|
||||
{
|
||||
fatto = rPrint.printReport(confCoda.template, localReportPath, coda.Value.Printer, item.rdsData, confCoda.deviceInfoParam, true);
|
||||
}
|
||||
// fatta stampa aggiorno server con indicazione che ho stampato
|
||||
if (fatto)
|
||||
{
|
||||
coda.Value.NumWaiting--;
|
||||
coda.Value.NumDone++;
|
||||
// compongo payload...
|
||||
printTask printResult = new printTask()
|
||||
{
|
||||
ticketNum = item.ticketNum,
|
||||
newStatus = 1,
|
||||
message = ""
|
||||
};
|
||||
string payload = JsonConvert.SerializeObject(printResult);
|
||||
// chiamo in put print result!
|
||||
postUrl(urlApiQueue, payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user