10 Commits

Author SHA1 Message Date
dev-mkoebis
a75c853e79 Projektdatei geändert 2026-07-30 11:29:05 +02:00
dev-mkoebis
70dd3f0a3a Jenkinsfile Step korrigiert 2026-07-30 09:40:22 +02:00
dev-mkoebis
4eba0b5139 Build Step zur Anzeige der SDK's eingefügt 2026-07-30 08:56:30 +02:00
dev-mkoebis
7682bd2fd6 Nuget-Pakete aktualisiert 2026-06-28 15:22:09 +02:00
dev-mkoebis
690626582e Merge branch 'Standortänderung' into dev-mkoebis
# Conflicts:
#	MergeCMInpro.csproj
2026-06-26 12:26:35 +02:00
dev-mkoebis
c401dae875 Pakete aktualisiert
Deprecaterd Vorgang-Datei aus Scan2Compress gelöscht
2026-06-26 10:12:37 +02:00
dev-mkoebis
e56cb114fa Pfad in Jenkinsfile angepasst 2026-06-25 16:19:04 +02:00
dev-mkoebis
a67f9ff77f Abhängigkeiten geupdatet 2026-06-25 16:16:05 +02:00
dev-mkoebis
6d4b5a15fc Jenkinsfile hinzugefügt 2026-06-25 16:09:24 +02:00
dev-mkoebis
7e3e99ad20 Server in config.txt angepasst Datum in Standortklasse angepasst
header eingefügt
Testing hinzugefügt
2026-04-23 14:59:28 +02:00
9 changed files with 110 additions and 467 deletions

View File

@@ -101,7 +101,6 @@ namespace MergeCMInpro.Business
{ {
int count = 0; int count = 0;
int countRows = File.ReadAllLines(path).Length; int countRows = File.ReadAllLines(path).Length;
using (StreamReader sr = new StreamReader(path, System.Text.Encoding.GetEncoding("ISO-8859-1"))) using (StreamReader sr = new StreamReader(path, System.Text.Encoding.GetEncoding("ISO-8859-1")))
{ {
string[] arr = new string[10]; string[] arr = new string[10];
@@ -117,44 +116,22 @@ namespace MergeCMInpro.Business
Console.WriteLine("\r{0}/{1} ", count, countRows); Console.WriteLine("\r{0}/{1} ", count, countRows);
} }
arr = sr.ReadLine().Split(";"); arr = sr.ReadLine().Split(";");
bool jpmFiles = arr[2].Contains(".jpm");
//Erstelle Basis-Vorgang aus den SAGA-Daten //Erstelle Basis-Vorgang aus den SAGA-Daten
Vorgang v; Vorgang v;
if(arr[2].Contains("70/")) if(arr[2].Contains("70/"))
{ {
//arr[0]=ID z.B. 815922, arr[2]=AZ z.B. 61/5-3-048105, arr[3]=Strasse z.B. Westheck, arr[5]=DocType z.B. SCHRIFTVERKEHR, arr[6]=Teil z.B. 001, arr[8]=PDF z.B. 815922.pdf //arr[0]=ID z.B. 815922, arr[2]=AZ z.B. 61/5-3-048105, arr[3]=Strasse z.B. Westheck, arr[5]=DocType z.B. SCHRIFTVERKEHR, arr[6]=Teil z.B. 001, arr[8]=PDF z.B. 815922.pdf
if (jpmFiles) v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[8], arr[3],arr[4]);
{
v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[7], arr[3], arr[4]);
} }
else else
{
v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[7], arr[3], arr[4]);
}
}
else
{
if (jpmFiles)
{ {
v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[8]); v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[8]);
} }
else
{
v = new Vorgang(arr[0], arr[2], string.Concat(arr[5], " Teil ", arr[6]), arr[6], arr[7]);
}
}
#region PDF #region PDF
if(jpmFiles)
{
v.AbsoluteFilePath = GetFullFilePath(arr[8], path); //arr[7]=jpm-Dateien v.AbsoluteFilePath = GetFullFilePath(arr[8], path); //arr[7]=jpm-Dateien
}
else
{
v.AbsoluteFilePath = GetFullFilePath(arr[7], path);
}
if (v.AbsoluteFilePath == string.Empty) if (v.AbsoluteFilePath == string.Empty)
{ {
Console.WriteLine("Keine PDF-Dateien gefunden."); Console.WriteLine("Keine PDF-Dateien gefunden.");

View File

@@ -108,7 +108,8 @@ namespace MergeCMInpro.Business
byte[] tmpHash; byte[] tmpHash;
tmpDt = ASCIIEncoding.ASCII.GetBytes(dt); tmpDt = ASCIIEncoding.ASCII.GetBytes(dt);
tmpHash = new MD5CryptoServiceProvider().ComputeHash(tmpDt); tmpHash = MD5.Create().ComputeHash(tmpDt);
//tmpHash = new MD5CryptoServiceProvider().ComputeHash(tmpDt);
StringBuilder res = new StringBuilder(tmpHash.Length); StringBuilder res = new StringBuilder(tmpHash.Length);
for (int i = 0; i < tmpHash.Length; i++) for (int i = 0; i < tmpHash.Length; i++)

View File

@@ -33,21 +33,7 @@ namespace MergeCMInpro.Business
string documentType = FileOperations.LowerDocumentType(v.DocType.Split(" ").FirstOrDefault()); string documentType = FileOperations.LowerDocumentType(v.DocType.Split(" ").FirstOrDefault());
sbCM.Append(string.Concat(documentType, " ", string.Concat(v.DocType.Split(" ").FirstOrDefault().Substring(0, 1), v.DocType.Split(" ").FirstOrDefault().Substring(1).ToLower()), " ", v.DocType.Split(" ", 2).Skip(1).FirstOrDefault(), ";")); sbCM.Append(string.Concat(documentType, " ", string.Concat(v.DocType.Split(" ").FirstOrDefault().Substring(0, 1), v.DocType.Split(" ").FirstOrDefault().Substring(1).ToLower()), " ", v.DocType.Split(" ", 2).Skip(1).FirstOrDefault(), ";"));
string langBez = string.Empty; string langBez = base.GenerateLangbezeichnungFromPath(v.AbsoluteFilePath);
try
{
langBez = base.GenerateLangbezeichnungFromPath(v.AbsoluteFilePath);
}
catch (ArgumentOutOfRangeException ex)
{
Console.WriteLine("ERROR: Wrong Path {0}. Please provide folder like '843.818 - 847.187 SAGA HD 28 2023_12_18'", Path.GetDirectoryName(v.AbsoluteFilePath),ex.Message);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
//string langBez = base.GenerateLangbezeichnungFromPath(v.AbsoluteFilePath);
sbCM.Append(string.Concat(langBez, ";")); sbCM.Append(string.Concat(langBez, ";"));
sbCM.Append(string.Concat(v.FameId, ".pdf")); sbCM.Append(string.Concat(v.FameId, ".pdf"));
@@ -55,5 +41,7 @@ namespace MergeCMInpro.Business
return sbCM.ToString(); return sbCM.ToString();
} }
} }
} }

View File

@@ -37,11 +37,12 @@ namespace MergeCMInpro.Business
sbStandort.Append(string.Concat(this.CID, ";"));//CID sbStandort.Append(string.Concat(this.CID, ";"));//CID
sbStandort.Append(string.Concat(v.Aktenzeichen, ";"));//Vorgangsnummer sbStandort.Append(string.Concat(v.Aktenzeichen, ";"));//Vorgangsnummer
sbStandort.Append(string.Concat(this.Sachbearbeiter, ";"));//Sachbearbeiter sbStandort.Append(string.Concat(this.Sachbearbeiter, ";"));//Sachbearbeiter
sbStandort.Append(string.Concat(this.Bemerkung, ";"));//Bemerkung
sbStandort.Append(string.Concat(this.Standort, ";"));//Standort sbStandort.Append(string.Concat(this.Standort, ";"));//Standort
sbStandort.Append(string.Concat(this.Entnahmedatum.ToShortDateString(), ";"));//Entnahmedatum -> Datum Tabelle sbStandort.Append(string.Concat(this.Entnahmedatum.ToShortDateString(), ";"));//Entnahmedatum -> Datum Tabelle
sbStandort.Append(string.Concat(this.Entnahmezeit, ";"));//Entnahmezeit sbStandort.Append(string.Concat(this.Entnahmezeit, ";"));//Entnahmezeit
sbStandort.Append(string.Concat(this.Entnahmedatum.ToShortDateString(), ";"));//Rückgabedatum=Entnahmedatum sbStandort.Append(string.Concat(this.Entnahmedatum.ToShortDateString(), ";"));//Rückgabedatum=Entnahmedatum
sbStandort.Append(string.Concat(this.Entnahmezeit, ";"));//Rückgabezeit=Entnahmezeit sbStandort.Append(this.Entnahmezeit);//Rückgabezeit=Entnahmezeit
return sbStandort.ToString(); return sbStandort.ToString();
} }

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<Platforms>AnyCPU;x86</Platforms> <Platforms>AnyCPU;x86</Platforms>
</PropertyGroup> </PropertyGroup>
@@ -12,15 +12,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<COMReference Include="Microsoft.Office.Interop.Excel"> <PackageReference Include="Microsoft.Office.Interop.Excel" Version="16.0.0.0" />
<WrapperTool>tlbimp</WrapperTool> <PackageReference Include="ODP.NetCore" Version="2.0.12" />
<VersionMinor>8</VersionMinor> <PackageReference Include="System.Data.SqlClient" Version="4.9.1" />
<VersionMajor>1</VersionMajor> </ItemGroup>
<Guid>00020813-0000-0000-c000-000000000046</Guid>
<Lcid>0</Lcid> <ItemGroup>
<Isolated>false</Isolated> <Folder Include="config\" />
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -30,9 +28,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NLog" Version="6.0.3" /> <PackageReference Include="NLog" Version="6.1.3" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.9.1" /> <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.26.200" />
<PackageReference Include="Sentry" Version="5.14.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -40,5 +37,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -5,8 +5,6 @@ VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MergeCMInpro", "MergeCMInpro.csproj", "{0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MergeCMInpro", "MergeCMInpro.csproj", "{0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MergeCMInpro.Test", "..\TestProject1\MergeCMInpro.Test.csproj", "{E67A9AAD-585E-4F23-8A85-665A49285C61}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -23,14 +21,6 @@ Global
{0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|Any CPU.Build.0 = Release|Any CPU {0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|Any CPU.Build.0 = Release|Any CPU
{0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|x86.ActiveCfg = Release|x86 {0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|x86.ActiveCfg = Release|x86
{0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|x86.Build.0 = Release|x86 {0798D653-CA13-4E5D-8A9E-4D8A3ADA4D1A}.Release|x86.Build.0 = Release|x86
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Debug|x86.ActiveCfg = Debug|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Debug|x86.Build.0 = Debug|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Release|Any CPU.Build.0 = Release|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Release|x86.ActiveCfg = Release|Any CPU
{E67A9AAD-585E-4F23-8A85-665A49285C61}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -4,7 +4,6 @@ using NLog;
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Sentry;
namespace MergeCMInpro namespace MergeCMInpro
{ {
@@ -18,18 +17,15 @@ namespace MergeCMInpro
{ {
try try
{ {
CallSentry();
Console.ForegroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.White;
//productive //productive
csvPath = Path.Combine(Directory.GetFiles(Environment.CurrentDirectory, "*.csv").FirstOrDefault()); csvPath = Path.Combine(Directory.GetFiles(Environment.CurrentDirectory, "*.csv").FirstOrDefault());
//testing //testing
//csvPath = Path.Combine(Directory.GetFiles(@"\\fsdeg002\DatenStA61_S\Bauvorhaben\0_SAGA\839.867 - 843.817 SAGA HD 27 2023_11_08", "*.csv").FirstOrDefault()); //csvPath = Path.Combine(Directory.GetFiles(@"\\fsdeg002\DatenStA61_S\Bauvorhaben\0_SAGA\815.922 - 819.917 SAGA HD 21 2021_09_27_Testing", "*.csv").FirstOrDefault());
//csvPath = Path.Combine(Directory.GetFiles(@"C:\Testing\MergeInpro", "*.csv").FirstOrDefault()); //csvPath = Path.Combine(Directory.GetFiles(@"E:\TestData\MergeCMInpro", "*.csv").FirstOrDefault());
//csvPath = Path.Combine(Directory.GetFiles(@"C:\TEMP\SAGA\839.867 - 843.817 SAGA HD 27 2023_11_08", "*.csv").FirstOrDefault());
//csvPath = Path.Combine(Directory.GetFiles(@"C:\TEMP\SAGA\843.818 - 847.187 SAGA HD 28 2023_12_18", "*.csv").FirstOrDefault());
csvPath = Path.Combine(Directory.GetFiles(@"D:\TestData\MergeCMInpro", "*.csv").FirstOrDefault());
string pathOutputFileCM = Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv"); string pathOutputFileCM = Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv");
string pathOutputFileInpro = Path.Combine(Directory.GetParent(csvPath).FullName, "outputInpro.csv"); string pathOutputFileInpro = Path.Combine(Directory.GetParent(csvPath).FullName, "outputInpro.csv");
@@ -43,15 +39,6 @@ namespace MergeCMInpro
return; return;
} }
if(!CheckFolderStructure(csvPath))
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("WARNING: folder structure wrong. Please note folder with name '{0}' has to contain all pdf files.", Path.GetFileNameWithoutExtension(csvPath));
Console.ResetColor();
return;
}
var config = File.ReadLines(@".\config.txt").ToArray(); var config = File.ReadLines(@".\config.txt").ToArray();
DataOperations.conString = config[0]; DataOperations.conString = config[0];
DataOperations.kanalAktePath = config[2]; DataOperations.kanalAktePath = config[2];
@@ -60,10 +47,6 @@ namespace MergeCMInpro
if (!File.Exists(DataOperations.kanalAktePath)) if (!File.Exists(DataOperations.kanalAktePath))
throw new FileNotFoundException("Kanalaktendatei nicht gefunden."); throw new FileNotFoundException("Kanalaktendatei nicht gefunden.");
//Testing
//string archivNetPath = Path.Combine(@"C:\TEMP\ArchivPath");
//productive
string archivNetPath = Path.Combine(config[1]); string archivNetPath = Path.Combine(config[1]);
Console.WriteLine("Working, please wait... or get yourself a tea."); Console.WriteLine("Working, please wait... or get yourself a tea.");
@@ -91,33 +74,29 @@ namespace MergeCMInpro
//Standort //Standort
using (StreamWriter sw = new StreamWriter(pathOutputFileStandort)) using (StreamWriter sw = new StreamWriter(pathOutputFileStandort))
{ {
foreach (var item in DataOperations.vorgängeStandort.Distinct()) for (int i = 0; i < DataOperations.vorgängeStandort.Count; i++)
{ {
sw.WriteLine(item.ToString()); if (i == 0)
{
sw.WriteLine(String.Concat("CID", "VORGANGID", "Sachbearbeiter", "Bemerkung", "Standort", "ENTNAHMEDATUM", "Entnahmezeit", "RUECKGABEDATUM", "Rückgabezeit"));
}
sw.WriteLine(DataOperations.vorgängeStandort[i]);
} }
} }
Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("{0} created.", pathOutputFileCM); Console.WriteLine("{0} created.", pathOutputFileCM);
FileInfo fi = new FileInfo(pathOutputFileInpro);
if(fi.Length!=0)
{
Console.WriteLine("{0} created.", pathOutputFileInpro); Console.WriteLine("{0} created.", pathOutputFileInpro);
Console.WriteLine("{0} created.", pathOutputFileStandort); Console.WriteLine("{0} created.", pathOutputFileStandort);
}
Console.ResetColor(); Console.ResetColor();
//#region Backup JPM-Files //Backup JPM-Files
//Console.WriteLine("Start copying jpm-files, please wait..."); Console.WriteLine("Start copying jpm-files, please wait...");
//FileInfo fi = new FileInfo(csvPath); FileInfo fi = new FileInfo(csvPath);
//FileOperations.CopyJPMFilesToDestination(fi.Directory.FullName, archivNetPath); FileOperations.CopyJPMFilesToDestination(fi.Directory.FullName, archivNetPath);
//Console.WriteLine(""); Console.WriteLine("");
//Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
//Console.WriteLine("Done. You may close this window now."); Console.WriteLine("Done. You may close this window now.");
//#endregion
Console.ReadLine(); Console.ReadLine();
@@ -141,59 +120,10 @@ namespace MergeCMInpro
Console.ReadLine(); Console.ReadLine();
} }
} }
static string CallSentry()
{
try
{
var res = SentrySdk.Init(options =>
{
// A Sentry Data Source Name (DSN) is required.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
// You can set it in the SENTRY_DSN environment variable, or you can set it in code here.
options.Dsn = "";
// When debug is enabled, the Sentry client will emit detailed debugging information to the console.
// This might be helpful, or might interfere with the normal operation of your application.
// We enable it here for demonstration purposes when first trying Sentry.
// You shouldn't do this in your applications unless you're troubleshooting issues with Sentry.
options.Debug = true;
// This option is recommended. It enables Sentry's "Release Health" feature.
options.AutoSessionTracking = true;
});
return res.ToString();
}
catch (Exception ex)
{
SentrySdk.CaptureMessage("Something went wrong");
return ex.Message;
}
}
private static bool CheckFolderStructure(string csvName)
{
string fileName = Path.GetFileNameWithoutExtension(csvName);
bool result = false;
string dir = Path.GetDirectoryName(csvName);
DirectoryInfo di = new DirectoryInfo(dir);
if(di.GetFiles("*.pdf").Length > 0)
{
return result;
}
if (Directory.Exists(Path.Combine(dir, fileName)))
{
result = true;
}
return result;
}
public static bool CheckFileExist() public static bool CheckFileExist()
{ {
FileInfo fi = new FileInfo(Path.Combine(Directory.GetParent(csvPath).FullName, "outputInpro.csv")); if (File.Exists(Path.Combine(Directory.GetParent(csvPath).FullName, "outputInpro.csv")) || File.Exists(Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv")))
if ((File.Exists(Path.Combine(Directory.GetParent(csvPath).FullName, "outputInpro.csv")) && fi.Length!=0) || File.Exists(Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv")))
{ {
return true; return true;
} }

View File

@@ -1,278 +0,0 @@
using NLog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Scan2Compress.Business
{
public sealed class Vorgang
{
#region Fields
private static readonly Logger _logger = NLog.LogManager.GetCurrentClassLogger();
private string aktenzeichen;
#endregion
//TODO: fehlende Felder aus den CM und Inpro hinzufügen
#region Properties
public DateTime Enddatum { get; set; }
public DateTime Eingangsdatum { get; set; }
public string BeschreibungVorgang { get; set; }
public string Checkliste { get; set; }
public string VorgangsDefinition { get; set; }
public int Id { get; set; }
public string Aktenzeichen
{
get
{
return aktenzeichen;
}
set
{
aktenzeichen = value;
if (!aktenzeichen.Contains("/"))
{
aktenzeichen = ReplaceHiphenWithSlash(value);
}
}
}
public string FameId { get; set; }
public string DocsSZ { get; set; }
public string DocType { get; set; }
public static Dictionary<int, string> Strassen { get; set; }
public string IdStrasse { get; set; }
public string Strasse1 { get; set; }
public string Hausnummer1Von { get; set; }
public string Hausnummer1Bis { get; set; }
public string HsNrVonZusatz { get; set; }
public string HsNrBisZusatz { get; set; }
public string Strasse2 { get; set; } = string.Empty;
public string Hausnummer2 { get; set; } = string.Empty;
public string Teil { get; set; }
public string NamePDF { get; set; }
public string AbsoluteFilePath { get; set; }
public DateTime CreationDate { get; set; }
public DateTime ScanDatum { get; set; } = DateTime.Now; //Erstelldatum
#endregion Properties
#region Contructor
public Vorgang(string id, string aktenzeichen, string docType, string teil, string namePDF)
{
this.DocType = docType;
this.Teil = teil;
this.Aktenzeichen = aktenzeichen;
this.NamePDF = namePDF;
this.Id = Convert.ToInt32(id);
this.FameId = GenerateFameId();
}
public Vorgang(string id, string aktenzeichen, string docType, string teil, string namePDF, string strasse1, string hausnummer1)
{
this.DocType = docType;
this.Teil = teil;
this.Aktenzeichen = aktenzeichen;
this.NamePDF = namePDF;
this.Id = Convert.ToInt32(id);
this.FameId = GenerateFameId();
this.Strasse1 = strasse1.Trim();
this.Hausnummer1Von = hausnummer1;
}
public Vorgang()
{
}
#endregion
#region Methods
private int GenerateVorgangId(int oldValue)
{
int newValue = oldValue + 1;
return newValue;
}
//Erstelle Originalaktenzeichen
private string ReplaceHiphenWithSlash(string aktenzeichen)
{
var regex = new Regex(Regex.Escape("-"));
string res = regex.Replace(aktenzeichen, "/", 1);
return res;
}
#region Extract Strassen
private void ExtractStrasseHausnummer(string strasse)
{
string[] res = strasse.Split(' ');
StringBuilder sb = new StringBuilder();
try
{
//Abtrennen von Hausnummerzusätzen wie z.B. "4A" in "4" und "A" sowie Aufspaltung von Bereichen z.B. "4-8" in "4" und "8"
for (int i = 0; i < res.Length; i++)
{
if (!char.IsDigit(res[i].ElementAt(0)) && char.IsDigit(res[i].ElementAt(1)))
{
DocsSZ = res[i];
}
else if (char.IsDigit(res[i].ElementAt(0)))
{
SplittedHausnummerZusatz(res[i]);
}
else
{
//z.B. Auf der Mühle, Herbert-Scholtissek-Str, Westholz etc.
sb.Append(res[i]);
sb.Append(" ");
}
}
Strasse1 = sb.ToString().Trim();
}
catch (System.ArgumentOutOfRangeException ex)
{
_logger.Error(string.Concat(ex.Message, " Beim Extrahieren der Strasse/Hausnummer ist ein Fehler aufgetreten."));
throw new ArgumentOutOfRangeException("Beim Extrahieren der Strasse1 ist ein Fehler aufgetreten.\n\nBitte Eingaben überprüfen.", ex);
}
catch (Exception ex)
{
_logger.Error(ex.Message);
throw;
}
}
private void SplittedStrasse2(string input)
{
string[] strasseHnr = input.Split(' ');
StringBuilder builder = new StringBuilder();
Hausnummer2 = strasseHnr.LastOrDefault();
strasseHnr = strasseHnr.Take(strasseHnr.Length - 1).ToArray();
for (int i = 0; i < strasseHnr.Length; i++)
{
if (i == strasseHnr.Length - 1)
builder.Append(strasseHnr[i]);
else
builder.Append(string.Concat(strasseHnr[i], " "));
}
Strasse2 = builder.ToString();
}
private void SplittedHausnummerZusatz(string input)
{
string hausnummerZusatzVon = string.Empty;
string hausnummerZusatzBis = string.Empty;
Tuple<string, string> result;
if (input.Contains('-')) //13-15, 13a-15
{
hausnummerZusatzVon = input.Split('-').FirstOrDefault();
hausnummerZusatzBis = input.Split('-').LastOrDefault();
result = ExtractingZusatzFromHausnummer(hausnummerZusatzVon);
Hausnummer1Von = result.Item1;
HsNrVonZusatz = result.Item2;
result = ExtractingZusatzFromHausnummer(hausnummerZusatzBis);
Hausnummer1Bis = result.Item1;
HsNrBisZusatz = result.Item2;
if (HsNrBisZusatz.Length >= 2 || HsNrVonZusatz.Length >= 2)
{
HsNrVonZusatz = HsNrVonZusatz != string.Empty ? HsNrVonZusatz.FirstOrDefault().ToString() : string.Empty;
HsNrBisZusatz = HsNrBisZusatz != string.Empty ? HsNrBisZusatz.LastOrDefault().ToString() : string.Empty;
}
}
else //13
{
result = ExtractingZusatzFromHausnummer(input);
Hausnummer1Von = result.Item1;
HsNrBisZusatz = result.Item2;
}
}
private Tuple<string, string> ExtractingZusatzFromHausnummer(string input)
{
StringBuilder sbHausnummer = new StringBuilder();
StringBuilder sbZusatz = new StringBuilder();
for (int i = 0; i < input.Length; i++)
{
if (char.IsDigit(input[i]))
{
sbHausnummer.Append(input[i]);
}
else
{
sbZusatz.Append(input[i]);
}
}
return new Tuple<string, string>(sbHausnummer.ToString(), sbZusatz.ToString());
}
#endregion
private string GenerateFameId()
{
string dt = DateTime.Now.ToString("ddMMyyhhmmssfff");
byte[] tmpDt;
byte[] tmpHash;
tmpDt = ASCIIEncoding.ASCII.GetBytes(dt);
tmpHash = new MD5CryptoServiceProvider().ComputeHash(tmpDt);
StringBuilder res = new StringBuilder(tmpHash.Length);
for (int i = 0; i < tmpHash.Length; i++)
{
res.Append(tmpHash[i].ToString("X2"));
}
string tmp = res.ToString().ToLower().Substring(res.Length - 12);
_logger.Info("FameId " + tmp + " für " + dt + " und " + Aktenzeichen + " erzeugt.");
return tmp;
}
public override string ToString()
{
return Id.ToString() + ";" + Aktenzeichen + ";" + Checkliste + ";" + VorgangsDefinition + ";" + BeschreibungVorgang + ";" + Strasse1 + ";" + Hausnummer1Von + ";" + HsNrVonZusatz + ";" + Hausnummer1Bis + ";" + HsNrBisZusatz + ";" + Strasse2.Trim() + ";" + Hausnummer2 + ";" + Eingangsdatum.ToShortDateString() + ";" + FameId + ";" + Enddatum.ToShortDateString() + ";" + DocType + ";" + NamePDF;
}
//CM:
//aktenzeichen
//vorgangdefid VV
//Vorgangsart Kanalakte
//strasse 1
//strasse 1 hausnummer
//strasse 2
//strasse 2 hausnummer
//datumabschluss
//fameid
//dokumentdatum
//langebzeichnung/dokumentbezeichnung in inpro
//dokumentname mit Endung
#endregion
}
}

38
config/Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,38 @@
pipeline
{
agent
{
node
{
label 'Jenkins_Homer'
}
}
stages
{
stage('Build')
{
steps
{
bat "dotnet --list-sdks"
bat "\"${tool 'MSBuild17'}\" ${WORKSPACE}\\MergeCMInpro.csproj /t:Restore /t:Rebuild /p:Configuration=Release"
}
}
stage('SonarQube')
{
environment
{
scannerHome = tool 'sonar-scanner4.4'
project = 'mergecminpro'
token = 'sqa_07d4e3802cf6283fc38a002e75bd0a5eb158af87'
}
steps
{
withSonarQubeEnv('SonarQube_Homer')
{
bat "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${project} -Dsonar.login=${token}"
}
}
}
}
}