update librerie steamware + gestione coda con template
This commit is contained in:
@@ -3,7 +3,8 @@ using Newtonsoft.Json;
|
||||
|
||||
//using SteamWare.IO;
|
||||
//using SteamWare.Reports;
|
||||
using SteamWare;
|
||||
//using SteamWare;
|
||||
using SteamWare.Reports;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -96,7 +97,7 @@ namespace MP_MAG.Controllers
|
||||
/// </summary>
|
||||
/// <param name="queueName"></param>
|
||||
/// <returns></returns>
|
||||
protected MagData.reportRichiesto reportByTemplate(string queueName)
|
||||
protected MagData.reportRichiesto reportByQueue(string queueName)
|
||||
{
|
||||
MagData.reportRichiesto report = MagData.reportRichiesto.ND;
|
||||
var qConf = MagDataLayerObj.queueConfRedis.Find(x => x.name == queueName);
|
||||
@@ -113,6 +114,28 @@ namespace MP_MAG.Controllers
|
||||
return report;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera report da conf TipoDoc
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
protected MagData.reportRichiesto reportByTipoDoc(string name)
|
||||
{
|
||||
MagData.reportRichiesto report = MagData.reportRichiesto.ND;
|
||||
var qConf = MagDataLayerObj.reportConfRedis.Find(x => x.name == name);
|
||||
if (qConf != null)
|
||||
{
|
||||
// decodifico
|
||||
try
|
||||
{
|
||||
report = (MagData.reportRichiesto)Enum.Parse(typeof(MagData.reportRichiesto), qConf.template.Replace(".rdlc", ""));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
@@ -126,7 +149,7 @@ namespace MP_MAG.Controllers
|
||||
{
|
||||
// restituisco...
|
||||
int answ = 0;
|
||||
string redVal = memLayer.ML.getRSV(MagDataLayer.redQueueCount);
|
||||
string redVal = SteamWare.memLayer.ML.getRSV(MagDataLayer.redQueueCount);
|
||||
// cerco in redis se ci sia chiave..
|
||||
if (!string.IsNullOrEmpty(redVal))
|
||||
{
|
||||
@@ -135,10 +158,10 @@ namespace MP_MAG.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
int ttlPrintCount = memLayer.ML.CRI("ttlPrintCount");
|
||||
int ttlPrintCount = SteamWare.memLayer.ML.CRI("ttlPrintCount");
|
||||
// recupero da dbe e salvo
|
||||
answ = countWaitingDb;
|
||||
memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{answ}", ttlPrintCount);
|
||||
SteamWare.memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{answ}", ttlPrintCount);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -159,13 +182,21 @@ namespace MP_MAG.Controllers
|
||||
reportData currReport = new reportData();
|
||||
Dictionary<string, DataTable> currRdsData;
|
||||
// ciclo!
|
||||
MagData.reportRichiesto tipoRep = MagData.reportRichiesto.ND;
|
||||
foreach (var pjReq in tabPJQ)
|
||||
{
|
||||
currRdsData = caricaDati(reportByTemplate(pjReq.prtName), pjReq.KeyParam);
|
||||
// verifico SE HO un tipo report particolare...
|
||||
tipoRep = reportByTipoDoc(pjReq.TipoReport);
|
||||
if (tipoRep == MagData.reportRichiesto.ND)
|
||||
{
|
||||
tipoRep = reportByQueue(pjReq.prtName);
|
||||
}
|
||||
currRdsData = caricaDati(tipoRep, pjReq.KeyParam);
|
||||
// in base alla coda --> recupero i dati
|
||||
currReport = new reportData()
|
||||
{
|
||||
ticketNum = $"{pjReq.IdxPrintJob}",
|
||||
template = $"{pjReq.TipoReport}",
|
||||
rdsData = currRdsData
|
||||
};
|
||||
answ.Add(currReport);
|
||||
@@ -205,7 +236,7 @@ namespace MP_MAG.Controllers
|
||||
int.TryParse(printAnsw.ticketNum, out idxPJQ);
|
||||
MagDataLayerObj.taPJQ.updateStato(idxPJQ, printAnsw.newStatus);
|
||||
// resetto conteggio in redis...
|
||||
memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{countWaitingDb}", 30);
|
||||
SteamWare.memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{countWaitingDb}", 30);
|
||||
answ = "OK";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user