This commit is contained in:
2021-08-31 17:05:31 +00:00
parent 710868a25c
commit bc3f16e1db
2 changed files with 26 additions and 13 deletions

View File

@@ -161,7 +161,7 @@ namespace AyaNova.PlugIn.V8
ImportTag = util.NormalizeTag(dOpt.Tags); ImportTag = util.NormalizeTag(dOpt.Tags);
util.HTTPCLIENT_TIMEOUT_SECONDS = dOpt.HTTPTimeOut; util.HTTPCLIENT_TIMEOUT_SECONDS = dOpt.HTTPTimeOut;
util.InitClient(); util.InitClient();
//here because we logged in fine and can proceed //here because we logged in fine and can proceed
//MessageBox.Show("Login successful! JWT is " + util.JWT); //MessageBox.Show("Login successful! JWT is " + util.JWT);
@@ -377,7 +377,7 @@ namespace AyaNova.PlugIn.V8
private bool V7UseInventory = false; private bool V7UseInventory = false;
private List<long> Allv8WarehouseIds = new List<long>(); private List<long> Allv8WarehouseIds = new List<long>();
private const long AYANOVA_SERVER_MAX_ATTACH_SIZE_LIMIT=10737418241; private const long AYANOVA_SERVER_MAX_ATTACH_SIZE_LIMIT = 10737418241;
private long SmallestFileUploadRejectedAsTooBig = AYANOVA_SERVER_MAX_ATTACH_SIZE_LIMIT; private long SmallestFileUploadRejectedAsTooBig = AYANOVA_SERVER_MAX_ATTACH_SIZE_LIMIT;
private string MaxFileSizeInfo(long lSize) private string MaxFileSizeInfo(long lSize)
@@ -416,7 +416,7 @@ namespace AyaNova.PlugIn.V8
//MIGRATE MODE //MIGRATE MODE
progress.Append("Setting v8 Server State to 'Migrate Mode'"); progress.Append("Setting v8 Server State to 'Migrate Mode'");
await util.PostAsync("server-state", "{\"serverState\":\"MigrateMode\"}"); await util.PostAsync("server-state", "{\"serverState\":\"MigrateMode\"}");
//delay to allow migrate mode to take effect //delay to allow migrate mode to take effect
//this is a result of pm's generating in a loop at server causing issues with erasure //this is a result of pm's generating in a loop at server causing issues with erasure
//this delay should not need to be more time than it takes for a single PM to generate into a workorder //this delay should not need to be more time than it takes for a single PM to generate into a workorder
@@ -448,7 +448,7 @@ namespace AyaNova.PlugIn.V8
//ERASE DB //ERASE DB
progress.Append("Erasing AyaNova 8 data"); progress.Append("Erasing AyaNova 8 data");
var a = await util.PostAsync("license/permanently-erase-all-data", "\"I understand\""); var a = await util.PostAsync("license/permanently-erase-all-data", "\"I understand\"");
@@ -550,10 +550,10 @@ namespace AyaNova.PlugIn.V8
if (ExceptionDuringMigrate != null) if (ExceptionDuringMigrate != null)
{ {
progress.Append("ERROR, During operation:"); progress.Append("ERROR, During operation:");
progress.Append(progress.LastOp + ", " + progress.LastSubOp); progress.Append(progress.LastOp + ", " + progress.LastSubOp);
progress.Append("Export failed with error:"); progress.Append("Export failed with error:");
progress.Append(ExceptionDuringMigrate.Message); progress.Append(ExceptionDuringMigrate.Message);
progress.Append("StackTrace:" ); progress.Append("StackTrace:");
progress.Append(ExceptionDuringMigrate.StackTrace); progress.Append(ExceptionDuringMigrate.StackTrace);
if (ExceptionDuringMigrate.InnerException != null) if (ExceptionDuringMigrate.InnerException != null)
{ {
@@ -3110,6 +3110,17 @@ namespace AyaNova.PlugIn.V8
dynamic d = new JObject(); dynamic d = new JObject();
progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber); progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber);
if (c.FromPMID != Guid.Empty)
{
d.fromPMId = await Getv7v8IdMapNullOk(c.FromPMID, RootObjectTypes.WorkorderPreventiveMaintenance, false, true);
}
if (c.FromQuoteID != Guid.Empty)
{
d.fromQuoteId = await Getv7v8IdMapNullOk(c.FromQuoteID, RootObjectTypes.WorkorderPreventiveMaintenance, false, true);
}
d.serial = c.WorkorderService.ServiceNumber; d.serial = c.WorkorderService.ServiceNumber;
if (c.WorkorderService.ServiceNumber > _highestWorkOrderNumberExported) if (c.WorkorderService.ServiceNumber > _highestWorkOrderNumberExported)
_highestWorkOrderNumberExported = c.WorkorderService.ServiceNumber; _highestWorkOrderNumberExported = c.WorkorderService.ServiceNumber;
@@ -3717,6 +3728,7 @@ namespace AyaNova.PlugIn.V8
var rMainObject = await util.PostAsync("quote", d); var rMainObject = await util.PostAsync("quote", d);
long RavenId = util.IdFromResponse(rMainObject); long RavenId = util.IdFromResponse(rMainObject);
Addv7v8IdMap(c.ID, RavenId); Addv7v8IdMap(c.ID, RavenId);
Addv7v8IdMap(c.WorkorderQuote.ID, RavenId);//some things need this id to link to
d = rMainObject.ObjectResponse["data"]; d = rMainObject.ObjectResponse["data"];
@@ -4085,6 +4097,7 @@ namespace AyaNova.PlugIn.V8
long RavenId = util.IdFromResponse(rMainObject); long RavenId = util.IdFromResponse(rMainObject);
Addv7v8IdMap(c.ID, RavenId); Addv7v8IdMap(c.ID, RavenId);
Addv7v8IdMap(c.WorkorderPreventiveMaintenance.ID, RavenId);//some things need this id to link to
d = rMainObject.ObjectResponse["data"]; d = rMainObject.ObjectResponse["data"];
@@ -5532,10 +5545,10 @@ namespace AyaNova.PlugIn.V8
progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize)); progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize));
if (IsDuplicatev7v8IdMapItem(i.LT_O_AyaFile.Value, i.LT_O_AyaFile.Display, progress)) continue; if (IsDuplicatev7v8IdMapItem(i.LT_O_AyaFile.Value, i.LT_O_AyaFile.Display, progress)) continue;
if (af.FileSize > SmallestFileUploadRejectedAsTooBig) if (af.FileSize > SmallestFileUploadRejectedAsTooBig)
{ {
progress.Append("WIKI Attachment file " + i.LT_O_AyaFile.Display + " too large (" + AyaBizUtils.FileSizeDisplay(af.FileSize) + "). " + MaxFileSizeInfo(af.FileSize)); progress.Append("WIKI Attachment file " + i.LT_O_AyaFile.Display + " too large (" + AyaBizUtils.FileSizeDisplay(af.FileSize) + "). " + MaxFileSizeInfo(af.FileSize));
continue; continue;
} }
@@ -5599,7 +5612,7 @@ namespace AyaNova.PlugIn.V8
try try
{ {
a=await util.PostFormDataAsync("attachment", formDataContent); a = await util.PostFormDataAsync("attachment", formDataContent);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<!-- Development test MSSQL DB --> <!-- Development test MSSQL DB
<ConnectionType>DataBase</ConnectionType> <ConnectionType>DataBase</ConnectionType>
<DataBaseType>MSSQL</DataBaseType> <DataBaseType>MSSQL</DataBaseType>
<DataBaseConnectionString>Server=DEV-V7-LAPTOP\SQLEXPRESS;initial catalog=AyaNova;User Id=sa; Password = abraxis;</DataBaseConnectionString> <DataBaseConnectionString>Server=DEV-V7-LAPTOP\SQLEXPRESS;initial catalog=AyaNova;User Id=sa; Password = abraxis;</DataBaseConnectionString>
-->
<!-- DEVELOPMENT embedded Firebird database <!-- DEVELOPMENT embedded Firebird database -->
<ConnectionType>DataBase</ConnectionType> <ConnectionType>DataBase</ConnectionType>
<DataBaseType>FireBird</DataBaseType> <DataBaseType>FireBird</DataBaseType>
<DataBaseConnectionString>ServerType=1;DataBase=C:\data\AyaNova\database\AYANOVA.fdb;Dialect=3;</DataBaseConnectionString> <DataBaseConnectionString>ServerType=1;DataBase=C:\data\AyaNova\database\AYANOVA.fdb;Dialect=3;</DataBaseConnectionString>
-->
<!-- DataPortal <!-- DataPortal