Files
lux/EgwCoreLib.Lux.Data/DbModel/Production/ProductionODLModel.cs
T
2026-03-25 07:24:21 +01:00

172 lines
5.1 KiB
C#

using EgwCoreLib.Lux.Core.Generic;
using EgwCoreLib.Lux.Core.RestPayload;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace EgwCoreLib.Lux.Data.DbModel.Production
{
/// <summary>
/// Tabella delle fasi di lavorazione x ogni item da produrre
/// </summary>
[Table("production_odl")]
public class ProductionODLModel
{
/// <summary>
/// ID del record
/// </summary>
[Key]
public int ProdODLID { get; set; }
/// <summary>
/// Codice calcolato (16 char)
/// - tipo (ODL.)
/// - anno (yyyy)
/// - id annuale (00000000x8)
/// es: "ODL.20250012AF
/// </summary>
public string OdlTag { get; set; } = "";
/// <summary>
/// BatchID di appartenenza
/// </summary>
public int ProdBatchID { get; set; }
/// <summary>
/// Indice della fase all'interno del Job x produrre item
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// ID della fase realizzata
/// </summary>
public int? PhaseID { get; set; }
/// <summary>
/// ID della risorsa impiegata
/// </summary>
public int? ResourceID { get; set; }
/// <summary>
/// Codice Plant
/// </summary>
public string ProdPlantCod { get; set; } = "";
/// <summary>
/// Descrizione della fase del Job
/// </summary>
public string Description { get; set; } = "";
/// <summary>
/// Margine percentuale standard
/// </summary>
public double Qty { get; set; } = 1;
/// <summary>
/// DataOra assegnazione (in planner)
/// </summary>
public DateTime? DateAssign { get; set; } = null;
/// <summary>
/// DataOra massima per completamento (in planner)
/// </summary>
public DateTime? DateMaxCompl { get; set; } = null;
/// <summary>
/// DataOra inizio effettivo
/// </summary>
public DateTime? DateStart { get; set; } = null;
/// <summary>
/// DataOra fine
/// </summary>
public DateTime? DateEnd { get; set; } = null;
/// <summary>
/// Tempo di lavorazione Stimato
/// </summary>
public decimal EstimTime { get; set; } = 0;
/// <summary>
/// Tempo di lavorazione netto (non solo inizio fine ma al netto di pause/spento)
/// </summary>
public decimal WorkTime { get; set; } = 0;
/// <summary>
/// BOM serializzata per la produzione dell'intero ODL
/// </summary>
public string RawBoM { get; set; } = "";
/// <summary>
/// Valore serializzato del materiale DISPONIBILE inviato al prod per la produzione dell'intero ODL
/// </summary>
public string RawItemRawList { get; set; } = "";
/// <summary>
/// Valore serializzato del materiale NECESSARIO (calcolato) per la produzione dell'intero ODL (es barre e consumo) tornato dal PROD
/// </summary>
public string RawMaterials { get; set; } = "";
/// <summary>
/// BOM in versione deserializzata
/// </summary>
[NotMapped]
public List<BomItemDTO> ListBoM
{
get
{
List<BomItemDTO> bomList = new List<BomItemDTO>();
if (!string.IsNullOrEmpty(RawBoM) && RawBoM.Length > 2)
{
bomList = JsonConvert.DeserializeObject<List<BomItemDTO>>(RawBoM) ?? new List<BomItemDTO>();
}
return bomList;
}
}
/// <summary>
/// Dizionario ItemList per calcolo lavorazioni inviato al prod, deserializzato
/// </summary>
[NotMapped]
public Dictionary<string, List<ItemRawDTO>> DictItemRaw
{
get
{
Dictionary<string, List<ItemRawDTO>> itemList = new Dictionary<string, List<ItemRawDTO>>();
if (!string.IsNullOrEmpty(RawItemRawList) && RawItemRawList.Length > 2)
{
itemList = JsonConvert.DeserializeObject<Dictionary<string, List<ItemRawDTO>>>(RawItemRawList) ?? new Dictionary<string, List<ItemRawDTO>>();
}
return itemList;
}
}
/// <summary>
/// Navigazione sui Batch
/// </summary>
[ForeignKey("ProdBatchID")]
public virtual ProductionBatchModel ProdBatchNav { get; set; } = null!;
#if false
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("PhaseID")]
public virtual PhaseModel? PhaseNav { get; set; }
/// <summary>
/// Navigazione Job/Cicli
/// </summary>
[ForeignKey("ResourceID")]
public virtual ResourceModel? ResourceNav { get; set; }
#endif
/// <summary>
/// Navigazione verso tabella Item2Odl
/// </summary>
public ICollection<ProductionItem2ODLModel> Item2OdlNav { get; set; } = new List<ProductionItem2ODLModel>();
}
}