ms
This commit is contained in:
@@ -75,6 +75,8 @@ Public Class clsPMRefresh
|
||||
Return True
|
||||
Else
|
||||
Logger.Info($"No run of PMRefresh as hour is not in timespan ({CInt(Now.Hour)} >= {oMinHour} And {CInt(Now.Hour)} < {oMaxHour})")
|
||||
Logger.Info($"Check TBPM_KONFIGURATION Column SERVICE_SCHEDULE")
|
||||
|
||||
End If
|
||||
Else
|
||||
Logger.Info($"No run of PMRefresh as today Is Not configured as RUN")
|
||||
@@ -97,6 +99,68 @@ Public Class clsPMRefresh
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Function GetSearchDocumentsDTviaSQL(ByVal pSQLCommand As String) As DataTable
|
||||
Dim dtresult As New DataTable
|
||||
dtresult.Columns.Add("DOC_ID", GetType(Integer))
|
||||
dtresult.Columns.Add("PATH", GetType(String))
|
||||
dtresult.Columns.Add("CREATED", GetType(String))
|
||||
|
||||
Try
|
||||
Dim oSQLRESULT As DataTable = _database.Return_Datatable(pSQLCommand)
|
||||
If IsNothing(oSQLRESULT) Then
|
||||
Return dtresult
|
||||
End If
|
||||
'If returnDT = True Then
|
||||
If oSQLRESULT.Rows.Count > 0 Then
|
||||
|
||||
For Each oDocRow As DataRow In oSQLRESULT.Rows
|
||||
Dim oDOC_ID As Int64
|
||||
Try
|
||||
oDOC_ID = oDocRow.Item("IDB_OBJ_ID")
|
||||
Catch ex As Exception
|
||||
Try
|
||||
oDOC_ID = oDocRow.Item("DocID")
|
||||
Catch ex1 As Exception
|
||||
Logger.Warn("Could not get DocID-Column: " & ex.Message)
|
||||
Return dtresult
|
||||
End Try
|
||||
End Try
|
||||
Dim oCreated
|
||||
Try
|
||||
oCreated = oDocRow.Item("ADDED_WHEN")
|
||||
Catch ex As Exception
|
||||
Try
|
||||
oCreated = oDocRow.Item("AddedWhen")
|
||||
Catch ex1 As Exception
|
||||
Logger.Warn($"(GetSearchDocumentsDTviaSQL)Could not get AddedWhen-Column: [{ex.Message}] - SQL-Command: [{pSQLCommand}]")
|
||||
Return dtresult
|
||||
End Try
|
||||
End Try
|
||||
|
||||
Dim oPath As String
|
||||
Try
|
||||
oPath = oDocRow.Item("DocRelativePath")
|
||||
Catch ex As Exception
|
||||
Try
|
||||
oPath = oDocRow.Item("FULL_FILENAME")
|
||||
Catch ex1 As Exception
|
||||
Logger.Warn($"(GetSearchDocumentsDTviaSQL)Could not get FULL_FILENAME-Column: [{ex.Message}] - SQL-Command: [{pSQLCommand}]")
|
||||
Return dtresult
|
||||
End Try
|
||||
End Try
|
||||
Logger.Debug($"Adding DocInfo {oDOC_ID.ToString}|{oPath}|{oCreated}")
|
||||
dtresult.Rows.Add(oDOC_ID, oPath, oCreated)
|
||||
Next
|
||||
dtresult.AcceptChanges()
|
||||
End If
|
||||
Return dtresult
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Logger.Warn($"Error Getting Docs via SLQ ({pSQLCommand})")
|
||||
Return dtresult
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Refresh_Data()
|
||||
Dim oStep As String
|
||||
Try
|
||||
@@ -134,7 +198,13 @@ Public Class clsPMRefresh
|
||||
'---------------------- Die Dateien auslesen ------------------------
|
||||
Dim oDTWM_Results As DataTable
|
||||
oStep = "4c"
|
||||
oDTWM_Results = _windream.GetSearchDocumentsDT(WD_Search, oConfigIDXName_DocID, oConfigIDXName_Created, True)
|
||||
If WD_Search.Contains("wdf") Or WD_Search.Contains("wdfx") Then
|
||||
oDTWM_Results = _windream.GetSearchDocumentsDT(WD_Search, oConfigIDXName_DocID, oConfigIDXName_Created, True)
|
||||
Else
|
||||
Logger.Debug("Search via SQL")
|
||||
oDTWM_Results = GetSearchDocumentsDTviaSQL(WD_Search)
|
||||
End If
|
||||
|
||||
oStep = "4d"
|
||||
Dim oDocCount As Integer = 0
|
||||
If IsNothing(oDTWM_Results) Then
|
||||
|
||||
Reference in New Issue
Block a user