fixes bug#24703
AL-1236 qua: dev:Valdir git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@113903 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
113fe7319d
commit
1b0e1430ce
|
@ -207,23 +207,34 @@ public class ModificacionMasivaPricingEspecificoUploadController extends MyGener
|
||||||
private Date getDatePorRow(Row row, int numeroCell, StringBuilder erro) throws ParseException {
|
private Date getDatePorRow(Row row, int numeroCell, StringBuilder erro) throws ParseException {
|
||||||
Cell cell = row.getCell(numeroCell);
|
Cell cell = row.getCell(numeroCell);
|
||||||
String nome = getNomeCell(numeroCell);
|
String nome = getNomeCell(numeroCell);
|
||||||
|
Date date =null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cell.getStringCellValue() == null) {
|
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
|
||||||
return null;
|
date = cell.getDateCellValue();
|
||||||
|
}else{
|
||||||
|
if (cell.getStringCellValue() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
date = format.parse(cell.getStringCellValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
} catch (ParseException ex) {
|
||||||
Date date = format.parse(cell.getStringCellValue());
|
|
||||||
return date;
|
|
||||||
} catch (Exception ex) {
|
|
||||||
erro.append("Coluna '" + nome + "' da linha " + row.getRowNum() + " está fora do formato.\n");
|
erro.append("Coluna '" + nome + "' da linha " + row.getRowNum() + " está fora do formato.\n");
|
||||||
return null;
|
return null;
|
||||||
|
} catch (IllegalStateException ex) {
|
||||||
|
erro.append("Coluna '" + nome + "' da linha " + row.getRowNum() + ". Tipo da coluna divergente com dado informado. Ex.: Número no lugar do texto\n");
|
||||||
|
return null;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
erro.append("Coluna '" + nome + "' da linha " + row.getRowNum() + ". Erro desconhecido\n");
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean isCancelar(Row row) {
|
private Boolean isCancelar(Row row) {
|
||||||
|
|
Loading…
Reference in New Issue