diff --git a/server/biz/GlobalBizSettingsBiz.cs b/server/biz/GlobalBizSettingsBiz.cs index 6a265d5..80321bc 100644 --- a/server/biz/GlobalBizSettingsBiz.cs +++ b/server/biz/GlobalBizSettingsBiz.cs @@ -298,6 +298,7 @@ namespace Sockeye.Biz }//end of all customers iteration #region CASES + /* log.LogInformation("RFImport Cases"); //case projects to be tags List CaseProjectList = new List(); @@ -398,6 +399,7 @@ namespace Sockeye.Biz await ct.Database.CloseConnectionAsync(); } } + */ #endregion cases @@ -433,72 +435,23 @@ namespace Sockeye.Biz if (cust != null) l.CustomerId = cust.Id; l.DbId = jLicense["DBID"].Value(); + if (l.DbId == "na/v7" || l.DbId == "na/v7") + l.DbId = null; l.FetchCode = jLicense["DBID"].Value(); if (l.FetchCode == "na") l.FetchCode = null; l.FetchedOn = DateUtil.EpochToDateNullIsNull(jLicense["dtCreated"].Value()); - - - - - //------- - - l.Closed = DateUtil.EpochToDateNullIsNull(jLicenseListItem["dtClosed"].Value()); - //NOTE: closed in rockfish was the date at midnight in GMT - //so to be in the same day as here need to add a few hours, let's say 8 am for each so add 8 hours - if (l.Closed != null) - { - l.Closed = ((DateTime)l.Closed).AddHours(16); - } - - //fuckery to try to insert a at least semi close date when created date is missing - DateTime? dtTemp = DateUtil.EpochToDateNullIsNull(jLicenseListItem["dtCreated"].Value()); - if (dtTemp == null) - { - dtTemp = dtTempCreated; - } - else - { - dtTempCreated = (DateTime)dtTemp; - } - l.Created = (DateTime)dtTemp; - l.Name = jLicenseListItem["title"].Value(); - l.Notes = jLicenseListItem["notes"].Value(); - - var ver = jLicenseListItem["releaseVersion"].Value(); - if (!string.IsNullOrWhiteSpace(ver)) - l.Notes += $"\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nReleased on version:{ver}"; - - var releaseNotes = jLicenseListItem["releaseNotes"].Value(); - if (!string.IsNullOrWhiteSpace(releaseNotes)) - l.Notes += $"\nRelease notes:{releaseNotes}"; - - //Project name to tags - l.Tags.Add(CaseProjectList.FirstOrDefault(z => z.Id == jLicenseListItem["rfCaseProjectId"].Value()).Name.Replace("z_", "legacy-")); + l.FetchEmail = jLicense["email"].Value(); + l.Key = jLicense["key"].Value(); //priority to tags - l.Tags.Add($"{jLicenseListItem["priority"].Value()}-priority"); + if (l.FetchCode == null) + l.Tags.Add("raven"); + else + l.Tags.Add("v7"); - //check for attachments and just add as a note, don't bother with actual transfer of attachment, there aren't a lot and most are way in the past and not required for anything - //if needed in future can manually xfer it over from the rockfish.sqlite db directly using DB BRowser for sqlite which allows opening the blob from the rfcaseblob table and saving it - res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/{l.CaseId}/attachments"); - responseText = await res.Content.ReadAsStringAsync(); - var jAttachments = JObject.Parse(responseText); - if (jAttachments["attach"].Count() > 0) - { - l.Notes += "\n********\nRockfish attachments\n"; - foreach (JObject jAttachmentRecord in jAttachments["attach"]) - { - l.Notes += $"File: \"{jAttachmentRecord["name"].Value()}\", rfcaseblob table id: {jAttachmentRecord["id"].Value()}\n"; - - } - l.Notes += "\n********\n"; - } - - GZCaseBiz biz = GZCaseBiz.GetBiz(ct); + LicenseBiz biz = LicenseBiz.GetBiz(ct); await biz.CreateAsync(l); - - }// all licenses loop