Merge branch 'release/FirstRelease'
This commit is contained in:
+7
-1
@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31727.386
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPW.Api", "GPW.Api\GPW.Api.csproj", "{EF8D5A17-0D60-4EF0-9262-57AFAC574843}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GPW.Api", "GPW.Api\GPW.Api.csproj", "{EF8D5A17-0D60-4EF0-9262-57AFAC574843}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPW.Data", "GPW.Data\GPW.Data.csproj", "{E0716E55-CFD3-466E-9919-328B0B7ACD6C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{EF8D5A17-0D60-4EF0-9262-57AFAC574843}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EF8D5A17-0D60-4EF0-9262-57AFAC574843}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EF8D5A17-0D60-4EF0-9262-57AFAC574843}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E0716E55-CFD3-466E-9919-328B0B7ACD6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E0716E55-CFD3-466E-9919-328B0B7ACD6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E0716E55-CFD3-466E-9919-328B0B7ACD6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E0716E55-CFD3-466E-9919-328B0B7ACD6C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,58 +1,81 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using GPW.Api.Data;
|
||||
using GPW.Data;
|
||||
using GPW.Data.DBModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GPW.Api.Controllers
|
||||
{
|
||||
[Route("api/VC19")]
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
//[Route("[controller]")]
|
||||
public class VC19Controller : ControllerBase
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<VC19Controller> _logger;
|
||||
/// <summary>
|
||||
/// Classe per logging
|
||||
/// </summary>
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public VC19Controller(ILogger<VC19Controller> logger)
|
||||
public VC19Controller(GpwDataService DataService)
|
||||
{
|
||||
_logger = logger;
|
||||
_DataService = DataService;
|
||||
Log.Info("Avviata classe PlantDataController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected GpwDataService _DataService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
[HttpGet]
|
||||
public IEnumerable<VC19Check> Get()
|
||||
public async Task<List<CheckVc19>> Get()
|
||||
{
|
||||
var rng = new Random();
|
||||
return Enumerable.Range(1, 5).Select(index => new VC19Check
|
||||
{
|
||||
DTRecord = DateTime.Now.AddMinutes(-index * 3),
|
||||
CheckRecorded = rng.Next(0, 10) > 5 ? true : false,
|
||||
TimbrRecorder = rng.Next(0, 10) > 5 ? true : false
|
||||
})
|
||||
.ToArray();
|
||||
var result = await _DataService.ChecksGetLast(20);
|
||||
return result;
|
||||
}
|
||||
|
||||
// GET api/VC19/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<List<CheckVc19>> Get(int id)
|
||||
{
|
||||
var result = await _DataService.ChecksGetByDip(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public VC19Check Post(DCCDecode DecodedData)
|
||||
public async Task<VC19Check> Post(DCCDecode DecodedData)
|
||||
{
|
||||
VC19Check answ = new VC19Check
|
||||
VC19Check answ = new VC19Check()
|
||||
{
|
||||
DTRecord = DateTime.Now,
|
||||
CheckRecorded = true,
|
||||
TimbrRecorder = true,
|
||||
Result = $"OK, Check Recorded for {DecodedData.Cognome} {DecodedData.Nome} {DecodedData.DOB:yyyy.MM.dd}"
|
||||
Result = "KO"
|
||||
};
|
||||
var result = await _DataService.InsertCheck(DecodedData, "0.0.0.0");
|
||||
if (result)
|
||||
{
|
||||
answ = new VC19Check
|
||||
{
|
||||
DTRecord = DateTime.Now,
|
||||
CheckRecorded = true,
|
||||
TimbrRecorder = true,
|
||||
Result = $"OK, Check Recorded for {DecodedData.nam.fn} {DecodedData.nam.gn} {DecodedData.dob:yyyy.MM.dd}"
|
||||
};
|
||||
}
|
||||
else
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GPW.Api.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]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
var rng = new Random();
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateTime.Now.AddDays(index),
|
||||
TemperatureC = rng.Next(-20, 55),
|
||||
Summary = Summaries[rng.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GPW.Api
|
||||
{
|
||||
public class DCCDecode
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string Cognome { get; set; } = "";
|
||||
public DateTime DOB { get; set; }
|
||||
public string Nome { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using GPW.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GPW.Api.Data
|
||||
{
|
||||
public class GpwDataService : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<GpwDataService> _logger;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
public static GPW.Data.Controllers.DbController dbController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public GpwDataService(IConfiguration configuration, ILogger<GpwDataService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
// conf DB
|
||||
string connStrDB = _configuration.GetConnectionString("Gpw.DB");
|
||||
if (string.IsNullOrEmpty(connStrDB))
|
||||
{
|
||||
_logger.LogError("ConnString empty!");
|
||||
}
|
||||
else
|
||||
{
|
||||
dbController = new GPW.Data.Controllers.DbController(configuration);
|
||||
_logger.LogInformation("DbController OK");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<List<GPW.Data.DBModels.CheckVc19>> ChecksGetByDip(int idxDip)
|
||||
{
|
||||
DateTime dtFine = DateTime.Today.AddDays(1);
|
||||
List<GPW.Data.DBModels.CheckVc19> dbResult = new List<GPW.Data.DBModels.CheckVc19>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.GetChecksVC19Filt(idxDip, dtFine.AddMonths(-1), dtFine);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per ChecksGetByDip: {ts.TotalMilliseconds} ms");
|
||||
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<GPW.Data.DBModels.CheckVc19>> ChecksGetLast(int numRecord)
|
||||
{
|
||||
List<GPW.Data.DBModels.CheckVc19> dbResult = new List<GPW.Data.DBModels.CheckVc19>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.GetChecksVC19(numRecord);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per ChecksGetLast: {ts.TotalMilliseconds} ms");
|
||||
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
public async Task<bool> InsertCheck(DCCDecode updItem, string clientIp)
|
||||
{
|
||||
bool done = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
done = dbController.InsertCheck(updItem, clientIp);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata operazione InsertCheck: {ts.TotalMilliseconds} ms");
|
||||
|
||||
return await Task.FromResult(done);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GPW.Data\GPW.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
+24
-10
@@ -1,3 +1,4 @@
|
||||
using GPW.Api.Data;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
@@ -16,23 +17,22 @@ namespace GPW.Api
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
#endregion Public Properties
|
||||
|
||||
services.AddControllers();
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "GPW.Api", Version = "v1" });
|
||||
});
|
||||
}
|
||||
#region Public Methods
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
@@ -55,5 +55,19 @@ namespace GPW.Api
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddControllers();
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "GPW.Api", Version = "v1" });
|
||||
});
|
||||
|
||||
services.AddSingleton<GpwDataService>();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace GPW.Api
|
||||
{
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string Summary { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"Gpw.DB": "Server=SQLSTEAM;Database=GPW;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=GPW.Api;"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
using GPW.Data.DBModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GPW.Data.Controllers
|
||||
{
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DbController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public bool DbForceMigrate()
|
||||
{
|
||||
bool answ = false;
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
localDbCtx.DbForceMigrate();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in DbForceMigrate{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
Log.Info("Dispose di DbController");
|
||||
}
|
||||
|
||||
public List<CheckVc19> GetChecksVC19(int maxNum)
|
||||
{
|
||||
List<CheckVc19> dbResult = new List<CheckVc19>();
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
int numRec = localDbCtx
|
||||
.DbSetCheckVc19
|
||||
.Count();
|
||||
|
||||
// se ho meno record che quelli richiesti --> riduco
|
||||
maxNum = numRec > maxNum ? maxNum : numRec;
|
||||
|
||||
dbResult = localDbCtx
|
||||
.DbSetCheckVc19
|
||||
.OrderByDescending(x => x.DtCheck)
|
||||
.Take(maxNum)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<CheckVc19> GetChecksVC19Filt(int idxDip, DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
List<CheckVc19> dbResult = new List<CheckVc19>();
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
DateTime oggi = DateTime.Today;
|
||||
dbResult = localDbCtx
|
||||
.DbSetCheckVc19
|
||||
.Where(x => (idxDip == 0 || x.IdxDipendente == idxDip) && (x.DtCheck >= dtStart && x.DtCheck <= dtEnd))
|
||||
.OrderByDescending(x => x.DtCheck)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool InsertCheck(DCCDecode updItem, string clientIp)
|
||||
{
|
||||
bool done = false;
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
int idxDip = 0;
|
||||
Dipendenti currUser = new Dipendenti()
|
||||
{
|
||||
IdxDipendente = 0
|
||||
};
|
||||
// per prima cosa cerca il dipendente x cognome/nome...
|
||||
var userList = localDbCtx
|
||||
.DbSetDipendenti
|
||||
.Where(x => x.Cognome == updItem.nam.fn && x.Nome == updItem.nam.gn)
|
||||
.ToList();
|
||||
// se ne ho solo 1 ok...
|
||||
if (userList.Count > 1)
|
||||
{
|
||||
currUser = userList
|
||||
.Where(x => x.DataNascita != null && updItem.dob.Date == ((DateTime)x.DataNascita).Date)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
// altrimenti cerco anche con DOB...
|
||||
else if (userList.Count == 1)
|
||||
{
|
||||
// se lo trova inserisce check...
|
||||
currUser = userList[0];
|
||||
}
|
||||
|
||||
// fisso dipendente
|
||||
idxDip = currUser.IdxDipendente;
|
||||
|
||||
// se trovato procedo
|
||||
if (idxDip > 0)
|
||||
{
|
||||
string rawPayload = JsonConvert.SerializeObject(updItem);
|
||||
CheckVc19 newItem = new CheckVc19()
|
||||
{
|
||||
IdxDipendente = idxDip,
|
||||
DtCheck = DateTime.Now,
|
||||
Payload = rawPayload
|
||||
};
|
||||
// aggiungo!
|
||||
localDbCtx
|
||||
.DbSetCheckVc19
|
||||
.Add(newItem);
|
||||
|
||||
// verifico se ho timbratura ingresso
|
||||
var listTimbra = localDbCtx
|
||||
.DbSetTimbrature
|
||||
.Where(x => x.IdxDipendente == idxDip)
|
||||
.ToList();
|
||||
// se non ci fosse aggiungo
|
||||
if (listTimbra == null || listTimbra.Count == 0)
|
||||
{
|
||||
var newIngresso = new Timbrature()
|
||||
{
|
||||
IdxDipendente = idxDip,
|
||||
DataOra = DateTime.Now,
|
||||
CodTipoTimb = "Web",
|
||||
Ipv4 = clientIp,
|
||||
Entrata = true,
|
||||
};
|
||||
|
||||
// aggiungo!
|
||||
localDbCtx
|
||||
.DbSetTimbrature
|
||||
.Add(newIngresso);
|
||||
}
|
||||
|
||||
// ora salvo!
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
// altrimenti NON FA NULLA
|
||||
else
|
||||
{
|
||||
Log.Info($"Attenzione, dipendente non trovato: {updItem.nam.fn} {updItem.nam.gn}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in UpdateApplicazioni:{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
public bool rollBackEntity(object item)
|
||||
{
|
||||
bool answ = false;
|
||||
using (GPWContext localDbCtx = new GPWContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (localDbCtx.Entry(item).State == EntityState.Deleted || localDbCtx.Entry(item).State == EntityState.Modified)
|
||||
{
|
||||
localDbCtx.Entry(item).Reload();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class AnagGruppi
|
||||
{
|
||||
public AnagGruppi()
|
||||
{
|
||||
Dipendentis = new HashSet<Dipendenti>();
|
||||
}
|
||||
|
||||
public string Gruppo { get; set; }
|
||||
public string DescrGruppo { get; set; }
|
||||
public string CodExt { get; set; }
|
||||
public bool? ExportEnab { get; set; }
|
||||
|
||||
public virtual ICollection<Dipendenti> Dipendentis { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class AnagOrari
|
||||
{
|
||||
public AnagOrari()
|
||||
{
|
||||
Dipendentis = new HashSet<Dipendenti>();
|
||||
}
|
||||
|
||||
public string CodOrario { get; set; }
|
||||
public string DescOrario { get; set; }
|
||||
public double OreLun { get; set; }
|
||||
public double OreMar { get; set; }
|
||||
public double OreMer { get; set; }
|
||||
public double OreGio { get; set; }
|
||||
public double OreVen { get; set; }
|
||||
public double OreSab { get; set; }
|
||||
public double OreDom { get; set; }
|
||||
public double OreOrdSett { get; set; }
|
||||
public double OreStraordAss { get; set; }
|
||||
public bool AutoCompOreOrd { get; set; }
|
||||
public string TipoCompens { get; set; }
|
||||
public TimeSpan OraInizio1 { get; set; }
|
||||
public TimeSpan OraFine1 { get; set; }
|
||||
public TimeSpan OraInizio2 { get; set; }
|
||||
public TimeSpan OraFine2 { get; set; }
|
||||
public TimeSpan OraInizio3 { get; set; }
|
||||
public TimeSpan OraFine3 { get; set; }
|
||||
public int ArrotMinuti { get; set; }
|
||||
public string ChkFun { get; set; }
|
||||
|
||||
public virtual ICollection<Dipendenti> Dipendentis { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class AnagTipoTimb
|
||||
{
|
||||
public AnagTipoTimb()
|
||||
{
|
||||
Timbratures = new HashSet<Timbrature>();
|
||||
}
|
||||
|
||||
public string CodTipoTimb { get; set; }
|
||||
public string DescrTipoTimb { get; set; }
|
||||
|
||||
public virtual ICollection<Timbrature> Timbratures { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class CheckVc19
|
||||
{
|
||||
public DateTime DtCheck { get; set; }
|
||||
public int IdxDipendente { get; set; }
|
||||
public string Payload { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class Dipendenti
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public Dipendenti()
|
||||
{
|
||||
//PeriodiLavs = new HashSet<PeriodiLav>();
|
||||
//RegAttivita = new HashSet<RegAttivitum>();
|
||||
//RegAttivitaEgals = new HashSet<RegAttivitaEgal>();
|
||||
//RilievoTemps = new HashSet<RilievoTemp>();
|
||||
Timbratures = new HashSet<Timbrature>();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public bool? Attivo { get; set; }
|
||||
public string AuthKey { get; set; }
|
||||
public string Cf { get; set; }
|
||||
public string CodDipendenteExt { get; set; }
|
||||
public string CodHw { get; set; }
|
||||
public string CodOrario { get; set; }
|
||||
public virtual AnagOrari CodOrarioNavigation { get; set; }
|
||||
public string Cognome { get; set; }
|
||||
public DateTime? DataAssunzione { get; set; }
|
||||
public DateTime? DataCessazione { get; set; }
|
||||
public DateTime? DataNascita { get; set; }
|
||||
public string Dominio { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Gruppo { get; set; }
|
||||
public virtual AnagGruppi GruppoNavigation { get; set; }
|
||||
public int IdxDipendente { get; set; }
|
||||
public string LuogoNascita { get; set; }
|
||||
public bool? MailDay { get; set; }
|
||||
public bool? MailLastOp { get; set; }
|
||||
public bool? MailMonth { get; set; }
|
||||
public bool? MailWeek { get; set; }
|
||||
public string Matricola { get; set; }
|
||||
public string NazNascita { get; set; }
|
||||
public string Nome { get; set; }
|
||||
public int? NumAuth { get; set; }
|
||||
public string ProvNascita { get; set; }
|
||||
|
||||
//public virtual ICollection<PeriodiLav> PeriodiLavs { get; set; }
|
||||
//public virtual ICollection<RegAttivitum> RegAttivita { get; set; }
|
||||
//public virtual ICollection<RegAttivitaEgal> RegAttivitaEgals { get; set; }
|
||||
//public virtual ICollection<RilievoTemp> RilievoTemps { get; set; }
|
||||
public virtual ICollection<Timbrature> Timbratures { get; set; }
|
||||
|
||||
public string Utente { get; set; }
|
||||
public string WolMac { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GPW.Data.DBModels
|
||||
{
|
||||
public partial class Timbrature
|
||||
{
|
||||
public DateTime DataOra { get; set; }
|
||||
public int IdxDipendente { get; set; }
|
||||
public bool? Entrata { get; set; }
|
||||
public string Ipv4 { get; set; }
|
||||
public string CodTipoTimb { get; set; }
|
||||
public bool? Approv { get; set; }
|
||||
|
||||
public virtual AnagTipoTimb CodTipoTimbNavigation { get; set; }
|
||||
public virtual Dipendenti IdxDipendenteNavigation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace GPW.Data
|
||||
{
|
||||
public class DCCDecode
|
||||
{
|
||||
public List<certVal> v { get; set; }
|
||||
|
||||
public userVal nam { get; set; }
|
||||
public DateTime dob { get; set; }
|
||||
|
||||
|
||||
public string ver { get; set; }
|
||||
|
||||
public class certVal
|
||||
{
|
||||
|
||||
public string @is { get; set; }
|
||||
public string ci { get; set; }
|
||||
public string co { get; set; }
|
||||
public int dn { get; set; }
|
||||
public string dt { get; set; }
|
||||
public string ma { get; set; }
|
||||
public string mp { get; set; }
|
||||
public int sd { get; set; }
|
||||
public string tg { get; set; }
|
||||
public string vp { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class userVal
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Cognome
|
||||
/// </summary>
|
||||
public string fn { get; set; }
|
||||
|
||||
public string fnt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Nome
|
||||
/// </summary>
|
||||
public string gn { get; set; }
|
||||
|
||||
public string gnt { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.11">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NLog" Version="4.7.11" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
{"_type":"export","__export_format":4,"__export_date":"2021-10-18T10:46:32.117Z","__export_source":"insomnia.desktop.app:v2021.5.3","resources":[{"_id":"req_13d8a26fe9d4433684a0816a33ecd618","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634553716040,"created":1634553671776,"url":"{{ _.BASE_URL }}/api/VC19","name":"DailyCheckList","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1627351578955,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","parentId":null,"modified":1634552379774,"created":1634552379774,"name":"GPW.Api","description":"","scope":"collection","_type":"workspace"},{"_id":"req_92b40959f3b14d069a1defaea63782d4","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634553902195,"created":1634553726864,"url":"{{ _.BASE_URL }}/api/VC19","name":"RecordCheck","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"cognome\": \"ROSSI\",\n \"dob\": \"1980-10-01\",\n \"nome\": \"PAOLO\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json","id":"pair_ed76bfea595e4917be2ce6797185529e"}],"authentication":{},"metaSortKey":-1626151423711,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_659ee5f03be1f9fc42cab55192dd76583acae449","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552627514,"created":1634552379782,"name":"Base Environment","data":{},"dataPropertyOrder":{},"color":null,"isPrivate":false,"metaSortKey":1634552379782,"_type":"environment"},{"_id":"jar_659ee5f03be1f9fc42cab55192dd76583acae449","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552379783,"created":1634552379783,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_f198ccd3ea154fce9ba8e43694030bf9","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552379777,"created":1634552379777,"fileName":"GPW.Api","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"env_9ae41782f3fc4f33bb679db14ed36156","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552719561,"created":1634552420009,"name":"DEV","data":{"BASE_URL":"https://localhost:44300"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552420009,"_type":"environment"},{"_id":"env_8b92b7eaf4fc43538d77db9768714516","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552533475,"created":1634552444561,"name":"IIS01","data":{"BASE_URL":"https://iis01/GPW/Api"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552444561,"_type":"environment"},{"_id":"env_6047c5aeb1f445748982b91445f3691d","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552536977,"created":1634552456998,"name":"IIS02","data":{"BASE_URL":"https://iis02/GPW/Api"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552456998,"_type":"environment"}]}
|
||||
{"_type":"export","__export_format":4,"__export_date":"2021-10-18T13:01:01.812Z","__export_source":"insomnia.desktop.app:v2021.5.3","resources":[{"_id":"req_13d8a26fe9d4433684a0816a33ecd618","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634553716040,"created":1634553671776,"url":"{{ _.BASE_URL }}/api/VC19","name":"DailyCheckList","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1627351578955,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","parentId":null,"modified":1634552379774,"created":1634552379774,"name":"GPW.Api","description":"","scope":"collection","_type":"workspace"},{"_id":"req_92b40959f3b14d069a1defaea63782d4","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634562011082,"created":1634553726864,"url":"{{ _.BASE_URL }}/api/VC19","name":"RecordCheck","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"v\": [ \n { \n \"dn\": 1,\n \"ma\": \"ORG-100001417\",\n \"vp\": \"1119305005\",\n \"dt\": \"2021-06-01\",\n \"co\": \"IT\",\n \"ci\": \"01IT1281367B650F42FA939E8C14806A3390#0\",\n \"mp\": \"EU/1/20/1525\",\n \"is\": \"Ministero della Salute\",\n \"sd\": 1,\n \"tg\": \"840539006\"\n }\n ],\n \"nam\": { \n\t\"fnt\": \"SALVI\", \n\t\"fn\": \"SALVI\", \n\t\"gnt\": \"MARCO\", \n\t\"gn\": \"MARCO\" \n\t},\n \"ver\": \"1.0.0\",\n \"dob\": \"1980-07-05\"\n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json","id":"pair_ed76bfea595e4917be2ce6797185529e"}],"authentication":{},"metaSortKey":-1626151423711,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_659ee5f03be1f9fc42cab55192dd76583acae449","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552627514,"created":1634552379782,"name":"Base Environment","data":{},"dataPropertyOrder":{},"color":null,"isPrivate":false,"metaSortKey":1634552379782,"_type":"environment"},{"_id":"jar_659ee5f03be1f9fc42cab55192dd76583acae449","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552379783,"created":1634552379783,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_f198ccd3ea154fce9ba8e43694030bf9","parentId":"wrk_15a980661ee94bab9d1ccc5a2bac0f42","modified":1634552379777,"created":1634552379777,"fileName":"GPW.Api","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"env_9ae41782f3fc4f33bb679db14ed36156","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552719561,"created":1634552420009,"name":"DEV","data":{"BASE_URL":"https://localhost:44300"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552420009,"_type":"environment"},{"_id":"env_8b92b7eaf4fc43538d77db9768714516","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552533475,"created":1634552444561,"name":"IIS01","data":{"BASE_URL":"https://iis01/GPW/Api"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552444561,"_type":"environment"},{"_id":"env_6047c5aeb1f445748982b91445f3691d","parentId":"env_659ee5f03be1f9fc42cab55192dd76583acae449","modified":1634552536977,"created":1634552456998,"name":"IIS02","data":{"BASE_URL":"https://iis02/GPW/Api"},"dataPropertyOrder":{"&":["BASE_URL"]},"color":null,"isPrivate":false,"metaSortKey":1634552456998,"_type":"environment"}]}
|
||||
Submodule
+1
Submodule qrscan/dcc added at 99e255d469
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Html-Qrcode Demo</title>
|
||||
<body>
|
||||
<div id="qr-reader" style="width:500px"></div>
|
||||
<div id="qr-reader-results"></div>
|
||||
</body>
|
||||
<script src="html5-qrcode.min.js"></script>
|
||||
<script>
|
||||
function docReady(fn) {
|
||||
// see if DOM is already available
|
||||
if (document.readyState === "complete"
|
||||
|| document.readyState === "interactive") {
|
||||
// call on next available tick
|
||||
setTimeout(fn, 1);
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", fn);
|
||||
}
|
||||
}
|
||||
|
||||
docReady(function () {
|
||||
var resultContainer = document.getElementById('qr-reader-results');
|
||||
var lastResult, countResults = 0;
|
||||
function onScanSuccess(decodedText, decodedResult) {
|
||||
if (decodedText !== lastResult) {
|
||||
++countResults;
|
||||
lastResult = decodedText;
|
||||
// Handle on success condition with the decoded message.
|
||||
console.log(`Scan result ${decodedText}`, decodedResult);
|
||||
}
|
||||
}
|
||||
|
||||
var html5QrcodeScanner = new Html5QrcodeScanner(
|
||||
"qr-reader", { fps: 10, qrbox: 250 });
|
||||
html5QrcodeScanner.render(onScanSuccess);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
Generated
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "qrscan",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"html5-qrcode": "^2.1.0",
|
||||
"zxing": "^0.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/html5-qrcode": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.1.0.tgz",
|
||||
"integrity": "sha512-Lzm6U1Vm2WM4g7dyoFJM/YP10l7af7MuIRx/dEdyWxMyDGYBEOCOinBiQnuGm8wFK6z3g4sUV/e4ewFoVwH/1g=="
|
||||
},
|
||||
"node_modules/zxing": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/zxing/-/zxing-0.1.2.tgz",
|
||||
"integrity": "sha1-Jg2+nWeF1oTTd1vpd5VyjVm72fk=",
|
||||
"deprecated": "zxing is no longer maintained. Please use qrcode-reader"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"html5-qrcode": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.1.0.tgz",
|
||||
"integrity": "sha512-Lzm6U1Vm2WM4g7dyoFJM/YP10l7af7MuIRx/dEdyWxMyDGYBEOCOinBiQnuGm8wFK6z3g4sUV/e4ewFoVwH/1g=="
|
||||
},
|
||||
"zxing": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/zxing/-/zxing-0.1.2.tgz",
|
||||
"integrity": "sha1-Jg2+nWeF1oTTd1vpd5VyjVm72fk="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"html5-qrcode": "^2.1.0",
|
||||
"zxing": "^0.1.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user