Merge branch 'develop' into SDK
This commit is contained in:
+8
-8
@@ -6,12 +6,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace AppData
|
||||
{
|
||||
public enum StatType
|
||||
{
|
||||
BATCH =1,
|
||||
BUNK,
|
||||
SHEET,
|
||||
CART,
|
||||
BIN
|
||||
}
|
||||
public enum StatType
|
||||
{
|
||||
BATCH = 1,
|
||||
BUNK,
|
||||
SHEET,
|
||||
CART,
|
||||
BIN
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=334']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=335']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.versionNumberBeta = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
|
||||
+38
-16
@@ -100,22 +100,6 @@ namespace NKC_WF
|
||||
public string currIpAddress()
|
||||
{
|
||||
string userip = Request.UserHostAddress;
|
||||
//if (Request.UserHostAddress != null)
|
||||
//{
|
||||
// Int64 macinfo = new Int64();
|
||||
// string macSrc = macinfo.ToString("X");
|
||||
// if (macSrc == "0")
|
||||
// {
|
||||
// if (userip == "127.0.0.1")
|
||||
// {
|
||||
// Response.Write("visited Localhost!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// lblIPAdd.Text = userip;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
return userip;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -130,5 +114,43 @@ namespace NKC_WF
|
||||
string answ = $"{baseUrl}{payload}";
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Calcola il rapporto tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="_dividendo"></param>
|
||||
/// <param name="_divisore"></param>
|
||||
/// <returns></returns>
|
||||
public double getRatio(object _dividendo, object _divisore)
|
||||
{
|
||||
double ratio = 0;
|
||||
double dividendo = 0;
|
||||
double divisore = 1;
|
||||
double.TryParse(_dividendo.ToString(), out dividendo);
|
||||
double.TryParse(_divisore.ToString(), out divisore);
|
||||
ratio = dividendo / divisore;
|
||||
return ratio;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina CSS x colore testo da perc svuotamento...
|
||||
/// </summary>
|
||||
/// <param name="ratio"></param>
|
||||
/// <returns></returns>
|
||||
public string getCssByRatio(double ratio)
|
||||
{
|
||||
string answ = "text-dark";
|
||||
if (ratio == 0)
|
||||
{
|
||||
answ = "text-danger";
|
||||
}
|
||||
else if (ratio == 1)
|
||||
{
|
||||
answ = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "text-warning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
|
||||
namespace NKC_WF.Controllers
|
||||
{
|
||||
@@ -210,37 +209,6 @@ namespace NKC_WF.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce numero jobs aperti (stato = 0...), se 0 = NESSUNO
|
||||
/// GET: api/PrintQueue?queueList=|queueOffline|
|
||||
/// </summary>
|
||||
/// <param name="queueList">Elenco code delimitate da |..|</param>
|
||||
/// <returns></returns>
|
||||
//[HttpGet]
|
||||
//[Route("count")]
|
||||
public int GetCount(string queueList)
|
||||
{
|
||||
// restituisco...
|
||||
int answ = 0;
|
||||
string redVal = memLayer.ML.getRSV($"{ComLib.redQueueCountSet}:{queueList}");
|
||||
// cerco in redis se ci sia chiave..
|
||||
if (!string.IsNullOrEmpty(redVal))
|
||||
{
|
||||
// recupero
|
||||
int.TryParse(redVal, out answ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// recupero da db e salvo
|
||||
answ = countWaitingDbQueueMult(queueList);
|
||||
memLayer.ML.setRSV($"{ComLib.redQueueCountSet}:{queueList}", answ.ToString(), memLayer.ML.CRI("cacheQueueSec"));
|
||||
// chiudo gli zombie (stampe non chiuse)...
|
||||
DataLayer.man.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime")));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa una chiamata POST per l'invio in blocco del risultato dell'elaborazione
|
||||
/// POST: api/PrintQueue
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
using AppData;
|
||||
using Newtonsoft.Json;
|
||||
using NKC_SDK;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace NKC_WF.Controllers
|
||||
{
|
||||
public class PrintQueueLenController : ApiController
|
||||
{
|
||||
#region classi gestione PJQ
|
||||
|
||||
/// <summary>
|
||||
/// Conteggio elementi in attesa stampa da DB
|
||||
/// </summary>
|
||||
protected int countWaitingDb
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
// resetto conteggio in redis...
|
||||
DS_Report.PrintJobQueueDataTable tabPJQ = DataLayer.man.taPJQ.getWaiting();
|
||||
if (tabPJQ != null)
|
||||
{
|
||||
answ = tabPJQ.Count;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Conteggio elementi in attesa stampa da DB che fanno parte di un SET di queue
|
||||
/// </summary>
|
||||
protected int countWaitingDbQueueMult(string queueSet)
|
||||
{
|
||||
int answ = 0;
|
||||
// resetto conteggio in redis...
|
||||
DS_Report.PrintJobQueueDataTable tabPJQ = DataLayer.man.taPJQ.getWaiting();
|
||||
if (tabPJQ != null)
|
||||
{
|
||||
var selQueue = tabPJQ.Where(x => queueSet.Contains($"|{x.prtName}|")).ToList();
|
||||
if (selQueue != null)
|
||||
{
|
||||
answ = selQueue.Count;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...) e restituisce Dictionary [nome RDS / tab RDS]
|
||||
/// </summary>
|
||||
/// <param name="tipoReport"></param>
|
||||
/// <param name="keyParam">cod UDC</param>
|
||||
/// <returns>tabella dati</returns>
|
||||
private Dictionary<string, DataTable> caricaDati(reportRichiesto tipoReport, string keyParam)
|
||||
{
|
||||
int intIdx = 0;
|
||||
Dictionary<string, DataTable> answ = new Dictionary<string, DataTable>();
|
||||
DataTable tab = new DataTable();
|
||||
// FIXME TODO...
|
||||
string qrCodeBaseUrl = "";
|
||||
string imagePath = ""; //"http://seriate.steamware.net:8083/NKC/PartsImg/";
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.binPost:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepBin.GetData(intIdx, true, imagePath, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocBin"), tab);
|
||||
break;
|
||||
case reportRichiesto.binPre:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepBin.GetData(intIdx, false, imagePath, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocBin"), tab);
|
||||
break;
|
||||
case reportRichiesto.bunkGroup:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepBunkGroup.GetData(intIdx, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocBunkGroup"), tab);
|
||||
break;
|
||||
case reportRichiesto.bunkList:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepBunkList.GetData(intIdx, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocBunkList"), tab);
|
||||
break;
|
||||
case reportRichiesto.cart:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepCart.GetData(intIdx, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocCart"), tab);
|
||||
break;
|
||||
case reportRichiesto.offline:
|
||||
case reportRichiesto.part:
|
||||
int.TryParse(keyParam, out intIdx);
|
||||
tab = (DataTable)DataLayer.man.taRepPart.GetData(intIdx, qrCodeBaseUrl);
|
||||
answ.Add(memLayer.ML.cdv("ReportDS_DocPart"), tab);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tab.Dispose();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola report da tipo + nome coda...
|
||||
/// </summary>
|
||||
/// <param name="tipo"></param>
|
||||
/// <param name="queueName"></param>
|
||||
/// <returns></returns>
|
||||
protected reportRichiesto reportByTipo(string tipo, string queueName)
|
||||
{
|
||||
reportRichiesto report = reportRichiesto.bunkGroup;
|
||||
switch (tipo)
|
||||
{
|
||||
case "docStack":
|
||||
if (queueName == "queueBunkDetail")
|
||||
{
|
||||
report = reportRichiesto.bunkList;
|
||||
}
|
||||
else
|
||||
{
|
||||
report = reportRichiesto.bunkGroup;
|
||||
}
|
||||
break;
|
||||
case "docBinPre":
|
||||
report = reportRichiesto.binPre;
|
||||
break;
|
||||
case "docBinPost":
|
||||
report = reportRichiesto.binPost;
|
||||
break;
|
||||
case "docCart":
|
||||
report = reportRichiesto.cart;
|
||||
break;
|
||||
case "docPart":
|
||||
report = reportRichiesto.part;
|
||||
break;
|
||||
case "docOffline":
|
||||
report = reportRichiesto.offline;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region REST api call
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce numero jobs aperti (stato = 0...), se 0 = NESSUNO
|
||||
/// GET: api/PrintQueue
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int Get()
|
||||
{
|
||||
// restituisco...
|
||||
int answ = 0;
|
||||
string redVal = memLayer.ML.getRSV(ComLib.redQueueCount);
|
||||
// cerco in redis se ci sia chiave..
|
||||
if (!string.IsNullOrEmpty(redVal))
|
||||
{
|
||||
// recupero
|
||||
int.TryParse(redVal, out answ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// recupero da db e salvo
|
||||
answ = countWaitingDb;
|
||||
memLayer.ML.setRSV(ComLib.redQueueCount, answ.ToString(), memLayer.ML.CRI("cacheQueueSec"));
|
||||
// chiudo gli zombie (stampe non chiuse)...
|
||||
DataLayer.man.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime")));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce numero jobs aperti (stato = 0...), se 0 = NESSUNO
|
||||
/// GET: api/PrintQueue?queueList=|queueOffline|
|
||||
/// </summary>
|
||||
/// <param name="queueList">Elenco code delimitate da |..|</param>
|
||||
/// <returns></returns>
|
||||
public int Get(string queueList)
|
||||
{
|
||||
// restituisco...
|
||||
int answ = 0;
|
||||
string redVal = memLayer.ML.getRSV($"{ComLib.redQueueCountSet}:{queueList}");
|
||||
// cerco in redis se ci sia chiave..
|
||||
if (!string.IsNullOrEmpty(redVal))
|
||||
{
|
||||
// recupero
|
||||
int.TryParse(redVal, out answ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// recupero da db e salvo
|
||||
answ = countWaitingDbQueueMult(queueList);
|
||||
memLayer.ML.setRSV($"{ComLib.redQueueCountSet}:{queueList}", answ.ToString(), memLayer.ML.CRI("cacheQueueSec"));
|
||||
// chiudo gli zombie (stampe non chiuse)...
|
||||
DataLayer.man.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime")));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -637,6 +637,7 @@
|
||||
<Compile Include="Controllers\getMUSheetRevController.cs" />
|
||||
<Compile Include="Controllers\PrintQueueController.cs" />
|
||||
<Compile Include="Controllers\PrintQueueConfController.cs" />
|
||||
<Compile Include="Controllers\PrintQueueLenController.cs" />
|
||||
<Compile Include="Controllers\ReportController.cs" />
|
||||
<Compile Include="Controllers\SheetController.cs" />
|
||||
<Compile Include="Default.aspx.cs">
|
||||
|
||||
@@ -95,44 +95,6 @@ namespace NKC_WF.WebUserControls
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// Calcola il rapporto tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="_dividendo"></param>
|
||||
/// <param name="_divisore"></param>
|
||||
/// <returns></returns>
|
||||
public double getRatio(object _dividendo, object _divisore)
|
||||
{
|
||||
double ratio = 0;
|
||||
double dividendo = 0;
|
||||
double divisore = 1;
|
||||
double.TryParse(_dividendo.ToString(), out dividendo);
|
||||
double.TryParse(_divisore.ToString(), out divisore);
|
||||
ratio = dividendo / divisore;
|
||||
return ratio;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina CSS x colore testo da perc svuotamento...
|
||||
/// </summary>
|
||||
/// <param name="ratio"></param>
|
||||
/// <returns></returns>
|
||||
public string getCssByRatio(double ratio)
|
||||
{
|
||||
string answ = "text-dark";
|
||||
if (ratio == 0)
|
||||
{
|
||||
answ = "text-danger";
|
||||
}
|
||||
else if (ratio == 1)
|
||||
{
|
||||
answ = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "text-warning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Dimensione QRCode
|
||||
/// </summary>
|
||||
public int qrSize
|
||||
|
||||
@@ -111,44 +111,6 @@ namespace NKC_WF.WebUserControls
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// Calcola il rapporto tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="_dividendo"></param>
|
||||
/// <param name="_divisore"></param>
|
||||
/// <returns></returns>
|
||||
public double getRatio(object _dividendo, object _divisore)
|
||||
{
|
||||
double ratio = 0;
|
||||
double dividendo = 0;
|
||||
double divisore = 1;
|
||||
double.TryParse(_dividendo.ToString(), out dividendo);
|
||||
double.TryParse(_divisore.ToString(), out divisore);
|
||||
ratio = dividendo / divisore;
|
||||
return ratio;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina CSS x colore testo da perc svuotamento...
|
||||
/// </summary>
|
||||
/// <param name="ratio"></param>
|
||||
/// <returns></returns>
|
||||
public string getCssByRatio(double ratio)
|
||||
{
|
||||
string answ = "text-dark";
|
||||
if (ratio == 0)
|
||||
{
|
||||
answ = "text-danger";
|
||||
}
|
||||
else if (ratio == 1)
|
||||
{
|
||||
answ = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "text-warning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Alla selezione mando in stampa il singolo record
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
|
||||
@@ -57,43 +57,5 @@ namespace NKC_WF.WebUserControls
|
||||
cmp_MU_singleStatCart.titleCss = "bg-success";
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Calcola il rapporto tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="_dividendo"></param>
|
||||
/// <param name="_divisore"></param>
|
||||
/// <returns></returns>
|
||||
public double getRatio(object _dividendo, object _divisore)
|
||||
{
|
||||
double ratio = 0;
|
||||
double dividendo = 0;
|
||||
double divisore = 1;
|
||||
double.TryParse(_dividendo.ToString(), out dividendo);
|
||||
double.TryParse(_divisore.ToString(), out divisore);
|
||||
ratio = dividendo / divisore;
|
||||
return ratio;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina CSS x colore testo da perc svuotamento...
|
||||
/// </summary>
|
||||
/// <param name="ratio"></param>
|
||||
/// <returns></returns>
|
||||
public string getCssByRatio(double ratio)
|
||||
{
|
||||
string answ = "text-dark";
|
||||
if (ratio == 0)
|
||||
{
|
||||
answ = "text-danger";
|
||||
}
|
||||
else if (ratio == 1)
|
||||
{
|
||||
answ = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "text-warning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,44 +138,6 @@ namespace NKC_WF.WebUserControls
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// Calcola il rapporto tra 2 valori
|
||||
/// </summary>
|
||||
/// <param name="_dividendo"></param>
|
||||
/// <param name="_divisore"></param>
|
||||
/// <returns></returns>
|
||||
public double getRatio(object _dividendo, object _divisore)
|
||||
{
|
||||
double ratio = 0;
|
||||
double dividendo = 0;
|
||||
double divisore = 1;
|
||||
double.TryParse(_dividendo.ToString(), out dividendo);
|
||||
double.TryParse(_divisore.ToString(), out divisore);
|
||||
ratio = dividendo / divisore;
|
||||
return ratio;
|
||||
}
|
||||
/// <summary>
|
||||
/// determina CSS x colore testo da perc svuotamento...
|
||||
/// </summary>
|
||||
/// <param name="ratio"></param>
|
||||
/// <returns></returns>
|
||||
public string getCssByRatio(double ratio)
|
||||
{
|
||||
string answ = "text-dark";
|
||||
if (ratio == 0)
|
||||
{
|
||||
answ = "text-danger";
|
||||
}
|
||||
else if (ratio == 1)
|
||||
{
|
||||
answ = "text-success";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "text-warning";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Dimensione QRCode
|
||||
/// </summary>
|
||||
public int qrSize
|
||||
|
||||
Reference in New Issue
Block a user