This commit is contained in:
gexce
2017-08-16 13:46:58 +02:00
parent c78f9bb0a4
commit 3c18cb1418
@@ -28,7 +28,7 @@ import com.univocity.parsers.csv.CsvWriterSettings;
public class ToolboxImportFileGenerator { public class ToolboxImportFileGenerator {
private static Logger log = Logger.getLogger(ToolboxImportFileGenerator.class); private static Logger log = Logger.getLogger(ToolboxImportFileGenerator.class);
private static String toolboxExportFilePath = "C:\\Temp\\Migration CS - SQL Server\\export-2017-08-15.csv"; private static String toolboxExportFilePath = "C:\\Temp\\Migration CS - SQL Server\\auszug.csv";
private static String importFilePath = "C:\\Temp\\Migration CS - SQL Server\\importFile.csv"; private static String importFilePath = "C:\\Temp\\Migration CS - SQL Server\\importFile.csv";
private static final Map<String, String> brandMap; private static final Map<String, String> brandMap;
@@ -314,7 +314,7 @@ public class ToolboxImportFileGenerator {
unitMap = new HashMap<String, String>(); unitMap = new HashMap<String, String>();
unitMap.put("Bayer/General", "Crop Protection"); unitMap.put("Bayer/General", "Bayer");
unitMap.put("National Tradeshow", "Crop Protection"); unitMap.put("National Tradeshow", "Crop Protection");
unitMap.put("Absolute", "Crop Protection"); unitMap.put("Absolute", "Crop Protection");
unitMap.put("Absolute Maxx", "Crop Protection"); unitMap.put("Absolute Maxx", "Crop Protection");
@@ -1130,19 +1130,19 @@ public class ToolboxImportFileGenerator {
if (asset.byr_cs_businessUnit == null) { if (asset.byr_cs_businessUnit == null) {
asset.byr_cs_businessUnit = unitMap.get(brandMap.get(line[14])); asset.byr_cs_businessUnit = unitMap.get(brandMap.get(line[14]));
} }
else if (!asset.byr_cs_businessUnit.equals(unitMap.get(brandMap.get(line[14])))) { // else if (!asset.byr_cs_businessUnit.equals(unitMap.get(brandMap.get(line[14])))) {
//
String assignedBrands = ""; // String assignedBrands = "";
for (String brand : asset.brands) { // for (String brand : asset.brands) {
if (assignedBrands.length() > 0) // if (assignedBrands.length() > 0)
assignedBrands += ", "; // assignedBrands += ", ";
assignedBrands += brand; // assignedBrands += brand;
} // }
//
// log.error("Asset " + asset.toolboxAssetId + ": Additional brand " + brandMap.get(line[14]) + " (" // 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 // + unitMap.get(brandMap.get(line[14])) + ") does not belong to business unit " + asset.byr_cs_businessUnit
// + " of already assigned brand(s) " + assignedBrands); // + " of already assigned brand(s) " + assignedBrands);
} // }
// Indications stored in POJO for reference only. Indications are added to classifications in readToolboxExport() // Indications stored in POJO for reference only. Indications are added to classifications in readToolboxExport()
if (indicationMap.get(line[14]) != null) if (indicationMap.get(line[14]) != null)