Compare commits
3 Commits
45359d3cab
...
4cb20bfb59
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cb20bfb59 | ||
|
|
409e4e375d | ||
|
|
ed02436dd6 |
@@ -5,18 +5,18 @@ Imports DigitalData.Modules.EDMI
|
|||||||
|
|
||||||
<TestClass()> Public Class PathTest
|
<TestClass()> Public Class PathTest
|
||||||
|
|
||||||
<TestMethod()> Public Sub TestMethod1()
|
'<TestMethod()> Public Sub TestMethod1()
|
||||||
Dim oLogConfig As New LogConfig(LogConfig.PathType.Temp)
|
' Dim oLogConfig As New LogConfig(LogConfig.PathType.Temp)
|
||||||
Dim oTempPath = System.IO.Path.GetTempPath()
|
' Dim oTempPath = System.IO.Path.GetTempPath()
|
||||||
Dim oPath As New DigitalData.Modules.EDMI.File.Path(oLogConfig, oTempPath)
|
' Dim oPath As New DigitalData.Modules.EDMI.File.Path(oLogConfig, oTempPath)
|
||||||
Dim oNow As DateTime = DateTime.Now
|
' Dim oNow As DateTime = DateTime.Now
|
||||||
Dim oYear = oNow.Year
|
' Dim oYear = oNow.Year
|
||||||
Dim oMonth = oNow.Month.ToString.PadLeft(2, "0")
|
' Dim oMonth = oNow.Month.ToString.PadLeft(2, "0")
|
||||||
Dim oDay = oNow.Day.ToString.PadLeft(2, "0")
|
' Dim oDay = oNow.Day.ToString.PadLeft(2, "0")
|
||||||
|
|
||||||
|
|
||||||
Assert.AreEqual(oPath.GetFullPath("TestDocumentType"), $"{oTempPath}EDMI\Active\TestDocumentType\{oYear}\{oMonth}\{oDay}")
|
' Assert.AreEqual(oPath.GetFullPath("TestDocumentType"), $"{oTempPath}EDMI\Active\TestDocumentType\{oYear}\{oMonth}\{oDay}")
|
||||||
Assert.AreEqual(oPath.GetArchivePath("TestDocumentType"), $"{oTempPath}EDMI\Archive\TestDocumentType\{oYear}\{oMonth}\{oDay}")
|
' Assert.AreEqual(oPath.GetArchivePath("TestDocumentType"), $"{oTempPath}EDMI\Archive\TestDocumentType\{oYear}\{oMonth}\{oDay}")
|
||||||
End Sub
|
'End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -27,7 +27,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
Public HISTORY_ID As Integer
|
Public HISTORY_ID As Integer
|
||||||
|
|
||||||
' List of allowed extensions for PDF/A Attachments
|
' List of allowed extensions for PDF/A Attachments
|
||||||
Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"xml", "docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
|
Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
|
||||||
|
|
||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
Private ReadOnly _logConfig As LogConfig
|
Private ReadOnly _logConfig As LogConfig
|
||||||
@@ -181,7 +181,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
_logger.Info("Start processing file {0}", oFile.Name)
|
_logger.Info("Start processing file {0}", oFile.Name)
|
||||||
|
|
||||||
Try
|
Try
|
||||||
oDocument = _zugferd.ExtractZUGFeRDFile(oFile.FullName)
|
oDocument = _zugferd.ExtractZUGFeRDFileWithGDPicture(oFile.FullName)
|
||||||
Catch ex As ZUGFeRDExecption
|
Catch ex As ZUGFeRDExecption
|
||||||
Select Case ex.ErrorType
|
Select Case ex.ErrorType
|
||||||
Case ZUGFeRDInterface.ErrorType.NoZugferd
|
Case ZUGFeRDInterface.ErrorType.NoZugferd
|
||||||
@@ -420,33 +420,25 @@ Public Class ImportZUGFeRDFiles
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
For Each oProperty In oCheckResult.ValidProperties
|
For Each oProperty In oCheckResult.ValidProperties
|
||||||
Dim oGroupCounterValue = Nothing
|
Dim oGroupCounterValue = oProperty.GroupCounter
|
||||||
|
|
||||||
If oProperty.GroupCounter > -1 Then
|
' If GroupCounter is -1, it means this is a default property that can only occur once.
|
||||||
oGroupCounterValue = oProperty.GroupCounter
|
' Set the actual inserted value to 0
|
||||||
End If
|
If oGroupCounterValue = -1 Then
|
||||||
If (oGroupCounterValue > 0) = False Then
|
oGroupCounterValue = 0
|
||||||
Dim oTerm As String
|
|
||||||
If IsNothing(oGroupCounterValue) Then
|
|
||||||
oTerm = "NOTHING"
|
|
||||||
Else
|
|
||||||
oTerm = oGroupCounterValue.ToString
|
|
||||||
End If
|
|
||||||
_logger.Warn($"[ImportZUGFeRDFiles] - oGroupCounterValue is not valid [{oTerm}]!!")
|
|
||||||
Else
|
|
||||||
Dim oCommand = $"INSERT INTO {oProperty.TableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oProperty.Description}', '{oProperty.Value}', {oGroupCounterValue})"
|
|
||||||
_logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oProperty.Description, oProperty.Value, oProperty.TableName)
|
|
||||||
' Insert into SQL Server
|
|
||||||
If oArgs.InsertIntoSQLServer = True Then
|
|
||||||
Dim oResult = _mssql.NewExecutenonQuery(oCommand)
|
|
||||||
If oResult = False Then
|
|
||||||
_logger.Warn($"SQL Command [{oCommand}] was not successful. Check the log.")
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' Insert into Firebird
|
|
||||||
_firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim oCommand = $"INSERT INTO {oProperty.TableName} (REFERENCE_GUID, ITEM_DESCRIPTION, ITEM_VALUE, GROUP_COUNTER) VALUES ('{oMessageId}', '{oProperty.Description}', '{oProperty.Value}', {oGroupCounterValue})"
|
||||||
|
_logger.Debug("Mapping Property [{0}] to value [{1}] . Will be inserted into table {2}", oProperty.Description, oProperty.Value, oProperty.TableName)
|
||||||
|
' Insert into SQL Server
|
||||||
|
If oArgs.InsertIntoSQLServer = True Then
|
||||||
|
Dim oResult = _mssql.NewExecutenonQuery(oCommand)
|
||||||
|
If oResult = False Then
|
||||||
|
_logger.Warn($"SQL Command [{oCommand}] was not successful. Check the log.")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' Insert into Firebird
|
||||||
|
_firebird.ExecuteNonQueryWithConnection(oCommand, oConnection, Firebird.TransactionMode.ExternalTransaction, oTransaction)
|
||||||
Next
|
Next
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.2.0.0")>
|
<Assembly: AssemblyVersion("1.2.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
Reference in New Issue
Block a user