Merge branch 'Release/TaskExecMan07'
This commit is contained in:
@@ -869,21 +869,21 @@ namespace MP.FileData.Controllers
|
||||
DateTime adesso = DateTime.Now;
|
||||
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||
{
|
||||
// SOLO SE richiesto forzatura tags
|
||||
if (forceTag)
|
||||
// elenco Tags
|
||||
List<TagModel> currTags = localDbCtx.DbSetTags.ToList();
|
||||
FileModel currItem = null;
|
||||
foreach (var item in updFiles)
|
||||
{
|
||||
// elenco Tags
|
||||
List<TagModel> currTags = localDbCtx.DbSetTags.ToList();
|
||||
FileModel currItem = null;
|
||||
foreach (var item in updFiles)
|
||||
{
|
||||
// recupero record da DB...
|
||||
currItem = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == item.FileId)
|
||||
.Include(x => x.Tags)
|
||||
.FirstOrDefault();
|
||||
// recupero record da DB...
|
||||
currItem = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == item.FileId)
|
||||
.Include(x => x.Tags)
|
||||
.FirstOrDefault();
|
||||
|
||||
// SOLO SE richiesto forzatura tags
|
||||
if (forceTag)
|
||||
{
|
||||
List<string> Tags = new List<string>();
|
||||
List<TagModel> Tag4File = new List<TagModel>();
|
||||
// se necessario bonifico filename...
|
||||
@@ -933,30 +933,24 @@ namespace MP.FileData.Controllers
|
||||
// salvo i tags relativi ai files
|
||||
currItem.Tags.Clear();
|
||||
currItem.Tags = Tag4File;
|
||||
//localDbCtx.Entry(currItem).State = EntityState.Modified;
|
||||
}
|
||||
//localDbCtx.SaveChanges();
|
||||
}
|
||||
try
|
||||
{
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in salvataggio FileSetChecked{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
#if false
|
||||
// update comunque data-ora
|
||||
foreach (var item in updFiles)
|
||||
{
|
||||
// salvo update file
|
||||
item.LastCheck = adesso;
|
||||
localDbCtx.Entry(item).State = EntityState.Modified;
|
||||
}
|
||||
#endif
|
||||
// update comunque data-ora e stato missing
|
||||
currItem.DiskStatus = FileState.Ok;
|
||||
currItem.LastCheck = adesso;
|
||||
localDbCtx.Entry(currItem).State = EntityState.Modified;
|
||||
|
||||
}
|
||||
|
||||
// salvo
|
||||
try
|
||||
{
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore in salvataggio FileSetChecked{Environment.NewLine}{exc}");
|
||||
}
|
||||
answ = true;
|
||||
}
|
||||
GC.Collect();
|
||||
@@ -977,21 +971,21 @@ namespace MP.FileData.Controllers
|
||||
DateTime adesso = DateTime.Now;
|
||||
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||
{
|
||||
// SOLO SE richiesto forzatura tags
|
||||
if (forceTag)
|
||||
// elenco Tags
|
||||
List<TagModel> currTags = localDbCtx.DbSetTags.ToList();
|
||||
FileModel currItem = null;
|
||||
foreach (var item in missFiles)
|
||||
{
|
||||
// elenco Tags
|
||||
List<TagModel> currTags = localDbCtx.DbSetTags.ToList();
|
||||
FileModel currItem = null;
|
||||
foreach (var item in missFiles)
|
||||
{
|
||||
// recupero record da DB...
|
||||
currItem = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == item.FileId)
|
||||
.Include(x => x.Tags)
|
||||
.FirstOrDefault();
|
||||
// recupero record da DB...
|
||||
currItem = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == item.FileId)
|
||||
.Include(x => x.Tags)
|
||||
.FirstOrDefault();
|
||||
|
||||
// SOLO SE richiesto forzatura tags
|
||||
if (forceTag)
|
||||
{
|
||||
List<string> Tags = new List<string>();
|
||||
List<TagModel> Tag4File = new List<TagModel>();
|
||||
// se necessario bonifico filename...
|
||||
@@ -1043,18 +1037,13 @@ namespace MP.FileData.Controllers
|
||||
currItem.Tags = Tag4File;
|
||||
//localDbCtx.Entry(currItem).State = EntityState.Modified;
|
||||
}
|
||||
//localDbCtx.SaveChanges();
|
||||
}
|
||||
// update comunque data-ora e stato missing
|
||||
currItem.DiskStatus = FileState.Missing;
|
||||
currItem.LastCheck = adesso;
|
||||
localDbCtx.Entry(currItem).State = EntityState.Modified;
|
||||
}
|
||||
|
||||
// update comunque data-ora e stato missing
|
||||
foreach (var item in missFiles)
|
||||
{
|
||||
// salvo update file
|
||||
item.DiskStatus = FileState.Missing;
|
||||
item.LastCheck = adesso;
|
||||
localDbCtx.Entry(item).State = EntityState.Modified;
|
||||
}
|
||||
try
|
||||
{
|
||||
// salvo
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ using StackExchange.Redis;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
/*--------------------
|
||||
* Note migrazione startup.cs -_> program.cs:
|
||||
* Note migrazione startup.cs --> program.cs:
|
||||
*
|
||||
* - https://stackoverflow.com/questions/69722872/asp-net-core-6-how-to-access-configuration-during-startup
|
||||
* - https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-5.0&tabs=visual-studio#where-do-i-put-state-that-was-stored-as-fields-in-my-program-or-startup-class
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace MP.Prog.Components
|
||||
setupMessages.Add("Inizio Analisi Archivio...");
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await ArchiveCheck(maxHour);
|
||||
await Task.Delay(400);
|
||||
await Task.Delay(200);
|
||||
ClearMessage();
|
||||
await ReloadData();
|
||||
}
|
||||
@@ -99,7 +99,7 @@ namespace MP.Prog.Components
|
||||
setupMessages.Add($"Inizio Analisi Archivio | Archivio {idxMacchina}");
|
||||
await InvokeAsync(StateHasChanged);
|
||||
await ArchiveSingleCheck(idxMacchina, 0);
|
||||
await Task.Delay(400);
|
||||
await Task.Delay(200);
|
||||
ClearMessage();
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Prog</RootNamespace>
|
||||
<Version>6.16.2410.2910</Version>
|
||||
<Version>6.16.2410.2917</Version>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.16.2410.2910</h4>
|
||||
<h4>Versione: 6.16.2410.2917</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2410.2910
|
||||
6.16.2410.2917
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2410.2910</version>
|
||||
<version>6.16.2410.2917</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -54,13 +54,17 @@
|
||||
"DefaultSearch": "##"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
"MP.Prog": "Server=SQL2016DEV;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
|
||||
"DefaultConnection": "Server=W2019-SQL-STEAM;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
"MP.Prog": "Server=W2019-SQL-STEAM;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
//"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
//"MP.Prog": "Server=SQL2016DEV;Database=MoonPro_PROG;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Prog;",
|
||||
"Redis": "localhost:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
|
||||
},
|
||||
"ServerConf": {
|
||||
"FolderBasePath": "\\\\stor01",
|
||||
"Prog.ApiUrl": "https://iis01.egalware.com/MP/PROG"
|
||||
"Prog.ApiUrl": "https://office.egalware.com/MP/PROG"
|
||||
//"Prog.ApiUrl": "https://iis01.egalware.com/MP/PROG"
|
||||
},
|
||||
"SpecialConf": {
|
||||
"AppUrl": "/MP/PROG",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2410.1816</Version>
|
||||
<Version>6.16.2410.2917</Version>
|
||||
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
+33
-2
@@ -3,6 +3,8 @@ using Blazored.SessionStorage;
|
||||
using Microsoft.AspNetCore.Authentication.Negotiate;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using MP.SPEC.Components;
|
||||
using MP.SPEC.Data;
|
||||
@@ -31,7 +33,7 @@ ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
|
||||
// REDIS setup
|
||||
logger.Info("Setup REDIS");
|
||||
logger.Info("Setup REDIS");
|
||||
string connStringRedis = configuration.GetConnectionString("Redis");
|
||||
//string connStringRedis = ConfMan.GetConnectionString("RedisAdmin");
|
||||
string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"));
|
||||
@@ -40,7 +42,7 @@ var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
logger.Info("Setup Auth");
|
||||
logger.Info("Setup Auth");
|
||||
builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
|
||||
.AddNegotiate();
|
||||
|
||||
@@ -66,6 +68,10 @@ logger.Info("Aggiunti services");
|
||||
var app = builder.Build();
|
||||
logger.Info("Build App");
|
||||
|
||||
|
||||
// aggiunt base URL x routing corretto
|
||||
app.UsePathBase(configuration.GetValue<string>("SpecialConf:AppUrl"));
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
@@ -82,12 +88,37 @@ app.UseStaticFiles();
|
||||
string BasePathOdlReturn = configuration.GetValue<string>("ServerConf:BasePathOdlReturn") ?? configuration.GetValue<string>("OptConf:BasePathOdlReturn") ?? "";
|
||||
if (!string.IsNullOrEmpty(BasePathOdlReturn))
|
||||
{
|
||||
// preparo mappings opzionali se presenti in conf...
|
||||
var provider = new FileExtensionContentTypeProvider();
|
||||
// vedere https://code-maze.com/dotnet-appsettings-json-content-to-dictionary/
|
||||
var mimeSection = configuration.GetSection("ServerConf:MimeMappings");
|
||||
if (mimeSection != null)
|
||||
{
|
||||
var mimeDict = mimeSection
|
||||
.AsEnumerable()
|
||||
.Where(x => !string.IsNullOrWhiteSpace(x.Value))
|
||||
.ToDictionary(x => x.Key.Replace("ServerConf:MimeMappings:", ""), x => x.Value);
|
||||
// se ne ho trovati
|
||||
if (mimeDict != null && mimeDict.Count > 0)
|
||||
{
|
||||
// li aggiungo! vedere
|
||||
// https://thechrisgreen.com/2022/05/add-a-mime-type-to-an-asp-net-core-net-6-app/
|
||||
// https://harrybellamy.com/posts/getting-mime-types-from-file-extensions-in-net-core/
|
||||
foreach (var item in mimeDict)
|
||||
{
|
||||
// Add new mappings
|
||||
provider.Mappings[item.Key] = item.Value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// verifico esista folder
|
||||
if (Directory.Exists(BasePathOdlReturn))
|
||||
{
|
||||
// gestione cartella x file ritornati x ODL
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
ContentTypeProvider = provider,
|
||||
FileProvider = new PhysicalFileProvider(BasePathOdlReturn),
|
||||
RequestPath = "/RET_DATA",
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2410.1816</h4>
|
||||
<h4>Versione: 6.16.2410.2917</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2410.1816
|
||||
6.16.2410.2917
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2410.1816</version>
|
||||
<version>6.16.2410.2917</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"CodApp": "MP.SPEC",
|
||||
"ConnectionStrings": {
|
||||
"MP.Data": "Server=localhost\\SQLEXPRESS;Database=MoonPro; User ID=steamware;Password=viadante16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
|
||||
@@ -21,6 +20,13 @@
|
||||
"redisLongTimeCache": 15,
|
||||
"MpIoBaseUrl": "http://localhost/MP/IO/",
|
||||
"MpIoNS": "MoonPro:SQL2016DEV:MoonPro",
|
||||
"BasePathOdlReturn": "\\\\iis01\\W$\\Files\\ODL"
|
||||
"BasePathOdlReturn": "\\\\iis01\\W$\\Files\\ODL",
|
||||
"MimeMappings": {
|
||||
".dxf": "application/octet-stream",
|
||||
".utcfg": "application/octet-stream",
|
||||
".utdata": "application/octet-stream",
|
||||
".utprobe": "application/octet-stream",
|
||||
".utwedge": "application/octet-stream"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
]
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"CodApp": "MP.SPEC",
|
||||
"ConnectionStrings": {
|
||||
"MP.Data": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
"MP.Inve": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
|
||||
@@ -63,6 +62,18 @@
|
||||
"redisLongTimeCache": "15",
|
||||
"MpIoBaseUrl": "http://localhost:20967/",
|
||||
"MpIoNS": "MoonPro:SQL2016DEV:MoonPro",
|
||||
"BasePathOdlReturn": "\\\\iis01\\W$\\Files\\ODL"
|
||||
"BasePathOdlReturn": "\\\\iis01\\W$\\Files\\ODL",
|
||||
"MimeMappings": {
|
||||
".dxf": "application/octet-stream",
|
||||
".utcfg": "application/octet-stream",
|
||||
".utdata": "application/octet-stream",
|
||||
".utprobe": "application/octet-stream",
|
||||
".utwedge": "application/octet-stream"
|
||||
}
|
||||
},
|
||||
"SpecialConf": {
|
||||
"AppUrl": "/MP/SPEC",
|
||||
"CodApp": "MP-SPEC",
|
||||
"CodModulo": "MP-SPEC"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Microsoft.Extensions.Options;
|
||||
using MP.TaskMan.Controllers;
|
||||
using MP.TaskMan.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
@@ -128,13 +129,15 @@ namespace MP.TaskMan.Services
|
||||
{
|
||||
var callResp = await RCallService.CallRestGet(TaskRec.Command, TaskRec.Args);
|
||||
DateTime dtEnd = DateTime.Now;
|
||||
string formattedJson = JValue.Parse(callResp.Content).ToString(Formatting.Indented);
|
||||
TaskExecModel tExeMod = new TaskExecModel()
|
||||
{
|
||||
DtEnd = dtEnd,
|
||||
DtStart = dtStart,
|
||||
IsError = callResp.StatusCode != System.Net.HttpStatusCode.OK,
|
||||
TaskId = TaskRec.TaskId,
|
||||
Result = $"{callResp.Content}".Replace("\"", ""),
|
||||
// deserializzazione come json indentato?!?
|
||||
Result = formattedJson// $"{callResp.Content}".Replace("\"", ""),
|
||||
};
|
||||
// salvo su DB
|
||||
answ = MLController.TaskExecSaveExecuted(TaskRec.TaskId, SchedNext, tExeMod);
|
||||
|
||||
Reference in New Issue
Block a user