From 1f331157031dba6650390f7d77a0ebf86fda3270 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 6 Dec 2018 22:39:16 +0000 Subject: [PATCH] --- server/AyaNova/biz/ImportAyaNova7Biz.cs | 47 +++++-------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/server/AyaNova/biz/ImportAyaNova7Biz.cs b/server/AyaNova/biz/ImportAyaNova7Biz.cs index fe5acf69..776db28b 100644 --- a/server/AyaNova/biz/ImportAyaNova7Biz.cs +++ b/server/AyaNova/biz/ImportAyaNova7Biz.cs @@ -252,59 +252,30 @@ namespace AyaNova.Biz //Other job handlers here... - private async Task ImportTagList(string entryStartsWith, Guid jobId, Dictionary tagDictionary, string importFileName, List zipEntries) + private void ImportTagList(string entryStartsWith, Guid jobId, Dictionary tagDictionary, string importFileName, List zipEntries) { var zipObjectList = zipEntries.Where(m => m.StartsWith(entryStartsWith)).ToList(); long importCount = 0; - long notImportCount = 0; + if (zipObjectList.Count > 0) { - JobsBiz.LogJob(jobId, $"Starting import to TAGS of {entryStartsWith} objects", ct); - - var jList = FileUtil.ZipGetUtilityArchiveEntriesAsJsonObjects(zipObjectList, importFileName); - //IImportAyaNova7Object o = (IImportAyaNova7Object)BizObjectFactory.GetBizObject(importerType, ct); - 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); - if (bImportSucceeded) - importCount++; - else - notImportCount++; + //------- IMPORT OBJECTS NAME AND ID TO LIST ------ + + + //----------------------------------------------- + importCount++; + } if (importCount > 0) { - if (importTask != "main") - { - 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); - } + JobsBiz.LogJob(jobId, $"Successfully imported as TAGS {importCount.ToString()} of {zipObjectList.Count.ToString()} {entryStartsWith} objects", ct); } } }