Merge branch 'main' of https://gitea.tecnosis.net/ASEGASA/Asegasa.NET
This commit is contained in:
17
APIFicheros/APIFicheros.csproj
Normal file
17
APIFicheros/APIFicheros.csproj
Normal file
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\bdAsegasa\bdAsegasa.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
6
APIFicheros/APIFicheros.http
Normal file
6
APIFicheros/APIFicheros.http
Normal file
@@ -0,0 +1,6 @@
|
||||
@APIFicheros_HostAddress = http://localhost:5219
|
||||
|
||||
GET {{APIFicheros_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
67
APIFicheros/Controllers/ObtenerFicherosController.cs
Normal file
67
APIFicheros/Controllers/ObtenerFicherosController.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using APIFicheros.DTOs;
|
||||
using bdAsegasa;
|
||||
using bdAsegasa.db;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using static Org.BouncyCastle.Math.EC.ECCurve;
|
||||
|
||||
namespace APIFicheros.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class ObtenerFicherosController : Controller
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private bdAsegasa.tscgestionasegasa bd;
|
||||
public ObtenerFicherosController(IConfiguration configuration)
|
||||
{
|
||||
|
||||
_configuration = configuration;
|
||||
|
||||
var nombreConexion = _configuration["Configuracion:NombreConexionBD"];
|
||||
|
||||
bd = tscgestionasegasa.NuevoContexto(nombreConexion, true, false, true, "ObtenerFicheros");
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("ObtenerFicherosFaltantes")]
|
||||
public ActionResult PostNombreBD([FromBody] string numeroPoliza)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
int idPoliza = bd.polizassg.First(x => x.NumeroPoliza!.Contains(numeroPoliza)).idPoliza;
|
||||
|
||||
|
||||
List<bdAsegasa.db.documentospolizassg> listadoDocumentos = new List<bdAsegasa.db.documentospolizassg>();
|
||||
List<PolizasFaltantes> listadoFicherosFaltantes = new List<PolizasFaltantes>();
|
||||
|
||||
listadoDocumentos = bd.documentospolizassg.Where(x => x.idPoliza == idPoliza && x.idFichero == null).ToList();
|
||||
|
||||
|
||||
foreach (documentospolizassg documentoFaltante in listadoDocumentos)
|
||||
{
|
||||
listadoFicherosFaltantes.Add(new PolizasFaltantes
|
||||
{
|
||||
idDocumento = documentoFaltante.idDocumento,
|
||||
descripcion = documentoFaltante.idDocumentoASolicitarNavigation!.idTipoNavigation!.Descripcion
|
||||
});
|
||||
}
|
||||
|
||||
return Ok(listadoFicherosFaltantes);
|
||||
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
return BadRequest("Ha ocurrido un error. Mensaje de error: " + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
32
APIFicheros/Controllers/WeatherForecastController.cs
Normal file
32
APIFicheros/Controllers/WeatherForecastController.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace APIFicheros.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
{
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
};
|
||||
|
||||
private readonly ILogger<WeatherForecastController> _logger;
|
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
9
APIFicheros/DTOs/PolizasFaltantes.cs
Normal file
9
APIFicheros/DTOs/PolizasFaltantes.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace APIFicheros.DTOs
|
||||
{
|
||||
public class PolizasFaltantes
|
||||
{
|
||||
public int idDocumento { get; set; }
|
||||
public string descripcion { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
32
APIFicheros/Program.cs
Normal file
32
APIFicheros/Program.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
|
||||
builder.Services.AddControllers()
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.ReferenceHandler =
|
||||
System.Text.Json.Serialization.ReferenceHandler.IgnoreCycles;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
41
APIFicheros/Properties/launchSettings.json
Normal file
41
APIFicheros/Properties/launchSettings.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:3277",
|
||||
"sslPort": 44319
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5219",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7224;http://localhost:5219",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
APIFicheros/WeatherForecast.cs
Normal file
12
APIFicheros/WeatherForecast.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace APIFicheros;
|
||||
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateOnly Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string? Summary { get; set; }
|
||||
}
|
||||
8
APIFicheros/appsettings.Development.json
Normal file
8
APIFicheros/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
15
APIFicheros/appsettings.json
Normal file
15
APIFicheros/appsettings.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
|
||||
"Configuracion": {
|
||||
"SegundosMinimosEntreProcesos": "60",
|
||||
"HoraProcesosDiarios": "06:30",
|
||||
"NombreConexionBD": "Producción Remoto"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
18
Asegasa.sln
18
Asegasa.sln
@@ -7,10 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSAsegasa", "WSAsegasa\WSAs
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdAsegasa", "bdAsegasa\bdAsegasa.csproj", "{E42D668E-CB26-498B-89AF-8A205528C4EF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tsVeriFactu", "..\..\Comunes\tsVeriFactu\tsVeriFactu.csproj", "{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bdfactu", "..\Tecnosis\tsFactu\bdFactu\bdfactu.csproj", "{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tsVeriFactu", "..\Tecnosis\tsVeriFactu\tsVeriFactu.csproj", "{947E1B2F-7877-66E7-8DF0-282429B770F0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APIFicheros", "APIFicheros\APIFicheros.csproj", "{729F814F-BBAF-A079-B0A1-D5890DA11543}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -25,14 +27,18 @@ Global
|
||||
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E42D668E-CB26-498B-89AF-8A205528C4EF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DDFE8F31-9ED8-5C11-4E72-6CE96526C459}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{56D9C47A-1D6F-0C5B-2DB0-72EB359C1093}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{947E1B2F-7877-66E7-8DF0-282429B770F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{947E1B2F-7877-66E7-8DF0-282429B770F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{947E1B2F-7877-66E7-8DF0-282429B770F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{947E1B2F-7877-66E7-8DF0-282429B770F0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{729F814F-BBAF-A079-B0A1-D5890DA11543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{729F814F-BBAF-A079-B0A1-D5890DA11543}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{729F814F-BBAF-A079-B0A1-D5890DA11543}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{729F814F-BBAF-A079-B0A1-D5890DA11543}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Comunes\tsVeriFactu\tsVeriFactu.csproj" />
|
||||
<ProjectReference Include="..\..\Tecnosis\tsFactu\bdFactu\bdfactu.csproj" />
|
||||
<ProjectReference Include="..\..\Tecnosis\tsVeriFactu\tsVeriFactu.csproj" />
|
||||
<ProjectReference Include="..\bdAsegasa\bdAsegasa.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user