This commit is contained in:
@@ -252,59 +252,30 @@ namespace AyaNova.Biz
|
|||||||
//Other job handlers here...
|
//Other job handlers here...
|
||||||
|
|
||||||
|
|
||||||
private async Task ImportTagList(string entryStartsWith, Guid jobId, Dictionary<Guid, string> tagDictionary, string importFileName, List<string> zipEntries)
|
private void ImportTagList(string entryStartsWith, Guid jobId, Dictionary<Guid, string> tagDictionary, string importFileName, List<string> zipEntries)
|
||||||
{
|
{
|
||||||
var zipObjectList = zipEntries.Where(m => m.StartsWith(entryStartsWith)).ToList();
|
var zipObjectList = zipEntries.Where(m => m.StartsWith(entryStartsWith)).ToList();
|
||||||
long importCount = 0;
|
long importCount = 0;
|
||||||
long notImportCount = 0;
|
|
||||||
if (zipObjectList.Count > 0)
|
if (zipObjectList.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
JobsBiz.LogJob(jobId, $"Starting import to TAGS of {entryStartsWith} objects", ct);
|
JobsBiz.LogJob(jobId, $"Starting import to TAGS of {entryStartsWith} objects", ct);
|
||||||
|
|
||||||
|
|
||||||
var jList = FileUtil.ZipGetUtilityArchiveEntriesAsJsonObjects(zipObjectList, importFileName);
|
var jList = FileUtil.ZipGetUtilityArchiveEntriesAsJsonObjects(zipObjectList, importFileName);
|
||||||
|
|
||||||
//IImportAyaNova7Object o = (IImportAyaNova7Object)BizObjectFactory.GetBizObject(importerType, ct);
|
|
||||||
|
|
||||||
foreach (JObject j in jList)
|
foreach (JObject j in jList)
|
||||||
{
|
{
|
||||||
bool bImportSucceeded = false;
|
|
||||||
//some new types can import multiple old types and it might matter which is which to the importer
|
|
||||||
//so tag it with the original type
|
|
||||||
//------
|
|
||||||
j.Add("V7_TYPE", JToken.FromObject(entryStartsWith));
|
|
||||||
j.Add("IMPORT_TASK", JToken.FromObject(importTask));
|
|
||||||
|
|
||||||
bImportSucceeded = await o.ImportV7Async(j, importMap, jobId);
|
//------- IMPORT OBJECTS NAME AND ID TO LIST ------
|
||||||
if (bImportSucceeded)
|
|
||||||
importCount++;
|
|
||||||
else
|
//-----------------------------------------------
|
||||||
notImportCount++;
|
importCount++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (importCount > 0)
|
if (importCount > 0)
|
||||||
{
|
{
|
||||||
if (importTask != "main")
|
JobsBiz.LogJob(jobId, $"Successfully imported as TAGS {importCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct);
|
||||||
{
|
|
||||||
JobsBiz.LogJob(jobId, $"Successfully ran import subtask {importTask} on {importCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
JobsBiz.LogJob(jobId, $"Successfully imported {importCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (notImportCount > 0)
|
|
||||||
{
|
|
||||||
if (importTask != "main")
|
|
||||||
{
|
|
||||||
JobsBiz.LogJob(jobId, $"Failed to run import subtask {importTask} on {notImportCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
JobsBiz.LogJob(jobId, $"Did not import {notImportCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user