Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ISO_ADM_Exporter/output/0/TASKDATA/TASKDATA.XML
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ISO11783_TaskData VersionMajor="4" VersionMinor="2" ManagementSoftwareManufacturer="AgGateway" ManagementSoftwareVersion="1.0" TaskControllerManufacturer="" TaskControllerVersion="" DataTransferOrigin="1">
<!--Export created 4/27/2025 9:44:32 PM-->
<!--Export created 5/1/2025 10:45:19 PM-->
<PGP A="PGP1" B="CropType" C="2" />
<CTP A="CTP1" B="Soybeans" C="PGP1">
<CVT A="CVT1" B="3230Enlist-E22388816X" C="PDT1" />
Expand Down
2 changes: 1 addition & 1 deletion ISO_ADM_Exporter/output/1/TASKDATA/TASKDATA.XML
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ISO11783_TaskData VersionMajor="4" VersionMinor="2" ManagementSoftwareManufacturer="AgGateway" ManagementSoftwareVersion="1.0" TaskControllerManufacturer="" TaskControllerVersion="" DataTransferOrigin="1">
<!--Export created 4/27/2025 9:44:32 PM-->
<!--Export created 5/1/2025 10:45:20 PM-->
<PGP A="PGP1" B="CropType" C="2" />
<CTP A="CTP1" B="Corn" C="PGP1">
<CVT A="CVT1" B="CP2585-769MXJ4JX" C="PDT1" />
Expand Down
32 changes: 0 additions & 32 deletions ShippedItemInstancePlugin/Document.cs

This file was deleted.

8 changes: 4 additions & 4 deletions ShippedItemInstancePlugin/Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ private List<ContextItem> CreateProductInstanceSpecificContextItems(ShippedItemI
contextItem.NestedItems.Add(CreateContextItem("ShipmentId", shippedItemInstance.ShipmentReference?.Id));

// semi-trailer Id
if (shippedItemInstance.ShipmentReference.ShipUnitReference.Id.Content != null &&
shippedItemInstance.ShipmentReference.ShipUnitReference.Id.TypeCode != null &&
shippedItemInstance.ShipmentReference.ShipUnitReference.TypeCode != null)
if (shippedItemInstance.ShipmentReference?.ShipUnitReference?.Id?.Content != null &&
shippedItemInstance.ShipmentReference?.ShipUnitReference?.Id?.TypeCode != null &&
shippedItemInstance.ShipmentReference?.ShipUnitReference?.TypeCode != null)
{
contextItem.NestedItems.Add(CreateContextItem("ShippingContainer.Type",
shippedItemInstance.ShipmentReference.ShipUnitReference.TypeCode));
Expand All @@ -338,7 +338,7 @@ private List<ContextItem> CreateProductInstanceSpecificContextItems(ShippedItemI
items.Add(contextItem);

// Item.Retailed is the link to AGIIS
if (shippedItemInstance.Item.RelatedId?.Count > 0)
if (shippedItemInstance.Item?.RelatedId?.Count > 0)
{
contextItem = CreateRelatedIdsContextItem(shippedItemInstance);
if (contextItem.NestedItems.Count > 0)
Expand Down
3 changes: 3 additions & 0 deletions ShippedItemInstancePlugin/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public Properties GetProperties(string dataPath)
// Console.WriteLine(jsonText);

List<ShippedItemInstance> ShippedItems = JsonConvert.DeserializeObject<List<ShippedItemInstance>>(jsonText);

if (ShippedItems != null)
{
//Each document will import as individual ApplicationDataModel
Expand All @@ -80,11 +81,13 @@ public Properties GetProperties(string dataPath)
}
else
{

errors.Add(new Error(null, $"Importing {fileName}", "Couldn't parse ShippedItemInstances", null));
}
}
catch (Exception ex)
{
_logger.LogError("Parse Error" + ex);
errors.Add(new Error(null, $"Exception Importing {fileName}", ex.Message, ex.StackTrace));
}

Expand Down
Loading