Compare commits
60 Commits
RC1
...
Jenkins2GitLab
| Author | SHA1 | Date | |
|---|---|---|---|
| c848168552 | |||
| d95a19af32 | |||
| c5e4f95b94 | |||
| 35e00bdb71 | |||
| 8948984b44 | |||
| 58f8d2aee3 | |||
| 951a704b52 | |||
| d518861228 | |||
| 32a0fa1287 | |||
| 33212941c8 | |||
| 59975a335d | |||
| 390046a0c7 | |||
| 149f6251f7 | |||
| 46a0efe748 | |||
| ace620b09d | |||
| 3d87f28004 | |||
| b7071dcbe1 | |||
| fdf937131c | |||
| 1b8a19b036 | |||
| 86bd0f375c | |||
| 9e1d437563 | |||
| 6bd54468dd | |||
| 52a71d236d | |||
| c2fd4870c7 | |||
| b67fae281b | |||
| 22f4455356 | |||
| 8107ba51b9 | |||
| b3062b04fc | |||
| 3739225a28 | |||
| 2db1fbc8d6 | |||
| 85944da9ed | |||
| a598c6793a | |||
| bf30e006c3 | |||
| e799fdf10a | |||
| 34ce093ca9 | |||
| c1d39b73e9 | |||
| 567b966157 | |||
| e076bc3f6b | |||
| fd027e424f | |||
| 3bd8ee233b | |||
| bb9e9ce7d5 | |||
| a5f5a55e34 | |||
| 2ecc7338e6 | |||
| 66c069fb35 | |||
| 361d4338a6 | |||
| 9a964330e3 | |||
| 0e65410340 | |||
| b0e5d54061 | |||
| 9c979582d4 | |||
| 11cae94995 | |||
| 05ca047b5c | |||
| cd533c190b | |||
| efd84437b5 | |||
| 1c36305304 | |||
| f1f1e784da | |||
| 512d25f513 | |||
| f1628818f3 | |||
| b57d20420b | |||
| cbf97a2eb6 | |||
| 284f7ff241 |
+11
-1
@@ -70,6 +70,8 @@ stages:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
before_script:
|
before_script:
|
||||||
- *nuget-fix
|
- *nuget-fix
|
||||||
- dotnet restore GWMS.sln
|
- dotnet restore GWMS.sln
|
||||||
@@ -78,6 +80,8 @@ build:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
@@ -110,6 +114,8 @@ test:
|
|||||||
|
|
||||||
installer:
|
installer:
|
||||||
stage: installer
|
stage: installer
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
@@ -118,13 +124,17 @@ installer:
|
|||||||
# - *nuget-fix
|
# - *nuget-fix
|
||||||
# - dotnet restore
|
# - dotnet restore
|
||||||
script:
|
script:
|
||||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
|
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
|
||||||
|
# pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/
|
||||||
|
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish -r linux-x64 --self-contained false
|
||||||
# qui il deploy su nexus...
|
# qui il deploy su nexus...
|
||||||
- *hashBuild
|
- *hashBuild
|
||||||
- *nexusUpload
|
- *nexusUpload
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
|
tags:
|
||||||
|
- win
|
||||||
only:
|
only:
|
||||||
#- feature/Deploy_CI_CD
|
#- feature/Deploy_CI_CD
|
||||||
# - master
|
# - master
|
||||||
|
|||||||
@@ -26,117 +26,11 @@ namespace GWMS.Data.Controllers
|
|||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
dbCtx = new GWMSContext(configuration);
|
dbCtx = new GWMSContext(configuration);
|
||||||
Log.Info("Avviata classe GWMSController");
|
//Log.Info("Avviata classe GWMSController");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
|
|
||||||
private void CreateSimData(int numDays, int stepMin, int maxHourRate)
|
|
||||||
{
|
|
||||||
// disattivazione per sicurezza
|
|
||||||
#if false
|
|
||||||
ResetController();
|
|
||||||
// generazione dati casuale
|
|
||||||
Random rnd = new Random();
|
|
||||||
foreach (var plant in GetPlants())
|
|
||||||
{
|
|
||||||
var currPlant = GetPlant(plant.PlantId);
|
|
||||||
// imposto limiti e valori attuali...
|
|
||||||
//currPlant.LevelMax = rnd.Next(24, 28) * 1000;
|
|
||||||
int simLevel = rnd.Next(1, (int)currPlant.LevelMax);
|
|
||||||
double simPress = (double)rnd.Next((int)(currPlant.PressMax - 50) * 10, (int)currPlant.PressMax * 10) / 10;
|
|
||||||
double simPressH = (double)rnd.Next((int)(currPlant.PressBHMax - 70) * 10, (int)currPlant.PressBHMax * 10) / 10;
|
|
||||||
double simPressL = (double)rnd.Next((int)(currPlant.PressBLMax - 70) * 10, (int)currPlant.PressBLMax * 10) / 10;
|
|
||||||
currPlant.LevelAct = simLevel;
|
|
||||||
currPlant.PressAct = simPress;
|
|
||||||
currPlant.PressBHAct = simPressH;
|
|
||||||
currPlant.PressBLAct = simPressL;
|
|
||||||
dbCtx.SaveChanges();
|
|
||||||
|
|
||||||
// genero random le soglie x simulare rilievi e ordini
|
|
||||||
int soglia01 = rnd.Next((int)currPlant.LevelMax * 60 / 100, (int)currPlant.LevelMax * 75 / 100);
|
|
||||||
int soglia02 = rnd.Next((int)currPlant.LevelMax * 5 / 100, (int)currPlant.LevelMax * 35 / 100);
|
|
||||||
|
|
||||||
List<PlantLogModel> LogLevels = new List<PlantLogModel>();
|
|
||||||
List<PlantLogModel> LogPressures = new List<PlantLogModel>();
|
|
||||||
List<OrderModel> LogOrders = new List<OrderModel>();
|
|
||||||
|
|
||||||
DateTime adesso = DateTime.Now;
|
|
||||||
int lastLevel = simLevel;
|
|
||||||
int lastOrder = 0;
|
|
||||||
int anticipo = 0;
|
|
||||||
double lastPress = simPress;
|
|
||||||
double lastPressH = simPressH;
|
|
||||||
double lastPressL = simPressL;
|
|
||||||
// simulo numDays gg...
|
|
||||||
for (int i = numDays * 24 * (60 / stepMin); i > 0; i--)
|
|
||||||
{
|
|
||||||
anticipo = i * stepMin;
|
|
||||||
lastLevel = lastLevel - rnd.Next(0, maxHourRate / (60 / stepMin));
|
|
||||||
// se inferiore a soglia 1 --> ordine
|
|
||||||
if (lastLevel + lastOrder < soglia01)
|
|
||||||
{
|
|
||||||
lastOrder = rnd.Next((int)currPlant.LevelMax - soglia01, (int)currPlant.LevelMax - soglia02);
|
|
||||||
LogOrders.Add(new OrderModel() { DtOrder = adesso.AddMinutes(-anticipo), OrderQty = lastOrder, PlantId = plant.PlantId, OrderCode = $"ORD{i:000000}", OrderDesc = "SIM Order", SupplierId = 1, TransporterId = 1 });
|
|
||||||
}
|
|
||||||
|
|
||||||
// se inferiore a soglia 2 --> refill
|
|
||||||
if (lastLevel < soglia02)
|
|
||||||
{
|
|
||||||
lastLevel += lastOrder;
|
|
||||||
lastOrder = 0;
|
|
||||||
}
|
|
||||||
LogLevels.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "Level", PlantId = plant.PlantId, ValNumber = lastLevel });
|
|
||||||
|
|
||||||
// pressioni!
|
|
||||||
lastPress = lastPress - (double)rnd.Next(-30, 25) / 10;
|
|
||||||
lastPressH = lastPressH - (double)rnd.Next(-25, 20) / 10;
|
|
||||||
lastPressL = lastPressL - (double)rnd.Next(-25, 20) / 10;
|
|
||||||
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "MainPress", PlantId = plant.PlantId, ValNumber = lastPress });
|
|
||||||
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "PressBH", PlantId = plant.PlantId, ValNumber = lastPressH });
|
|
||||||
LogPressures.Add(new PlantLogModel() { DtEvent = adesso.AddMinutes(-anticipo), FluxType = "PressBL", PlantId = plant.PlantId, ValNumber = lastPressL });
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dbCtx
|
|
||||||
.DbSetPlantLog
|
|
||||||
.AddRange(LogLevels);
|
|
||||||
|
|
||||||
dbCtx
|
|
||||||
.DbSetPlantLog
|
|
||||||
.AddRange(LogPressures);
|
|
||||||
|
|
||||||
// salvo sul DB!
|
|
||||||
dbCtx.SaveChanges();
|
|
||||||
Log.Info($"Effettuato inserimento {LogLevels.Count} record PlantLog");
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Log.Error($"Eccezione in salvataggio PlantLog{Environment.NewLine}{exc}");
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
dbCtx
|
|
||||||
.DbSetOrders
|
|
||||||
.AddRange(LogOrders);
|
|
||||||
|
|
||||||
// salvo sul DB!
|
|
||||||
dbCtx.SaveChanges();
|
|
||||||
Log.Info($"Effettuato inserimento {LogOrders.Count} record Orders");
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Log.Error($"Eccezione in salvataggio Orders{Environment.NewLine}{exc}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private Methods
|
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -156,6 +50,7 @@ namespace GWMS.Data.Controllers
|
|||||||
{
|
{
|
||||||
// Clear database context
|
// Clear database context
|
||||||
dbCtx.Dispose();
|
dbCtx.Dispose();
|
||||||
|
//Log.Info("Dispose di GWMSController");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ConfigModel> GetConfig()
|
public List<ConfigModel> GetConfig()
|
||||||
@@ -261,9 +156,9 @@ namespace GWMS.Data.Controllers
|
|||||||
public List<PlantDTO> GetPlantsDTO(int maxRecords)
|
public List<PlantDTO> GetPlantsDTO(int maxRecords)
|
||||||
{
|
{
|
||||||
List<PlantDTO> dbResult = new List<PlantDTO>();
|
List<PlantDTO> dbResult = new List<PlantDTO>();
|
||||||
using (GWMSContext dbCtxMult = new GWMSContext(_configuration))
|
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
|
||||||
{
|
{
|
||||||
var plantList = dbCtxMult
|
var plantList = localDbCtx
|
||||||
.DbSetPlant
|
.DbSetPlant
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
@@ -330,7 +225,7 @@ namespace GWMS.Data.Controllers
|
|||||||
List<WeekPlanModel> dbResult = new List<WeekPlanModel>();
|
List<WeekPlanModel> dbResult = new List<WeekPlanModel>();
|
||||||
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
|
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
|
||||||
{
|
{
|
||||||
dbResult = dbCtx
|
dbResult = localDbCtx
|
||||||
.DbSetPlantSupplWeekPlan
|
.DbSetPlantSupplWeekPlan
|
||||||
.Include(p => p.Plant)
|
.Include(p => p.Plant)
|
||||||
.Include(s => s.Supplier)
|
.Include(s => s.Supplier)
|
||||||
@@ -451,6 +346,7 @@ namespace GWMS.Data.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PlantDTO PlantDTO(int PlantId, int maxRecords)
|
public PlantDTO PlantDTO(int PlantId, int maxRecords)
|
||||||
{
|
{
|
||||||
|
DateTime lastRec = DateTime.Today;
|
||||||
var currPlant = GetPlant(PlantId);
|
var currPlant = GetPlant(PlantId);
|
||||||
PlantDTO answ = new PlantDTO();
|
PlantDTO answ = new PlantDTO();
|
||||||
List<TSData> LevelTS = new List<TSData>();
|
List<TSData> LevelTS = new List<TSData>();
|
||||||
@@ -461,10 +357,10 @@ namespace GWMS.Data.Controllers
|
|||||||
List<TSData> PressBLTS = new List<TSData>();
|
List<TSData> PressBLTS = new List<TSData>();
|
||||||
List<TSData> OrderTS = new List<TSData>();
|
List<TSData> OrderTS = new List<TSData>();
|
||||||
|
|
||||||
using (GWMSContext dbCtxMult = new GWMSContext(_configuration))
|
using (GWMSContext localDbCtx = new GWMSContext(_configuration))
|
||||||
{
|
{
|
||||||
// recupero dal DB
|
// recupero dal DB
|
||||||
var rawLevelData = dbCtxMult
|
var rawLevelData = localDbCtx
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
|
||||||
.OrderByDescending(x => x.DtEvent)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
@@ -472,7 +368,7 @@ namespace GWMS.Data.Controllers
|
|||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawMainPressData = dbCtxMult
|
var rawMainPressData = localDbCtx
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
|
||||||
.OrderByDescending(x => x.DtEvent)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
@@ -480,7 +376,7 @@ namespace GWMS.Data.Controllers
|
|||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawBHPressData = dbCtxMult
|
var rawBHPressData = localDbCtx
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
|
||||||
.OrderByDescending(x => x.DtEvent)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
@@ -488,7 +384,7 @@ namespace GWMS.Data.Controllers
|
|||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawBLPressData = dbCtxMult
|
var rawBLPressData = localDbCtx
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
|
||||||
.OrderByDescending(x => x.DtEvent)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
@@ -496,7 +392,7 @@ namespace GWMS.Data.Controllers
|
|||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawOrderData = dbCtxMult
|
var rawOrderData = localDbCtx
|
||||||
.DbSetOrders
|
.DbSetOrders
|
||||||
.Where(x => x.PlantId == PlantId && x.ExecutionQty == 0)
|
.Where(x => x.PlantId == PlantId && x.ExecutionQty == 0)
|
||||||
.OrderByDescending(x => x.DtOrder)
|
.OrderByDescending(x => x.DtOrder)
|
||||||
@@ -528,6 +424,8 @@ namespace GWMS.Data.Controllers
|
|||||||
double valBH = PressBHTS.Count > 0 ? PressBHTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
double valBH = PressBHTS.Count > 0 ? PressBHTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
||||||
double valBL = PressBLTS.Count > 0 ? PressBLTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
double valBL = PressBLTS.Count > 0 ? PressBLTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
||||||
|
|
||||||
|
lastRec = LevelTS.Count > 0 ? LevelTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().DtEvent : DateTime.Today;
|
||||||
|
|
||||||
PressAct.Add("Main", valMain);
|
PressAct.Add("Main", valMain);
|
||||||
PressAct.Add("BH", valBH);
|
PressAct.Add("BH", valBH);
|
||||||
PressAct.Add("BL", valBL);
|
PressAct.Add("BL", valBL);
|
||||||
@@ -535,6 +433,7 @@ namespace GWMS.Data.Controllers
|
|||||||
// popolo valolri
|
// popolo valolri
|
||||||
answ = new PlantDTO()
|
answ = new PlantDTO()
|
||||||
{
|
{
|
||||||
|
LastUpdate = lastRec,
|
||||||
PlantId = PlantId,
|
PlantId = PlantId,
|
||||||
PlantCode = currPlant.PlantCode,
|
PlantCode = currPlant.PlantCode,
|
||||||
PlantDesc = currPlant.PlantDesc,
|
PlantDesc = currPlant.PlantDesc,
|
||||||
@@ -609,30 +508,6 @@ namespace GWMS.Data.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Rigenera intero DB se riceve ID di un plant SIM...
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="PlantId"></param>
|
|
||||||
public bool RegenDB(int PlantId, int numDays, int stepMin, int maxHourRate)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
var currPlant = GetPlant(PlantId);
|
|
||||||
if (currPlant.PlantCode.StartsWith("PIZ"))
|
|
||||||
{
|
|
||||||
Log.Info("Inizio RegenDB");
|
|
||||||
|
|
||||||
DbAdmin.resetPlantLogTable();
|
|
||||||
|
|
||||||
ResetController();
|
|
||||||
|
|
||||||
CreateSimData(numDays, stepMin, maxHourRate);
|
|
||||||
Log.Info("Dati SIM generati");
|
|
||||||
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetController()
|
public void ResetController()
|
||||||
{
|
{
|
||||||
dbCtx = new GWMSContext(_configuration);
|
dbCtx = new GWMSContext(_configuration);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ namespace GWMS.Data.DTO
|
|||||||
public string PlantCode { get; set; } = "";
|
public string PlantCode { get; set; } = "";
|
||||||
public string PlantDesc { get; set; } = "";
|
public string PlantDesc { get; set; } = "";
|
||||||
|
|
||||||
|
public DateTime LastUpdate { get; set; } = DateTime.Today.AddDays(DateTime.Today.DayOfYear);
|
||||||
|
|
||||||
public double LevelMax { get; set; } = 99999;
|
public double LevelMax { get; set; } = 99999;
|
||||||
|
|
||||||
public double LevelAct { get; set; } = 0;
|
public double LevelAct { get; set; } = 0;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="row px-1 text-light">
|
<div class="form-row text-light">
|
||||||
<div class="col-5 pr-0 text-left">
|
<div class="col-5 pr-0 text-left">
|
||||||
GWMS <span class="small">v.@version</span>
|
GWMS <span class="small">v.@version</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
@inject MessageService AppMessages
|
@inject MessageService AppMessages
|
||||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||||
|
|
||||||
<div class="row pt-3">
|
<div class="form-row pt-3">
|
||||||
<div class="col-6 col-sm-6 col-lg-4 col-xl-3">
|
<div class="col-7 col-md-6 col-lg-4 col-xl-3">
|
||||||
<LoginDisplay></LoginDisplay>
|
<LoginDisplay></LoginDisplay>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
|
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
|
||||||
<span class="@PageIcon" aria-hidden="true"></span> @PageName
|
<span class="@PageIcon" aria-hidden="true"></span> @PageName
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 col-sm-6 col-lg-4 col-xl-3 text-right">
|
<div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right">
|
||||||
@if (ShowSearch)
|
@if (ShowSearch)
|
||||||
{
|
{
|
||||||
<SearchMod></SearchMod>
|
<SearchMod></SearchMod>
|
||||||
|
|||||||
@@ -8,8 +8,13 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<a title="LogOut" href="Identity/Account/LogOut" class="btn btn-sm btn-danger"><i class="fas fa-sign-out-alt"></i></a>
|
<a title="LogOut" href="Identity/Account/LogOut" class="btn btn-sm btn-danger"><i class="fas fa-sign-out-alt"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<a title="Manage" href="Identity/Account/Manage" class="btn btn-sm btn-outline-dark mx-0 px-1">
|
<a title="Gestione account @userName" href="Identity/Account/Manage" class="btn btn-sm btn-outline-dark mx-0 px-1">
|
||||||
<i class="fas fa-user-alt"></i> @userName.Substring(0, 10) ...
|
<div class="d-none d-sm-block">
|
||||||
|
<i class="fas fa-user-alt"></i> @StringLim(userName, 30)
|
||||||
|
</div>
|
||||||
|
<div class="d-block d-sm-none">
|
||||||
|
<i class="fas fa-user-alt"></i> @StringLim(userName, 15)
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
@@ -48,4 +53,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected string StringLim(string original, int maxLen)
|
||||||
|
{
|
||||||
|
return original.Length <= maxLen ? original : $"{original.Substring(0, maxLen - 3)}...";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-1">
|
<div class="col-12 col-lg-1">
|
||||||
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />
|
<div id="qrCodeImg"></div>
|
||||||
|
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />*@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-9 align-items-center">
|
<div class="col-12 col-lg-9 align-items-center">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -266,6 +267,20 @@
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
|
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string rawCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (_currItem != null)
|
||||||
|
{
|
||||||
|
answ = _currItem.OrderCode;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task ReloadAllData()
|
protected async Task ReloadAllData()
|
||||||
@@ -290,17 +305,17 @@
|
|||||||
return q[parmName] ?? "";
|
return q[parmName] ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Restituisce URL immagine QRCode
|
///// Restituisce URL immagine QRCode
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
protected string getImgUrl(object QrValue)
|
//protected string getImgUrl(object QrValue)
|
||||||
{
|
//{
|
||||||
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
||||||
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
||||||
string answ = $"{baseUrl}{payload}";
|
// string answ = $"{baseUrl}{payload}";
|
||||||
return answ;
|
// return answ;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
@inject MessageService AppMService
|
@inject MessageService AppMService
|
||||||
@inject GWMSDataService DataService
|
@inject GWMSDataService DataService
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
@inject IJSRuntime JSRuntime
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header bg-info text-light">
|
<div class="card-header bg-info text-light">
|
||||||
@@ -17,10 +18,11 @@
|
|||||||
<EditForm Model="@_currItem">
|
<EditForm Model="@_currItem">
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-2">
|
<div class="col-12 col-lg-1">
|
||||||
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />
|
<div id="qrCodeImg"></div>
|
||||||
|
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" width="85" />*@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-8 align-items-center">
|
<div class="col-12 col-lg-9 align-items-center">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -66,10 +68,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-lg-2">
|
<div class="col-12 col-lg-2">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button type="button" class="btn btn-outline-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
|
<button type="button" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="button" class="btn btn-outline-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
|
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -138,6 +140,20 @@
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
|
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string rawCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (_currItem != null)
|
||||||
|
{
|
||||||
|
answ = _currItem.OrderCode;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task ReloadAllData()
|
protected async Task ReloadAllData()
|
||||||
@@ -145,17 +161,17 @@
|
|||||||
transpList = await DataService.TransportersGetAll();
|
transpList = await DataService.TransportersGetAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Restituisce URL immagine QRCode
|
///// Restituisce URL immagine QRCode
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
protected string getImgUrl(object QrValue)
|
//protected string getImgUrl(object QrValue)
|
||||||
{
|
//{
|
||||||
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
||||||
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
||||||
string answ = $"{baseUrl}{payload}";
|
// string answ = $"{baseUrl}{payload}";
|
||||||
return answ;
|
// return answ;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,50 +17,14 @@
|
|||||||
{
|
{
|
||||||
<EditForm Model="@_currItem">
|
<EditForm Model="@_currItem">
|
||||||
<DataAnnotationsValidator />
|
<DataAnnotationsValidator />
|
||||||
<div class="row">
|
<div class="d-flex flex-column text-center">
|
||||||
<div class="col-12 col-lg-2 text-center">
|
<div class="p-1 flex-grow-1">
|
||||||
<div id="qrCodeImg"></div>
|
<div id="qrCodeImg"></div>
|
||||||
@_currItem.OrderCode
|
@_currItem.OrderCode
|
||||||
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />*@
|
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />*@
|
||||||
</div>
|
</div>
|
||||||
@*<div class="col-12 col-lg-8 align-items-center">
|
<div class="p-1 flex-grow-1">
|
||||||
<div class="row small">
|
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
|
||||||
<div class="col-12">
|
|
||||||
<div class="input-group input-group-sm">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text" style="width: 3em;">
|
|
||||||
<span class="fas fa-truck" aria-hidden="true"></span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<DateEdit @bind-Date="_currItem.DtETA" InputMode="DateInputMode.DateTime" class="form-control" title="ETA (previsione consegna)" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12">
|
|
||||||
<div class="input-group input-group-sm">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text" style="width: 3em;">
|
|
||||||
<span class="fas fa-comment-alt" aria-hidden="true"></span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<InputText id="OrderDesc" @bind-Value="_currItem.OrderDesc" class="form-control" title="Note Ordine (opzionali)" />
|
|
||||||
<div class="input-group-append">
|
|
||||||
<span class="input-group-text">
|
|
||||||
Note
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>*@
|
|
||||||
<div class="col-12 col-lg-2">
|
|
||||||
<div class="row">
|
|
||||||
@*<div class="col">
|
|
||||||
<button type="button" class="btn btn-sm btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
|
|
||||||
</div>*@
|
|
||||||
<div class="col">
|
|
||||||
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</EditForm>
|
</EditForm>
|
||||||
@@ -155,17 +119,17 @@
|
|||||||
transpList = await DataService.TransportersGetAll();
|
transpList = await DataService.TransportersGetAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Restituisce URL immagine QRCode
|
///// Restituisce URL immagine QRCode
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
protected string getImgUrl(object QrValue)
|
//protected string getImgUrl(object QrValue)
|
||||||
{
|
//{
|
||||||
string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
|
||||||
string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
|
||||||
string answ = $"{baseUrl}{payload}";
|
// string answ = $"{baseUrl}{payload}";
|
||||||
return answ;
|
// return answ;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="col-5 pr-0 font-weight-bold">
|
<div class="col-5 pr-0 font-weight-bold">
|
||||||
<h2>@currItem.PlantCode</h2>
|
<h2>@currItem.PlantCode</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-7 text-right">
|
<div class="col-7 text-right align-bottom">
|
||||||
<h4>@currItem.PlantDesc</h4>
|
<h4>@currItem.PlantDesc</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,31 +46,26 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item active d-flex justify-content-between align-items-center">SERBATOIO Principale</li>
|
<li class="list-group-item @headerStatus d-flex justify-content-between align-items-center px-0 py-1 small">
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
<div class="px-1" title="@checkRTime">
|
||||||
<div class="row">
|
SERBATOIO Principale <i class="fas fa-play @playStatus"></i>
|
||||||
@*<div class="col-4 small">
|
</div>
|
||||||
@currItem.LevelAct.ToString("N0")
|
<div class="px-1 text-right">
|
||||||
</div>*@
|
<span><i class="fas fa-database"></i> Livello:</span><span>@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0")</span> | <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
|
||||||
<div class="col-12 text-center small">
|
</div>
|
||||||
<span><i class="fas fa-database"></i> Livello: </span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span> <span>(@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0"))</span>
|
</li>
|
||||||
</div>
|
<li class="list-group-item align-items-center px-1 py-2">
|
||||||
@*<div class="col-4 text-right small">
|
<div class="d-flex flex-column">
|
||||||
@currItem.LevelMax.ToString("N0")
|
<div class="p-1 flex-grow-1">
|
||||||
</div>*@
|
|
||||||
<div class="col-12 small">
|
|
||||||
<Progress>
|
<Progress>
|
||||||
<ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
|
<ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
|
||||||
</Progress>
|
</Progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 px-0 mt-2">
|
<div class="px-1 py-2">
|
||||||
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
|
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@*<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
||||||
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
|
|
||||||
</li>*@
|
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||||
<span><i class="fas fa-compress-arrows-alt"></i> Pressione</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span>
|
<span><i class="fas fa-compress-arrows-alt"></i> Pressione</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using GWMS.Data.DTO;
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Blazorise.Charts;
|
using Blazorise.Charts;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
namespace GWMS.UI.Components
|
namespace GWMS.UI.Components
|
||||||
{
|
{
|
||||||
@@ -56,7 +57,7 @@ namespace GWMS.UI.Components
|
|||||||
Mode = "nearest",
|
Mode = "nearest",
|
||||||
Intersect = false
|
Intersect = false
|
||||||
},
|
},
|
||||||
Animation = true,
|
Animation = false,
|
||||||
Responsive = true,
|
Responsive = true,
|
||||||
AspectRatio = 2,
|
AspectRatio = 2,
|
||||||
type = "line",
|
type = "line",
|
||||||
@@ -75,6 +76,9 @@ namespace GWMS.UI.Components
|
|||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
private IConfiguration Configuration { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
private NavigationManager NavManager { get; set; }
|
private NavigationManager NavManager { get; set; }
|
||||||
|
|
||||||
@@ -112,6 +116,11 @@ namespace GWMS.UI.Components
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
public string checkRTime
|
||||||
|
{
|
||||||
|
get => DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > 2 ? $"Mancata ricezione: ultimo aggiornamento {_currItem.LastUpdate}" : $"Dati Realtime aggiornati al {_currItem.LastUpdate}";
|
||||||
|
}
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public PlantDTO currItem
|
public PlantDTO currItem
|
||||||
{
|
{
|
||||||
@@ -127,13 +136,25 @@ namespace GWMS.UI.Components
|
|||||||
var dataReload = Task.Run(async () =>
|
var dataReload = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
// aggiunta delay o non riesce a disegnare
|
// aggiunta delay o non riesce a disegnare
|
||||||
Thread.Sleep(150);
|
int ChartWaitDelay = 150;
|
||||||
|
int.TryParse(Configuration["ChartWaitDelay"], out ChartWaitDelay);
|
||||||
|
Thread.Sleep(ChartWaitDelay);
|
||||||
await HandleRedraw();
|
await HandleRedraw();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string headerStatus
|
||||||
|
{
|
||||||
|
get => DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > 2 ? "text-secondary" : "active";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string playStatus
|
||||||
|
{
|
||||||
|
get => DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > 2 ? "text-danger" : "text-success";
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
@@ -144,13 +165,13 @@ namespace GWMS.UI.Components
|
|||||||
int numCount = _currItem.LevelTS.Count;
|
int numCount = _currItem.LevelTS.Count;
|
||||||
// passo a 2h se > 3 gg
|
// passo a 2h se > 3 gg
|
||||||
if (numCount > 72)
|
if (numCount > 72)
|
||||||
answ = 2;
|
answ = 3;
|
||||||
// passo a 3h se > 5 gg
|
// passo a 3h se > 5 gg
|
||||||
else if (numCount > 120)
|
else if (numCount > 120)
|
||||||
answ = 3;
|
answ = 4;
|
||||||
// passo a 4h se > 10 gg
|
// passo a 4h se > 10 gg
|
||||||
else if (numCount > 240)
|
else if (numCount > 240)
|
||||||
answ = 4;
|
answ = 5;
|
||||||
redFact = answ;
|
redFact = answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
reportProcess();
|
reportProcess();
|
||||||
await DataService.RegenDB(numDays, stepMin, maxHourRate);
|
//await DataService.RegenDB(numDays, stepMin, maxHourRate);
|
||||||
reportChange();
|
reportChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using GWMS.UI.Data;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -27,11 +28,21 @@ namespace GWMS.UI.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class IOBController : ControllerBase
|
public class IOBController : ControllerBase
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Classe per logging
|
||||||
|
/// </summary>
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public IOBController(GWMSDataService DataService)
|
public IOBController(GWMSDataService DataService)
|
||||||
{
|
{
|
||||||
_DataService = DataService;
|
_DataService = DataService;
|
||||||
|
//Log.Debug("Avviata classe IOBController");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -56,6 +67,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("addOptPar/{id}")]
|
[HttpGet("addOptPar/{id}")]
|
||||||
public string addOptPar(string id, string pName, string pValue)
|
public string addOptPar(string id, string pName, string pValue)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata addOptPar | {id} | {pName} | {pValue}");
|
||||||
return $"N.A. | {id} | {pName} | {pValue}";
|
return $"N.A. | {id} | {pName} | {pValue}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +87,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("addTask2Exe/{id}")]
|
[HttpGet("addTask2Exe/{id}")]
|
||||||
public string addTask2Exe(string id, string taskName, string taskVal)
|
public string addTask2Exe(string id, string taskName, string taskVal)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata addTask2Exe | {id} | {taskName} | {taskVal}");
|
||||||
return $"N.A. | {id} | {taskName} | {taskVal}";
|
return $"N.A. | {id} | {taskName} | {taskVal}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +100,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("alive")]
|
[HttpGet("alive")]
|
||||||
public string alive()
|
public string alive()
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata alive");
|
||||||
return $"OK";
|
return $"OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +114,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("checkLevels/{id}")]
|
[HttpGet("checkLevels/{id}")]
|
||||||
public async Task<string> checkLevels(string id)
|
public async Task<string> checkLevels(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata checkLevels | {id}");
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// ...verifica per ricalcolo ordini...
|
// ...verifica per ricalcolo ordini...
|
||||||
fatto = await _DataService.checkLevels();
|
fatto = await _DataService.checkLevels();
|
||||||
@@ -117,6 +132,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Delete | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -129,6 +145,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("enabled/{id}")]
|
[HttpGet("enabled/{id}")]
|
||||||
public async Task<string> enabled(string id)
|
public async Task<string> enabled(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata enabled | {id}");
|
||||||
string answ = "ND";
|
string answ = "ND";
|
||||||
// se id nullo --> KO!
|
// se id nullo --> KO!
|
||||||
if (id == null)
|
if (id == null)
|
||||||
@@ -152,6 +169,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("evListJson/{id}")]
|
[HttpPost("evListJson/{id}")]
|
||||||
public string evListJson(string id, [FromBody] evJsonPayload rawData)
|
public string evListJson(string id, [FromBody] evJsonPayload rawData)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata evListJson | {id}");
|
||||||
string answ = "KO";
|
string answ = "KO";
|
||||||
#if false
|
#if false
|
||||||
int insDone = 0;
|
int insDone = 0;
|
||||||
@@ -166,7 +184,7 @@ namespace GWMS.UI.Controllers
|
|||||||
{
|
{
|
||||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||||
{
|
{
|
||||||
logger.lg.scriviLog($"Valori letti: idxMacchina: {id} | valore: {item.valore}", tipoLog.INFO);
|
logger.lg.scriviLog($"Valori letti: idxMacchina: {id} | valore: {item.valore}", tipoLog.Debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
||||||
@@ -204,6 +222,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("flog/{id}")]
|
[HttpGet("flog/{id}")]
|
||||||
public async Task<string> flog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt)
|
public async Task<string> flog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata flog | {id} | {flux} | {valore} | {dtEve} | {dtCurr} | {cnt}");
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||||
if (cnt == null)
|
if (cnt == null)
|
||||||
@@ -300,6 +319,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("flogJson/{id}")]
|
[HttpPost("flogJson/{id}")]
|
||||||
public async Task<string> flogJson(string id, [FromBody] flogJsonPayload rawData)
|
public async Task<string> flogJson(string id, [FromBody] flogJsonPayload rawData)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata flogJson | {id}");
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// verifico ci sia valore
|
// verifico ci sia valore
|
||||||
if (rawData != null && !string.IsNullOrEmpty(id))
|
if (rawData != null && !string.IsNullOrEmpty(id))
|
||||||
@@ -338,6 +358,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("forceSplitOdl/{id}")]
|
[HttpPost("forceSplitOdl/{id}")]
|
||||||
public string forceSplitOdl(string id)
|
public string forceSplitOdl(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata forceSplitOdl | {id}");
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,6 +377,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("forceSplitOdlFull/{id}")]
|
[HttpPost("forceSplitOdlFull/{id}")]
|
||||||
public string forceSplitOdlFull(string id, bool doConfirm, bool qtyFromLast, int? roundStep, string keyRichiesta = "")
|
public string forceSplitOdlFull(string id, bool doConfirm, bool qtyFromLast, int? roundStep, string keyRichiesta = "")
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata forceSplitOdlFull | {id}");
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,6 +390,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public string Get()
|
public string Get()
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata Get");
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,6 +404,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public string Get(int id)
|
public string Get(int id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Get | {id}");
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,6 +419,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCounter/{id}")]
|
[HttpGet("getCounter/{id}")]
|
||||||
public string getCounter(string id)
|
public string getCounter(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCounter | {id}");
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,6 +434,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCounterTCRec/{id}")]
|
[HttpGet("getCounterTCRec/{id}")]
|
||||||
public string getCounterTCRec(string id)
|
public string getCounterTCRec(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCounterTCRec | {id}");
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,6 +449,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCurrData/{id}")]
|
[HttpGet("getCurrData/{id}")]
|
||||||
public string getCurrData(string id)
|
public string getCurrData(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCurrData | {id}");
|
||||||
return $"{id}";
|
return $"{id}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,6 +464,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCurrODL/{id}")]
|
[HttpGet("getCurrODL/{id}")]
|
||||||
public string getCurrODL(string id)
|
public string getCurrODL(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCurrODL | {id}");
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,6 +477,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCurrOdlRow/{id}")]
|
[HttpGet("getCurrOdlRow/{id}")]
|
||||||
public string getCurrOdlRow(string id)
|
public string getCurrOdlRow(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCurrOdlRow | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,6 +490,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCurrOdlStart/{id}")]
|
[HttpGet("getCurrOdlStart/{id}")]
|
||||||
public string getCurrOdlStart(string id)
|
public string getCurrOdlStart(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCurrOdlStart | {id}");
|
||||||
return $"{DateTime.Now}";
|
return $"{DateTime.Now}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,6 +503,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getCurrStatoRow/{id}")]
|
[HttpGet("getCurrStatoRow/{id}")]
|
||||||
public string getCurrStatoRow(string id)
|
public string getCurrStatoRow(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getCurrStatoRow | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,6 +516,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getFiles/{id}")]
|
[HttpGet("getFiles/{id}")]
|
||||||
public string getFiles(string id)
|
public string getFiles(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getFiles | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,6 +529,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getIdlePeriod/{id}")]
|
[HttpGet("getIdlePeriod/{id}")]
|
||||||
public int getIdlePeriod(string id)
|
public int getIdlePeriod(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getIdlePeriod | {id}");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,6 +541,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getIob2call/{id}")]
|
[HttpGet("getIob2call/{id}")]
|
||||||
public string getIob2call(string id)
|
public string getIob2call(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getIob2call | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,6 +553,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getM2IOB/{id}")]
|
[HttpGet("getM2IOB/{id}")]
|
||||||
public string getM2IOB(string id)
|
public string getM2IOB(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getM2IOB | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,6 +566,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getObjItems/{id}")]
|
[HttpGet("getObjItems/{id}")]
|
||||||
public string getObjItems(string id)
|
public string getObjItems(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getObjItems | {id}");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,6 +581,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("getTask2Exe/{id}")]
|
[HttpGet("getTask2Exe/{id}")]
|
||||||
public string getTask2Exe(string id)
|
public string getTask2Exe(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata getTask2Exe | {id}");
|
||||||
string answ = "";
|
string answ = "";
|
||||||
#if false
|
#if false
|
||||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||||
@@ -576,6 +613,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("input/{id}")]
|
[HttpGet("input/{id}")]
|
||||||
public string input(string id, string valore, string dtEve, string dtCurr, string cnt)
|
public string input(string id, string valore, string dtEve, string dtCurr, string cnt)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata input | {id} | {valore} | {dtEve} | {dtCurr} | {cnt}");
|
||||||
string answ = "OK";
|
string answ = "OK";
|
||||||
#if false
|
#if false
|
||||||
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||||
@@ -587,7 +625,7 @@ namespace GWMS.UI.Controllers
|
|||||||
DateTime dataOraEvento = DateTime.Now;
|
DateTime dataOraEvento = DateTime.Now;
|
||||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||||
{
|
{
|
||||||
logger.lg.scriviLog($"Valori letti: idxMacchina: {id} | valore: {valore}", tipoLog.INFO);
|
logger.lg.scriviLog($"Valori letti: idxMacchina: {id} | valore: {valore}", tipoLog.Debug);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -607,12 +645,14 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Post([FromBody] string value)
|
public void Post([FromBody] string value)
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata Post");
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/IOB/5
|
// PUT api/IOB/5
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Put | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if false
|
#if false
|
||||||
@@ -692,7 +732,7 @@ namespace GWMS.UI.Controllers
|
|||||||
if (nCall >= nCall2Log)
|
if (nCall >= nCall2Log)
|
||||||
{
|
{
|
||||||
// loggo
|
// loggo
|
||||||
logger.lg.scriviLog(string.Format("IOB_INDEX: effettuate {0} call", nCall), tipoLog.INFO);
|
logger.lg.scriviLog(string.Format("IOB_INDEX: effettuate {0} call", nCall), tipoLog.Debug);
|
||||||
// resetto!
|
// resetto!
|
||||||
memLayer.ML.resetRCnt(DataLayer.mHash("COUNT:pCall:IOB_INDEX"));
|
memLayer.ML.resetRCnt(DataLayer.mHash("COUNT:pCall:IOB_INDEX"));
|
||||||
}
|
}
|
||||||
@@ -748,7 +788,7 @@ namespace GWMS.UI.Controllers
|
|||||||
DateTime dataOraEvento = DateTime.Now;
|
DateTime dataOraEvento = DateTime.Now;
|
||||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||||
{
|
{
|
||||||
logger.lg.scriviLog($"Valori Live:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}liveData: {liveData}", tipoLog.INFO);
|
logger.lg.scriviLog($"Valori Live:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}liveData: {liveData}", tipoLog.Debug);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -897,7 +937,7 @@ namespace GWMS.UI.Controllers
|
|||||||
string answ = "";
|
string answ = "";
|
||||||
DateTime dataOraEvento = DateTime.Now;
|
DateTime dataOraEvento = DateTime.Now;
|
||||||
// salvo SEMPRE log x questo tipo di dati!
|
// salvo SEMPRE log x questo tipo di dati!
|
||||||
logger.lg.scriviLog($"Salvataggio incremento contapezzi:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}pezzi: {qty}", tipoLog.INFO);
|
logger.lg.scriviLog($"Salvataggio incremento contapezzi:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}pezzi: {qty}", tipoLog.Debug);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataLayer DataLayerObj = new DataLayer();
|
DataLayer DataLayerObj = new DataLayer();
|
||||||
@@ -940,7 +980,7 @@ namespace GWMS.UI.Controllers
|
|||||||
DateTime dataOraEvento = DateTime.Now;
|
DateTime dataOraEvento = DateTime.Now;
|
||||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||||
{
|
{
|
||||||
logger.lg.scriviLog($"Salvataggio counter | idxMacchina: {id}", tipoLog.INFO);
|
logger.lg.scriviLog($"Salvataggio counter | idxMacchina: {id}", tipoLog.Debug);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -1093,6 +1133,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("saveConf/{id}")]
|
[HttpPost("saveConf/{id}")]
|
||||||
public string saveConf(string id, [FromBody] System.Text.Json.JsonElement rawQuery)
|
public string saveConf(string id, [FromBody] System.Text.Json.JsonElement rawQuery)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata saveConf | {id}");
|
||||||
// problema deserializzaizone ENUM con classe nuova dotnet 5:
|
// problema deserializzaizone ENUM con classe nuova dotnet 5:
|
||||||
// https://github.com/graphql-dotnet/graphql-dotnet/issues/1439
|
// https://github.com/graphql-dotnet/graphql-dotnet/issues/1439
|
||||||
|
|
||||||
@@ -1131,6 +1172,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("sendReboot")]
|
[HttpGet("sendReboot")]
|
||||||
public string sendReboot(string idxMacchina, string mac)
|
public string sendReboot(string idxMacchina, string mac)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata sendReboot | {idxMacchina} | {mac}");
|
||||||
string answ = "";
|
string answ = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -1158,6 +1200,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("setObjItems/{id}")]
|
[HttpPost("setObjItems/{id}")]
|
||||||
public string setObjItems(string id, [FromBody] List<objItem> currParams)
|
public string setObjItems(string id, [FromBody] List<objItem> currParams)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata setObjItems | {id}");
|
||||||
string answ = "";
|
string answ = "";
|
||||||
if (string.IsNullOrWhiteSpace(id))
|
if (string.IsNullOrWhiteSpace(id))
|
||||||
{
|
{
|
||||||
@@ -1187,6 +1230,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost("uploadFile/{id}")]
|
[HttpPost("uploadFile/{id}")]
|
||||||
public string uploadFile(string id)
|
public string uploadFile(string id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata uploadFile | {id}");
|
||||||
string answ = "";
|
string answ = "";
|
||||||
#if false
|
#if false
|
||||||
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
// questa classe è derivata da Controller.Response... x cui recupero lo stream in altro modo...
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using GWMS.UI.Data;
|
using GWMS.UI.Data;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -15,11 +16,21 @@ namespace GWMS.UI.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class PlantDataController : ControllerBase
|
public class PlantDataController : ControllerBase
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Classe per logging
|
||||||
|
/// </summary>
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public PlantDataController(GWMSDataService DataService)
|
public PlantDataController(GWMSDataService DataService)
|
||||||
{
|
{
|
||||||
_DataService = DataService;
|
_DataService = DataService;
|
||||||
|
Log.Info("Avviata classe PlantDataController");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -36,12 +47,14 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Delete | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/PlantData
|
// GET: api/PlantData
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<PlantDTO>> Get()
|
public async Task<List<PlantDTO>> Get()
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata Get");
|
||||||
// serializzo i dati di PlantDTO dell'impianto richiesto
|
// serializzo i dati di PlantDTO dell'impianto richiesto
|
||||||
List<PlantDTO> ListRecords = await _DataService.PlantsGetAll();
|
List<PlantDTO> ListRecords = await _DataService.PlantsGetAll();
|
||||||
return ListRecords;
|
return ListRecords;
|
||||||
@@ -51,6 +64,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public async Task<PlantDTO> Get(int id)
|
public async Task<PlantDTO> Get(int id)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Get | {id}");
|
||||||
// serializzo i dati di PlantDTO dell'impianto richiesto
|
// serializzo i dati di PlantDTO dell'impianto richiesto
|
||||||
var ListRecords = await _DataService.PlantsGetAll();
|
var ListRecords = await _DataService.PlantsGetAll();
|
||||||
//seleziono plant...
|
//seleziono plant...
|
||||||
@@ -62,12 +76,14 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Post([FromBody] string value)
|
public void Post([FromBody] string value)
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata Post");
|
||||||
}
|
}
|
||||||
|
|
||||||
// PUT api/PlantData/5
|
// PUT api/PlantData/5
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
|
//Log.Debug($"Chiamata Put | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using GWMS.UI.Data;
|
using GWMS.UI.Data;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -15,11 +16,21 @@ namespace GWMS.UI.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class PlantLogController : ControllerBase
|
public class PlantLogController : ControllerBase
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Classe per logging
|
||||||
|
/// </summary>
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public PlantLogController(GWMSDataService DataService)
|
public PlantLogController(GWMSDataService DataService)
|
||||||
{
|
{
|
||||||
_DataService = DataService;
|
_DataService = DataService;
|
||||||
|
Log.Debug("Avviata classe PlantDataController");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -36,12 +47,14 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public void Delete(int id)
|
public void Delete(int id)
|
||||||
{
|
{
|
||||||
|
Log.Debug($"Chiamata Delete | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/PlantLog
|
// GET: api/PlantLog
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<PlantLogModel>> Get()
|
public async Task<List<PlantLogModel>> Get()
|
||||||
{
|
{
|
||||||
|
//Log.Debug("Chiamata Get");
|
||||||
// arrotondo ai 5 minuti
|
// arrotondo ai 5 minuti
|
||||||
DateTime adesso = DateTime.Now;
|
DateTime adesso = DateTime.Now;
|
||||||
int dayHour = adesso.Hour;
|
int dayHour = adesso.Hour;
|
||||||
@@ -57,6 +70,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public async Task<List<PlantLogModel>> Get(int id)
|
public async Task<List<PlantLogModel>> Get(int id)
|
||||||
{
|
{
|
||||||
|
Log.Debug($"Chiamata Get | {id}");
|
||||||
// arrotondo ai 5 minuti
|
// arrotondo ai 5 minuti
|
||||||
DateTime adesso = DateTime.Now;
|
DateTime adesso = DateTime.Now;
|
||||||
int dayHour = adesso.Hour;
|
int dayHour = adesso.Hour;
|
||||||
@@ -72,6 +86,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<ActionResult> Post([FromBody] List<PlantLogModel> newItems)
|
public async Task<ActionResult> Post([FromBody] List<PlantLogModel> newItems)
|
||||||
{
|
{
|
||||||
|
Log.Debug("Chiamata Post");
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// verifico ci sia valore
|
// verifico ci sia valore
|
||||||
if (newItems != null)
|
if (newItems != null)
|
||||||
@@ -92,6 +107,7 @@ namespace GWMS.UI.Controllers
|
|||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public void Put(int id, [FromBody] string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
|
Log.Debug($"Chiamata Put | {id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace GWMS.UI.Data
|
namespace GWMS.UI.Data
|
||||||
{
|
{
|
||||||
public class GWMSDataService
|
public class GWMSDataService : IDisposable
|
||||||
{
|
{
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
@@ -73,9 +73,9 @@ namespace GWMS.UI.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dbController = new GWMS.Data.Controllers.GWMSController(configuration);
|
dbController = new GWMS.Data.Controllers.GWMSController(configuration);
|
||||||
StringBuilder sb = new StringBuilder();
|
//StringBuilder sb = new StringBuilder();
|
||||||
sb.AppendLine($"DbController OK");
|
//sb.AppendLine($"DbController OK");
|
||||||
_logger.LogInformation(sb.ToString());
|
//_logger.LogInformation(sb.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +97,7 @@ namespace GWMS.UI.Data
|
|||||||
/// <param name="newItems"></param>
|
/// <param name="newItems"></param>
|
||||||
private async Task updateCurrDTO(List<PlantLogModel> newItems)
|
private async Task updateCurrDTO(List<PlantLogModel> newItems)
|
||||||
{
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
List<PlantDTO> dbResult = new List<PlantDTO>();
|
List<PlantDTO> dbResult = new List<PlantDTO>();
|
||||||
int PlantId = newItems.FirstOrDefault().PlantId;
|
int PlantId = newItems.FirstOrDefault().PlantId;
|
||||||
string cacheKey = "DATA:PLANTS:ListDTO";
|
string cacheKey = "DATA:PLANTS:ListDTO";
|
||||||
@@ -121,6 +122,7 @@ namespace GWMS.UI.Data
|
|||||||
if (lastLev != null)
|
if (lastLev != null)
|
||||||
{
|
{
|
||||||
currDto.LevelAct = lastLev.ValNumber;
|
currDto.LevelAct = lastLev.ValNumber;
|
||||||
|
currDto.LastUpdate = adesso;
|
||||||
}
|
}
|
||||||
|
|
||||||
// verifico SE c'è MainPress
|
// verifico SE c'è MainPress
|
||||||
@@ -394,6 +396,12 @@ namespace GWMS.UI.Data
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
// Clear database controller
|
||||||
|
dbController.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> HasPlantLog()
|
public async Task<bool> HasPlantLog()
|
||||||
{
|
{
|
||||||
return await Task.FromResult(dbController.HasPlantLog());
|
return await Task.FromResult(dbController.HasPlantLog());
|
||||||
@@ -662,11 +670,6 @@ namespace GWMS.UI.Data
|
|||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> RegenDB(int numDays, int stepMin = 30, int maxHourRate = 800)
|
|
||||||
{
|
|
||||||
return await Task.FromResult(dbController.RegenDB(1, numDays, stepMin, maxHourRate));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetController()
|
public void ResetController()
|
||||||
{
|
{
|
||||||
dbController.ResetController();
|
dbController.ResetController();
|
||||||
|
|||||||
+21
-16
@@ -2,10 +2,17 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Version>1.0.2108.2618</Version>
|
<Version>1.0.2109.0211</Version>
|
||||||
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
|
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
|
||||||
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||||
|
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
|
||||||
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="QuartzHostedService.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Remove="bundleconfig.json" />
|
<Content Remove="bundleconfig.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -13,6 +20,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
|
||||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
|
||||||
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileLinux.pubxml" />
|
||||||
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileWin.pubxml" />
|
||||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
@@ -29,25 +38,21 @@
|
|||||||
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
|
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
|
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
|
||||||
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.4" />
|
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.4" />
|
||||||
<PackageReference Include="Blazorise" Version="0.9.3.7" />
|
<PackageReference Include="Blazorise" Version="0.9.4.3" />
|
||||||
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3.7" />
|
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.4.3" />
|
||||||
<PackageReference Include="Blazorise.Charts" Version="0.9.3.7" />
|
<PackageReference Include="Blazorise.Charts" Version="0.9.4.3" />
|
||||||
<PackageReference Include="Blazorise.Components" Version="0.9.3.7" />
|
<PackageReference Include="Blazorise.Components" Version="0.9.4.3" />
|
||||||
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3.7" />
|
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.4.3" />
|
||||||
<PackageReference Include="ElmahCore" Version="2.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.9" />
|
||||||
<PackageReference Include="ElmahCore.Common" Version="2.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.9" />
|
||||||
<PackageReference Include="ElmahCore.Sql" Version="2.0.6" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.9" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.9">
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.7" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.7" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.7">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" ExcludeAssets="All" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.12.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
|
||||||
<PackageReference Include="Quartz" Version="3.3.2" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace GWMS.UI.Pages
|
|||||||
NavManager.NavigateTo($"GasStation/{args.BarcodeText}");
|
NavManager.NavigateTo($"GasStation/{args.BarcodeText}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task reloadData()
|
private async Task ReloadAllData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
PlantsList = null;
|
PlantsList = null;
|
||||||
@@ -175,7 +175,7 @@ namespace GWMS.UI.Pages
|
|||||||
MessageService.ShowSearch = false;
|
MessageService.ShowSearch = false;
|
||||||
MessageService.PageName = "Stazione";
|
MessageService.PageName = "Stazione";
|
||||||
MessageService.PageIcon = "fas fa-gas-pump pr-2";
|
MessageService.PageIcon = "fas fa-gas-pump pr-2";
|
||||||
await reloadData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ResetData()
|
protected void ResetData()
|
||||||
|
|||||||
@@ -132,7 +132,20 @@
|
|||||||
@foreach (var record in ListRecords)
|
@foreach (var record in ListRecords)
|
||||||
{
|
{
|
||||||
<tr class="@checkSelect(@record.OrderId)">
|
<tr class="@checkSelect(@record.OrderId)">
|
||||||
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-pencil"></span></button></td>
|
<td class="text-nowrap">
|
||||||
|
@if (currRecord == null)
|
||||||
|
{
|
||||||
|
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
|
||||||
|
<span class="oi oi-pencil"></span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button class="btn btn-sm btn-secondary disabled">
|
||||||
|
<i class="oi oi-pencil"></i>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>@record.Plant.PlantCode</div>
|
<div>@record.Plant.PlantCode</div>
|
||||||
<div class="small">@record.Plant.PlantDesc</div>
|
<div class="small">@record.Plant.PlantDesc</div>
|
||||||
|
|||||||
@@ -115,8 +115,6 @@ namespace GWMS.UI.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShowCharts { get; set; } = false;
|
|
||||||
|
|
||||||
private bool ShowClosed
|
private bool ShowClosed
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -308,9 +306,6 @@ namespace GWMS.UI.Pages
|
|||||||
protected void Edit(OrderModel selRecord)
|
protected void Edit(OrderModel selRecord)
|
||||||
{
|
{
|
||||||
// rileggo dal DB il record corrente...
|
// rileggo dal DB il record corrente...
|
||||||
#if false
|
|
||||||
currRecord = selRecord;
|
|
||||||
#endif
|
|
||||||
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
|
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -338,8 +333,8 @@ namespace GWMS.UI.Pages
|
|||||||
protected async Task ReloadAllData()
|
protected async Task ReloadAllData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
//PlantsList = await DataService.PlantsGetAll();
|
|
||||||
SuppliersList = await DataService.SuppliersGetAll();
|
SuppliersList = await DataService.SuppliersGetAll();
|
||||||
|
SelPlantId = 0;
|
||||||
PlantsList = null;
|
PlantsList = null;
|
||||||
await GetClaimsData();
|
await GetClaimsData();
|
||||||
// se ho un plantId valido --> altrimenti non abilitato
|
// se ho un plantId valido --> altrimenti non abilitato
|
||||||
@@ -358,7 +353,6 @@ namespace GWMS.UI.Pages
|
|||||||
PlantsList = new List<PlantDTO>();
|
PlantsList = new List<PlantDTO>();
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
await ReloadData();
|
await ReloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
processRunning = true;
|
processRunning = true;
|
||||||
DataService.RegenDB(numDays, stepMin, maxHourRate);
|
//DataService.RegenDB(numDays, stepMin, maxHourRate);
|
||||||
processRunning = false;
|
processRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace GWMS.UI.Pages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task reloadData()
|
private async Task ReloadAllData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
ListRecords = null;
|
ListRecords = null;
|
||||||
@@ -131,7 +131,7 @@ namespace GWMS.UI.Pages
|
|||||||
MessageService.PageName = "Impianti";
|
MessageService.PageName = "Impianti";
|
||||||
MessageService.PageIcon = "fas fa-gas-pump pr-2";
|
MessageService.PageIcon = "fas fa-gas-pump pr-2";
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||||
await reloadData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Select(PlantDTO selRecord)
|
protected void Select(PlantDTO selRecord)
|
||||||
@@ -143,7 +143,7 @@ namespace GWMS.UI.Pages
|
|||||||
protected async Task UpdateData()
|
protected async Task UpdateData()
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
await reloadData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|||||||
@@ -105,7 +105,20 @@
|
|||||||
@foreach (var record in ListRecords)
|
@foreach (var record in ListRecords)
|
||||||
{
|
{
|
||||||
<tr class="@checkSelect(@record.OrderId)">
|
<tr class="@checkSelect(@record.OrderId)">
|
||||||
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-pencil"></span></button></td>
|
<td class="text-nowrap">
|
||||||
|
@if (currRecord == null)
|
||||||
|
{
|
||||||
|
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
|
||||||
|
<span class="oi oi-pencil"></span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button class="btn btn-sm btn-secondary disabled">
|
||||||
|
<i class="oi oi-pencil"></i>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>@record.Plant.PlantCode</div>
|
<div>@record.Plant.PlantCode</div>
|
||||||
<div class="small">@record.Plant.PlantDesc</div>
|
<div class="small">@record.Plant.PlantDesc</div>
|
||||||
|
|||||||
@@ -76,17 +76,17 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
int answ = 0;
|
int answ = 0;
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.PlantId;
|
answ = AppMService.Order_Filter.PlantId;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.PlantId.Equals(value))
|
if (!AppMService.Order_Filter.PlantId.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.PlantId = value;
|
AppMService.Order_Filter.PlantId = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -98,29 +98,30 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
int answ = 0;
|
int answ = 0;
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.SupplierId;
|
answ = AppMService.Order_Filter.SupplierId;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.SupplierId.Equals(value))
|
if (!AppMService.Order_Filter.SupplierId.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.SupplierId = value;
|
AppMService.Order_Filter.SupplierId = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShowCharts { get; set; } = false;
|
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected MessageService AppMService { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
|
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
|
||||||
|
|
||||||
@@ -132,17 +133,17 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime answ = DateTime.Today.AddDays(1);
|
DateTime answ = DateTime.Today.AddDays(1);
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.DateEnd;
|
answ = AppMService.Order_Filter.DateEnd;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.DateEnd.Equals(value))
|
if (!AppMService.Order_Filter.DateEnd.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.DateEnd = value;
|
AppMService.Order_Filter.DateEnd = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -154,17 +155,17 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime answ = DateTime.Today.AddDays(-1);
|
DateTime answ = DateTime.Today.AddDays(-1);
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.DateStart;
|
answ = AppMService.Order_Filter.DateStart;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.DateStart.Equals(value))
|
if (!AppMService.Order_Filter.DateStart.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.DateStart = value;
|
AppMService.Order_Filter.DateStart = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -174,9 +175,6 @@ namespace GWMS.UI.Pages
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected IJSRuntime JSRuntime { get; set; }
|
protected IJSRuntime JSRuntime { get; set; }
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MessageService { get; set; }
|
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected NavigationManager NavManager { get; set; }
|
protected NavigationManager NavManager { get; set; }
|
||||||
|
|
||||||
@@ -241,7 +239,7 @@ namespace GWMS.UI.Pages
|
|||||||
private async Task ReloadData()
|
private async Task ReloadData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
SearchRecords = await DataService.OrdersGetFilt(MessageService.Order_Filter);
|
SearchRecords = await DataService.OrdersGetFilt(AppMService.Order_Filter);
|
||||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
@@ -252,7 +250,9 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
protected void Edit(OrderModel selRecord)
|
protected void Edit(OrderModel selRecord)
|
||||||
{
|
{
|
||||||
currRecord = selRecord;
|
// rileggo dal DB il record corrente...
|
||||||
|
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
|
||||||
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ForceReload(int newNum)
|
protected void ForceReload(int newNum)
|
||||||
@@ -267,19 +267,21 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
MessageService.ShowSearch = false;
|
DataService.ResetController();
|
||||||
MessageService.PageName = "Fornitore";
|
AppMService.ShowSearch = false;
|
||||||
MessageService.PageIcon = "fas fa-industry pr-2";
|
AppMService.PageName = "Fornitore";
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
AppMService.PageIcon = "fas fa-industry pr-2";
|
||||||
|
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task ReloadAllData()
|
protected async Task ReloadAllData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
PlantsList = await DataService.PlantsGetAll();
|
||||||
|
SelSupplierId = 0;
|
||||||
SuppliersList = null;
|
SuppliersList = null;
|
||||||
await GetClaimsData();
|
await GetClaimsData();
|
||||||
PlantsList = await DataService.PlantsGetAll();
|
|
||||||
// se ho un plantId valido --> altrimenti non abilitato
|
// se ho un plantId valido --> altrimenti non abilitato
|
||||||
if (ClaimSupplierId == 0)
|
if (ClaimSupplierId == 0)
|
||||||
{
|
{
|
||||||
@@ -310,7 +312,7 @@ namespace GWMS.UI.Pages
|
|||||||
currRecord = null;
|
currRecord = null;
|
||||||
SearchRecords = null;
|
SearchRecords = null;
|
||||||
ListRecords = null;
|
ListRecords = null;
|
||||||
MessageService.Order_Filter = SelectOrderData.Init(5, 7);
|
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,6 +325,7 @@ namespace GWMS.UI.Pages
|
|||||||
protected async Task UpdateData()
|
protected async Task UpdateData()
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
|
DataService.ResetController();
|
||||||
await ReloadData();
|
await ReloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +350,7 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void OnSeachUpdated()
|
public async void OnSeachUpdated()
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 pr-0 col-lg-8 h3">
|
<div class="col-6 pr-0 col-lg-8 h3 mb-0">
|
||||||
Consegne
|
Consegne
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 col-lg-4">
|
<div class="col-6 col-lg-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 px-1">
|
<div class="col-6">
|
||||||
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="@icnFiltTime"></i></button>
|
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="@icnFiltTime"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 px-1">
|
<div class="col-6">
|
||||||
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="@icnFiltDest"></i></button>
|
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="@icnFiltDest"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-1">
|
<div class="card-body">
|
||||||
@if (currRecord != null)
|
@if (currRecord != null)
|
||||||
{
|
{
|
||||||
<OrderTranspEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" SupplierId="@currRecord.SupplierId"></OrderTranspEditor>
|
<OrderTranspEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" SupplierId="@currRecord.SupplierId"></OrderTranspEditor>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ namespace GWMS.UI.Pages
|
|||||||
private List<OrderModel> ListRecords;
|
private List<OrderModel> ListRecords;
|
||||||
private List<PlantDTO> PlantsList;
|
private List<PlantDTO> PlantsList;
|
||||||
private List<OrderModel> SearchRecords;
|
private List<OrderModel> SearchRecords;
|
||||||
|
|
||||||
private List<TransporterModel> TransportersList;
|
private List<TransporterModel> TransportersList;
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
@@ -100,18 +99,18 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
int answ = 0;
|
int answ = 0;
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.PlantId;
|
answ = AppMService.Order_Filter.PlantId;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.PlantId.Equals(value))
|
if (!AppMService.Order_Filter.PlantId.Equals(value))
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
MessageService.Order_Filter.PlantId = value;
|
AppMService.Order_Filter.PlantId = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -123,18 +122,18 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
int answ = 0;
|
int answ = 0;
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.TransporterId;
|
answ = AppMService.Order_Filter.TransporterId;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.TransporterId.Equals(value))
|
if (!AppMService.Order_Filter.TransporterId.Equals(value))
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
MessageService.Order_Filter.TransporterId = value;
|
AppMService.Order_Filter.TransporterId = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -145,6 +144,9 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected MessageService AppMService { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
|
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
|
||||||
|
|
||||||
@@ -156,17 +158,17 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime answ = DateTime.Today.AddDays(1);
|
DateTime answ = DateTime.Today.AddDays(1);
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.DateEnd;
|
answ = AppMService.Order_Filter.DateEnd;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.DateEnd.Equals(value))
|
if (!AppMService.Order_Filter.DateEnd.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.DateEnd = value;
|
AppMService.Order_Filter.DateEnd = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -178,17 +180,17 @@ namespace GWMS.UI.Pages
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime answ = DateTime.Today.AddDays(-1);
|
DateTime answ = DateTime.Today.AddDays(-1);
|
||||||
if (MessageService.Order_Filter != null)
|
if (AppMService.Order_Filter != null)
|
||||||
{
|
{
|
||||||
answ = MessageService.Order_Filter.DateStart;
|
answ = AppMService.Order_Filter.DateStart;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!MessageService.Order_Filter.DateStart.Equals(value))
|
if (!AppMService.Order_Filter.DateStart.Equals(value))
|
||||||
{
|
{
|
||||||
MessageService.Order_Filter.DateStart = value;
|
AppMService.Order_Filter.DateStart = value;
|
||||||
var pUpd = Task.Run(async () => await ReloadData());
|
var pUpd = Task.Run(async () => await ReloadData());
|
||||||
pUpd.Wait();
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
@@ -198,9 +200,6 @@ namespace GWMS.UI.Pages
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected IJSRuntime JSRuntime { get; set; }
|
protected IJSRuntime JSRuntime { get; set; }
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MessageService { get; set; }
|
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected NavigationManager NavManager { get; set; }
|
protected NavigationManager NavManager { get; set; }
|
||||||
|
|
||||||
@@ -235,6 +234,7 @@ namespace GWMS.UI.Pages
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task GetClaimsData()
|
private async Task GetClaimsData()
|
||||||
{
|
{
|
||||||
|
ClaimTransporterId = -1;
|
||||||
// recupero auth
|
// recupero auth
|
||||||
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||||
var user = authState.User;
|
var user = authState.User;
|
||||||
@@ -266,9 +266,8 @@ namespace GWMS.UI.Pages
|
|||||||
private async Task ReloadData()
|
private async Task ReloadData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
SearchRecords = await DataService.OrdersGetFilt(MessageService.Order_Filter);
|
SearchRecords = await DataService.OrdersGetFilt(AppMService.Order_Filter);
|
||||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
//ListRecords = SearchRecords.Where(x => x.TransporterId == TransporterIdFilt).Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +277,9 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
protected void Edit(OrderModel selRecord)
|
protected void Edit(OrderModel selRecord)
|
||||||
{
|
{
|
||||||
currRecord = selRecord;
|
// rileggo dal DB il record corrente...
|
||||||
|
var pUpd = Task.Run(async () => currRecord = await DataService.OrderGetByCode(selRecord.OrderCode));
|
||||||
|
pUpd.Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ForceReload(int newNum)
|
protected void ForceReload(int newNum)
|
||||||
@@ -293,12 +294,13 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
DataService.ResetController();
|
||||||
SelPlantId = 0;
|
SelPlantId = 0;
|
||||||
SelTranspId = 0;
|
SelTranspId = 0;
|
||||||
MessageService.ShowSearch = false;
|
AppMService.ShowSearch = false;
|
||||||
MessageService.PageName = "Fornitore";
|
AppMService.PageName = "Fornitore";
|
||||||
MessageService.PageIcon = "fas fa-industry pr-2";
|
AppMService.PageIcon = "fas fa-industry pr-2";
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +308,7 @@ namespace GWMS.UI.Pages
|
|||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
PlantsList = await DataService.PlantsGetAll();
|
PlantsList = await DataService.PlantsGetAll();
|
||||||
|
SelTranspId = 0;
|
||||||
TransportersList = null;
|
TransportersList = null;
|
||||||
await GetClaimsData();
|
await GetClaimsData();
|
||||||
// se ho un plantId valido --> altrimenti non abilitato
|
// se ho un plantId valido --> altrimenti non abilitato
|
||||||
@@ -324,7 +327,6 @@ namespace GWMS.UI.Pages
|
|||||||
PlantsList = new List<PlantDTO>();
|
PlantsList = new List<PlantDTO>();
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
await ReloadData();
|
await ReloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +341,7 @@ namespace GWMS.UI.Pages
|
|||||||
currRecord = null;
|
currRecord = null;
|
||||||
SearchRecords = null;
|
SearchRecords = null;
|
||||||
ListRecords = null;
|
ListRecords = null;
|
||||||
MessageService.Order_Filter = SelectOrderData.Init(5, 7);
|
AppMService.Order_Filter = SelectOrderData.Init(5, 7);
|
||||||
await ReloadAllData();
|
await ReloadAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,6 +373,7 @@ namespace GWMS.UI.Pages
|
|||||||
protected async Task UpdateData()
|
protected async Task UpdateData()
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
|
DataService.ResetController();
|
||||||
await ReloadData();
|
await ReloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,7 +398,7 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void OnSeachUpdated()
|
public async void OnSeachUpdated()
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" href="font-awesome/css/fontawesome.min.css" />
|
<link rel="stylesheet" href="font-awesome/css/fontawesome.min.css" />
|
||||||
|
<link rel="stylesheet" href="Chart.js/Chart.min.css" />
|
||||||
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
|
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
|
||||||
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
|
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
|
||||||
|
|
||||||
@@ -41,9 +42,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- inside of body section and after the div/app tag -->
|
<!-- inside of body section and after the div/app tag -->
|
||||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
<script src="jquery/jquery.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
|
<script src="Chart.js/Chart.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
|
<script src="popper.js/umd/popper.min.js"></script>
|
||||||
<script src="bootstrap/js/bootstrap.min.js"></script>
|
<script src="bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="_content/Blazorise/blazorise.js"></script>
|
<script src="_content/Blazorise/blazorise.js"></script>
|
||||||
@@ -67,8 +68,8 @@
|
|||||||
new QRCode(document.getElementById(elementName),
|
new QRCode(document.getElementById(elementName),
|
||||||
{
|
{
|
||||||
text: rawData,
|
text: rawData,
|
||||||
width: 400,
|
width: 300,
|
||||||
height: 400
|
height: 300
|
||||||
});
|
});
|
||||||
//qrcode.makeCode(rawData);
|
//qrcode.makeCode(rawData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||||
|
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAAD+ZfytfJJzf+XzD0ShcSagAAAAAASAAACgAAAAEAAAAAhSlOT4SIk7WdUrN1YS1qMYAAAAGI+89iBgQqaMJeEi4KxlVpTh9PMYTidkFAAAAO7so25722o8lxnn313D6J0eV2MV</EncryptedPassword>
|
||||||
|
<History>False|2021-06-23T12:54:39.3412623Z;</History>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||||
|
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAAAwZbVLPZ+eVCZgVc7GoE8CAAAAAASAAACgAAAAEAAAAEmDwlS8G30J/kR5K+eX8B4YAAAAZ14uy/TVGN4ui4QHWpgdmwaMob7VeTSiFAAAAC/61bXCe/Mgyo7S2QBvJRJ2GUiZ</EncryptedPassword>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<History>True|2021-06-23T13:11:40.1591388Z;</History>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Package</WebPublishMethod>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
|
<ProjectGuid>5f0dbab0-122f-4a81-be73-161bbefeef59</ProjectGuid>
|
||||||
|
<DesktopBuildPackageLocation>bin\publish\GWMS.UI.zip</DesktopBuildPackageLocation>
|
||||||
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
|
<DeployIisAppPath>Default Web Site/GWMS</DeployIisAppPath>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Package</WebPublishMethod>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||||
|
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||||
|
<ProjectGuid>5f0dbab0-122f-4a81-be73-161bbefeef59</ProjectGuid>
|
||||||
|
<DesktopBuildPackageLocation>bin\publish\GWMS.UI.zip</DesktopBuildPackageLocation>
|
||||||
|
<PackageAsSingleFile>true</PackageAsSingleFile>
|
||||||
|
<DeployIisAppPath>Default Web Site/GWMS</DeployIisAppPath>
|
||||||
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||||
|
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||||
|
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAxNUOeyL5oUSNi/ISzvJtLgAAAAACAAAAAAADZgAAwAAAABAAAADTQmYF8PrkLa4Xb9E/zxuXAAAAAASAAACgAAAAEAAAADLKIlcnZuaCFkaVmfe382YYAAAADxGWDujdGKLnZ+ycw0Vb2K2g5K0dRHB8FAAAAHB9B2k06W3L+M48vPfUvedJRpJX</EncryptedPassword>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
using Quartz;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace GWMS.UI
|
|
||||||
{
|
|
||||||
public class QuartzHostedService : IHostedService
|
|
||||||
{
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
private readonly IScheduler _scheduler;
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
|
||||||
|
|
||||||
public QuartzHostedService(IScheduler scheduler)
|
|
||||||
{
|
|
||||||
_scheduler = scheduler;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Constructors
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
public async Task StartAsync(CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
await _scheduler?.Start(cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task StopAsync(CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
await _scheduler?.Shutdown(cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,11 +11,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CascadingValue Name="ShowSearch" Value=@ShowSearch>
|
<CascadingValue Name="ShowSearch" Value=@ShowSearch>
|
||||||
<div class="main">
|
<div class="main mr-1">
|
||||||
<div class="top-row px-0">
|
<div class="top-row">
|
||||||
<CmpTop></CmpTop>
|
<CmpTop></CmpTop>
|
||||||
</div>
|
</div>
|
||||||
<div class="content pt-1 pt-lg-2 px-2 mb-5">
|
<div class="content pt-1 pt-lg-2 mb-5">
|
||||||
@Body
|
@Body
|
||||||
</div>
|
</div>
|
||||||
<div class="fixed-bottom bottom-row">
|
<div class="fixed-bottom bottom-row">
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
border-bottom: 1px solid #d6d5d5;
|
border-bottom: 1px solid #d6d5d5;
|
||||||
height: 3.5rem;
|
height: 3.5rem;
|
||||||
|
align-items: center;
|
||||||
/*justify-content: space-evenly;
|
/*justify-content: space-evenly;
|
||||||
display: flex;*/
|
display: flex;*/
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-row ::deep a, .top-row .btn-link {
|
.top-row ::deep a, .top-row .btn-link {
|
||||||
@@ -34,37 +34,10 @@
|
|||||||
.bottom-row {
|
.bottom-row {
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
/*border-bottom: 1px solid #313131;*/
|
|
||||||
/*justify-content: flex-end;*/
|
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
/*display: flex;*/
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-row ::deep a, .top-row .btn-link {
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-left: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-row a:first-child {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
@media (max-width: 640.98px) {
|
|
||||||
.top-row:not(.auth) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-row.auth {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-row a, .top-row .btn-link {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
@media (min-width: 641px) {
|
||||||
.page {
|
.page {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -94,6 +94,12 @@
|
|||||||
<span class="@hideText">Planner Consegne</span>
|
<span class="@hideText">Planner Consegne</span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item px-3" title="Setup Parametri">
|
||||||
|
<NavLink class="nav-link" href="Parameters">
|
||||||
|
<i class="fas fa-2x fa-wrench pr-2" aria-hidden="true"></i>
|
||||||
|
<span class="@hideText">Setup Parametri</span>
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
<li class="nav-item px-3" title="Admin Utenti">
|
<li class="nav-item px-3" title="Admin Utenti">
|
||||||
<NavLink class="nav-link" href="UserAdmin">
|
<NavLink class="nav-link" href="UserAdmin">
|
||||||
<i class="fas fa-2x fa-users pr-2" aria-hidden="true"></i>
|
<i class="fas fa-2x fa-users pr-2" aria-hidden="true"></i>
|
||||||
@@ -114,12 +120,6 @@
|
|||||||
<i class="fas fa-2x fa-calendar-alt pr-2" aria-hidden="true"></i>
|
<i class="fas fa-2x fa-calendar-alt pr-2" aria-hidden="true"></i>
|
||||||
<span class="@hideText">Job Scheduler</span>
|
<span class="@hideText">Job Scheduler</span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</li>
|
|
||||||
<li class="nav-item px-3" title="Setup Parametri">
|
|
||||||
<NavLink class="nav-link" href="Parameters">
|
|
||||||
<i class="fas fa-2x fa-wrench pr-2" aria-hidden="true"></i>
|
|
||||||
<span class="@hideText">Setup Parametri</span>
|
|
||||||
</NavLink>
|
|
||||||
</li>*@
|
</li>*@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+11
-14
@@ -1,7 +1,6 @@
|
|||||||
using Blazorise;
|
using Blazorise;
|
||||||
using Blazorise.Bootstrap;
|
using Blazorise.Bootstrap;
|
||||||
using Blazorise.Icons.FontAwesome;
|
using Blazorise.Icons.FontAwesome;
|
||||||
using ElmahCore.Mvc;
|
|
||||||
using GWMS.Data;
|
using GWMS.Data;
|
||||||
using GWMS.UI.Areas.Identity;
|
using GWMS.UI.Areas.Identity;
|
||||||
using GWMS.UI.Data;
|
using GWMS.UI.Data;
|
||||||
@@ -23,8 +22,6 @@ using Microsoft.Extensions.Configuration;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Quartz;
|
|
||||||
using Quartz.Impl;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -79,9 +76,9 @@ namespace GWMS.UI
|
|||||||
});
|
});
|
||||||
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
|
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
|
||||||
|
|
||||||
// Registrazione Elmah:
|
//// Registrazione Elmah:
|
||||||
// https://github.com/ElmahCore/ElmahCore
|
//// https://github.com/ElmahCore/ElmahCore
|
||||||
app.UseElmah();
|
//app.UseElmah();
|
||||||
|
|
||||||
// fix forwarders
|
// fix forwarders
|
||||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||||
@@ -132,18 +129,18 @@ namespace GWMS.UI
|
|||||||
string connStringDB = DbConfig.CONNECTION_STRING;
|
string connStringDB = DbConfig.CONNECTION_STRING;
|
||||||
string connStringRedis = Configuration.GetConnectionString("Redis");
|
string connStringRedis = Configuration.GetConnectionString("Redis");
|
||||||
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||||
var qrCodeUri = new Uri(Configuration["ZCodeUrl"]);
|
//var qrCodeUri = new Uri(Configuration["ZCodeUrl"]);
|
||||||
string qrCodeAddr = qrCodeUri.Host;
|
//string qrCodeAddr = qrCodeUri.Host;
|
||||||
|
|
||||||
// healthchecks
|
// healthchecks
|
||||||
services.AddHealthChecks()
|
services.AddHealthChecks()
|
||||||
.AddMySql(connStringDB, "MySql instance")
|
.AddMySql(connStringDB, "MySql instance")
|
||||||
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => Health.Checks.PingCheck(dbServerAddr))
|
.AddAsyncCheck($"DB PING ({dbServerAddr})", () => Health.Checks.PingCheck(dbServerAddr))
|
||||||
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => Health.Checks.PingCheck(redisSrvAddr))
|
.AddAsyncCheck($"Redis PING ({redisSrvAddr})", () => Health.Checks.PingCheck(redisSrvAddr))
|
||||||
.AddAsyncCheck($"QrCode PING ({qrCodeAddr})", () => Health.Checks.PingCheck(qrCodeAddr))
|
//.AddAsyncCheck($"QrCode PING ({qrCodeAddr})", () => Health.Checks.PingCheck(qrCodeAddr))
|
||||||
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded) // 512 MB max allocated memory
|
.AddProcessAllocatedMemoryHealthCheck(512, "Max Process memory (<512MB)", failureStatus: HealthStatus.Degraded) // 512 MB max allocated memory
|
||||||
.AddRedis(Configuration.GetConnectionString("Redis"), "Redis", failureStatus: HealthStatus.Degraded)
|
.AddRedis(Configuration.GetConnectionString("Redis"), "Redis", failureStatus: HealthStatus.Degraded)
|
||||||
.AddUrlGroup(new Uri(Configuration["ZCodeUrl"]), name: $"QrCode Gen ({Configuration["ZCodeUrl"]})", failureStatus: HealthStatus.Degraded)
|
//.AddUrlGroup(new Uri(Configuration["ZCodeUrl"]), name: $"QrCode Gen ({Configuration["ZCodeUrl"]})", failureStatus: HealthStatus.Degraded)
|
||||||
.AddAsyncCheck($"MySql Root User", () => Health.Checks.DbUserRoot("MySql"))
|
.AddAsyncCheck($"MySql Root User", () => Health.Checks.DbUserRoot("MySql"))
|
||||||
.AddAsyncCheck($"MySql App Users", () => Health.Checks.DbUserApp(DbConfig.DATABASE_NAME))
|
.AddAsyncCheck($"MySql App Users", () => Health.Checks.DbUserApp(DbConfig.DATABASE_NAME))
|
||||||
.AddAsyncCheck($"MySql Identity", () => Health.Checks.DbIdentity(DbConfig.DATABASE_NAME))
|
.AddAsyncCheck($"MySql Identity", () => Health.Checks.DbIdentity(DbConfig.DATABASE_NAME))
|
||||||
@@ -157,8 +154,8 @@ namespace GWMS.UI
|
|||||||
.AddHealthChecksUI(s =>
|
.AddHealthChecksUI(s =>
|
||||||
{
|
{
|
||||||
s.AddHealthCheckEndpoint("GWMS_Services", "health");
|
s.AddHealthCheckEndpoint("GWMS_Services", "health");
|
||||||
s.SetEvaluationTimeInSeconds(15);
|
s.SetEvaluationTimeInSeconds(60);
|
||||||
s.SetMinimumSecondsBetweenFailureNotifications(60);
|
s.SetMinimumSecondsBetweenFailureNotifications(120);
|
||||||
s.SetApiMaxActiveRequests(5);
|
s.SetApiMaxActiveRequests(5);
|
||||||
s.SetHeaderText("GWMS Health Check Status");
|
s.SetHeaderText("GWMS Health Check Status");
|
||||||
})
|
})
|
||||||
@@ -218,8 +215,8 @@ namespace GWMS.UI
|
|||||||
.AddBootstrapProviders()
|
.AddBootstrapProviders()
|
||||||
.AddFontAwesomeIcons();
|
.AddFontAwesomeIcons();
|
||||||
|
|
||||||
// Elmah
|
//// Elmah
|
||||||
services.AddElmah();
|
//services.AddElmah();
|
||||||
//string elmaConn = "Data Source=SQL2016DEV;Initial Catalog=Elmah;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=SHERPA.BBM;";
|
//string elmaConn = "Data Source=SQL2016DEV;Initial Catalog=Elmah;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=SHERPA.BBM;";
|
||||||
//services.AddElmah<SqlErrorLog>(options =>
|
//services.AddElmah<SqlErrorLog>(options =>
|
||||||
//{
|
//{
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
"IntervalMin": 60,
|
"IntervalMin": 60,
|
||||||
"MaxLogRecord": 360,
|
"MaxLogRecord": 360,
|
||||||
"ZCodeUrl": "https://qrcode.steamware.net/",
|
"ZCodeUrl": "https://qrcode.steamware.net/",
|
||||||
|
"ChartWaitDelay": 10,
|
||||||
"logo": "img/LogoPizzaferri.jpg",
|
"logo": "img/LogoPizzaferri.jpg",
|
||||||
"ExternalProviders": {
|
"ExternalProviders": {
|
||||||
"MailKit": {
|
"MailKit": {
|
||||||
|
|||||||
+24
-12
@@ -1,14 +1,26 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"defaultProvider": "cdnjs",
|
"defaultProvider": "cdnjs",
|
||||||
"libraries": [
|
"libraries": [
|
||||||
{
|
{
|
||||||
"library": "font-awesome@5.15.4",
|
"library": "font-awesome@5.15.4",
|
||||||
"destination": "wwwroot/font-awesome/"
|
"destination": "wwwroot/font-awesome/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"library": "bootstrap@4.6.0",
|
"library": "bootstrap@4.6.0",
|
||||||
"destination": "wwwroot/bootstrap/"
|
"destination": "wwwroot/bootstrap/"
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
"library": "Chart.js@2.8.0",
|
||||||
|
"destination": "wwwroot/Chart.js/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"library": "popper.js@1.16.1",
|
||||||
|
"destination": "wwwroot/popper.js/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"library": "jquery@3.5.1",
|
||||||
|
"destination": "wwwroot/jquery/"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* DOM element rendering detection
|
||||||
|
* https://davidwalsh.name/detect-node-insertion
|
||||||
|
*/
|
||||||
|
@keyframes chartjs-render-animation {
|
||||||
|
from { opacity: 0.99; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.chartjs-render-monitor {
|
||||||
|
animation: chartjs-render-animation 0.001s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DOM element resizing detection
|
||||||
|
* https://github.com/marcj/css-element-queries
|
||||||
|
*/
|
||||||
|
.chartjs-size-monitor,
|
||||||
|
.chartjs-size-monitor-expand,
|
||||||
|
.chartjs-size-monitor-shrink {
|
||||||
|
position: absolute;
|
||||||
|
direction: ltr;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
pointer-events: none;
|
||||||
|
visibility: hidden;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chartjs-size-monitor-expand > div {
|
||||||
|
position: absolute;
|
||||||
|
width: 1000000px;
|
||||||
|
height: 1000000px;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chartjs-size-monitor-shrink > div {
|
||||||
|
position: absolute;
|
||||||
|
width: 200%;
|
||||||
|
height: 200%;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
Vendored
+14680
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
|||||||
|
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}
|
||||||
+7
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+10872
File diff suppressed because it is too large
Load Diff
Vendored
+2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -362,6 +362,7 @@ var QRCode;
|
|||||||
this._elImage.src = this._elCanvas.toDataURL("image/png");
|
this._elImage.src = this._elCanvas.toDataURL("image/png");
|
||||||
this._elImage.style.display = "block";
|
this._elImage.style.display = "block";
|
||||||
this._elCanvas.style.display = "none";
|
this._elCanvas.style.display = "none";
|
||||||
|
this._elImage.className = "img-fluid";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Android 2.1 bug workaround
|
// Android 2.1 bug workaround
|
||||||
@@ -471,6 +472,7 @@ var QRCode;
|
|||||||
var nRoundedHeight = Math.round(nHeight);
|
var nRoundedHeight = Math.round(nHeight);
|
||||||
|
|
||||||
_elImage.style.display = "none";
|
_elImage.style.display = "none";
|
||||||
|
_elImage.className = "img-fluid";
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
||||||
for (var row = 0; row < nCount; row++) {
|
for (var row = 0; row < nCount; row++) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -98,4 +98,19 @@ link da approfondire
|
|||||||
- https://github.com/parallelbgls/Modbus.Net
|
- https://github.com/parallelbgls/Modbus.Net
|
||||||
- http://easymodbustcp.net/en/
|
- http://easymodbustcp.net/en/
|
||||||
- https://sourceforge.net/p/easymodbustcp/wiki/Home/
|
- https://sourceforge.net/p/easymodbustcp/wiki/Home/
|
||||||
- https://techitmore.com/dotnet/modbus-tcp-communication-in-net-c/
|
- https://techitmore.com/dotnet/modbus-tcp-communication-in-net-c/
|
||||||
|
|
||||||
|
|
||||||
|
## Appunti
|
||||||
|
|
||||||
|
### Linux debug
|
||||||
|
|
||||||
|
Questa applicazione viene distribuita (localmente in ufficio ed in ovh x cliente finale) su macchina Linux, tramite dotnetcore.
|
||||||
|
|
||||||
|
In particolare su linux x debug dei messaggi di log usare il comando
|
||||||
|
|
||||||
|
|
||||||
|
journalctl -fu kestrel-app-gwms.service
|
||||||
|
|
||||||
|
|
||||||
|
## Versioni
|
||||||
BIN
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<i>GWMS - Gas Warehouse Management System</i>
|
<i>GWMS - Gas Warehouse Management System</i>
|
||||||
<h4>Versione: 1.0.2108.2618</h4>
|
<h4>Versione: 1.0.2109.0211</h4>
|
||||||
<br /> Note di rilascio:
|
<br /> Note di rilascio:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.0.2108.2618
|
1.0.2109.0211
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>1.0.2108.2618</version>
|
<version>1.0.2109.0211</version>
|
||||||
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
|
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
|
||||||
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
|
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
|
||||||
<mandatory>false</mandatory>
|
<mandatory>false</mandatory>
|
||||||
|
|||||||
Reference in New Issue
Block a user