Pakete aktualisiert

Deprecaterd Vorgang-Datei aus Scan2Compress gelöscht
This commit is contained in:
dev-mkoebis
2026-06-26 10:12:37 +02:00
parent 7e3e99ad20
commit c401dae875
5 changed files with 6 additions and 294 deletions

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

@@ -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>
@@ -30,8 +30,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NLog" Version="5.0.4" /> <PackageReference Include="NLog" Version="6.1.3" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.70" /> <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.26.200" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -39,5 +39,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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MergeCMInpro.Testing", "..\MergeCMInpro.Testing\MergeCMInpro.Testing.csproj", "{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}"
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
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Debug|x86.ActiveCfg = Debug|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Debug|x86.Build.0 = Debug|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Release|Any CPU.Build.0 = Release|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Release|x86.ActiveCfg = Release|Any CPU
{F0F62B9F-4802-44AE-BFEC-7E20285ED2BE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -24,7 +24,7 @@ namespace MergeCMInpro
//testing //testing
//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(@"\\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());
string pathOutputFileCM = Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv"); string pathOutputFileCM = Path.Combine(Directory.GetParent(csvPath).FullName, "outputCM.csv");

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
}
}