diff --git a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java index 4bed47d..e5af7de 100644 --- a/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java +++ b/Toolbox Migration/src/com/bayer/edam/excelimport/ToolboxImportFileGenerator.java @@ -299,19 +299,19 @@ public class ToolboxImportFileGenerator { brandMap.put("Wolverine PowerPak", "Wolverine Advanced"); brandMap.put("Yield Shield", "TEMPORARY"); - // TODO to be checked by business + // XXX additional mappings brandMap.put("NULL", "TEMPORARY"); // Bayer/General? brandMap.put("131-Kote", "TEMPORARY"); - brandMap.put("Cotgard", "TEMPORARY"); - brandMap.put("Fluency Agent/Fluency Agent Advanced", "TEMPORARY"); // --> set both brands via special rule brandMap.put("ICP - Food Chain", "Bayer/General"); brandMap.put("ICP - Fruit", "Bayer/General"); brandMap.put("ICP-Programs", "Bayer/General"); brandMap.put("ICP - Veg/Potato", "Bayer/General"); - brandMap.put("Poncho/VOTiVO 2", "TEMPORARY"); // set both 'Poncho' and 'Votivo' via special rule - brandMap.put("Poncho 1250/VOTiVO 2", "TEMPORARY"); // set 'Poncho 250/1250' and 'Votivo' via special rule (there is no Votivo 2) brandMap.put("Velum", "Velum One"); brandMap.put("Velum Prime 3", "Velum Prime"); + brandMap.put("Fluency Agent/Fluency Agent Advanced", "TEMPORARY"); // set both brands via special rule + brandMap.put("Poncho/VOTiVO 2", "TEMPORARY"); // set both 'Poncho' and 'Votivo' via special rule + brandMap.put("Poncho 1250/VOTiVO 2", "TEMPORARY"); // set 'Poncho 250/1250' and 'Votivo' via special rule (there is no Votivo 2) + unitMap = new HashMap(); unitMap.put("Bayer/General", "Crop Protection"); @@ -1108,8 +1108,25 @@ public class ToolboxImportFileGenerator { assets.put(assetId, asset); } - - asset.brands.add(brandMap.get(line[14])); + + // Special rules for brands + if (line[14].equals("Fluency Agent/Fluency Agent Advanced")) { + asset.brands.add(brandMap.get("Fluency Agent")); + asset.brands.add(brandMap.get("Fluency Agent Advanced")); + } + else if (line[14].equals("Poncho/VOTiVO 2")) { + asset.brands.add(brandMap.get("Poncho")); + asset.brands.add(brandMap.get("Votivo")); + } + else if (line[14].equals("Poncho 1250/VOTiVO 2")) { + asset.brands.add(brandMap.get("Poncho 1250")); + asset.brands.add(brandMap.get("Votivo")); + } + else { + // default + asset.brands.add(brandMap.get(line[14])); + } + if (asset.byr_cs_businessUnit == null) { asset.byr_cs_businessUnit = unitMap.get(brandMap.get(line[14])); } @@ -1122,9 +1139,9 @@ public class ToolboxImportFileGenerator { assignedBrands += brand; } - log.error("Asset " + asset.toolboxAssetId + ": Additional brand " + brandMap.get(line[14]) + " (" - + unitMap.get(brandMap.get(line[14])) + ") does not belong to business unit " + asset.byr_cs_businessUnit - + " of already assigned brand(s) " + assignedBrands); +// log.error("Asset " + asset.toolboxAssetId + ": Additional brand " + brandMap.get(line[14]) + " (" +// + unitMap.get(brandMap.get(line[14])) + ") does not belong to business unit " + asset.byr_cs_businessUnit +// + " of already assigned brand(s) " + assignedBrands); } // Indications stored in POJO for reference only. Indications are added to classifications in readToolboxExport()