- DakotaSender gibt detailiertere Fehlermeldung aus -> Ohne PDFs nachschauen - DakotaSender gruppiert Files nach Tenant und dann nach Datenannahmestelle. -> Konsistenz nur zwischen Tenant und Datenannahmestelle erforderlich. - DakotaSender sammelt Ergebnisse. Todo: - DakotaSender nach Bearbeitung Feedback an jeweilige AppServer - GkvAbrechnungServer wertet Feedback aus und startet ggf neuen Sendeprozess
66 lines
2.4 KiB
C#
66 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DakotaSender
|
|
{
|
|
internal static class Config
|
|
{
|
|
public static string GkvSecretKey { get; set; } = ConfigurationManager.AppSettings.Get("GkvSecretKey");
|
|
|
|
public static string LogPath { get; }
|
|
= ConfigurationManager.AppSettings.Get("LogPath") ?? @"C:\GkvAbrechnung\Sender\log.txt";
|
|
public static int ProcessWaitForExitMs { get; }
|
|
= int.Parse(ConfigurationManager.AppSettings.Get("ProcessWaitForExitMs") ?? "10000");
|
|
public static FileInfo DakotaExe { get; }
|
|
= new FileInfo(ConfigurationManager.AppSettings.Get("DakotaExePath") ?? @"C:\Program Files (x86)\ITSG\dakotale\dakota30.exe");
|
|
public static DirectoryInfo DakotaFolder { get; }
|
|
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("DakotaFolder") ?? @"C:\dakotale\");
|
|
public static DirectoryInfo QueueFolder { get; }
|
|
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("GkvAbrechnungQueueFolderPath") ?? @"C:\GkvAbrechnung\Queue\");
|
|
public static DirectoryInfo ResultFolder { get; }
|
|
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("GkvAbrechnungResultFolderPath") ?? @"C:\GkvAbrechnung\Results\");
|
|
public static DirectoryInfo FailedFolder { get; }
|
|
= new DirectoryInfo(ConfigurationManager.AppSettings.Get("GkvAbrechnungFailedFolderPath") ?? @"C:\GkvAbrechnung\Failed\");
|
|
|
|
public static bool IsDatenannahmestelleValid(string datenannahmestelle)
|
|
{
|
|
try
|
|
{
|
|
_ = LoadDatenannahmestelleFolder(datenannahmestelle);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
public static DirectoryInfo LoadDatenannahmestelleFolder(string datenannahmestelle)
|
|
{
|
|
var folder = new DirectoryInfo(Path.Combine(Config.DakotaFolder.FullName, "TP5Daten", datenannahmestelle));
|
|
|
|
if (!folder.Exists)
|
|
folder = new DirectoryInfo(Path.Combine(Config.DakotaFolder.FullName, "TP5Daten", datenannahmestelle.Substring(0, datenannahmestelle.Length - 1)));
|
|
|
|
if (!folder.Exists)
|
|
throw new Exception($"Datenannahmestelle {datenannahmestelle} konnte nicht gefunden werden.");
|
|
|
|
return folder;
|
|
}
|
|
public static DirectoryInfo GetResultTenantFolder(string tenant)
|
|
{
|
|
var dirinfo = new DirectoryInfo(Path.Combine(Config.ResultFolder.FullName, tenant));
|
|
|
|
if (!dirinfo.Exists)
|
|
dirinfo.Create();
|
|
|
|
return dirinfo;
|
|
}
|
|
}
|
|
}
|