From d4a9eba6ab13fe71c34ec3f77e52acf087bbc154 Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Tue, 23 Apr 2024 14:53:40 +0200 Subject: [PATCH] =?UTF-8?q?MS=20=5F=20=20Service=20=C3=9Cberpr=C3=BCfen=20?= =?UTF-8?q?der=20Ordnerkonfiguration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinalizeDocument/FinalizeDocumentJob.vb | 41 +++--- EnvelopeGenerator.Form/frmMain.vb | 1 + .../EnvelopeGenerator.Service.vbproj | 3 + .../My Project/AssemblyInfo.vb | 4 +- EnvelopeGenerator.Service/Service.Designer.vb | 5 +- EnvelopeGenerator.Service/Service.resx | 123 ++++++++++++++++++ 6 files changed, 154 insertions(+), 23 deletions(-) create mode 100644 EnvelopeGenerator.Service/Service.resx diff --git a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb index a3bba2b3..9b4feb68 100644 --- a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb +++ b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb @@ -114,11 +114,7 @@ Namespace Jobs If Config.ExportPath_DMZ <> String.Empty Then Logger.Debug("RuninDMZ - Using ExportPath_DMZ: [{0}] - Overwrite ExportPath", Config.ExportPath_DMZ) Config.ExportPath = Config.ExportPath_DMZ - Else - Config.ExportPath = Config.ExportPath End If - Else - Config.ExportPath = Config.ExportPath End If Logger.Debug("ExportPath: [{0}]", Config.ExportPath) @@ -138,7 +134,10 @@ Namespace Jobs Cast(Of Integer). ToList() - Logger.Info("Found [{0}] completed envelopes.", oEnvelopeIds.Count) + If oEnvelopeIds.Count > 0 Then + Logger.Info("Found [{0}] completed envelopes.", oEnvelopeIds.Count) + End If + Dim oTotal As Integer = oEnvelopeIds.Count Dim oCurrent As Integer = 1 @@ -157,16 +156,16 @@ Namespace Jobs Logger.Debug("Loading Envelope Data..") Dim oEnvelopeData = GetEnvelopeData(oId) - If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) - Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!") - End If + If oEnvelopeData Is Nothing Then Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId) Throw New ArgumentNullException("EnvelopeData") End If - + If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then + oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) + Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!") + End If Logger.Debug("Burning Annotations to pdf ...") Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData) If oBurnedDocument Is Nothing Then @@ -242,7 +241,7 @@ Namespace Jobs Next - Logger.Info("Completed job {0} successfully!", JobId) + Logger.Debug("Completed job {0} successfully!", JobId) Catch ex As MergeDocumentException Logger.Warn("Certificate Document job failed at step: Merging documents!") Logger.Error(ex) @@ -366,22 +365,24 @@ Namespace Jobs End If End Function - Private Function BurnAnnotationsToPdf(pData As EnvelopeData) As Byte() - Dim pEnvelopeId = pData.EnvelopeId + Private Function BurnAnnotationsToPdf(pEnvelopeData As EnvelopeData) As Byte() + Dim pEnvelopeId = pEnvelopeData.EnvelopeId - Logger.Info("Burning [{0}] signatures", pData.AnnotationData.Count) - Dim oAnnotations = pData.AnnotationData + Logger.Info($"Burning [{pEnvelopeData.AnnotationData.Count}] signatures") + Dim oAnnotations = pEnvelopeData.AnnotationData Dim oInputPath = "" If My.Settings.RuninDMZ Then - oInputPath = pData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath) - Logger.Debug("Replaced Path in pData.DocumentPath!") + Logger.Debug("Replacing Path in pData.DocumentPath ...") + oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath) ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - oInputPath = pData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) - Logger.Debug("Replaced Path in pData.DocumentPath!") + Logger.Debug("Replacing Path in pData.DocumentPath ...") + oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) + Else + oInputPath = pEnvelopeData.DocumentPath End If - Logger.Info("Input path: [{0}]", oInputPath) + Logger.Info($"Input path: [{oInputPath}]") Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath) Dim split As String() = oDirectorySource.Split("\") ParentFolderUID = split(split.Length - 1) diff --git a/EnvelopeGenerator.Form/frmMain.vb b/EnvelopeGenerator.Form/frmMain.vb index d23053e5..902b88cc 100644 --- a/EnvelopeGenerator.Form/frmMain.vb +++ b/EnvelopeGenerator.Form/frmMain.vb @@ -351,5 +351,6 @@ Public Class frmMain Else BarCheckItem1.Checked = False End If + RefreshTimer.Start() End Sub End Class \ No newline at end of file diff --git a/EnvelopeGenerator.Service/EnvelopeGenerator.Service.vbproj b/EnvelopeGenerator.Service/EnvelopeGenerator.Service.vbproj index 54b8f039..20402aeb 100644 --- a/EnvelopeGenerator.Service/EnvelopeGenerator.Service.vbproj +++ b/EnvelopeGenerator.Service/EnvelopeGenerator.Service.vbproj @@ -156,6 +156,9 @@ ProjectInstaller.vb Designer + + Service.vb + diff --git a/EnvelopeGenerator.Service/My Project/AssemblyInfo.vb b/EnvelopeGenerator.Service/My Project/AssemblyInfo.vb index b8a34bf4..94cf9c00 100644 --- a/EnvelopeGenerator.Service/My Project/AssemblyInfo.vb +++ b/EnvelopeGenerator.Service/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/EnvelopeGenerator.Service/Service.Designer.vb b/EnvelopeGenerator.Service/Service.Designer.vb index e5973b23..aac70919 100644 --- a/EnvelopeGenerator.Service/Service.Designer.vb +++ b/EnvelopeGenerator.Service/Service.Designer.vb @@ -41,8 +41,11 @@ Partial Class Service ' Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() - components = New System.ComponentModel.Container() + ' + 'Service + ' Me.ServiceName = "EnvelopeGenerator.Service" + End Sub End Class diff --git a/EnvelopeGenerator.Service/Service.resx b/EnvelopeGenerator.Service/Service.resx new file mode 100644 index 00000000..e5858cc2 --- /dev/null +++ b/EnvelopeGenerator.Service/Service.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file