Get()
{
@@ -80,6 +129,12 @@ namespace GPW.CORE.Api.Controllers
int numFix = 0;
int numProj = 0;
int numFasi = 0;
+ string enableChiudiRaw = _configuration["EnableChiudiFasi"];
+ bool enableChiudi = false;
+ if (!string.IsNullOrEmpty(enableChiudiRaw))
+ {
+ bool.TryParse(enableChiudiRaw, out enableChiudi);
+ }
// recupero progetti attivi...
doLog("Esito della verifica stato ore progetto (allocate/consumate)", logType.info, ref sbMain);
@@ -97,8 +152,7 @@ namespace GPW.CORE.Api.Controllers
doLog("", logType.none, ref sbMain);
// ciclo elenco fasi ancestor di ognuno...
- doLog(sepaMsg, logType.none, ref sbActions);
- doLog("Elenco Progetti valutati", logType.none, ref sbAllProj);
+ doLog("Elenco Progetti valutati
", logType.none, ref sbAllProj);
foreach (var itemProj in currProj)
{
// cerco le sue fasi PARENT...
@@ -120,16 +174,19 @@ namespace GPW.CORE.Api.Controllers
// segno che ho +1 fix
numFix++;
// x ora LOG... poi chiudo...
- string currAction = $"[F.{parentFase.IdxFase}] Budget esaurito in Fase {parentFase.NomeFase} {statoFase.totOre:N2}h consumate, budgt {statoFase.budgetTime:N0} al {statoFase.percOpen:P1}";
+ string currAction = $" [F.{parentFase.IdxFase}] Budget esaurito in Fase {parentFase.NomeFase} {statoFase.totOre:N2}h consumate, budgt {statoFase.budgetTime:N0} al {statoFase.percOpen:P1}";
- doLog(projData, logType.none, ref sbActions);
+ doLog(projData, logType.local, ref sbActions);
doLog(currAction, logType.warn, ref sbActions);
- doLog(sepaMsg, logType.none, ref sbActions);
+ doLog("------------------", logType.local, ref sbActions);
+
+ // se abilitato CHIUDO fase master e sottofasi!
}
}
}
if (numFix > 0)
{
+ doLog("
", logType.none, ref sbMain);
doLog("", logType.none, ref sbMain);
doLog($"Fasi critiche: {numFix}", logType.info, ref sbMain);
doLog("
", logType.none, ref sbMain);
@@ -151,24 +208,13 @@ namespace GPW.CORE.Api.Controllers
//{ HtmlEncoder.Default.Encode(callbackUrl)}
// invio email
- await sendEmail(msgTopic, msgBody.Replace($"{Environment.NewLine}","
"));
+ await sendEmail(msgTopic, msgBody.Replace($"{Environment.NewLine}", "
"));
// ritorno solo LOG azioni
answ = numFix == 0 ? $"ALL {numProj} Proj OK" : $"Proj: {numProj} | Fasi: {numFasi} | Fixed/Closed: {numFix}";
return answ;
}
-
- private readonly IEmailSender _emailSender;
-
- protected async Task sendEmail(string subject, string message)
- {
- string emailRaw = _configuration["MailDest:ProjCheck"];
- List emailDestList = emailRaw.Split(",").ToList();
- foreach (var dest in emailDestList)
- {
- await _emailSender.SendEmailAsync(dest, subject, message);
- }
- }
+ #endregion Public Methods
}
-}
+}
\ No newline at end of file
diff --git a/GPW.CORE.Api/appsettings.json b/GPW.CORE.Api/appsettings.json
index 92226ea..3b5be06 100644
--- a/GPW.CORE.Api/appsettings.json
+++ b/GPW.CORE.Api/appsettings.json
@@ -24,9 +24,9 @@
},
"MailDest": {
"Admin": "samuele@steamware.net",
- "ProjCheck": "samuele.locatelli@egalware.com",
- "ProjCheck2": "samuele.locatelli@egalware.com,mara.baroni@egalware.com"
+ "ProjCheck": "samuele.locatelli@egalware.com,mara.baroni@egalware.com"
},
+ "EnableChiudiFasi": "true",
"Redis": {
"Password": "",
"AllowAdmin": false,
diff --git a/GPW.CORE.UI/GPW.CORE.UI.csproj b/GPW.CORE.UI/GPW.CORE.UI.csproj
index f9b84ba..9371dbd 100644
--- a/GPW.CORE.UI/GPW.CORE.UI.csproj
+++ b/GPW.CORE.UI/GPW.CORE.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 3.0.2201.2616
+ 3.0.2201.2617
enable
enable