Version 2.9.2.0: Verbesserte Dokumentenverarbeitung
Die Assembly-Version wurde auf 2.9.2.0 aktualisiert. Wesentliche Änderungen umfassen: - Aggregation und Caching von Dokumentensuchergebnissen. - Copy2TempPath und Mapping nun auch bei Exportfunktion - Verbesserte Fehlerbehandlung und Logging bei Exporten. - Konsistente Verarbeitung von Dateipfaden mit `.ToString()`. - Codebereinigung und Entfernung redundanter Zeilen. - Erweiterte Debug-Logs zur besseren Nachvollziehbarkeit.
This commit is contained in:
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.9.1.0")>
|
<Assembly: AssemblyVersion("2.9.2.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
<Assembly: NeutralResourcesLanguage("")>
|
<Assembly: NeutralResourcesLanguage("")>
|
||||||
|
|||||||
@@ -1018,6 +1018,8 @@ Public Class frmValidator
|
|||||||
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
|
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
|
||||||
MyValidationLogger.Debug("========================================")
|
MyValidationLogger.Debug("========================================")
|
||||||
|
|
||||||
|
DT_AdditionalSearches_Resultset_Docs = Nothing
|
||||||
|
|
||||||
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
|
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
|
||||||
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
|
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
|
||||||
|
|
||||||
@@ -1048,6 +1050,7 @@ Public Class frmValidator
|
|||||||
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
|
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
|
||||||
Dim validSQLSearches As DataTable = allSQLSearches.Clone()
|
Dim validSQLSearches As DataTable = allSQLSearches.Clone()
|
||||||
Dim validDocSearches As DataTable = allDocSearches.Clone()
|
Dim validDocSearches As DataTable = allDocSearches.Clone()
|
||||||
|
Dim aggregatedDocResults As DataTable = Nothing
|
||||||
|
|
||||||
If hasDATASearches Then
|
If hasDATASearches Then
|
||||||
For i As Integer = 0 To allSQLSearches.Rows.Count - 1
|
For i As Integer = 0 To allSQLSearches.Rows.Count - 1
|
||||||
@@ -1091,6 +1094,12 @@ Public Class frmValidator
|
|||||||
If IsValidDocSearchResult(testDT) Then
|
If IsValidDocSearchResult(testDT) Then
|
||||||
validDocSearches.ImportRow(searchRow)
|
validDocSearches.ImportRow(searchRow)
|
||||||
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
|
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
|
||||||
|
If aggregatedDocResults Is Nothing Then
|
||||||
|
aggregatedDocResults = testDT.Clone()
|
||||||
|
End If
|
||||||
|
For Each resultRow As DataRow In testDT.Rows
|
||||||
|
aggregatedDocResults.ImportRow(resultRow)
|
||||||
|
Next
|
||||||
Else
|
Else
|
||||||
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
|
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
|
||||||
End If
|
End If
|
||||||
@@ -1102,6 +1111,10 @@ Public Class frmValidator
|
|||||||
End Try
|
End Try
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
DT_AdditionalSearches_Resultset_Docs = aggregatedDocResults
|
||||||
|
If DT_AdditionalSearches_Resultset_Docs IsNot Nothing Then
|
||||||
|
MyValidationLogger.Debug($"Zusätzliche Doc-Results gecached: {DT_AdditionalSearches_Resultset_Docs.Rows.Count} Rows")
|
||||||
|
End If
|
||||||
|
|
||||||
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
|
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
|
||||||
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
|
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
|
||||||
@@ -8631,16 +8644,39 @@ Public Class frmValidator
|
|||||||
Dim oFileCount As Integer = 1
|
Dim oFileCount As Integer = 1
|
||||||
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
|
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
|
||||||
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
|
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
|
||||||
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")
|
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")?.ToString()
|
||||||
Dim oDocID = oFileRecord.Item("DocID")
|
Dim oDocID = oFileRecord.Item("DocID")
|
||||||
If File.Exists(oFromFilename) Then
|
|
||||||
MyValidationLogger.Debug($"Found additional document for export: [{oFromFilename}] with DocID [{oDocID}]")
|
' COPY_WMFILE_2TEMP: Pfad analog zu GetDocPathWindows() auflösen
|
||||||
|
Dim oResolvedFilename As String = oFromFilename
|
||||||
|
If COPY_WMFILE_2TEMP = True AndAlso Not String.IsNullOrWhiteSpace(oFromFilename) Then
|
||||||
|
Dim options As New DocumentPathHandler.DocumentPathOptions With {
|
||||||
|
.EnableMapping = True,
|
||||||
|
.WMSuffix = WMSUFFIX,
|
||||||
|
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
|
||||||
|
.DriveBlacklist = MAP_BLACKLIST,
|
||||||
|
.CopyToTemp = True,
|
||||||
|
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
||||||
|
.UnmapAfterCopy = True
|
||||||
|
}
|
||||||
|
Dim result = _documentPathHandler.ProcessDocumentPath(oFromFilename, options)
|
||||||
|
If result.Success AndAlso Not String.IsNullOrWhiteSpace(result.FinalPath) AndAlso File.Exists(result.FinalPath) Then
|
||||||
|
MyValidationLogger.Info($"✓ Zusatzdokument via Temp aufgelöst: [{result.FinalPath}]")
|
||||||
|
oResolvedFilename = result.FinalPath
|
||||||
|
Else
|
||||||
|
MyValidationLogger.Warn($"⚠️ Temp-Auflösung fehlgeschlagen für [{oFromFilename}]: {result.ErrorMessage} - Fallback auf Originalpfad")
|
||||||
|
oResolvedFilename = oFromFilename
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If File.Exists(oResolvedFilename) Then
|
||||||
|
MyValidationLogger.Debug($"Found additional document for export: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
|
||||||
oFileCount += 1
|
oFileCount += 1
|
||||||
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
||||||
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
||||||
"SELECT @Filename"
|
"SELECT @Filename"
|
||||||
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
||||||
oExtension = Path.GetExtension(oFromFilename)
|
oExtension = Path.GetExtension(oResolvedFilename)
|
||||||
If Not IsNothing(oExportFilename) Then
|
If Not IsNothing(oExportFilename) Then
|
||||||
If IsDBNull(oExportFilename) Then
|
If IsDBNull(oExportFilename) Then
|
||||||
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}")
|
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}")
|
||||||
@@ -8648,8 +8684,8 @@ Public Class frmValidator
|
|||||||
End If
|
End If
|
||||||
If oExportFilename <> String.Empty Then
|
If oExportFilename <> String.Empty Then
|
||||||
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
|
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
|
||||||
File.Copy(oFromFilename, oTargetPath)
|
File.Copy(oResolvedFilename, oTargetPath)
|
||||||
LOGGER.Info($"Additional file [{oFromFilename}] exported successfully to [{oTargetPath}]")
|
MyValidationLogger.Info($"Additional file [{oResolvedFilename}] exported successfully to [{oTargetPath}]")
|
||||||
oCount += 1
|
oCount += 1
|
||||||
Else
|
Else
|
||||||
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
|
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
|
||||||
@@ -8661,9 +8697,8 @@ Public Class frmValidator
|
|||||||
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
|
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
|
||||||
MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
||||||
End If
|
End If
|
||||||
'oFilenameOnly = Path.GetFileName(oFromFilename)
|
|
||||||
Else
|
Else
|
||||||
MyValidationLogger.Warn($"⚠️ Additional file for export not found: [{oFromFilename}] with DocID [{oDocID}]")
|
MyValidationLogger.Warn($"⚠️ Additional file for export not found: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
|
|||||||
Reference in New Issue
Block a user