Commit 1fe2b612 authored by Alina Habibulina's avatar Alina Habibulina

[FIX] более подробные логи

parent 9ec6cff3
......@@ -233,20 +233,28 @@ public class ImportBean {
Cell cell = iter.next();
CellValue cellValue = evaluator.evaluate(cell);
if(cellValue == null || cellValue.equals("")) continue;
//получили заголовок ячейки
String header = cell.getSheet().getRow(0).getCell(cell.getColumnIndex()).getRichStringCellValue().toString();
try {
//получили заголовок ячейки
if (header.equals(NO) || header.equals("")) {
continue;
}
if (header.equals(NO)) {
continue;
}
FormField defField = formFields.get(header);
if (defField == null) {
errors.add(row);
LOGGER.error("Import error in line :" + (row.getRowNum() + 1));
}
FormField valueFF = new FormField(defField);
FormField defField = formFields.get(header);
if (defField == null) {
errors.add(row);
LOGGER.error("Import error in line :" + (row.getRowNum() + 1));
}
FormField valueFF = new FormField(defField);
if(cellValue == null) continue;
switch (cellValue.getCellType()) {
......@@ -317,7 +325,12 @@ public class ImportBean {
}
rowFF.add(valueFF);
rowFF.add(valueFF);
} catch (Exception e){
LOGGER.error("Error in line :" + (row.getRowNum() + 1) + ". Something wrong with cell of type: " + cellValue.getCellType() +
", and value: \"" + cellValue.formatAsString() + "\". The header is: \"" + header + "\".");
LOGGER.error(e.getMessage());
}
}
if (rowFF != null && !rowFF.isEmpty()) {
......@@ -381,8 +394,12 @@ public class ImportBean {
ff.setElements(elements);
}
} else if(formField.get("dataSource") != null){
JsonObject dataSource = formField.get("dataSource").getAsJsonObject();
ff.setElements(getDictionary(dataSource.get("dict").getAsString(), dataSource.get("key").getAsString(), dataSource.get("value").getAsString(), login, password));
try {
JsonObject dataSource = formField.get("dataSource").getAsJsonObject();
ff.setElements(getDictionary(dataSource.get("dict").getAsString(), dataSource.get("key").getAsString(), dataSource.get("value").getAsString(), login, password));
} catch (Exception e){
LOGGER.error(e.getMessage());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment