diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index 8f2a7b66..77092740 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -1,7 +1,6 @@ using EgwCoreLib.Lux.Core.Generic; using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.DbModel.Config; -using EgwCoreLib.Lux.Data.DbModel.Cost; using EgwCoreLib.Lux.Data.DbModel.Items; using EgwCoreLib.Lux.Data.DbModel.Job; using EgwCoreLib.Lux.Data.DbModel.Production; @@ -25,30 +24,6 @@ namespace EgwCoreLib.Lux.Data.Controllers #region Internal Methods - /// - /// Elenco CostDrivers - /// - /// - internal async Task> CostDriverGetAllAsync() - { - List dbResult = new List(); - //using (DataLayerContext dbCtx = new DataLayerContext(_config)) - using (DataLayerContext dbCtx = new DataLayerContext()) - { - try - { - dbResult = await dbCtx - .DbSetCostDriver - .ToListAsync(); - } - catch (Exception exc) - { - Log.Error($"Eccezione durante CostDriverGetAllAsync{Environment.NewLine}{exc}"); - } - } - return dbResult; - } - /// /// Add item ricevuti da BOM calcolata /// @@ -697,61 +672,6 @@ namespace EgwCoreLib.Lux.Data.Controllers return totalUpdated; } - /// - /// Elenco ProdItem dato OrderRow - /// - /// - /// - internal async Task> ProdItemByOrderRow(int orderRowId) - { - List dbResult = new List(); - //using (DataLayerContext dbCtx = new DataLayerContext(_config)) - using (DataLayerContext dbCtx = new DataLayerContext()) - { - try - { - dbResult = await dbCtx - .DbSetProdItem - .Where(x => x.OrderRowID == orderRowId) - .ToListAsync(); - } - catch (Exception exc) - { - Log.Error($"Eccezione durante ProdItemByOrderRow{Environment.NewLine}{exc}"); - } - } - return dbResult; - } - - /// - /// Reset impostazione ProdItem x ripartire senza setting ProdGroup - /// - /// - /// - internal async Task ProdItemResetProdGroup(int orderRowID) - { - int numItem = 0; - //using (DataLayerContext dbCtx = new DataLayerContext(_config)) - using (DataLayerContext dbCtx = new DataLayerContext()) - { - try - { - numItem = await dbCtx.DbSetProdItem - .Where(p => p.OrderRowID == orderRowID) - .ExecuteUpdateAsync(setters => setters - .SetProperty(p => p.ProdGroupID, (int?)null) - .SetProperty(p => p.EstimTime, 0) - ); - } - catch (Exception exc) - { - Log.Error($"Eccezione durante ProdItemResetProdGroup{Environment.NewLine}{exc}"); - } - } - return numItem; - } - - /// /// Aggiorna record ProdOdl (se trovato) con BOM (raw) ricevuta /// diff --git a/EgwCoreLib.Lux.Data/Repository/Cost/CostDriverRepository.cs b/EgwCoreLib.Lux.Data/Repository/Cost/CostDriverRepository.cs new file mode 100644 index 00000000..4db6b3b0 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Repository/Cost/CostDriverRepository.cs @@ -0,0 +1,28 @@ +using EgwCoreLib.Lux.Data.DbModel.Cost; +using Microsoft.EntityFrameworkCore; + +namespace EgwCoreLib.Lux.Data.Repository.Cost +{ + public class CostDriverRepository : BaseRepository, ICostDriverRepository + { + #region Public Constructors + + public CostDriverRepository(IDbContextFactory ctxFactory) : base(ctxFactory) + { + } + + #endregion Public Constructors + + #region Public Methods + + public async Task> GetAllAsync() + { + await using var dbCtx = await CreateContextAsync(); + return await dbCtx.DbSetCostDriver + .AsNoTracking() + .ToListAsync(); + } + + #endregion Public Methods + } +} diff --git a/EgwCoreLib.Lux.Data/Repository/Cost/ICostDriverRepository.cs b/EgwCoreLib.Lux.Data/Repository/Cost/ICostDriverRepository.cs new file mode 100644 index 00000000..6f52240b --- /dev/null +++ b/EgwCoreLib.Lux.Data/Repository/Cost/ICostDriverRepository.cs @@ -0,0 +1,9 @@ +using EgwCoreLib.Lux.Data.DbModel.Cost; + +namespace EgwCoreLib.Lux.Data.Repository.Cost +{ + public interface ICostDriverRepository + { + Task> GetAllAsync(); + } +} diff --git a/EgwCoreLib.Lux.Data/Repository/Production/IProductionItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Production/IProductionItemRepository.cs new file mode 100644 index 00000000..902768d5 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Repository/Production/IProductionItemRepository.cs @@ -0,0 +1,10 @@ +using EgwCoreLib.Lux.Data.DbModel.Production; + +namespace EgwCoreLib.Lux.Data.Repository.Production +{ + public interface IProductionItemRepository + { + Task> GetByOrderRowAsync(int orderRowId); + Task ResetAssignAsync(int orderRowID); + } +} diff --git a/EgwCoreLib.Lux.Data/Repository/Production/ProductionItemRepository.cs b/EgwCoreLib.Lux.Data/Repository/Production/ProductionItemRepository.cs new file mode 100644 index 00000000..cc1c392b --- /dev/null +++ b/EgwCoreLib.Lux.Data/Repository/Production/ProductionItemRepository.cs @@ -0,0 +1,51 @@ +using EgwCoreLib.Lux.Data.DbModel.Production; +using Microsoft.EntityFrameworkCore; + +namespace EgwCoreLib.Lux.Data.Repository.Production +{ + public class ProductionItemRepository : BaseRepository, IProductionItemRepository + { + #region Public Constructors + + public ProductionItemRepository(IDbContextFactory ctxFactory) : base(ctxFactory) + { + } + + #endregion Public Constructors + + #region Public Methods + + public async Task> GetByOrderRowAsync(int orderRowId) + { + await using var dbCtx = await CreateContextAsync(); + return await dbCtx.DbSetProdItem + .AsNoTracking() + .Where(x => x.OrderRowID == orderRowId) + .ToListAsync(); + } + + public async Task ResetAssignAsync(int orderRowID) + { + await using var dbCtx = await CreateContextAsync(); + int numItem = 0; + await using var tx = dbCtx.Database.BeginTransaction(); + try + { + numItem = await dbCtx.DbSetProdItem + .Where(p => p.OrderRowID == orderRowID) + .ExecuteUpdateAsync(setters => setters + .SetProperty(p => p.ProdGroupID, (int?)null) + .SetProperty(p => p.EstimTime, 0) + ); + } + catch + { + tx.Rollback(); + throw; + } + return numItem; + } + + #endregion Public Methods + } +} diff --git a/EgwCoreLib.Lux.Data/Services/Cost/CostDriverService.cs b/EgwCoreLib.Lux.Data/Services/Cost/CostDriverService.cs new file mode 100644 index 00000000..a43f0815 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Services/Cost/CostDriverService.cs @@ -0,0 +1,50 @@ +using EgwCoreLib.Lux.Data.DbModel.Cost; +using EgwCoreLib.Lux.Data.Repository.Cost; +using Microsoft.Extensions.Configuration; +using StackExchange.Redis; + +namespace EgwCoreLib.Lux.Data.Services.Cost +{ + public class CostDriverService : BaseServ, ICostDriverService + { + #region Public Constructors + + public CostDriverService( + IConfiguration config, + IConnectionMultiplexer redis, + ICostDriverRepository repo) : base(config, redis) + { + _className = "CostDriver"; + _repo = repo; + } + + #endregion Public Constructors + + #region Public Methods + + /// + /// Elenco completo CostDriver da DB + /// + /// + public async Task> GetAllAsync() + { + return await TraceAsync($"{_className}.GetAll", async (activity) => + { + return await GetOrSetCacheAsync( + $"{_redisBaseKey}:{_className}:ALL", + async () => await _repo.GetAllAsync(), + UltraLongCache + ); + }); + } + + #endregion Public Methods + + #region Private Fields + + private readonly string _className; + private readonly ICostDriverRepository _repo; + + #endregion Private Fields + } +} diff --git a/EgwCoreLib.Lux.Data/Services/Cost/ICostDriverService.cs b/EgwCoreLib.Lux.Data/Services/Cost/ICostDriverService.cs new file mode 100644 index 00000000..8dae9707 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Services/Cost/ICostDriverService.cs @@ -0,0 +1,9 @@ +using EgwCoreLib.Lux.Data.DbModel.Cost; + +namespace EgwCoreLib.Lux.Data.Services.Cost +{ + public interface ICostDriverService + { + Task> GetAllAsync(); + } +} diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs index c305a4fc..44d96b1c 100644 --- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs +++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs @@ -1,7 +1,6 @@ using EgwCoreLib.Lux.Core.Generic; using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Controllers; -using EgwCoreLib.Lux.Data.DbModel.Cost; using EgwCoreLib.Lux.Data.DbModel.Job; using EgwCoreLib.Lux.Data.DbModel.Production; using EgwCoreLib.Lux.Data.DbModel.Sales; @@ -72,39 +71,6 @@ namespace EgwCoreLib.Lux.Data.Services return listFix; } - /// - /// Elenco cost drivers - /// - /// - public async Task> CostDriverGetAllAsync() - { - using var activity = StartActivity(); - string source = "DB"; - List? result = new List(); - // cerco in redis... - string currKey = $"{redisBaseKey}:CostDrivers:ALL"; - RedisValue rawData = _redisDb.StringGet(currKey); - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject>($"{rawData}"); - source = "REDIS"; - } - else - { - result = await dbController.CostDriverGetAllAsync(); - // serializzo e salvo... - rawData = JsonConvert.SerializeObject(result); - _redisDb.StringSet(currKey, rawData, UltraLongCache); - } - if (result == null) - { - result = new List(); - } - activity?.SetTag("data.source", source); - LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); - return result; - } - /// /// Reset completo cache sistema /// @@ -219,8 +185,6 @@ namespace EgwCoreLib.Lux.Data.Services return numDone; } - - /// /// Elenco completo Fasi /// @@ -354,60 +318,6 @@ namespace EgwCoreLib.Lux.Data.Services return fatto; } - /// - /// Elenco dei ProductionItem collegati ad una riga d'ordine - /// - /// - /// - public async Task> ProdItemByOrderRow(int OrderRowId) - { - using var activity = StartActivity(); - string source = "DB"; - List? result = new List(); - // cerco in redis... - string currKey = $"{redisBaseKey}:ProdItems:OrdRowId:{OrderRowId}"; - RedisValue rawData = await _redisDb.StringGetAsync(currKey); - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject>($"{rawData}"); - source = "REDIS"; - } - else - { - result = await dbController.ProdItemByOrderRow(OrderRowId); - // serializzo e salvo con config x evitare loop... - rawData = JsonConvert.SerializeObject(result, JSSettings); - await _redisDb.StringSetAsync(currKey, rawData, LongCache); - } - if (result == null) - { - result = new List(); - } - activity?.SetTag("data.source", source); - LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); - return result; - } - - /// - /// Reset assegnazioni x ProdItems dato orderRowID - /// - /// - /// - public async Task ProdItemResetOrderAssign(int orderRowID) - { - using var activity = StartActivity(); - string source = "DB+REDIS"; - int result = await dbController.ProdItemResetProdGroup(orderRowID); - await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:ProdItems:OrdRowId:*"); - await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:ProdAssign:OrdRowId:*"); - await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRows:*"); - await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:OrderRowsByState:*"); - activity?.SetTag("data.source", source); - LogTrace($"{source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); - return result; - } - - /// /// Aggiorna record ProdOdl (se trovato) con ItemListRaw (raw) inviata x calcolo PROD /// diff --git a/EgwCoreLib.Lux.Data/Services/Production/IProductionItemService.cs b/EgwCoreLib.Lux.Data/Services/Production/IProductionItemService.cs new file mode 100644 index 00000000..aa2c9bd2 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Services/Production/IProductionItemService.cs @@ -0,0 +1,10 @@ +using EgwCoreLib.Lux.Data.DbModel.Production; + +namespace EgwCoreLib.Lux.Data.Services.Production +{ + public interface IProductionItemService + { + Task> GetByOrderRowAsync(int orderRowId); + Task ResetAssignAsync(int orderRowID); + } +} diff --git a/EgwCoreLib.Lux.Data/Services/Production/ProductionItemService.cs b/EgwCoreLib.Lux.Data/Services/Production/ProductionItemService.cs new file mode 100644 index 00000000..7a51a231 --- /dev/null +++ b/EgwCoreLib.Lux.Data/Services/Production/ProductionItemService.cs @@ -0,0 +1,66 @@ +using EgwCoreLib.Lux.Data.DbModel.Production; +using EgwCoreLib.Lux.Data.Repository.Production; +using Microsoft.Extensions.Configuration; +using StackExchange.Redis; + +namespace EgwCoreLib.Lux.Data.Services.Production +{ + public class ProductionItemService : BaseServ, IProductionItemService + { + #region Public Constructors + + public ProductionItemService( + IConfiguration config, + IConnectionMultiplexer redis, + IProductionItemRepository repo) : base(config, redis) + { + _className = "ProductionItem"; + _repo = repo; + } + + #endregion Public Constructors + + #region Public Methods + + /// + /// Elenco completo ProductionItem dato OrderRow + /// + /// + public async Task> GetByOrderRowAsync(int orderRowId) + { + return await TraceAsync($"{_className}.GetByOrderRow", async (activity) => + { + return await GetOrSetCacheAsync( + $"{_redisBaseKey}:{_className}:GetByOrderRow:{orderRowId}", + async () => await _repo.GetByOrderRowAsync(orderRowId), + UltraLongCache + ); + }); + } + + public async Task ResetAssignAsync(int orderRowID) + { + return await TraceAsync($"{_className}.ResetProdGroup", async (activity) => + { + var success = await _repo.ResetAssignAsync(orderRowID); + + await ClearCacheAsync($"{_redisBaseKey}:{_className}:*"); + await ClearCacheAsync($"{_redisBaseKey}:ProdItems:OrdRowId:*"); + await ClearCacheAsync($"{_redisBaseKey}:ProdAssign:OrdRowId:*"); + await ClearCacheAsync($"{_redisBaseKey}:OrderRows:*"); + await ClearCacheAsync($"{_redisBaseKey}:OrderRowsByState:*"); + + return success; + }); + } + + #endregion Public Methods + + #region Private Fields + + private readonly string _className; + private readonly IProductionItemRepository _repo; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 99d0a10e..517bf71c 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2603.1819 + 1.1.2603.1909 diff --git a/Lux.API/Program.cs b/Lux.API/Program.cs index 7ce47a95..50ec9dd9 100644 --- a/Lux.API/Program.cs +++ b/Lux.API/Program.cs @@ -178,6 +178,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -193,6 +194,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -205,6 +207,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -219,6 +222,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs index cdcbdb67..11b18a92 100644 --- a/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs +++ b/Lux.UI/Components/Compo/JobTask/ResourcesMan.razor.cs @@ -24,52 +24,8 @@ namespace Lux.UI.Components.Compo.JobTask #endregion Protected Fields - #region Protected Properties - - [Inject] - protected DataLayerServices DLService { get; set; } = null!; - - [Inject] - protected IResourceService ResService { get; set; } = null!; - - #endregion Protected Properties - #region Protected Methods - /// - /// Reset selezione - /// - protected async void DoReset() - { - editRecord = null; - selRecord = null; - await ReloadBaseData(); - ReloadData(); - } - - [Inject] - protected IJSRuntime JSRuntime { get; set; } = null!; - /// - /// Selezione articolo x display info - /// - /// - protected void DoSelect(ResourceModel curRec) - { - selRecord = curRec; - } - - protected async Task DoDelete(ResourceModel rec2del) - { - if (!await JSRuntime.InvokeAsync("confirm", $"Confermi di voler eliminare il record {rec2del.Name}?")) - return; - - isLoading = true; - // elimino e ricarico... - await ResService.DeleteAsync(rec2del); - await ReloadBaseData(); - ReloadData(); - } - protected override async Task OnInitializedAsync() { await ReloadBaseData(); @@ -81,38 +37,16 @@ namespace Lux.UI.Components.Compo.JobTask ReloadData(); } - protected async void DoAdd() - { - - if (!await JSRuntime.InvokeAsync("confirm", $"Confermi di voler aggiungere un nuovo record risorsa?")) - return; - - isLoading = true; - var newRecord = new ResourceModel() - { - Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}", - CostDriverID = 1 - }; - - await ResService.UpsertAsync(newRecord); - AllRecords = new List(); - await Task.Delay(100); - await ReloadBaseData(); - ReloadData(); - } - #endregion Protected Methods #region Private Fields - private int currPage = 1; private ResourceModel? editRecord = null; private bool isLoading = false; - private int numRecord = 10; private ResourceModel? selRecord = null; @@ -123,11 +57,23 @@ namespace Lux.UI.Components.Compo.JobTask #region Private Properties + [Inject] + private ICostDriverService CDService { get; set; } = null!; + + [Inject] + private DataLayerServices DLService { get; set; } = null!; + + [Inject] + private IJSRuntime JSRuntime { get; set; } = null!; + private string mainCss { get => selRecord == null ? "col-6" : "col-4"; } + [Inject] + private IResourceService ResService { get; set; } = null!; + #endregion Private Properties #region Private Methods @@ -147,6 +93,57 @@ namespace Lux.UI.Components.Compo.JobTask return answ; } + private async Task DoAdd() + { + if (!await JSRuntime.InvokeAsync("confirm", $"Confermi di voler aggiungere un nuovo record risorsa?")) + return; + + isLoading = true; + var newRecord = new ResourceModel() + { + Name = $"Nuova Risorsa | {DateTime.Now:yyyy.MM.dd-HH.mm.ss}", + CostDriverID = 1 + }; + + await ResService.UpsertAsync(newRecord); + AllRecords = new List(); + await Task.Delay(100); + await ReloadBaseData(); + ReloadData(); + } + + private async Task DoDelete(ResourceModel rec2del) + { + if (!await JSRuntime.InvokeAsync("confirm", $"Confermi di voler eliminare il record {rec2del.Name}?")) + return; + + isLoading = true; + // elimino e ricarico... + await ResService.DeleteAsync(rec2del); + await ReloadBaseData(); + ReloadData(); + } + + /// + /// Reset selezione + /// + private async void DoReset() + { + editRecord = null; + selRecord = null; + await ReloadBaseData(); + ReloadData(); + } + + /// + /// Selezione articolo x display info + /// + /// + private void DoSelect(ResourceModel curRec) + { + selRecord = curRec; + } + /// /// Esegue gestione updated /// @@ -168,7 +165,7 @@ namespace Lux.UI.Components.Compo.JobTask private async Task ReloadBaseData() { AllRecords = await ResService.GetAllAsync(); - ListCostDriver = await DLService.CostDriverGetAllAsync(); + ListCostDriver = await CDService.GetAllAsync(); } private void ReloadData() diff --git a/Lux.UI/Components/Compo/OrderRowMan.razor.cs b/Lux.UI/Components/Compo/OrderRowMan.razor.cs index cc6fc481..0070d7aa 100644 --- a/Lux.UI/Components/Compo/OrderRowMan.razor.cs +++ b/Lux.UI/Components/Compo/OrderRowMan.razor.cs @@ -367,6 +367,9 @@ namespace Lux.UI.Components.Compo [Inject] private IEnvirParamService EPService { get; set; } = null!; + [Inject] + private IProductionItemService PIService { get; set; } = null!; + /// /// Costo totale calcolato x offerta /// @@ -1628,7 +1631,7 @@ namespace Lux.UI.Components.Compo /// private async Task ResetAssign(int OrderRowID) { - await DLService.ProdItemResetOrderAssign(OrderRowID); + await PIService.ResetAssignAsync(OrderRowID); await ForceOrderReload(OrderRowID); } diff --git a/Lux.UI/Components/Pages/JobRoute.razor.cs b/Lux.UI/Components/Pages/JobRoute.razor.cs index 2957e8de..e632b9b6 100644 --- a/Lux.UI/Components/Pages/JobRoute.razor.cs +++ b/Lux.UI/Components/Pages/JobRoute.razor.cs @@ -10,25 +10,6 @@ namespace Lux.UI.Components.Pages { public partial class JobRoute { - #region Protected Properties - - [Inject] - protected DataLayerServices DLService { get; set; } = null!; - - [Inject] - protected IJobStepService JStService { get; set; } = null!; - - [Inject] - protected IJobTaskService JTaService { get; set; } = null!; - - [Inject] - protected IResourceService ResService { get; set; } = null!; - - [Inject] - protected ITagService TagService { get; set; } = null!; - - #endregion Protected Properties - #region Protected Methods protected override Task OnInitializedAsync() @@ -36,36 +17,57 @@ namespace Lux.UI.Components.Pages return ReloadData(); } - protected void ResetSearch() - { - searchVal = ""; - } - #endregion Protected Methods #region Private Fields private JobTaskModel? editRecord = null; + private bool isLoading = false; + private List ListCostDrivers = new List(); + private List ListJobTask = new List(); + private List ListPhases = new List(); + private List ListResources = new List(); + private List? ListStep = null; + private List ListTagsAvailable = new List(); + private JobTaskModel? selRecord = null; #endregion Private Fields #region Private Properties + [Inject] + private ICostDriverService CDService { get; set; } = null!; + + [Inject] + private DataLayerServices DLService { get; set; } = null!; + + [Inject] + private IJobStepService JStService { get; set; } = null!; + + [Inject] + private IJobTaskService JTaService { get; set; } = null!; + private string mainCss { get => selRecord == null ? "col-6" : "col-4"; } + [Inject] + private IResourceService ResService { get; set; } = null!; + private string searchVal { get; set; } = string.Empty; + [Inject] + private ITagService TagService { get; set; } = null!; + #endregion Private Properties #region Private Methods @@ -80,7 +82,7 @@ namespace Lux.UI.Components.Pages isLoading = true; var rawTags = await TagService.GetAllAsync(); ListTagsAvailable = rawTags.Select(x => x.CodTag).ToList(); - ListCostDrivers = await DLService.CostDriverGetAllAsync(); + ListCostDrivers = await CDService.GetAllAsync(); ListPhases = await DLService.PhasesGetAllAsync(); ListResources = await ResService.GetAllAsync(); ListJobTask = await JTaService.GetAllAsync(); @@ -105,6 +107,11 @@ namespace Lux.UI.Components.Pages } } + private void ResetSearch() + { + searchVal = ""; + } + /// /// Salva ID sel e mostra dettagli JobTask /// diff --git a/Lux.UI/Components/Pages/Offers.razor.cs b/Lux.UI/Components/Pages/Offers.razor.cs index 496e8981..c4ac54e3 100644 --- a/Lux.UI/Components/Pages/Offers.razor.cs +++ b/Lux.UI/Components/Pages/Offers.razor.cs @@ -5,6 +5,7 @@ using EgwCoreLib.Lux.Data.DbModel.Config; using EgwCoreLib.Lux.Data.DbModel.Sales; using EgwCoreLib.Lux.Data.Services; using EgwCoreLib.Lux.Data.Services.Config; +using EgwCoreLib.Lux.Data.Services.Production; using EgwCoreLib.Lux.Data.Services.Sales; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; @@ -64,19 +65,9 @@ namespace Lux.UI.Components.Pages [Inject] protected DataLayerServices DLService { get; set; } = null!; - [Inject] - private IEnvirParamService EPService { get; set; } = null!; - [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; - [Inject] - private IOfferService OffService { get; set; } = default!; - - [Inject] - private IOrderService OrdService { get; set; } = default!; - - [Inject] protected ProdService PService { get; set; } = null!; @@ -213,7 +204,7 @@ namespace Lux.UI.Components.Pages CalcRequestDTO calcReq = new CalcRequestDTO(); bool needCalc = false; // recupero elenco items collegati alla riga d'ordine - var ProdList = await DLService.ProdItemByOrderRow(rigaOrd.OrderRowID); + var ProdList = await PIService.GetByOrderRowAsync(rigaOrd.OrderRowID); List TagList = ProdList.Select(x => x.ProdItemTag).ToList(); //string serTagList = JsonConvert.SerializeObject(TagList); string serTagList = string.Join(",", TagList); @@ -338,8 +329,20 @@ namespace Lux.UI.Components.Pages #region Private Properties + [Inject] + private IEnvirParamService EPService { get; set; } = null!; + private List listBord01 { get; set; } = new(); + [Inject] + private IOfferService OffService { get; set; } = default!; + + [Inject] + private IOrderService OrdService { get; set; } = default!; + + [Inject] + private IProductionItemService PIService { get; set; } = default!; + #endregion Private Properties #region Private Methods diff --git a/Lux.UI/Components/Pages/Orders.razor.cs b/Lux.UI/Components/Pages/Orders.razor.cs index 1305a467..868f9ebd 100644 --- a/Lux.UI/Components/Pages/Orders.razor.cs +++ b/Lux.UI/Components/Pages/Orders.razor.cs @@ -5,6 +5,7 @@ using EgwCoreLib.Lux.Data.DbModel.Config; using EgwCoreLib.Lux.Data.DbModel.Sales; using EgwCoreLib.Lux.Data.Services; using EgwCoreLib.Lux.Data.Services.Config; +using EgwCoreLib.Lux.Data.Services.Production; using EgwCoreLib.Lux.Data.Services.Sales; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; @@ -34,19 +35,21 @@ namespace Lux.UI.Components.Pages #region Protected Properties [Inject] - protected IConfiguration Config { get; set; } = null!; + private IConfiguration Config { get; set; } = null!; [Inject] - protected CalcRuidService CRService { get; set; } = null!; + private CalcRuidService CRService { get; set; } = null!; - protected string DivMainCss + private string DivMainCss { get => SelRecord != null ? "col-6" : "col-12"; } [Inject] - protected DataLayerServices DLService { get; set; } = null!; + private DataLayerServices DLService { get; set; } = null!; + [Inject] + private IProductionItemService PIService { get; set; } = default!; [Inject] private IOrderService OrdService { get; set; } = null!; @@ -71,16 +74,16 @@ namespace Lux.UI.Components.Pages } [Inject] - protected IJSRuntime JSRuntime { get; set; } = null!; + private IJSRuntime JSRuntime { get; set; } = null!; [Inject] - protected ProdService PService { get; set; } = null!; + private ProdService PService { get; set; } = null!; #endregion Protected Properties #region Protected Methods - protected string CheckSelect(OrderModel curRec) + private string CheckSelect(OrderModel curRec) { string answ = ""; if (SelRecord != null) @@ -90,7 +93,7 @@ namespace Lux.UI.Components.Pages return answ; } - protected void DoAdd() + private void DoAdd() { EditRecord = new OrderModel() { @@ -100,19 +103,19 @@ namespace Lux.UI.Components.Pages }; } - protected void DoEdit(OrderModel curRec) + private void DoEdit(OrderModel curRec) { currStep = CompileStep.Header; EditRecord = curRec; } - protected void DoReset() + private void DoReset() { EditRecord = null; SelRecord = null; } - protected void DoSelect(OrderModel curRec) + private void DoSelect(OrderModel curRec) { SelRecord = curRec; } @@ -133,7 +136,7 @@ namespace Lux.UI.Components.Pages /// Rimette un Job da coda running in waiting /// /// - protected async Task ReRunJob(string? JobCode) + private async Task ReRunJob(string? JobCode) { if (!string.IsNullOrEmpty(JobCode)) { @@ -153,7 +156,7 @@ namespace Lux.UI.Components.Pages /// /// /// - protected async Task ResetHistory(OrderModel currRec) + private async Task ResetHistory(OrderModel currRec) { if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler resettare l'history dell'ordine corrente? L'operazione non è revertibile.")) return; @@ -167,7 +170,7 @@ namespace Lux.UI.Components.Pages /// Resetta coda running riportandoli in waiting /// /// - protected async Task ResetRunQueue() + private async Task ResetRunQueue() { if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler resettarela coda di run calcolo? Le richieste verranno riaccodate in waiting.")) return; @@ -183,7 +186,7 @@ namespace Lux.UI.Components.Pages /// Resetta coda waiting eliminando task /// /// - protected async Task ResetWaitQueue() + private async Task ResetWaitQueue() { if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler resettarela coda di attesa calcolo eliminando le richieste in attesa? L'operazione non è revertibile.")) return; @@ -198,7 +201,7 @@ namespace Lux.UI.Components.Pages /// Manda l'ordine in fase di estimation /// /// - protected async Task SendEstim(OrderModel currRec) + private async Task SendEstim(OrderModel currRec) { /* --------------------------------- * Manda in stima l'ordine: @@ -226,7 +229,7 @@ namespace Lux.UI.Components.Pages CalcRequestDTO calcReq = new CalcRequestDTO(); bool needCalc = false; // recupero elenco items collegati alla riga d'ordine - var ProdList = await DLService.ProdItemByOrderRow(rigaOrd.OrderRowID); + var ProdList = await PIService.GetByOrderRowAsync(rigaOrd.OrderRowID); List TagsList = ProdList.Select(x => x.ProdItemTag).ToList(); //string serTagList = JsonConvert.SerializeObject(TagList); string serTagList = string.Join(",", TagsList); diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index cee5edb7..512a73db 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2603.1819 + 1.1.2603.1909 diff --git a/Lux.UI/Program.cs b/Lux.UI/Program.cs index 2db787f6..a87b0ad5 100644 --- a/Lux.UI/Program.cs +++ b/Lux.UI/Program.cs @@ -216,6 +216,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -231,6 +232,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -243,6 +245,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -257,6 +260,7 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 7671c91e..9f36b9b8 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2603.1819

+

Versione: 1.1.2603.1909


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index b5cd793c..8f1bd253 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2603.1819 +1.1.2603.1909 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 2110e749..78e2e1b6 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2603.1819 + 1.1.2603.1909 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false