Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86fab02ebf | |||
| 591166189d | |||
| d5e6ff58b4 | |||
| ead8c3c955 | |||
| ba01a4851d | |||
| f7ed3c8b59 | |||
| c56cd613d9 | |||
| f221b3ea19 | |||
| 575af20c54 | |||
| f2a91e09c0 | |||
| 15c3bf012f | |||
| d3e4c65b1c |
@@ -35,6 +35,8 @@ namespace GWMS.Data.Controllers
|
|||||||
|
|
||||||
private void CreateSimData(int numDays, int stepMin, int maxHourRate)
|
private void CreateSimData(int numDays, int stepMin, int maxHourRate)
|
||||||
{
|
{
|
||||||
|
// disattivazione per sicurezza
|
||||||
|
#if false
|
||||||
ResetController();
|
ResetController();
|
||||||
// generazione dati casuale
|
// generazione dati casuale
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
@@ -130,6 +132,7 @@ namespace GWMS.Data.Controllers
|
|||||||
Log.Error($"Eccezione in salvataggio Orders{Environment.NewLine}{exc}");
|
Log.Error($"Eccezione in salvataggio Orders{Environment.NewLine}{exc}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
@@ -227,13 +230,17 @@ namespace GWMS.Data.Controllers
|
|||||||
|
|
||||||
public List<PlantDTO> GetPlantsDTO(int maxRecords)
|
public List<PlantDTO> GetPlantsDTO(int maxRecords)
|
||||||
{
|
{
|
||||||
var plantList = dbCtx
|
List<PlantDTO> dbResult = new List<PlantDTO>();
|
||||||
.DbSetPlant
|
using (GWMSContext dbCtxMult = new GWMSContext(_configuration))
|
||||||
.ToList();
|
{
|
||||||
|
var plantList = dbCtxMult
|
||||||
|
.DbSetPlant
|
||||||
|
.ToList();
|
||||||
|
|
||||||
var dbResult = plantList
|
dbResult = plantList
|
||||||
.Select(x => PlantDTO(x.PlantId, maxRecords))
|
.Select(x => PlantDTO(x.PlantId, maxRecords))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
@@ -353,7 +360,7 @@ namespace GWMS.Data.Controllers
|
|||||||
public PlantDTO PlantDTO(int PlantId, int maxRecords)
|
public PlantDTO PlantDTO(int PlantId, int maxRecords)
|
||||||
{
|
{
|
||||||
var currPlant = GetPlant(PlantId);
|
var currPlant = GetPlant(PlantId);
|
||||||
|
PlantDTO answ = new PlantDTO();
|
||||||
List<TSData> LevelTS = new List<TSData>();
|
List<TSData> LevelTS = new List<TSData>();
|
||||||
Dictionary<string, double> PressAct = new Dictionary<string, double>();
|
Dictionary<string, double> PressAct = new Dictionary<string, double>();
|
||||||
Dictionary<string, List<TSData>> PressTS = new Dictionary<string, List<TSData>>();
|
Dictionary<string, List<TSData>> PressTS = new Dictionary<string, List<TSData>>();
|
||||||
@@ -361,82 +368,87 @@ namespace GWMS.Data.Controllers
|
|||||||
List<TSData> PressBHTS = new List<TSData>();
|
List<TSData> PressBHTS = new List<TSData>();
|
||||||
List<TSData> PressBLTS = new List<TSData>();
|
List<TSData> PressBLTS = new List<TSData>();
|
||||||
List<TSData> OrderTS = new List<TSData>();
|
List<TSData> OrderTS = new List<TSData>();
|
||||||
// recupero dal DB
|
|
||||||
var rawLevelData = dbCtx
|
using (GWMSContext dbCtxMult = new GWMSContext(_configuration))
|
||||||
|
{
|
||||||
|
// recupero dal DB
|
||||||
|
var rawLevelData = dbCtxMult
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
|
||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.Take(maxRecords)
|
.Take(maxRecords)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawMainPressData = dbCtx
|
var rawMainPressData = dbCtxMult
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
|
||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.Take(maxRecords)
|
.Take(maxRecords)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawBHPressData = dbCtx
|
var rawBHPressData = dbCtxMult
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
|
||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.Take(maxRecords)
|
.Take(maxRecords)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawBLPressData = dbCtx
|
var rawBLPressData = dbCtxMult
|
||||||
.DbSetPlantLog
|
.DbSetPlantLog
|
||||||
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
|
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
|
||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.Take(maxRecords)
|
.Take(maxRecords)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var rawOrderData = dbCtx
|
var rawOrderData = dbCtxMult
|
||||||
.DbSetOrders
|
.DbSetOrders
|
||||||
.Where(x => x.PlantId == PlantId)
|
.Where(x => x.PlantId == PlantId)
|
||||||
.OrderBy(x => x.DtOrder)
|
.OrderBy(x => x.DtOrder)
|
||||||
.Take(maxRecords)
|
.Take(maxRecords)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
LevelTS = rawLevelData
|
LevelTS = rawLevelData
|
||||||
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
||||||
|
|
||||||
OrderTS = rawOrderData
|
OrderTS = rawOrderData
|
||||||
.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
|
.Select(x => new TSData() { DtEvent = x.DtOrder, ValDouble = x.OrderQty }).ToList();
|
||||||
|
|
||||||
PressMainTS = rawMainPressData
|
PressMainTS = rawMainPressData
|
||||||
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
||||||
|
|
||||||
PressBHTS = rawBHPressData
|
PressBHTS = rawBHPressData
|
||||||
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
||||||
|
|
||||||
PressBLTS = rawBLPressData
|
PressBLTS = rawBLPressData
|
||||||
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
.Select(x => new TSData() { DtEvent = x.DtEvent, ValDouble = x.ValNumber }).ToList();
|
||||||
|
|
||||||
PressTS.Add("Main", PressMainTS);
|
PressTS.Add("Main", PressMainTS);
|
||||||
PressTS.Add("BH", PressBHTS);
|
PressTS.Add("BH", PressBHTS);
|
||||||
PressTS.Add("BL", PressBLTS);
|
PressTS.Add("BL", PressBLTS);
|
||||||
|
|
||||||
double actLevel = LevelTS.Count > 0 ? LevelTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
double actLevel = LevelTS.Count > 0 ? LevelTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
||||||
double valMain = PressMainTS.Count > 0 ? PressMainTS.OrderByDescending(x => x.DtEvent).Take(1).FirstOrDefault().ValDouble : 0;
|
double valMain = PressMainTS.Count > 0 ? PressMainTS.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 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;
|
||||||
|
|
||||||
PressAct.Add("Main", valMain);
|
PressAct.Add("Main", valMain);
|
||||||
PressAct.Add("BH", valBH);
|
PressAct.Add("BH", valBH);
|
||||||
PressAct.Add("BL", valBL);
|
PressAct.Add("BL", valBL);
|
||||||
|
|
||||||
PlantDTO answ = new PlantDTO()
|
// popolo valolri
|
||||||
{
|
answ = new PlantDTO()
|
||||||
PlantId = PlantId,
|
{
|
||||||
PlantCode = currPlant.PlantCode,
|
PlantId = PlantId,
|
||||||
PlantDesc = currPlant.PlantDesc,
|
PlantCode = currPlant.PlantCode,
|
||||||
LevelAct = actLevel,
|
PlantDesc = currPlant.PlantDesc,
|
||||||
LevelMax = currPlant.LevelMax,
|
LevelAct = actLevel,
|
||||||
PressAct = PressAct,
|
LevelMax = currPlant.LevelMax,
|
||||||
LevelTS = LevelTS,
|
PressAct = PressAct,
|
||||||
PressTS = PressTS,
|
LevelTS = LevelTS,
|
||||||
OrderTS = OrderTS
|
PressTS = PressTS,
|
||||||
};
|
OrderTS = OrderTS
|
||||||
|
};
|
||||||
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,26 +485,6 @@ namespace GWMS.Data.Controllers
|
|||||||
.AddRange(newItems);
|
.AddRange(newItems);
|
||||||
dbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
fatto = true;
|
fatto = true;
|
||||||
|
|
||||||
#if false
|
|
||||||
// ogni 10 insert faccio chiamata x pulizia per le ultime 3h... FARE!!!!
|
|
||||||
Dictionary<string, int> flux2prox = new Dictionary<string, int>();
|
|
||||||
foreach (var item in newItems)
|
|
||||||
{
|
|
||||||
if (!flux2prox.ContainsKey(item.FluxType))
|
|
||||||
{
|
|
||||||
flux2prox.Add(item.FluxType, item.PlantId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ciclo x ogni flusso
|
|
||||||
foreach (var item in flux2prox)
|
|
||||||
{
|
|
||||||
DateTime adesso = DateTime.Now;
|
|
||||||
DateTime startTime = DateTime.Today.AddHours(adesso.Hour - 2);
|
|
||||||
string sqlQuery = $"CALL DecimateLog('{startTime}', {item.Value}, 15, '{item.Key}')";
|
|
||||||
var table = dbCtx.DbSetPlantLog.FromSqlRaw(sqlQuery);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,18 +28,19 @@ namespace GWMS.Data.DatabaseModels
|
|||||||
|
|
||||||
public double LevelMax { get; set; } = 9999;
|
public double LevelMax { get; set; } = 9999;
|
||||||
|
|
||||||
public double LevelAct { get; set; } = 0;
|
public double LevelReorder { get; set; } = 0;
|
||||||
public double PressMax { get; set; } = 9999;
|
|
||||||
|
|
||||||
public double PressAct { get; set; } = 0;
|
//public double PressMax { get; set; } = 9999;
|
||||||
|
|
||||||
public double PressBHMax { get; set; } = 9999;
|
//public double PressAct { get; set; } = 0;
|
||||||
|
|
||||||
public double PressBHAct { get; set; } = 0;
|
//public double PressBHMax { get; set; } = 9999;
|
||||||
|
|
||||||
public double PressBLMax { get; set; } = 9999;
|
//public double PressBHAct { get; set; } = 0;
|
||||||
|
|
||||||
public double PressBLAct { get; set; } = 0;
|
//public double PressBLMax { get; set; } = 9999;
|
||||||
|
|
||||||
|
//public double PressBLAct { get; set; } = 0;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,14 +28,24 @@ namespace GWMS.Data
|
|||||||
public GWMSContext(IConfiguration configuration)
|
public GWMSContext(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
// se non ci fosse... crea!
|
try
|
||||||
Database.EnsureCreated();
|
{
|
||||||
|
// se non ci fosse... crea o migra!
|
||||||
|
Database.Migrate();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
public GWMSContext(DbContextOptions<GWMSContext> options) : base(options)
|
public GWMSContext(DbContextOptions<GWMSContext> options) : base(options)
|
||||||
{
|
{
|
||||||
// se non ci fosse... crea!
|
try
|
||||||
Database.EnsureCreated();
|
{
|
||||||
|
// se non ci fosse... crea o migra!
|
||||||
|
Database.Migrate();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|||||||
@@ -0,0 +1,868 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using GWMS.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
namespace GWMS.Data.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(GWMSContext))]
|
||||||
|
[Migration("20210806134012_PlantData_AddLevelReoder")]
|
||||||
|
partial class PlantData_AddLevelReoder
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||||
|
.HasAnnotation("ProductVersion", "5.0.7");
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Descript")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasComment("Descrizione dell'item");
|
||||||
|
|
||||||
|
b.Property<int>("ValFloat")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ValInt")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ValString")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("AnKeyVal");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ItemCode")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("ItemDesc")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<string>("ItemType")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<string>("UM")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("ItemId");
|
||||||
|
|
||||||
|
b.ToTable("Items");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("TabName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnName("TabName");
|
||||||
|
|
||||||
|
b.Property<string>("FieldName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnName("FieldName");
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnName("Val");
|
||||||
|
|
||||||
|
b.Property<string>("Descript")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnName("Descript");
|
||||||
|
|
||||||
|
b.Property<int>("Ordinal")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("Ordinal");
|
||||||
|
|
||||||
|
b.HasKey("TabName", "FieldName", "Val");
|
||||||
|
|
||||||
|
b.ToTable("ListVal");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("OrderId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtETA")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtExecEnd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtExecStart")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtOrder")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<double>("ExecutionQty")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("OrderCode")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("OrderDesc")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<double>("OrderQty")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<int>("PlantId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TransporterId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("OrderId");
|
||||||
|
|
||||||
|
b.HasIndex("PlantId");
|
||||||
|
|
||||||
|
b.HasIndex("SupplierId");
|
||||||
|
|
||||||
|
b.HasIndex("TransporterId");
|
||||||
|
|
||||||
|
b.ToTable("Order");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PlantId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("LevelMax")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("LevelReorder")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("PlantCode")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("PlantDesc")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("PlantId");
|
||||||
|
|
||||||
|
b.ToTable("PlantDetail");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
PlantId = 1,
|
||||||
|
LevelMax = 26000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
|
PlantCode = "PIZ03",
|
||||||
|
PlantDesc = "Collecchio"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
PlantId = 2,
|
||||||
|
LevelMax = 28000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
|
PlantCode = "PIZ04",
|
||||||
|
PlantDesc = "Noceto"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
PlantId = 3,
|
||||||
|
LevelMax = 24000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
|
PlantCode = "PIZ05",
|
||||||
|
PlantDesc = "Baganzola"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
PlantId = 4,
|
||||||
|
LevelMax = 26000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
|
PlantCode = "PIZ08",
|
||||||
|
PlantDesc = "Pilastrello"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PlantDataId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("FluxType")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<int>("PlantId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ValNumber")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ValString")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("PlantDataId");
|
||||||
|
|
||||||
|
b.HasIndex("PlantId");
|
||||||
|
|
||||||
|
b.ToTable("PlantLog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PlantId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("FluxType")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<double>("ValNumber")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ValString")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("PlantId", "FluxType");
|
||||||
|
|
||||||
|
b.ToTable("PlantStatus");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RecordId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Item")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<string>("Payload")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("RecordId");
|
||||||
|
|
||||||
|
b.ToTable("RebootLog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierCode")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("SupplierDesc")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("SupplierId");
|
||||||
|
|
||||||
|
b.ToTable("Supplier");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
SupplierId = 1,
|
||||||
|
SupplierCode = "LIQUIGAS",
|
||||||
|
SupplierDesc = "Liquigas"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
SupplierId = 2,
|
||||||
|
SupplierCode = "VULKANGAS",
|
||||||
|
SupplierDesc = "Vulkangas"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("TransporterId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("PositionLatitude")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("PositionLongitude")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<DateTime>("PositionUpdated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("TransporterCode")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("TransporterDesc")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.HasKey("TransporterId");
|
||||||
|
|
||||||
|
b.ToTable("Transporter");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
TransporterId = 1,
|
||||||
|
PositionLatitude = 0.0,
|
||||||
|
PositionLongitude = 0.0,
|
||||||
|
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9521),
|
||||||
|
TransporterCode = "LEVO",
|
||||||
|
TransporterDesc = "Levorato"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
TransporterId = 2,
|
||||||
|
PositionLatitude = 0.0,
|
||||||
|
PositionLongitude = 0.0,
|
||||||
|
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9901),
|
||||||
|
TransporterCode = "TRAF",
|
||||||
|
TransporterDesc = "Traffik"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("UserId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("AuthKey")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("varchar(100)");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<string>("Firstname")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Lang")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("varchar(10)");
|
||||||
|
|
||||||
|
b.Property<string>("Lastname")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.Property<int>("Livello")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MaskPlantId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MaskSupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MaskTranspId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SaltPasswd")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
|
b.HasKey("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Users");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 1,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt98",
|
||||||
|
Email = "samuele@steamware.net",
|
||||||
|
Firstname = "Samuele",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Locatelli",
|
||||||
|
Livello = 1,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "samuele.locatelli"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 2,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt91",
|
||||||
|
Email = "giancarlo@steamware.net",
|
||||||
|
Firstname = "Giancarlo",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Rottoli",
|
||||||
|
Livello = 1,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "giancarlo.rottoli"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 3,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt93",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "Steamware",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Admin",
|
||||||
|
Livello = 1,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "steamw.admin"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 4,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt97",
|
||||||
|
Email = "a.pizzaferri@pizzaferripetroli.it",
|
||||||
|
Firstname = "Angelo",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Pizzaferri",
|
||||||
|
Livello = 2,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "angelo.pizzaferri"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 5,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt99",
|
||||||
|
Email = "andrei.valeanu@winnlab.it",
|
||||||
|
Firstname = "Andrei",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Valeanu",
|
||||||
|
Livello = 2,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "andrei.valeanu"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 6,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt92",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "User",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "LIQUIGAS",
|
||||||
|
Livello = 4,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 1,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "liquigas.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 7,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt94",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "User",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "VULKANGAS",
|
||||||
|
Livello = 4,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 2,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "vulkangas.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 8,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt95",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "User",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "LEVORATO",
|
||||||
|
Livello = 4,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 1,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "levorato.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 9,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "User",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "TRAFFIK",
|
||||||
|
Livello = 4,
|
||||||
|
MaskPlantId = 0,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 2,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "traffik.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 10,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "Stazione",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Collecchio",
|
||||||
|
Livello = 3,
|
||||||
|
MaskPlantId = 1,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "piz03.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 11,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "Stazione",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Noceto",
|
||||||
|
Livello = 3,
|
||||||
|
MaskPlantId = 2,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "piz04.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 12,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "Stazione",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Baganzola",
|
||||||
|
Livello = 3,
|
||||||
|
MaskPlantId = 3,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "piz05.user01"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = 13,
|
||||||
|
AuthKey = "th1sIsTh3R1vrOfThNgt96",
|
||||||
|
Email = "info@steamware.net",
|
||||||
|
Firstname = "Stazione",
|
||||||
|
IsActive = true,
|
||||||
|
Lang = "IT",
|
||||||
|
Lastname = "Pilastrello",
|
||||||
|
Livello = 3,
|
||||||
|
MaskPlantId = 4,
|
||||||
|
MaskSupplierId = 0,
|
||||||
|
MaskTranspId = 0,
|
||||||
|
SaltPasswd = "",
|
||||||
|
UserName = "piz08.user01"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("WeekPlanId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DayNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("DeliveryHour")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
|
b.Property<int>("PlantId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("SupplierId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("TransporterId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("WeekPlanId");
|
||||||
|
|
||||||
|
b.HasIndex("PlantId");
|
||||||
|
|
||||||
|
b.HasIndex("SupplierId");
|
||||||
|
|
||||||
|
b.HasIndex("TransporterId");
|
||||||
|
|
||||||
|
b.ToTable("WeekPlan");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 1,
|
||||||
|
DayNum = 1,
|
||||||
|
DeliveryHour = 20,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 2,
|
||||||
|
DayNum = 2,
|
||||||
|
DeliveryHour = 20,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 3,
|
||||||
|
DayNum = 3,
|
||||||
|
DeliveryHour = 20,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 2
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 4,
|
||||||
|
DayNum = 4,
|
||||||
|
DeliveryHour = 15,
|
||||||
|
Note = "9K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 5,
|
||||||
|
DayNum = 4,
|
||||||
|
DeliveryHour = 20,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 6,
|
||||||
|
DayNum = 6,
|
||||||
|
DeliveryHour = 20,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 2,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 7,
|
||||||
|
DayNum = 2,
|
||||||
|
DeliveryHour = 14,
|
||||||
|
Note = "3K",
|
||||||
|
PlantId = 3,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 8,
|
||||||
|
DayNum = 2,
|
||||||
|
DeliveryHour = 15,
|
||||||
|
Note = "15K",
|
||||||
|
PlantId = 4,
|
||||||
|
SupplierId = 1,
|
||||||
|
TransporterId = 1
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
WeekPlanId = 9,
|
||||||
|
DayNum = 2,
|
||||||
|
DeliveryHour = 17,
|
||||||
|
Note = "18K",
|
||||||
|
PlantId = 1,
|
||||||
|
SupplierId = 2,
|
||||||
|
TransporterId = 2
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PlantId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SupplierId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TransporterId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Plant");
|
||||||
|
|
||||||
|
b.Navigation("Supplier");
|
||||||
|
|
||||||
|
b.Navigation("Transporter");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PlantId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Plant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PlantId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Plant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PlantId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SupplierId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TransporterId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Plant");
|
||||||
|
|
||||||
|
b.Navigation("Supplier");
|
||||||
|
|
||||||
|
b.Navigation("Transporter");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace GWMS.Data.Migrations
|
||||||
|
{
|
||||||
|
public partial class PlantData_AddLevelReoder : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "LevelAct",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PressAct",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PressBHAct",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PressBHMax",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PressBLAct",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PressBLMax",
|
||||||
|
table: "PlantDetail");
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "PressMax",
|
||||||
|
table: "PlantDetail",
|
||||||
|
newName: "LevelReorder");
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 1,
|
||||||
|
columns: new[] { "LevelMax", "LevelReorder" },
|
||||||
|
values: new object[] { 26000.0, 15000.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 2,
|
||||||
|
column: "LevelReorder",
|
||||||
|
value: 15000.0);
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 3,
|
||||||
|
column: "LevelReorder",
|
||||||
|
value: 15000.0);
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 4,
|
||||||
|
columns: new[] { "LevelMax", "LevelReorder" },
|
||||||
|
values: new object[] { 26000.0, 15000.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "Transporter",
|
||||||
|
keyColumn: "TransporterId",
|
||||||
|
keyValue: 1,
|
||||||
|
column: "PositionUpdated",
|
||||||
|
value: new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9521));
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "Transporter",
|
||||||
|
keyColumn: "TransporterId",
|
||||||
|
keyValue: 2,
|
||||||
|
column: "PositionUpdated",
|
||||||
|
value: new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9901));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "LevelReorder",
|
||||||
|
table: "PlantDetail",
|
||||||
|
newName: "PressMax");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "LevelAct",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "PressAct",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "PressBHAct",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "PressBHMax",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "PressBLAct",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "PressBLMax",
|
||||||
|
table: "PlantDetail",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 1,
|
||||||
|
columns: new[] { "LevelMax", "PressBHMax", "PressBLMax", "PressMax" },
|
||||||
|
values: new object[] { 28000.0, 270.0, 270.0, 19.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 2,
|
||||||
|
columns: new[] { "PressBHMax", "PressBLMax", "PressMax" },
|
||||||
|
values: new object[] { 270.0, 270.0, 19.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 3,
|
||||||
|
columns: new[] { "PressBHMax", "PressBLMax", "PressMax" },
|
||||||
|
values: new object[] { 270.0, 270.0, 19.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "PlantDetail",
|
||||||
|
keyColumn: "PlantId",
|
||||||
|
keyValue: 4,
|
||||||
|
columns: new[] { "LevelMax", "PressBHMax", "PressBLMax", "PressMax" },
|
||||||
|
values: new object[] { 24000.0, 270.0, 270.0, 19.0 });
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "Transporter",
|
||||||
|
keyColumn: "TransporterId",
|
||||||
|
keyValue: 1,
|
||||||
|
column: "PositionUpdated",
|
||||||
|
value: new DateTime(2021, 8, 2, 10, 51, 27, 549, DateTimeKind.Local).AddTicks(3264));
|
||||||
|
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "Transporter",
|
||||||
|
keyColumn: "TransporterId",
|
||||||
|
keyValue: 2,
|
||||||
|
column: "PositionUpdated",
|
||||||
|
value: new DateTime(2021, 8, 2, 10, 51, 27, 549, DateTimeKind.Local).AddTicks(3842));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -183,10 +183,10 @@ namespace GWMS.Data.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<double>("LevelAct")
|
b.Property<double>("LevelMax")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<double>("LevelMax")
|
b.Property<double>("LevelReorder")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<string>("PlantCode")
|
b.Property<string>("PlantCode")
|
||||||
@@ -197,24 +197,6 @@ namespace GWMS.Data.Migrations
|
|||||||
.HasMaxLength(250)
|
.HasMaxLength(250)
|
||||||
.HasColumnType("varchar(250)");
|
.HasColumnType("varchar(250)");
|
||||||
|
|
||||||
b.Property<double>("PressAct")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.Property<double>("PressBHAct")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.Property<double>("PressBHMax")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.Property<double>("PressBLAct")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.Property<double>("PressBLMax")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.Property<double>("PressMax")
|
|
||||||
.HasColumnType("double");
|
|
||||||
|
|
||||||
b.HasKey("PlantId");
|
b.HasKey("PlantId");
|
||||||
|
|
||||||
b.ToTable("PlantDetail");
|
b.ToTable("PlantDetail");
|
||||||
@@ -223,58 +205,34 @@ namespace GWMS.Data.Migrations
|
|||||||
new
|
new
|
||||||
{
|
{
|
||||||
PlantId = 1,
|
PlantId = 1,
|
||||||
LevelAct = 0.0,
|
LevelMax = 26000.0,
|
||||||
LevelMax = 28000.0,
|
LevelReorder = 15000.0,
|
||||||
PlantCode = "PIZ03",
|
PlantCode = "PIZ03",
|
||||||
PlantDesc = "Collecchio",
|
PlantDesc = "Collecchio"
|
||||||
PressAct = 0.0,
|
|
||||||
PressBHAct = 0.0,
|
|
||||||
PressBHMax = 270.0,
|
|
||||||
PressBLAct = 0.0,
|
|
||||||
PressBLMax = 270.0,
|
|
||||||
PressMax = 19.0
|
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
PlantId = 2,
|
PlantId = 2,
|
||||||
LevelAct = 0.0,
|
|
||||||
LevelMax = 28000.0,
|
LevelMax = 28000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
PlantCode = "PIZ04",
|
PlantCode = "PIZ04",
|
||||||
PlantDesc = "Noceto",
|
PlantDesc = "Noceto"
|
||||||
PressAct = 0.0,
|
|
||||||
PressBHAct = 0.0,
|
|
||||||
PressBHMax = 270.0,
|
|
||||||
PressBLAct = 0.0,
|
|
||||||
PressBLMax = 270.0,
|
|
||||||
PressMax = 19.0
|
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
PlantId = 3,
|
PlantId = 3,
|
||||||
LevelAct = 0.0,
|
|
||||||
LevelMax = 24000.0,
|
LevelMax = 24000.0,
|
||||||
|
LevelReorder = 15000.0,
|
||||||
PlantCode = "PIZ05",
|
PlantCode = "PIZ05",
|
||||||
PlantDesc = "Baganzola",
|
PlantDesc = "Baganzola"
|
||||||
PressAct = 0.0,
|
|
||||||
PressBHAct = 0.0,
|
|
||||||
PressBHMax = 270.0,
|
|
||||||
PressBLAct = 0.0,
|
|
||||||
PressBLMax = 270.0,
|
|
||||||
PressMax = 19.0
|
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
PlantId = 4,
|
PlantId = 4,
|
||||||
LevelAct = 0.0,
|
LevelMax = 26000.0,
|
||||||
LevelMax = 24000.0,
|
LevelReorder = 15000.0,
|
||||||
PlantCode = "PIZ08",
|
PlantCode = "PIZ08",
|
||||||
PlantDesc = "Pilastrello",
|
PlantDesc = "Pilastrello"
|
||||||
PressAct = 0.0,
|
|
||||||
PressBHAct = 0.0,
|
|
||||||
PressBHMax = 270.0,
|
|
||||||
PressBLAct = 0.0,
|
|
||||||
PressBLMax = 270.0,
|
|
||||||
PressMax = 19.0
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -420,7 +378,7 @@ namespace GWMS.Data.Migrations
|
|||||||
TransporterId = 1,
|
TransporterId = 1,
|
||||||
PositionLatitude = 0.0,
|
PositionLatitude = 0.0,
|
||||||
PositionLongitude = 0.0,
|
PositionLongitude = 0.0,
|
||||||
PositionUpdated = new DateTime(2021, 8, 2, 10, 51, 27, 549, DateTimeKind.Local).AddTicks(3264),
|
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9521),
|
||||||
TransporterCode = "LEVO",
|
TransporterCode = "LEVO",
|
||||||
TransporterDesc = "Levorato"
|
TransporterDesc = "Levorato"
|
||||||
},
|
},
|
||||||
@@ -429,7 +387,7 @@ namespace GWMS.Data.Migrations
|
|||||||
TransporterId = 2,
|
TransporterId = 2,
|
||||||
PositionLatitude = 0.0,
|
PositionLatitude = 0.0,
|
||||||
PositionLongitude = 0.0,
|
PositionLongitude = 0.0,
|
||||||
PositionUpdated = new DateTime(2021, 8, 2, 10, 51, 27, 549, DateTimeKind.Local).AddTicks(3842),
|
PositionUpdated = new DateTime(2021, 8, 6, 15, 40, 12, 341, DateTimeKind.Local).AddTicks(9901),
|
||||||
TransporterCode = "TRAF",
|
TransporterCode = "TRAF",
|
||||||
TransporterDesc = "Traffik"
|
TransporterDesc = "Traffik"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,10 +37,14 @@ namespace GWMS.Data
|
|||||||
|
|
||||||
// inizializzazione dei valori di default x Plant
|
// inizializzazione dei valori di default x Plant
|
||||||
modelBuilder.Entity<PlantDetailModel>().HasData(
|
modelBuilder.Entity<PlantDetailModel>().HasData(
|
||||||
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000 },
|
||||||
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000 },
|
||||||
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000 },
|
||||||
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 25500, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }
|
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000 }
|
||||||
|
// new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||||
|
//new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||||
|
//new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
|
||||||
|
//new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }
|
||||||
);
|
);
|
||||||
|
|
||||||
// inizializzazione dei valori di default x Fornitori
|
// inizializzazione dei valori di default x Fornitori
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body p-1">
|
<div class="card-body p-1">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-5 pr-0">
|
<div class="col-4 pr-0">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
@@ -26,23 +26,23 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Alta</li>
|
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Alta</li>
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
||||||
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@currItem.PressAct["BH"].ToString("N1")</b>bar</span>
|
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@getPressData("BH", "N1")</b> <sub>bar</sub></span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
||||||
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@currItem.PressAct["BH"].ToString("N1")</b>bar</span>
|
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@getPressData("BHA", "N1")</b> <sub>bar</sub></span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Bassa</li>
|
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Bassa</li>
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
||||||
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@currItem.PressAct["BL"].ToString("N1")</b>bar</span>
|
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@getPressData("BL", "N1")</b> <sub>bar</sub></span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
<li class="list-group-item d-flex justify-content-between align-items-center small">
|
||||||
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@currItem.PressAct["BL"].ToString("N1")</b>bar</span>
|
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@getPressData("BLA", "N1")</b> <sub>bar</sub></span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-7">
|
<div class="col-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
@@ -66,10 +66,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</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-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b>%</span>
|
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
|
||||||
</li>
|
</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">bar</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>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ namespace GWMS.UI.Components
|
|||||||
AspectRatio = 2
|
AspectRatio = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// fattore di riduzione x visualizzare meno punti (in base alla numerosità...
|
||||||
|
/// </summary>
|
||||||
|
protected int redFact = 1;
|
||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
@@ -121,12 +126,26 @@ namespace GWMS.UI.Components
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
|
private void fixRedFactor()
|
||||||
|
{
|
||||||
|
int answ = 1;
|
||||||
|
int numCount = _currItem.LevelTS.Count;
|
||||||
|
if (numCount > 200)
|
||||||
|
answ = 4;
|
||||||
|
else if (numCount > 150)
|
||||||
|
answ = 3;
|
||||||
|
else if (numCount >= 50)
|
||||||
|
answ = 2;
|
||||||
|
redFact = answ;
|
||||||
|
}
|
||||||
|
|
||||||
private LineChartDataset<double> GetLineChartDataset()
|
private LineChartDataset<double> GetLineChartDataset()
|
||||||
{
|
{
|
||||||
|
fixRedFactor();
|
||||||
var answ = new LineChartDataset<double>
|
var answ = new LineChartDataset<double>
|
||||||
{
|
{
|
||||||
//Label = "Livello",
|
//Label = "Livello",
|
||||||
Data = _currItem.LevelTS.Select(x => x.ValDouble).ToList(),
|
Data = _currItem.LevelTS.Where((cat, index) => index % redFact == 0).Select(x => x.ValDouble).ToList(),
|
||||||
BorderColor = getLineColors(1f),
|
BorderColor = getLineColors(1f),
|
||||||
Fill = true,
|
Fill = true,
|
||||||
PointRadius = 3,
|
PointRadius = 3,
|
||||||
@@ -139,7 +158,8 @@ namespace GWMS.UI.Components
|
|||||||
|
|
||||||
private List<string> GetLineChartLabels()
|
private List<string> GetLineChartLabels()
|
||||||
{
|
{
|
||||||
var answ = _currItem.LevelTS.Select(x => x.DtEvent.ToString("dd.MM HH")).ToList();
|
fixRedFactor();
|
||||||
|
var answ = _currItem.LevelTS.Where((cat, index) => index % redFact == 0).Select(x => x.DtEvent.ToString("dd.MM HH")).ToList();
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,5 +196,19 @@ namespace GWMS.UI.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
public string getPressData(string valore, string formato)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (currItem.PressAct.ContainsKey(valore))
|
||||||
|
{
|
||||||
|
answ = currItem.PressAct[valore].ToString(formato);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ namespace GWMS.UI.Controllers
|
|||||||
/// <param name="cnt"></param>
|
/// <param name="cnt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("flog/{id}")]
|
[HttpGet("flog/{id}")]
|
||||||
public 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)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
// formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi
|
||||||
@@ -247,7 +247,7 @@ namespace GWMS.UI.Controllers
|
|||||||
List<PlantLogModel> newData = new List<PlantLogModel>();
|
List<PlantLogModel> newData = new List<PlantLogModel>();
|
||||||
newData.Add(newItem);
|
newData.Add(newItem);
|
||||||
// insert!
|
// insert!
|
||||||
fatto = _DataService.PlantLogInsert(newData).Result;
|
fatto = await _DataService.PlantLogInsert(newData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
@@ -272,7 +272,7 @@ namespace GWMS.UI.Controllers
|
|||||||
/// <param name="id">ID dell'IOB</param>
|
/// <param name="id">ID dell'IOB</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("flogJson/{id}")]
|
[HttpPost("flogJson/{id}")]
|
||||||
public string flogJson(string id, [FromBody] flogJsonPayload rawData)
|
public async Task<string> flogJson(string id, [FromBody] flogJsonPayload rawData)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// verifico ci sia valore
|
// verifico ci sia valore
|
||||||
@@ -285,7 +285,7 @@ namespace GWMS.UI.Controllers
|
|||||||
// conversione dati
|
// conversione dati
|
||||||
List<PlantLogModel> plData = rawData.fluxData.Select(jpl => _DataService.convertFluxToPL(currPlant.PlantId, jpl)).ToList();
|
List<PlantLogModel> plData = rawData.fluxData.Select(jpl => _DataService.convertFluxToPL(currPlant.PlantId, jpl)).ToList();
|
||||||
//insert!
|
//insert!
|
||||||
fatto = _DataService.PlantLogInsert(plData).Result;
|
fatto = await _DataService.PlantLogInsert(plData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fatto)
|
if (fatto)
|
||||||
|
|||||||
@@ -70,13 +70,13 @@ namespace GWMS.UI.Controllers
|
|||||||
|
|
||||||
// POST api/PlantLog
|
// POST api/PlantLog
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Post([FromBody] List<PlantLogModel> newItems)
|
public async Task<ActionResult> Post([FromBody] List<PlantLogModel> newItems)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// verifico ci sia valore
|
// verifico ci sia valore
|
||||||
if (newItems != null)
|
if (newItems != null)
|
||||||
{
|
{
|
||||||
fatto = _DataService.PlantLogInsert(newItems).Result;
|
fatto = await _DataService.PlantLogInsert(newItems);
|
||||||
}
|
}
|
||||||
if (fatto)
|
if (fatto)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ namespace GWMS.UI.Data
|
|||||||
|
|
||||||
public async Task<bool> PlantLogInsert(List<PlantLogModel> newItems)
|
public async Task<bool> PlantLogInsert(List<PlantLogModel> newItems)
|
||||||
{
|
{
|
||||||
|
bool fatto = false;
|
||||||
// init valori
|
// init valori
|
||||||
int IntervalMin = 60;
|
int IntervalMin = 60;
|
||||||
int.TryParse(_configuration["IntervalMin"], out IntervalMin);
|
int.TryParse(_configuration["IntervalMin"], out IntervalMin);
|
||||||
@@ -403,7 +404,7 @@ namespace GWMS.UI.Data
|
|||||||
await updateCurrDTO(newItems);
|
await updateCurrDTO(newItems);
|
||||||
|
|
||||||
// recupero ultimi inseriti
|
// recupero ultimi inseriti
|
||||||
List<PlantLogModel> lastValues = await PlantLogGetLastByFlux(PlantId);
|
List<PlantLogModel> lastValues = PlantLogGetLastByFlux(PlantId).Result;
|
||||||
// verifico i flussi presenti tra quelli ricevuti
|
// verifico i flussi presenti tra quelli ricevuti
|
||||||
List<string> fluxList = newItems
|
List<string> fluxList = newItems
|
||||||
.GroupBy(g => g.FluxType)
|
.GroupBy(g => g.FluxType)
|
||||||
@@ -435,8 +436,19 @@ namespace GWMS.UI.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// faccio vero insert
|
// se ho record da inserire...
|
||||||
return await Task.FromResult(dbController.PlantLogInsertNew(item2insert));
|
if (item2insert.Count > 0)
|
||||||
|
{
|
||||||
|
// faccio vero insert
|
||||||
|
fatto = dbController.PlantLogInsertNew(item2insert);
|
||||||
|
|
||||||
|
// invalido i vari valori in cache
|
||||||
|
await distributedCache.RemoveAsync($"DATA:PLANTS:LastFlux:{PlantId}");
|
||||||
|
await distributedCache.RemoveAsync($"DATA:PLANTS:ListDTO");
|
||||||
|
}
|
||||||
|
|
||||||
|
// restituisco
|
||||||
|
return await Task.FromResult(fatto);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<PlantDTO>> PlantsGetAll()
|
public async Task<List<PlantDTO>> PlantsGetAll()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace GWMS.UI.Data
|
|||||||
{
|
{
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private SelectData _detailFilter = SelectData.Init(5, 7);
|
private SelectData _detailFilter = SelectData.Init(5, 15);
|
||||||
private string _pageIcon;
|
private string _pageIcon;
|
||||||
private string _pageName;
|
private string _pageName;
|
||||||
private string _searchVal;
|
private string _searchVal;
|
||||||
@@ -33,8 +33,6 @@ namespace GWMS.UI.Data
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public SelectData DDB_Filter { get; set; } = SelectData.Init(5, 3);
|
|
||||||
|
|
||||||
public SelectData DetailFilter
|
public SelectData DetailFilter
|
||||||
{
|
{
|
||||||
get => _detailFilter;
|
get => _detailFilter;
|
||||||
@@ -52,10 +50,7 @@ namespace GWMS.UI.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelectData KRE_Filter { get; set; } = SelectData.Init(5, 7);
|
public SelectOrderData Order_Filter { get; set; } = SelectOrderData.Init(5, 30);
|
||||||
public SelectData ODL_Filter { get; set; } = SelectData.Init(5, 7);
|
|
||||||
public SelectData OEE_Filter { get; set; } = SelectData.Init(5, 7);
|
|
||||||
public SelectOrderData Order_Filter { get; set; } = SelectOrderData.Init(5, 7);
|
|
||||||
|
|
||||||
public string PageIcon
|
public string PageIcon
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Version>1.0.2108.0515</Version>
|
<Version>1.0.2108.0617</Version>
|
||||||
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
|
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -20,41 +20,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@*<div class="d-flex justify-content-between">
|
@*<SetupSim />*@
|
||||||
<div class="p-2">
|
|
||||||
<h4>Simulazione</h4>
|
|
||||||
</div>
|
|
||||||
<div class="p-2">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text">giorni</span>
|
|
||||||
</div>
|
|
||||||
<input @bind-value="@numDays" @bind-value:event="oninput" type="number" class="form-control" title="Giorni" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="p-2">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text">step</span>
|
|
||||||
</div>
|
|
||||||
<input @bind-value="@stepMin" @bind-value:event="oninput" type="number" class="form-control" title="Step sim (minuti)" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="p-2">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text">cons orario max</span>
|
|
||||||
</div>
|
|
||||||
<input @bind-value="@maxHourRate" @bind-value:event="oninput" type="number" class="form-control" title="Consumo massimo orario" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="p-2">
|
|
||||||
<Button id="btnReset" class="btn btn-danger btn-block" Clicked="resetDB">
|
|
||||||
<span class="oi oi-reload"></span> Regen DB Data
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>*@
|
|
||||||
<SetupSim />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ namespace GWMS.UI.Pages
|
|||||||
|
|
||||||
protected List<WeekPlanModel> SlotList(DayOfWeek Giorno, int Ora)
|
protected List<WeekPlanModel> SlotList(DayOfWeek Giorno, int Ora)
|
||||||
{
|
{
|
||||||
List<WeekPlanModel> result = new();
|
List<WeekPlanModel> result = new List<WeekPlanModel>();
|
||||||
|
|
||||||
if (ListRecords != null && ListRecords.Count > 0)
|
if (ListRecords != null && ListRecords.Count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,17 +9,17 @@
|
|||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"Redis": "localhost:6379",
|
"Redis": "localhost:6379",
|
||||||
//"AuthConnection": "Server=10.74.83.98;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
//"AuthConnection": "Server=10.74.83.97;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
||||||
//"DefaultConnection": "Server=10.74.83.98;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
//"DefaultConnection": "Server=10.74.83.97;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
||||||
//"AdminConnection": "Server=10.74.83.98;port=3306;database=GWMS;user=root;pwd=Egalware_24068!;sslmode=None;",
|
//"AdminConnection": "Server=10.74.83.97;port=3306;database=GWMS;user=root;pwd=Egalware_24068!;sslmode=None;",
|
||||||
//"GWMS.Data": "Server=10.74.83.98;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
|
//"GWMS.Data": "Server=10.74.83.97;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
|
||||||
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
"AuthConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
||||||
"DefaultConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
"DefaultConnection": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;",
|
||||||
"AdminConnection": "Server=localhost;port=3306;database=GWMS;user=root;pwd=Egalware_24068!;sslmode=None;",
|
"AdminConnection": "Server=localhost;port=3306;database=GWMS;user=root;pwd=Egalware_24068!;sslmode=None;",
|
||||||
"GWMS.Data": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
|
"GWMS.Data": "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"
|
||||||
},
|
},
|
||||||
"DbConfig": {
|
"DbConfig": {
|
||||||
//"Server": "10.74.83.98",
|
//"Server": "10.74.83.97",
|
||||||
"Server": "localhost",
|
"Server": "localhost",
|
||||||
"nKey": "PZZFRR",
|
"nKey": "PZZFRR",
|
||||||
"sKey": "M3T@n0"
|
"sKey": "M3T@n0"
|
||||||
|
|||||||
@@ -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.0515</h4>
|
<h4>Versione: 1.0.2108.0617</h4>
|
||||||
<br /> Note di rilascio:
|
<br /> Note di rilascio:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.0.2108.0515
|
1.0.2108.0617
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>1.0.2108.0515</version>
|
<version>1.0.2108.0617</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