This commit is contained in:
@@ -131,7 +131,7 @@ namespace Sockeye.Biz
|
|||||||
|
|
||||||
public async Task ImportRockfish(AyContext ct, ILogger log)
|
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
|
//Authenticate to rockfish
|
||||||
//string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
|
//string sUrl = $"{LICENSE_SERVER_URL_ROCKFISH}rvr";
|
||||||
string URL_ROCKFISH = "https://rockfish.ayanova.com/";
|
string URL_ROCKFISH = "https://rockfish.ayanova.com/";
|
||||||
@@ -175,7 +175,7 @@ namespace Sockeye.Biz
|
|||||||
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/list");
|
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/list");
|
||||||
responseText = await res.Content.ReadAsStringAsync();
|
responseText = await res.Content.ReadAsStringAsync();
|
||||||
var jaCustomerList = JArray.Parse(responseText);
|
var jaCustomerList = JArray.Parse(responseText);
|
||||||
log.LogInformation("RFImport customers");
|
log.LogInformation("RFImport customers");
|
||||||
foreach (JObject jCustomerListItem in jaCustomerList)
|
foreach (JObject jCustomerListItem in jaCustomerList)
|
||||||
{
|
{
|
||||||
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/{jCustomerListItem["id"].Value<long>()}");
|
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/{jCustomerListItem["id"].Value<long>()}");
|
||||||
@@ -300,7 +300,7 @@ namespace Sockeye.Biz
|
|||||||
|
|
||||||
|
|
||||||
#region CASES
|
#region CASES
|
||||||
log.LogInformation("RFImport Cases");
|
log.LogInformation("RFImport Cases");
|
||||||
//case projects to be tags
|
//case projects to be tags
|
||||||
List<NameIdItem> CaseProjectList = new List<NameIdItem>();
|
List<NameIdItem> CaseProjectList = new List<NameIdItem>();
|
||||||
{
|
{
|
||||||
@@ -327,6 +327,11 @@ namespace Sockeye.Biz
|
|||||||
var g = new GZCase();
|
var g = new GZCase();
|
||||||
g.CaseId = jRFCase["id"].Value<long>();
|
g.CaseId = jRFCase["id"].Value<long>();
|
||||||
g.Closed = DateUtil.EpochToDateNullIsNull(jRFCase["dtClosed"].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
|
//fuckery to try to insert a at least semi close date when created date is missing
|
||||||
DateTime? dtTemp = DateUtil.EpochToDateNullIsNull(jRFCase["dtCreated"].Value<long?>());
|
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
|
//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");
|
res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/{g.CaseId}/attachments");
|
||||||
responseText = await res.Content.ReadAsStringAsync();
|
responseText = await res.Content.ReadAsStringAsync();
|
||||||
var jaAttachments = JArray.Parse(responseText);
|
var jAttachments = JObject.Parse(responseText);
|
||||||
if (jaAttachments.Count() > 0)
|
if (jAttachments["attach"].Count() > 0)
|
||||||
{
|
{
|
||||||
g.Notes += "\n********\nRockfish attachments\n";
|
g.Notes += "\n********\nRockfish attachments\n";
|
||||||
foreach (JObject jAttachmentRecord in jaAttachments["attach"])
|
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);
|
GZCaseBiz biz = GZCaseBiz.GetBiz(ct);
|
||||||
await biz.CreateAsync(g);
|
await biz.CreateAsync(g);
|
||||||
|
|
||||||
//attachments example
|
//attachments example 86400000
|
||||||
// /api/rfcase/4360/attachments
|
// /api/rfcase/4360/attachments
|
||||||
//{"dlkey":"ZFkAUpo1L0Gi3Q9aO5szkA","attach":[{"id":259,"name":"desired weight calcs.txt"}]}
|
//{"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 licenses
|
||||||
import all vendor data packets from shareit into purchases
|
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
|
DTR
|
||||||
License routes test locally and ensure works for v7 and v8
|
License routes test locally and ensure works for v7 and v8
|
||||||
|
|||||||
Reference in New Issue
Block a user