fix: use matrix42 journal service interface
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
<host xmlns="urn:m42/host.config">
|
||||
<modules>
|
||||
<module assembly="Matrix42.DataLayer.Persistence" />
|
||||
<module assembly="Matrix42.Services.WebApi" />
|
||||
<module assembly="Matrix42.ServiceRepository.BizLogic" />
|
||||
<module assembly="Matrix42.Pandora.ServiceStore" />
|
||||
<module assembly="Matrix42.Pandora.Persistence" />
|
||||
<module assembly="Matrix42.Pandora.BizLogic" />
|
||||
<module assembly="Matrix42.StorageService.BizLogic" />
|
||||
<module assembly="update4u.SPS.ComplianceRules.BizLogic" />
|
||||
<module assembly="Matrix42.ServiceManager.BizLogic" />
|
||||
</modules>
|
||||
<sections></sections>
|
||||
</host>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<M42ExtensionId>6673a25d-33d6-4072-91d9-abed4be1a966</M42ExtensionId>
|
||||
<M42AssemblyPattern>C4ITF4SD*.*</M42AssemblyPattern>
|
||||
<M42PackageVersion>1.4.0.19</M42PackageVersion>
|
||||
<M42PackageVersion>1.4.0.20</M42PackageVersion>
|
||||
<M42BuildPackage>true</M42BuildPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<HintPath>M42Libraries\26.1\Matrix42.Contracts.Platform.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Matrix42.BizLogic.Journal">
|
||||
<HintPath>M42Libraries\26.1\Matrix42.BizLogic.Journal.dll</HintPath>
|
||||
<Reference Include="Matrix42.Contracts.ServiceManagement">
|
||||
<HintPath>M42Libraries\26.1\Matrix42.Contracts.ServiceManagement.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Matrix42.Hosting.Contracts">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using C4IT.F4SDM;
|
||||
using C4IT.FASD.Base;
|
||||
using C4IT.Logging;
|
||||
using Matrix42.BizLogic.Common.Journal;
|
||||
using Matrix42.Common;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@@ -1409,29 +1408,20 @@ namespace C4IT.F4SD
|
||||
{
|
||||
await Task.Delay(0);
|
||||
List<cTicketJournalItem> journalEntries = new List<cTicketJournalItem>();
|
||||
var entries = JournalManager.GetObjectEntries(
|
||||
activityEOID,
|
||||
false,
|
||||
null,
|
||||
0,
|
||||
50,
|
||||
false,
|
||||
"<a href=\"#\" class=\"mx-object-journal--link {0} {1}\">{2}</a>",
|
||||
120);
|
||||
|
||||
LogEntry($"{entries.Count} Journal entries found for ObjectID={activityEOID}", LogLevels.Debug);
|
||||
for (int i = 0; i < entries.Count; i++)
|
||||
var entries = F4SDM42WebApiController.defaultInstance.GetJournalService().GetJournalList(activityEOID, false, 0, 50, "<a href=\"#\" class=\"mx-object-journal--link {0} {1}\">{2}</a>", 120);
|
||||
LogEntry($"{entries.Length} Journal entries found for ObjectID={activityEOID}", LogLevels.Debug);
|
||||
for (int i = 0; i < entries.Length; i++)
|
||||
{
|
||||
var item = entries[i];
|
||||
var text = item.Comments ?? string.Empty;
|
||||
Matrix42.Contracts.Platform.Data.JournalEntryInfo item = entries[i];
|
||||
var text = item.Text ?? string.Empty;
|
||||
var createdDate = item.CreatedDate ?? DateTime.MinValue;
|
||||
|
||||
LogEntry($"Journal entry {i + 1}/{entries.Count}: ID={item.Id}, CreatedDate={createdDate}, CreatedBy={item.CreatorName}, Header={item.Header}", LogLevels.Debug);
|
||||
LogEntry($"Journal entry {i + 1}/{entries.Length}: ID={item.Id}, CreatedDate={createdDate}, CreatedBy={item.Creator}, Header={item.Header}", LogLevels.Debug);
|
||||
journalEntries.Add(new cTicketJournalItem()
|
||||
{
|
||||
JournalId = item.Id,
|
||||
ActivityObjectId = activityEOID,
|
||||
CreatedBy = item.CreatorName,
|
||||
CreatedBy = item.Creator,
|
||||
CreationDate = createdDate,
|
||||
DescriptionHtml = text,
|
||||
Description = string.IsNullOrEmpty(text) ? string.Empty : Matrix42.Common.Html.HtmlConverter.ConvertHtmlToPlainText(text),
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
||||
|
||||
using Matrix42.Common;
|
||||
using Matrix42.Contracts.Common.Security;
|
||||
using Matrix42.Contracts.ServiceManagement.ServiceContracts;
|
||||
using Matrix42.Hosting.Contracts;
|
||||
using Matrix42.Pandora.Contracts;
|
||||
using Matrix42.Persistence.Contracts;
|
||||
@@ -89,6 +90,11 @@ namespace C4IT.F4SD
|
||||
throw new InvalidOperationException($"Required Matrix42 service is not registered: {typeof(T).FullName}");
|
||||
}
|
||||
|
||||
internal IJournalService GetJournalService()
|
||||
{
|
||||
return GetRequiredService<IJournalService>();
|
||||
}
|
||||
|
||||
[Route("getDirectLinkCreateTicket"), HttpGet]
|
||||
public async Task<F4SDHelperService.DirectLink> getDirectLinkCreateTicket(string sid = "", string assetname = "")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user