global xml for demo
This commit is contained in:
@@ -2811,65 +2811,100 @@ namespace C4IT.DataHistoryProvider
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task ProtocollSupportCaseProtocollEntries(List<ProtocollEntryBase> supportCaseProtocollEntries, Guid ticketId, cF4sdWebRequestInfo requestInfo, int logDeep, CancellationToken token)
|
||||
{
|
||||
foreach (var protocollEntry in supportCaseProtocollEntries)
|
||||
{
|
||||
if (!(protocollEntry is QuickActionProtocollEntry entry))
|
||||
continue;
|
||||
|
||||
cCreateJournalEntryInfo _entry = null;
|
||||
switch (entry.ResultCode)
|
||||
{
|
||||
case -1:
|
||||
case 1:
|
||||
case 0:
|
||||
var entryType = entry.WasRunningOnAffectedDevice ? 20602 : 20601;
|
||||
_entry = new cCreateJournalEntryInfo()
|
||||
{
|
||||
Comments = "",
|
||||
ObjectId = ticketId,
|
||||
EntryType = entryType,
|
||||
Parameters = new List<cCreateJournalEntryInfo.Parameter>() { new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "result",
|
||||
Value = entry.HtmlContent ?? entry.MeasureValues ?? entry.ErrorMessage
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "quickActionName",
|
||||
Value = entry.Name
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "QuickActionId",
|
||||
Value = entry.Id
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "quickActionExecutionType",
|
||||
Value = entry.ExecutionTypeId
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "ExecutionTime",
|
||||
Value = entry.Time
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "AffectedDeviceName",
|
||||
Value = entry.AffectedDeviceName
|
||||
},}
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (_entry != null)
|
||||
{
|
||||
await CreateM42JournalAsync(_entry, requestInfo, logDeep + 1, token);
|
||||
if (token.IsCancellationRequested) return;
|
||||
}
|
||||
private async Task ProtocollSupportCaseProtocollEntries(List<ProtocollEntryBase> supportCaseProtocollEntries, Guid ticketId, cF4sdWebRequestInfo requestInfo, int logDeep, CancellationToken token)
|
||||
{
|
||||
foreach (var protocollEntry in supportCaseProtocollEntries.OrderBy(entry => entry.Time))
|
||||
{
|
||||
cCreateJournalEntryInfo _entry = null;
|
||||
if (protocollEntry is QuickActionProtocollEntry quickActionEntry)
|
||||
{
|
||||
switch (quickActionEntry.ResultCode)
|
||||
{
|
||||
case -1:
|
||||
case 1:
|
||||
case 0:
|
||||
var entryType = quickActionEntry.WasRunningOnAffectedDevice ? 20602 : 20601;
|
||||
_entry = new cCreateJournalEntryInfo()
|
||||
{
|
||||
Comments = "",
|
||||
ObjectId = ticketId,
|
||||
EntryType = entryType,
|
||||
Parameters = new List<cCreateJournalEntryInfo.Parameter>() { new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "result",
|
||||
Value = quickActionEntry.HtmlContent ?? quickActionEntry.MeasureValues ?? quickActionEntry.ErrorMessage
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "quickActionName",
|
||||
Value = quickActionEntry.Name
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "QuickActionId",
|
||||
Value = quickActionEntry.Id
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "quickActionExecutionType",
|
||||
Value = quickActionEntry.ExecutionTypeId
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "ExecutionTime",
|
||||
Value = quickActionEntry.Time
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "AffectedDeviceName",
|
||||
Value = quickActionEntry.AffectedDeviceName
|
||||
},}
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (protocollEntry is QuickTipStepProtocollEntry quickTipEntry)
|
||||
{
|
||||
_entry = new cCreateJournalEntryInfo()
|
||||
{
|
||||
Comments = "",
|
||||
ObjectId = ticketId,
|
||||
EntryType = 20605,
|
||||
Parameters = new List<cCreateJournalEntryInfo.Parameter>() { new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "result",
|
||||
Value = quickTipEntry.HtmlContent ?? quickTipEntry.AsciiContent
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "quickTipName",
|
||||
Value = quickTipEntry.Name
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "QuickTipId",
|
||||
Value = quickTipEntry.Id
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "ExecutionTime",
|
||||
Value = quickTipEntry.Time
|
||||
},
|
||||
new cCreateJournalEntryInfo.Parameter()
|
||||
{
|
||||
Name = "WasSuccessfull",
|
||||
Value = quickTipEntry.WasSuccessfull
|
||||
},}
|
||||
};
|
||||
}
|
||||
|
||||
if (_entry != null)
|
||||
{
|
||||
await CreateM42JournalAsync(_entry, requestInfo, logDeep + 1, token);
|
||||
if (token.IsCancellationRequested) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user