Abbozata pagina ProdPlanner (SOLO BOZZA!!!)
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32126.317
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.3.11520.95 d18.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||
EndProject
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.Core.Objects;
|
||||
using MP.Data;
|
||||
using MP.Data.DbModels;
|
||||
using MP.Data.Services;
|
||||
using NLog;
|
||||
@@ -589,7 +589,6 @@ namespace MP_TAB3.Components
|
||||
|
||||
/***************************************************
|
||||
* comprende gestione machineSlave x fix ODL master --> slave
|
||||
*
|
||||
***************************************************/
|
||||
|
||||
// preparo gestione progress display
|
||||
@@ -824,6 +823,10 @@ namespace MP_TAB3.Components
|
||||
await checkConfProd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiusura produzione ODL corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task ProdEnd()
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi fine produzione?"))
|
||||
@@ -1729,7 +1732,7 @@ namespace MP_TAB3.Components
|
||||
private async Task processaEvento(string idxMaccCurr, int idxEvento, string userMsg, int idxODL, DateTime adesso)
|
||||
{
|
||||
inputComandoMapo inCmd;
|
||||
inputComandoMapo inCmd2;
|
||||
inputComandoMapo inCmd2;
|
||||
var rigaStato = TabDServ.StatoMacchina(idxMaccCurr);
|
||||
// processo evento...
|
||||
EventListModel newRec = new EventListModel()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2602.2607</Version>
|
||||
<Version>6.16.2603.411</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2602.2607</h4>
|
||||
<h4>Versione: 6.16.2603.411</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2602.2607
|
||||
6.16.2603.411
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2602.2607</version>
|
||||
<version>6.16.2603.411</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
namespace MP.Core.DTO
|
||||
{
|
||||
public class EventDto
|
||||
{
|
||||
public string CodTipo { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Idx univoco evento
|
||||
/// </summary>
|
||||
public int IdxEv { get; set; } = 0;
|
||||
|
||||
#if false
|
||||
public int IdxDipendente { get; set; } = 0;
|
||||
public string CognomeNome { get; set; } = "";
|
||||
public bool Conf { get; set; } = false;
|
||||
public bool IsCompany { get; set; } = false;
|
||||
#endif
|
||||
public string Abbrev { get; set; } = "";
|
||||
public string Titolo { get; set; } = "";
|
||||
public string Descrizione { get; set; } = "";
|
||||
public string Tooltip { get; set; } = "";
|
||||
public DateTime DtStart { get; set; } = DateTime.Today.AddHours(9);
|
||||
public DateTime DtEnd { get; set; } = DateTime.Today.AddHours(17);
|
||||
public string Note { get; set; } = "";
|
||||
public bool IsDraggable { get; set; } = false;
|
||||
public bool IsExpired { get; set; } = false;
|
||||
public bool IsPlanned { get; set; } = true;
|
||||
|
||||
public EventDto Clone()
|
||||
{
|
||||
return new EventDto()
|
||||
{
|
||||
CodTipo = this.CodTipo,
|
||||
IdxEv = this.IdxEv,
|
||||
#if false
|
||||
IdxDipendente = this.IdxDipendente,
|
||||
CognomeNome = this.CognomeNome,
|
||||
Conf = this.Conf,
|
||||
IsCompany = this.IsCompany,
|
||||
#endif
|
||||
Abbrev = this.Abbrev,
|
||||
Titolo = this.Titolo,
|
||||
Descrizione = this.Descrizione,
|
||||
Tooltip = this.Tooltip,
|
||||
DtStart = this.DtStart,
|
||||
DtEnd = this.DtEnd,
|
||||
Note = this.Note,
|
||||
IsDraggable = this.IsDraggable,
|
||||
IsPlanned = this.IsPlanned,
|
||||
IsExpired = this.IsExpired
|
||||
};
|
||||
}
|
||||
|
||||
public string Durata
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "-";
|
||||
var durata = DtEnd.Subtract(DtStart);
|
||||
if (CodTipo == "FER")
|
||||
{
|
||||
answ = $"{durata.TotalDays + 1:N0}gg";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{durata.TotalHours:N1}h";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public static string DateForm(string Tipo, DateTime DtEvent)
|
||||
{
|
||||
return (Tipo == "PERM" || Tipo == "104") ? $"{DtEvent:HH:mm}" : $"{DtEvent:ddd yyyy-MM-dd}";
|
||||
}
|
||||
|
||||
public string Color
|
||||
{
|
||||
get => calcColor(CodTipo, IsPlanned, IsExpired);
|
||||
}
|
||||
public string? ForeColor
|
||||
{
|
||||
get => calcText(CodTipo, IsPlanned, IsExpired);
|
||||
}
|
||||
|
||||
private string calcColor(string codTipo, bool isPlanned, bool isExpired)
|
||||
{
|
||||
string answ = "#EDEDED";
|
||||
switch (codTipo)
|
||||
{
|
||||
case "Saomad":
|
||||
answ = isExpired ? "#CDE0CD" : isPlanned ? "#11DD44" : "#D0F5DD";
|
||||
break;
|
||||
|
||||
case "Essetre":
|
||||
answ = isExpired ? "#AB9898" : isPlanned ? "#AD1919" : "#CD6767";
|
||||
break;
|
||||
|
||||
default:
|
||||
answ = isExpired ? "#EEDD11" : isPlanned ? "#11CD44" : "#AAFFCD";
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string calcText(string codTipo, bool isPlanned, bool isExpired)
|
||||
{
|
||||
string answ = "#EDEDED";
|
||||
switch (codTipo)
|
||||
{
|
||||
case "Saomad":
|
||||
answ = isExpired ? "#000000" : isPlanned ? "#000000" : "#555555";
|
||||
break;
|
||||
|
||||
case "Essetre":
|
||||
answ = isExpired ? "#000000" : isPlanned ? "#EEFF69" : "#D3E817";
|
||||
break;
|
||||
|
||||
default:
|
||||
answ = isExpired ? "#000000" : isPlanned ? "#FFFFFF" : "#000000";
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Core.DTO;
|
||||
using MP.Data.DbModels.Sched;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Controllers
|
||||
{
|
||||
public class MpSchedulerController : IDisposable
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public MpSchedulerController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
Log.Info("Avviata classe MpSchedulerController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, List<EventDto>>> PlannerGetEvents()
|
||||
{
|
||||
Dictionary<string, List<EventDto>> result = new Dictionary<string, List<EventDto>>();
|
||||
using (var dbCtx = new MP_SchedContext(_configuration))
|
||||
{
|
||||
var RawData = await dbCtx
|
||||
.DbSetPromOut
|
||||
//.AsNoTracking()
|
||||
.OrderBy(x => x.IdxPromessa)
|
||||
.ToListAsync();
|
||||
|
||||
DateTime oggi = DateTime.Today;
|
||||
|
||||
result = RawData
|
||||
.GroupBy(p => p.IdxMacchina)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => g.Select(p => new EventDto
|
||||
{
|
||||
IdxEv = p.IdxPromessa,
|
||||
Abbrev = p.CodPODL,
|
||||
Titolo = p.CodPODL,
|
||||
DtEnd = p.DueDate ?? oggi.AddMonths(2),
|
||||
DtStart = (p.DueDate ?? oggi.AddMonths(2)).AddDays(-3)
|
||||
}).ToList()
|
||||
);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PromesseIN
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<PromesseInModel> PromInGetAll()
|
||||
{
|
||||
List<PromesseInModel> dbResult = new List<PromesseInModel>();
|
||||
using (var dbCtx = new MP_SchedContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetPromIn
|
||||
//.AsNoTracking()
|
||||
.OrderBy(x => x.IdxPromessa)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PromesseIN
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<PromesseOutModel> ProOutGetAll()
|
||||
{
|
||||
List<PromesseOutModel> dbResult = new List<PromesseOutModel>();
|
||||
using (var dbCtx = new MP_SchedContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetPromOut
|
||||
//.AsNoTracking()
|
||||
.OrderBy(x => x.IdxPromessa)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DbModels.Sched
|
||||
{
|
||||
[Table("PromesseIN")]
|
||||
public partial class PromesseInModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxPromessa { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyRichiesta { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyBCode { get; set; }
|
||||
public bool Attivabile { get; set; } = false;
|
||||
public int IdxOdl { get; set; } = 0;
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodGruppo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
public int PzPallet { get; set; } = 1;
|
||||
[MaxLength(2500)]
|
||||
public string Note { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodCli { get; set; } = "";
|
||||
//public DateTime InsertDate { get; set; } = DateTime.Now;
|
||||
//[MaxLength(500)]
|
||||
//public string Recipe { get; set; } = "";
|
||||
|
||||
[MaxLength(250)]
|
||||
public string NoteRichiesta { get; set; } = "";
|
||||
|
||||
public bool flgPromDirty { get; set; } = false;
|
||||
public DateTime? DateAllOdlClose { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string CodFase
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
{
|
||||
answ = allData[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual MacchineModel MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoliModel ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DbModels.Sched
|
||||
{
|
||||
[Table("PromesseOUT")]
|
||||
public partial class PromesseOutModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxPromessa { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyRichiesta { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyBCode { get; set; }
|
||||
public bool Attivabile { get; set; } = false;
|
||||
public int IdxOdl { get; set; } = 0;
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodGruppo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
public int PzPallet { get; set; } = 1;
|
||||
[MaxLength(2500)]
|
||||
public string Note { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodCli { get; set; } = "";
|
||||
//public DateTime InsertDate { get; set; } = DateTime.Now;
|
||||
//[MaxLength(500)]
|
||||
//public string Recipe { get; set; } = "";
|
||||
|
||||
[NotMapped]
|
||||
public string CodFase
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
{
|
||||
answ = allData[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
[NotMapped]
|
||||
public string CodPODL
|
||||
{
|
||||
get => $"PODL{IdxPromessa:00000000}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual MacchineModel MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoliModel ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DbModels.Sched;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MP_SchedContext : DbContext
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IConfiguration _configuration;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MP_SchedContext(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public MP_SchedContext(DbContextOptions<MP_SchedContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<PromesseInModel> DbSetPromIn { get; set; }
|
||||
public virtual DbSet<PromesseOutModel> DbSetPromOut { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("MP.Sched");
|
||||
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||
|
||||
//modelBuilder.Entity<ConfigModel>(entity =>
|
||||
//{
|
||||
// entity.HasKey(e => e.Chiave);
|
||||
|
||||
// entity.ToTable("Config");
|
||||
|
||||
// entity.Property(e => e.Chiave)
|
||||
// .HasMaxLength(50)
|
||||
// .HasColumnName("chiave");
|
||||
|
||||
// entity.Property(e => e.Note).HasColumnName("note");
|
||||
|
||||
// entity.Property(e => e.Valore).HasColumnName("valore");
|
||||
|
||||
// entity.Property(e => e.ValoreStd)
|
||||
// .HasColumnName("valoreStd")
|
||||
// .HasComment("Valore di default/riferimento per la variabile");
|
||||
//});
|
||||
|
||||
//modelBuilder.Entity<VocabolarioModel>(entity =>
|
||||
//{
|
||||
// entity.HasKey(e => new { e.Lingua, e.Lemma });
|
||||
|
||||
//});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Core.DTO;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Services
|
||||
{
|
||||
public class SchedulerDataService : BaseServ
|
||||
{
|
||||
/// <summary>
|
||||
/// Init servizio TAB
|
||||
/// </summary>
|
||||
/// <param name="configuration"></param>
|
||||
public SchedulerDataService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn)
|
||||
{
|
||||
_configuration = configuration;
|
||||
|
||||
// // conf DB
|
||||
// ConnStr = _configuration.GetConnectionString("MP.All");
|
||||
// if (string.IsNullOrEmpty(ConnStr))
|
||||
// {
|
||||
// Log.Error("ConnString empty!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// dbTabController = new Controllers.MpTabController(configuration);
|
||||
// sb.AppendLine($"TabDataService | MpTabController OK");
|
||||
// dbIocController = new Controllers.MpIocController(configuration);
|
||||
// sb.AppendLine($"TabDataService | MpIocController OK");
|
||||
// dbInveController = new Controllers.MpInveController(configuration);
|
||||
// sb.AppendLine($"TabDataService | MpInveController OK");
|
||||
// Log.Info(sb.ToString());
|
||||
// // sistemo i parametri x redHas...
|
||||
// CodModulo = _configuration.GetValue<string>("SpecialConf:CodModulo");
|
||||
// CodModuloParam = _configuration.GetValue<string>("SpecialConf:CodModuloParam");
|
||||
//#if false
|
||||
// MpIoNS = _configuration.GetValue<string>("ServerConf:MpIoNS");
|
||||
//#endif
|
||||
// var cstringArray = ConnStr.Split(";");
|
||||
// foreach (var item in cstringArray)
|
||||
// {
|
||||
// var cData = item.Trim().Split("=");
|
||||
// if (cData.Length == 2)
|
||||
// {
|
||||
// if (!connStrParams.ContainsKey(cData[0]))
|
||||
// {
|
||||
// connStrParams.Add(cData[0], cData[1]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // sistemo
|
||||
// DataSource = connStrParams["Server"];
|
||||
// DataBase = connStrParams["Database"];
|
||||
// }
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, List<EventDto>>?> PlannerGetEvents(DateTime dtInizio, DateTime dtFine)
|
||||
{
|
||||
Dictionary<string, List<EventDto>>? result = null;
|
||||
await Task.Delay(200);
|
||||
return result;
|
||||
|
||||
//using var activity = StartActivity();
|
||||
//string source = "DB";
|
||||
//Dictionary<string, List<EventDto>>? result = null;
|
||||
//// cerco in redis...
|
||||
//string currKey = $"{redisBaseKey}:PlannerData:{dtStart:yyyyMMdd}:{dtEnd:yyyyMMdd}";
|
||||
//RedisValue rawData = await redisDb.StringGetAsync(currKey);
|
||||
////if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
//if (rawData.HasValue && rawData.Length() > 2)
|
||||
//{
|
||||
// result = JsonConvert.DeserializeObject<Dictionary<string, List<EventDto>>>($"{rawData}");
|
||||
// source = "REDIS";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// result = dataSimController.PlannerGetEvents(dtStart, dtEnd);
|
||||
// // serializzo e salvo...
|
||||
// rawData = JsonConvert.SerializeObject(result);
|
||||
// await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
//}
|
||||
//activity?.SetTag("data.source", source);
|
||||
//LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms");
|
||||
//return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2602.2612</Version>
|
||||
<Version>6.16.2603.2007</Version>
|
||||
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
@page "/ProdPlanner"
|
||||
<div class="card shadow">
|
||||
<div class="card-header">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
<h3>Production Planner</h3>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<PeriodoSel E_PeriodoSel="SetPeriodo" CurrPeriodo="PeriodoSel"></PeriodoSel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<CalendarPlanner EvDtoList="ListEventi"></CalendarPlanner>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Core.DTO;
|
||||
using MP.Data.Services;
|
||||
|
||||
namespace MP.SPEC.Pages
|
||||
{
|
||||
public partial class ProdPlanner
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected SchedulerDataService SDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Periodo selezionato attuale
|
||||
/// </summary>
|
||||
private EgwCoreLib.Utils.DtUtils.Periodo PeriodoSel = new EgwCoreLib.Utils.DtUtils.Periodo(EgwCoreLib.Utils.DtUtils.PeriodSet.ThisYear);
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<EventDto> ListEventi { get; set; } = new();
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Legge i dati dei record completi
|
||||
/// </summary>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
var rawData = await SDService.PlannerGetEvents(PeriodoSel.Inizio, PeriodoSel.Fine);
|
||||
if (rawData != null && rawData.Count > 0)
|
||||
{
|
||||
ListEventi.Clear();
|
||||
// x ora copio i vari blocchi...
|
||||
foreach (var item in rawData)
|
||||
{
|
||||
ListEventi.AddRange(item.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta periodo da filtro
|
||||
/// </summary>
|
||||
/// <param name="newPeriod"></param>
|
||||
/// <returns></returns>
|
||||
private async Task SetPeriodo(EgwCoreLib.Utils.DtUtils.Periodo newPeriod)
|
||||
{
|
||||
PeriodoSel = newPeriod;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2602.2612</h4>
|
||||
<h4>Versione: 6.16.2603.2007</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2602.2612
|
||||
6.16.2603.2007
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2602.2612</version>
|
||||
<version>6.16.2603.2007</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
"MP.Inve": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
"MP.Land": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
"MP.Land.Auth": "Server=SQL2016DEV;Database=MoonPro_Anagrafica; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
"MP.Sched": "Server=SQL2016DEV;Database=MoonPro_ES3; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
"Redis": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
|
||||
"RedisAdmin": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
|
||||
"mdbConnString": "mongodb://W2019-MONGODB:27017"
|
||||
|
||||
Reference in New Issue
Block a user