This commit is contained in:
@@ -131,7 +131,7 @@ namespace Sockeye.Biz
|
||||
|
||||
public async Task ImportRockfish(AyContext ct, ILogger log)
|
||||
{
|
||||
log.LogInformation("Start import from rockfish, authenticating");
|
||||
log.LogInformation("Start import from rockfish, authenticating");
|
||||
//Authenticate to rockfish
|
||||
//string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
|
||||
string URL_ROCKFISH = "https://rockfish.ayanova.com/";
|
||||
@@ -175,7 +175,7 @@ namespace Sockeye.Biz
|
||||
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/list");
|
||||
responseText = await res.Content.ReadAsStringAsync();
|
||||
var jaCustomerList = JArray.Parse(responseText);
|
||||
log.LogInformation("RFImport customers");
|
||||
log.LogInformation("RFImport customers");
|
||||
foreach (JObject jCustomerListItem in jaCustomerList)
|
||||
{
|
||||
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/{jCustomerListItem["id"].Value<long>()}");
|
||||
@@ -300,7 +300,7 @@ namespace Sockeye.Biz
|
||||
|
||||
|
||||
#region CASES
|
||||
log.LogInformation("RFImport Cases");
|
||||
log.LogInformation("RFImport Cases");
|
||||
//case projects to be tags
|
||||
List<NameIdItem> CaseProjectList = new List<NameIdItem>();
|
||||
{
|
||||
@@ -327,6 +327,11 @@ namespace Sockeye.Biz
|
||||
var g = new GZCase();
|
||||
g.CaseId = jRFCase["id"].Value<long>();
|
||||
g.Closed = DateUtil.EpochToDateNullIsNull(jRFCase["dtClosed"].Value<long?>());
|
||||
//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(g.Closed!=null){
|
||||
g.Closed=((DateTime)g.Closed).AddHours(8);
|
||||
}
|
||||
|
||||
//fuckery to try to insert a at least semi close date when created date is missing
|
||||
DateTime? dtTemp = DateUtil.EpochToDateNullIsNull(jRFCase["dtCreated"].Value<long?>());
|
||||
@@ -360,24 +365,25 @@ namespace Sockeye.Biz
|
||||
//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/{g.CaseId}/attachments");
|
||||
responseText = await res.Content.ReadAsStringAsync();
|
||||
var jaAttachments = JArray.Parse(responseText);
|
||||
if (jaAttachments.Count() > 0)
|
||||
var jAttachments = JObject.Parse(responseText);
|
||||
if (jAttachments["attach"].Count() > 0)
|
||||
{
|
||||
g.Notes += "\n********\nRockfish attachments\n";
|
||||
foreach (JObject jAttachmentRecord in jaAttachments["attach"])
|
||||
g.Notes += "\n********\nRockfish attachments\n";
|
||||
foreach (JObject jAttachmentRecord in jAttachments["attach"])
|
||||
{
|
||||
g.Notes += $"FileName: \"{jAttachmentRecord["name"].Value<string>()}\", rfcaseblob table id: {jAttachmentRecord["id"].Value<long>()}";
|
||||
g.Notes += $"File: \"{jAttachmentRecord["name"].Value<string>()}\", rfcaseblob table id: {jAttachmentRecord["id"].Value<long>()}\n";
|
||||
|
||||
}
|
||||
g.Notes += "\n********\n";
|
||||
g.Notes += "\n********\n";
|
||||
}
|
||||
|
||||
GZCaseBiz biz = GZCaseBiz.GetBiz(ct);
|
||||
await biz.CreateAsync(g);
|
||||
|
||||
//attachments example
|
||||
//attachments example 86400000
|
||||
// /api/rfcase/4360/attachments
|
||||
//{"dlkey":"ZFkAUpo1L0Gi3Q9aO5szkA","attach":[{"id":259,"name":"desired weight calcs.txt"}]}
|
||||
//{"dlkey":"iR6ncD70CkzkozyT0otA","attach":[]}
|
||||
|
||||
|
||||
|
||||
|
||||
16
todo.txt
16
todo.txt
@@ -4,6 +4,22 @@ import trial requests
|
||||
import licenses
|
||||
import all vendor data packets from shareit into purchases
|
||||
|
||||
- direct open a case by case number like workorder
|
||||
(id's differ so it isn't easy to just open a case in the url)
|
||||
|
||||
bugs:
|
||||
search:
|
||||
Exception data:
|
||||
Severity: ERROR
|
||||
SqlState: 42703
|
||||
MessageText: column "name" does not exist
|
||||
InternalPosition: 8
|
||||
InternalQuery: SELECT name FROM apurchase WHERE id = '732'
|
||||
Where: PL/pgSQL function aygetname(bigint,integer,integer) line 53 at EXECUTE
|
||||
File: parse_relation.c
|
||||
Line: 3599
|
||||
Routine: errorMissingColumn
|
||||
|
||||
|
||||
DTR
|
||||
License routes test locally and ensure works for v7 and v8
|
||||
|
||||
Reference in New Issue
Block a user