tenants_allows.txt + tenants_test.txt
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
</startup>
|
</startup>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
|
<add key="TenantsAllowTxtPath" value="C:\GkvAbrechnung\Sender\tenants_allow.txt" />
|
||||||
|
<add key="TenantsTestTxtPath" value="C:\GkvAbrechnung\Sender\tenants_test.txt" />
|
||||||
<add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" />
|
<add key="GkvAbrechnungResultFolderPath" value="C:\GkvAbrechnung\Results\" />
|
||||||
<add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" />
|
<add key="GkvAbrechnungQueueFolderPath" value="C:\GkvAbrechnung\Data\Queue\" />
|
||||||
<add key="GkvAbrechnungCopyFolderPath" value="C:\GkvAbrechnung\Data\QueueCopy\" />
|
<add key="GkvAbrechnungCopyFolderPath" value="C:\GkvAbrechnung\Data\QueueCopy\" />
|
||||||
@@ -12,12 +14,12 @@
|
|||||||
<add key="GkvAbrechnungCopySave" value="True" />
|
<add key="GkvAbrechnungCopySave" value="True" />
|
||||||
<add key="GkvAbrechnungFailedSave" value="True" />
|
<add key="GkvAbrechnungFailedSave" value="True" />
|
||||||
<add key="GkvAbrechnungSuccessSave" value="True" />
|
<add key="GkvAbrechnungSuccessSave" value="True" />
|
||||||
<add key="DakotaExePath" value="C:\Program Files (x86)\ITSG\dakotale\dakota30.exe" />
|
<add key="DakotaExePath" value="C:\Program Files (x86)\ITSG\dakotale\dakota30.exe" />
|
||||||
<add key="DakotaFolder" value="C:\dakotale\" />
|
<add key="DakotaFolder" value="C:\dakotale\" />
|
||||||
<add key="ProcessWaitForExitMs" value="10000" />
|
<add key="ProcessWaitForExitMs" value="10000" />
|
||||||
<add key="LogPath" value="C:\GkvAbrechnung\Sender\log.txt" />
|
<add key="LogPath" value="C:\GkvAbrechnung\Sender\log.txt" />
|
||||||
<add key="LogFileName" value="logs.txt" />
|
<add key="LogFileName" value="logs.txt" />
|
||||||
<add key="LogSingleFile" value="True" />
|
<add key="LogSingleFile" value="True" />
|
||||||
<add key="GkvSecretKey" value="DfDGNGn72PKfSYxSUsmRdzuBtpR9novewlmYU3gsjiFgSkaZZeylUXlbO42cWNqiKgLdMUFtWUNZT962F1raQDR7HGUzCNYsFeC" />
|
<add key="GkvSecretKey" value="DfDGNGn72PKfSYxSUsmRdzuBtpR9novewlmYU3gsjiFgSkaZZeylUXlbO42cWNqiKgLdMUFtWUNZT962F1raQDR7HGUzCNYsFeC" />
|
||||||
<add key="SendMailModuleSmtpServer" value="mail.ownsoft.de" />
|
<add key="SendMailModuleSmtpServer" value="mail.ownsoft.de" />
|
||||||
<add key="SendMailModuleGkvEnabled" value="true" />
|
<add key="SendMailModuleGkvEnabled" value="true" />
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ namespace DakotaSender
|
|||||||
{
|
{
|
||||||
internal static class Config
|
internal static class Config
|
||||||
{
|
{
|
||||||
|
public static string TenantsAllowTxtPath { get; }
|
||||||
|
= ConfigurationManager.AppSettings.Get("TenantsAllowTxtPath") ?? @"C:\GkvAbrechnung\Sender\tenants_allow.txt";
|
||||||
|
|
||||||
|
public static string TenantsTestTxtPath { get; }
|
||||||
|
= ConfigurationManager.AppSettings.Get("TenantsTestTxtPath") ?? @"C:\GkvAbrechnung\Sender\tenants_test.txt";
|
||||||
|
|
||||||
public static DirectoryInfo ResultFolder { get; }
|
public static DirectoryInfo ResultFolder { get; }
|
||||||
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("GkvAbrechnungResultFolderPath") ?? @"C:\GkvAbrechnung\Results\");
|
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("GkvAbrechnungResultFolderPath") ?? @"C:\GkvAbrechnung\Results\");
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Config.cs" />
|
<Compile Include="Config.cs" />
|
||||||
|
<Compile Include="DakotaSenderUtils.cs" />
|
||||||
<Compile Include="FileController.cs" />
|
<Compile Include="FileController.cs" />
|
||||||
<Compile Include="Returncodes.cs" />
|
<Compile Include="Returncodes.cs" />
|
||||||
<Compile Include="DakotaSystemFile.cs" />
|
<Compile Include="DakotaSystemFile.cs" />
|
||||||
@@ -61,5 +62,9 @@
|
|||||||
<Name>Shared</Name>
|
<Name>Shared</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="tenants_allows.txt" />
|
||||||
|
<Content Include="tenants_test.txt" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
25
DakotaSender/DakotaSenderUtils.cs
Normal file
25
DakotaSender/DakotaSenderUtils.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DakotaSender
|
||||||
|
{
|
||||||
|
internal static class DakotaSenderUtils
|
||||||
|
{
|
||||||
|
public static bool IsTenantAllowed(string tenant)
|
||||||
|
{
|
||||||
|
var list = FileController.GetTenantsAllowedList();
|
||||||
|
|
||||||
|
return list.Contains(tenant);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsTenantTest(string tenant)
|
||||||
|
{
|
||||||
|
var list = FileController.GetTenantsTestList();
|
||||||
|
|
||||||
|
return list.Contains(tenant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ namespace DakotaSender
|
|||||||
{
|
{
|
||||||
internal class DakotaSystemFile
|
internal class DakotaSystemFile
|
||||||
{
|
{
|
||||||
|
public bool TestCase { get; set; }
|
||||||
|
|
||||||
public string Tenant { get; set; }
|
public string Tenant { get; set; }
|
||||||
public long ProtokollOid { get; set; }
|
public long ProtokollOid { get; set; }
|
||||||
public long ApplicationUserOid { get; set; }
|
public long ApplicationUserOid { get; set; }
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace DakotaSender
|
|||||||
}
|
}
|
||||||
internal static void CopyFile(string source, string destination)
|
internal static void CopyFile(string source, string destination)
|
||||||
{
|
{
|
||||||
Program.Print($"Kopiere \"{source}\" nach \"{destination}\". ");
|
Program.Print($"- Kopiere \"{source}\" nach \"{destination}\". ");
|
||||||
|
|
||||||
File.Copy(source, destination);
|
File.Copy(source, destination);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ namespace DakotaSender
|
|||||||
}
|
}
|
||||||
internal static void DeleteFile(string file)
|
internal static void DeleteFile(string file)
|
||||||
{
|
{
|
||||||
Program.Print($"Lösche {file}. ");
|
Program.Print($"- Lösche {file}. ");
|
||||||
|
|
||||||
File.Delete(file);
|
File.Delete(file);
|
||||||
|
|
||||||
@@ -99,5 +99,18 @@ namespace DakotaSender
|
|||||||
|
|
||||||
Program.PrintLine("Ok.");
|
Program.PrintLine("Ok.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static IEnumerable<string> GetTenantsAllowedList()
|
||||||
|
{
|
||||||
|
var path = Config.TenantsAllowTxtPath;
|
||||||
|
|
||||||
|
return File.ReadAllLines(path);
|
||||||
|
}
|
||||||
|
internal static IEnumerable<string> GetTenantsTestList()
|
||||||
|
{
|
||||||
|
var path = Config.TenantsTestTxtPath;
|
||||||
|
|
||||||
|
return File.ReadAllLines(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,16 +195,18 @@ namespace DakotaSender
|
|||||||
var datenannahmestelle = split[3];
|
var datenannahmestelle = split[3];
|
||||||
var transfername = split[4];
|
var transfername = split[4];
|
||||||
|
|
||||||
// Muss nachher nur entfernt werden, um andere zu testen
|
var test = DakotaSenderUtils.IsTenantTest(tenant);
|
||||||
// Ggf Tool einbauen?
|
var allow = DakotaSenderUtils.IsTenantAllowed(tenant);
|
||||||
if (tenant != TEST_TENANT && tenant != TEST_TENANT_2)
|
|
||||||
|
if(!test && !allow)
|
||||||
{
|
{
|
||||||
PrintLine($"{auft.FullName} wird ignoriert. Tenant {tenant} nicht gültig.");
|
PrintLine($"{auft.FullName} wird ignoriert. Tenant \'{tenant}\' ungültig.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var file = new DakotaSystemFile()
|
var file = new DakotaSystemFile()
|
||||||
{
|
{
|
||||||
|
TestCase = test,
|
||||||
SourceAuftragsdatei = auft,
|
SourceAuftragsdatei = auft,
|
||||||
SourceNutzdatendatei = nutz,
|
SourceNutzdatendatei = nutz,
|
||||||
Tenant = tenant,
|
Tenant = tenant,
|
||||||
@@ -318,8 +320,14 @@ namespace DakotaSender
|
|||||||
|
|
||||||
PrintFileInfo(file);
|
PrintFileInfo(file);
|
||||||
|
|
||||||
|
if (file.TestCase)
|
||||||
|
{
|
||||||
|
success = true;
|
||||||
|
return "- TestCase. ";
|
||||||
|
}
|
||||||
|
|
||||||
if (!Config.IsDatenannahmestelleValid(file.Datenannahmestelle))
|
if (!Config.IsDatenannahmestelleValid(file.Datenannahmestelle))
|
||||||
return $"Datenannahmestelle {file.Datenannahmestelle} unbekannt.";
|
return $"- Datenannahmestelle {file.Datenannahmestelle} unbekannt.";
|
||||||
|
|
||||||
FileController.CopyFileToDestination(file);
|
FileController.CopyFileToDestination(file);
|
||||||
|
|
||||||
@@ -339,7 +347,10 @@ namespace DakotaSender
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
if (success)
|
||||||
|
return "Ok.";
|
||||||
|
else
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
static void Add2Results(DakotaSystemFile file, GkvTransferResultType type, string nachricht = null, string title = null)
|
static void Add2Results(DakotaSystemFile file, GkvTransferResultType type, string nachricht = null, string title = null)
|
||||||
{
|
{
|
||||||
|
|||||||
1
DakotaSender/tenants_allows.txt
Normal file
1
DakotaSender/tenants_allows.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
1
DakotaSender/tenants_test.txt
Normal file
1
DakotaSender/tenants_test.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
Reference in New Issue
Block a user