acabado la parte de configuracion
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="row container-fluid mt-4" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<button @onclick="generarExcel" class="btnBlue col-1 " style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
@@ -42,7 +44,6 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<button @onclick="generarExcel" class="btnBlue" style="background-color: #65b7c3 !important;"> <i class="fas fa-print pe-2"></i>Generar Excel</button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -54,7 +55,7 @@
|
||||
<Tab Title="Estadisticas Herramienta CASA" Active>
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab>
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab ListadoHerraCASA="@listadoHerramientaEstadistica.Where(x=> x.idSimulacionNavigation.idTipoSimulacion == 31).ToList()"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraCASATab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
@@ -62,7 +63,7 @@
|
||||
<Tab Title="Estadisticas Licitación CASA">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab>
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab ListadoLiciCASA="@listadoHerramientaEstadistica.Where(x => x.idSimulacionNavigation.idTipoSimulacion == 32).ToList()"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciCASATab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
@@ -70,7 +71,15 @@
|
||||
<Tab Title="Estadisticas Herramienta URBAN">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab>
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab ListadoHerraURBAN="@listadoHerramientaEstadisticaUrban.Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34).ToList()"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaHerraURBANTab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
<Tab Title="Estadisticas Licitación URBAN">
|
||||
<Content>
|
||||
<div class="CajaTab p-2">
|
||||
<HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciURBANTab ListadoLiciURBAN="@listadoHerramientaEstadisticaUrban.Where(x => x.idSimulacionNavigation.idTipoSimulacion == 35).ToList()"></HerramientaCASA.Components.Pages.ConfiguracionPages.EstadisticasTabs.EstadisticaLiciURBANTab>
|
||||
</div>
|
||||
</Content>
|
||||
</Tab>
|
||||
|
||||
@@ -16,78 +16,110 @@
|
||||
<label class="fw-bold">Total simulaciones herramienta CASA: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes directos:</label>
|
||||
<label class="tituloLbl">Nº total trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores.MilesYDecimales()</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste anual total:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeAnualTotal.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasProduccion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes indirectos:</label>
|
||||
<label class="tituloLbl">Costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes variables:</label>
|
||||
<label class="tituloLbl">Costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total fases:</label>
|
||||
<label class="tituloLbl">Total superficie:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalSuperficie.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas documentación:</label>
|
||||
<label class="tituloLbl">Horas documentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDocumentacion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas dirección obra:</label>
|
||||
<label class="tituloLbl">Horas dirección obra:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasDireccionObra.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion.MilesYDecimales() %</label>
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">% externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeExternalizacion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total número trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores</label>
|
||||
<label class="tituloLbl">Precio encargo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioEncargo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,141 +131,53 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes directos">
|
||||
<span>@context.costeDirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" Class="text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Total costes indirectos">
|
||||
<span>@context.costeIndirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes Variables">
|
||||
<span>@context.costeVariable</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
||||
<span>@context.costeHoraDespachoProf</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total superficie">
|
||||
<span></span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
||||
<span>@context.totalFases</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas documentación">
|
||||
<span>@context.horasTPEDocumentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas dirección de obra">
|
||||
<span>@context.horasTPEDireccionObra</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
||||
<span>@context.horasTPE</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
||||
<span>@context.plazoPresentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
||||
<span>@context.costeProduccion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje beneficio">
|
||||
<span>@context.porcentajeBeneficio</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total número trabajadores">
|
||||
<span>@context.numeroTrabajadores</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoHerraCASA { get; set; } = new List<estadisticas>();
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costesDirectos =UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto),totalProyectosTipo);
|
||||
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.costeAnualTotal = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalCosteAnual), totalProyectosTipo);
|
||||
estadisticasTotales.horasProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.costesDirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costesIndirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costesVariables = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.totalSuperficie= UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalSupeficie), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasDocumentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDocumentacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasDireccionObra = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPEDireccionObra), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.precioEncargo= UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioEncargo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 31).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
totalProyectosTipo = ListadoHerraCASA.Count();
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
hacerCalculos(ListadoHerraCASA);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -8,107 +8,93 @@
|
||||
|
||||
<div>
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaInicio"
|
||||
ValueChanged="OnFechaInicioChanged"
|
||||
ValueExpression="@(() => fechaInicio)" />
|
||||
|
||||
<label>Fecha final:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaFinal"
|
||||
ValueChanged="OnFechaFinalChanged"
|
||||
ValueExpression="@(() => fechaFinal)" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
{
|
||||
<label class="text-danger fw-semibold">
|
||||
@mensajeError
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="mt-5" style="padding:50px;">
|
||||
<div class="mt-2" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones herramienta URBAN: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDirecto.MilesYDecimales() €</label>
|
||||
<label class="tituloLbl">Nº total trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores.MilesYDecimales()</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeIndirecto.MilesYDecimales() €</label>
|
||||
<label class="tituloLbl">Coste anual total:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeAnualTotal.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeVariable.MilesYDecimales() €</label>
|
||||
<label class="tituloLbl">Horas de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasProduccion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeHoraDespachoProf.MilesYDecimales() €</label>
|
||||
<label class="tituloLbl">Costes directos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesDirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas documentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPEDocumentacion.MilesYDecimales() h</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas dirección obra:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPEDireccionObra.MilesYDecimales() h</label>
|
||||
<label class="tituloLbl">Costes indirectos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesIndirectos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPE.MilesYDecimales() h</label>
|
||||
<label class="tituloLbl">Costes variables:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costesVariables.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion.MilesYDecimales() %</label>
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">Innovación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.innovacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeExternalizacion %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste externalización:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeExternalizacion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total porcentaje beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeBeneficio.MilesYDecimales() %</label>
|
||||
<label class="tituloLbl">Beneficio:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.beneficio.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total número trabajadores:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.numeroTrabajadores</label>
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,10 +108,10 @@
|
||||
|
||||
|
||||
|
||||
|
||||
@*
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
Data="ListadoHerraURBAN"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
@@ -200,141 +186,48 @@
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
|
||||
*@
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoHerraURBAN { get; set; } = new List<estadisticas>();
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public estadisticas estadisticasTotales = new estadisticas();
|
||||
public EstadisticasUrbanVM estadisticasTotales = new EstadisticasUrbanVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
private async Task OnFechaInicioChanged(DateTime? value)
|
||||
{
|
||||
fechaInicio = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnFechaFinalChanged(DateTime? value)
|
||||
{
|
||||
fechaFinal = value;
|
||||
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
|
||||
private void AplicarFiltros()
|
||||
{
|
||||
// Filtra la lista en función de los criterios ingresados
|
||||
listadoHerramientaEstadistica = new List<bdHerramientaCACOA.db.estadisticas>();
|
||||
foreach (bdHerramientaCACOA.db.estadisticas item in listadoHerramientaEstadisticaAux)
|
||||
{
|
||||
if (IsVisible(item) == true)
|
||||
{
|
||||
listadoHerramientaEstadistica.Add(item);
|
||||
}
|
||||
}
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
public bool IsVisible(bdHerramientaCACOA.db.estadisticas listado)
|
||||
{
|
||||
DateTime? ultimaFecha;
|
||||
if (listado.idSimulacionNavigation.FechaModificacion != null)
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaModificacion;
|
||||
}
|
||||
else
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaCreacion;
|
||||
}
|
||||
|
||||
if (fechaFinal != null && listado.idSimulacionNavigation.FechaCreacion.Date >= fechaInicio?.Date && ultimaFecha?.Date <= fechaFinal?.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeDirecto = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costeIndirecto = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costeVariable = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
||||
estadisticasTotales.costeHoraDespachoProf = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
|
||||
estadisticasTotales.horasTPE = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.costeAnualTotal = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalCosteAnual), totalProyectosTipo);
|
||||
estadisticasTotales.horasProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.costesDirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeDirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costesIndirectos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeIndirecto), totalProyectosTipo);
|
||||
estadisticasTotales.costesVariables = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeVariable), totalProyectosTipo);
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.innovacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.innovacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeExternalizacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraExternalizacion), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeBeneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.numeroTrabajadores = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.numeroTrabajadores), totalProyectosTipo);
|
||||
estadisticasTotales.beneficio = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.porcentajeBeneficio), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 34).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
totalProyectosTipo = ListadoHerraURBAN.Count();
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
hacerCalculos(ListadoHerraURBAN);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,70 +8,64 @@
|
||||
|
||||
<div>
|
||||
|
||||
<div class="row" style="justify-content:space-between">
|
||||
<div class="form-group mt-4 col-6">
|
||||
<label>Fecha inicio:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaInicio"
|
||||
ValueChanged="OnFechaInicioChanged"
|
||||
ValueExpression="@(() => fechaInicio)" />
|
||||
|
||||
<label>Fecha final:</label>
|
||||
<InputDate TValue="DateTime?"
|
||||
Value="fechaFinal"
|
||||
ValueChanged="OnFechaFinalChanged"
|
||||
ValueExpression="@(() => fechaFinal)" />
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
@if (!string.IsNullOrEmpty(mensajeError))
|
||||
{
|
||||
<label class="text-danger fw-semibold">
|
||||
@mensajeError
|
||||
</label>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
|
||||
<div class="mt-5" style="padding:50px;">
|
||||
<div class="mt-2" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones licitación CASA: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste hora despacho profesional:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeHoraDespachoProf.MilesYDecimales() €</label>
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalFases %</label>
|
||||
<label class="tituloLbl">Total superficie:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalSuperficie.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total horas TPE:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTPE.MilesYDecimales() h</label>
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total plazo presentación:</label>
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total coste producción:</label>
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Total otros trabajos:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.totalOtrosTrabajos.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio encargo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioEncargo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -85,9 +79,9 @@
|
||||
|
||||
|
||||
|
||||
<Grid TItem="estadisticas"
|
||||
@* <Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="listadoHerramientaEstadistica"
|
||||
Data="ListadoLiciCASA"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
@@ -121,135 +115,38 @@
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
</Grid> *@
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoLiciCASA { get; set; } = new List<estadisticas>();
|
||||
|
||||
public List<estadisticas> listadoHerramientaEstadistica { get; set; } = new List<estadisticas>();
|
||||
public List<estadisticas> listadoHerramientaEstadisticaAux { get; set; } = new List<estadisticas>();
|
||||
|
||||
|
||||
public DateTime? fechaInicio { get; set; } = null;
|
||||
public DateTime? fechaFinal { get; set; } = null;
|
||||
|
||||
public estadisticas estadisticasTotales = new estadisticas();
|
||||
public EstadistiaHerraCasaVM estadisticasTotales = new EstadistiaHerraCasaVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private string mensajeError = "";
|
||||
|
||||
private async Task OnFechaInicioChanged(DateTime? value)
|
||||
{
|
||||
fechaInicio = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task OnFechaFinalChanged(DateTime? value)
|
||||
{
|
||||
fechaFinal = value;
|
||||
if (UtilidadesCASA.comprobarFechasNulas(fechaInicio, fechaFinal))
|
||||
{
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UtilidadesCASA.comprobarFechas((DateTime)fechaInicio, (DateTime)fechaFinal))
|
||||
{
|
||||
AplicarFiltros();
|
||||
mensajeError = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
mensajeError = "La fecha final no puede ser menor que la fecha inicial.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public tsHerramientasCACOA bd;
|
||||
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
bd = tsHerramientasCACOA.NuevoContexto(SoloLectura: false);
|
||||
inicializarListado();
|
||||
|
||||
}
|
||||
|
||||
private void AplicarFiltros()
|
||||
{
|
||||
// Filtra la lista en función de los criterios ingresados
|
||||
listadoHerramientaEstadistica = new List<bdHerramientaCACOA.db.estadisticas>();
|
||||
foreach (bdHerramientaCACOA.db.estadisticas item in listadoHerramientaEstadisticaAux)
|
||||
{
|
||||
if (IsVisible(item) == true)
|
||||
{
|
||||
listadoHerramientaEstadistica.Add(item);
|
||||
}
|
||||
}
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
}
|
||||
|
||||
public bool IsVisible(bdHerramientaCACOA.db.estadisticas listado)
|
||||
{
|
||||
DateTime? ultimaFecha;
|
||||
if (listado.idSimulacionNavigation.FechaModificacion != null)
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaModificacion;
|
||||
}
|
||||
else
|
||||
{
|
||||
ultimaFecha = listado.idSimulacionNavigation.FechaCreacion;
|
||||
}
|
||||
|
||||
if (fechaFinal != null && listado.idSimulacionNavigation.FechaCreacion.Date >= fechaInicio?.Date && ultimaFecha?.Date <= fechaFinal?.Date)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeHoraDespachoProf = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.totalFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasTPE = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.totalSuperficie = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalSupeficie), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
estadisticasTotales.totalOtrosTrabajos = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalOtrosTrabajos), totalProyectosTipo);
|
||||
estadisticasTotales.precioEncargo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioEncargo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
private void inicializarListado()
|
||||
{
|
||||
listadoHerramientaEstadistica = bd.estadisticas.Include(x => x.idSimulacionNavigation).Where(x => x.idSimulacionNavigation.idTipoSimulacion == 32).ToList();
|
||||
listadoHerramientaEstadisticaAux = listadoHerramientaEstadistica;
|
||||
|
||||
totalProyectosTipo = listadoHerramientaEstadistica.Count();
|
||||
|
||||
hacerCalculos(listadoHerramientaEstadistica);
|
||||
totalProyectosTipo = ListadoLiciCASA.Count();
|
||||
hacerCalculos(ListadoLiciCASA);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
@inject NavigationManager Navigation
|
||||
@layout ConfiguracionLayout
|
||||
@rendermode InteractiveServer
|
||||
@using BlazorBootstrap
|
||||
@using System.Globalization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using bdHerramientaCACOA.db
|
||||
|
||||
<div>
|
||||
|
||||
@if (totalProyectosTipo != 0)
|
||||
{
|
||||
<div class="mt-2" style="padding:50px;">
|
||||
<div class="mb-4">
|
||||
<label class="fw-bold">Total simulaciones licitación URBAN: <span>@totalProyectosTipo</span> </label>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Costes despacho:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeDespacho.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">% fases:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.porcentajeFases %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Innovación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.innovacion.MilesYDecimales() %</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Horas trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.horasTrabajo.MilesYDecimales() h</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Plazo presentación:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.plazoPresentacion</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Coste de producción:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.costeProduccion.MilesYDecimales() €</label>
|
||||
</div>
|
||||
|
||||
<div class="col-2 formatoCampos pt-2">
|
||||
<label class="tituloLbl">Precio trabajo:</label>
|
||||
<label class="tituloLbl">@estadisticasTotales.precioTrabajo.MilesYDecimales() €</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-5">
|
||||
<label class="tituloLbl">No hay datos entre esas fechas.</label>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
@*
|
||||
<Grid TItem="estadisticas"
|
||||
Class="tablaCACOA table"
|
||||
Data="ListadoLiciURBAN"
|
||||
AllowFiltering="false"
|
||||
PageSize="10"
|
||||
FixedHeader="true"
|
||||
Height="750"
|
||||
Unit="Unit.Px"
|
||||
EmptyText="No hay registros."
|
||||
PageSizeSelectorVisible="false"
|
||||
Responsive="true">
|
||||
<GridColumns>
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes directos">
|
||||
<span>@context.costeDirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" Class="text-end" HeaderTextAlignment="Alignment.Center" HeaderText="Total costes indirectos">
|
||||
<span>@context.costeIndirecto</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes Variables">
|
||||
<span>@context.costeVariable</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total coste hora despacho profesional">
|
||||
<span>@context.costeHoraDespachoProf</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total superficie">
|
||||
<span></span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total fases">
|
||||
<span>@context.totalFases</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas documentación">
|
||||
<span>@context.horasTPEDocumentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas dirección de obra">
|
||||
<span>@context.horasTPEDireccionObra</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total horas trabajo profesional">
|
||||
<span>@context.horasTPE</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total plazos">
|
||||
<span>@context.plazoPresentacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total costes de producción">
|
||||
<span>@context.costeProduccion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total otros trabajos">
|
||||
<span>@context.totalOtrosTrabajos</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje externalización">
|
||||
<span>@context.porcentajeExternalizacion</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total porcentaje beneficio">
|
||||
<span>@context.porcentajeBeneficio</span>
|
||||
</GridColumn>
|
||||
|
||||
<GridColumn TItem="estadisticas" HeaderTextAlignment="Alignment.Center" Class="text-end" HeaderText="Total número trabajadores">
|
||||
<span>@context.numeroTrabajadores</span>
|
||||
</GridColumn>
|
||||
</GridColumns>
|
||||
</Grid>
|
||||
*@
|
||||
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public List<estadisticas> ListadoLiciURBAN { get; set; } = new List<estadisticas>();
|
||||
public EstadisticasUrbanVM estadisticasTotales = new EstadisticasUrbanVM();
|
||||
private int totalProyectosTipo = 0;
|
||||
|
||||
private void hacerCalculos(List<bdHerramientaCACOA.db.estadisticas> listadoEstadistica)
|
||||
{
|
||||
estadisticasTotales.costeDespacho = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeHoraDespachoProf), totalProyectosTipo);
|
||||
estadisticasTotales.porcentajeFases = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.totalFases), totalProyectosTipo);
|
||||
estadisticasTotales.innovacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.innovacion), totalProyectosTipo);
|
||||
estadisticasTotales.horasTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.horasTPE), totalProyectosTipo);
|
||||
estadisticasTotales.plazoPresentacion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.plazoPresentacion), totalProyectosTipo);
|
||||
estadisticasTotales.costeProduccion = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.costeProduccion), totalProyectosTipo);
|
||||
estadisticasTotales.precioTrabajo = UtilidadesCASA.comprobarNull(listadoEstadistica.Sum(x => x.precioTrabajo), totalProyectosTipo);
|
||||
}
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
inicializarListado();
|
||||
}
|
||||
|
||||
private void inicializarListado()
|
||||
{
|
||||
totalProyectosTipo = ListadoLiciURBAN.Count();
|
||||
|
||||
hacerCalculos(ListadoLiciURBAN);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user