eduardo.dicarde 2016-07-05 23:42:45 +00:00
parent 13a0ac59bf
commit b7997c166f
2 changed files with 27 additions and 32 deletions

View File

@ -666,31 +666,37 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
HSSFSheet sheet1 = null;
String ruta = "";
int contRow = 0;
int contPlan = 0;
for (int i = 0; i < lsRutaCombinacion.size(); i++) {
Object[] obj = (Object[]) lsRutaCombinacion.get(i);
if (!ruta.equals(obj[4].toString().concat(obj[12].toString()))) {
ruta = obj[4].toString().concat(obj[12].toString());
String sheetName = "";
if (obj[4].toString().length() > 26) {
sheetName = (obj[12].toString().concat("-").concat(obj[4].toString().substring(0, 26)));
} else {
sheetName = (obj[12].toString().concat("-").concat(obj[4].toString()));
}
sheetName = sheetName.replaceAll("/", "-");
sheetName += ++contPlan;
log.debug("Aba: " + sheetName);
sheet1 = wb.createSheet(sheetName);
contRow = 1;
String sheetName = "";
criarCabecalhoExcel(sheet1, estilo);
try{
if (!ruta.equals(obj[4].toString().concat(obj[12].toString()))) {
ruta = obj[4].toString().concat(obj[12].toString());
String sentido = (obj[22].toString().equals("1"))?"IDA":"VOLTA";
if (obj[4].toString().length() > 26) {
sheetName = (obj[12].toString().concat("-").concat(obj[4].toString().substring(0, obj[4].toString().length()).concat(" - ").concat(sentido)));
} else {
sheetName = (obj[12].toString().concat("-").concat(obj[4].toString()).concat(" - ").concat(sentido));
}
sheetName = sheetName.replaceAll("/", "-");
log.debug("Aba: " + sheetName);
sheet1 = wb.createSheet(sheetName);
contRow = 1;
criarCabecalhoExcel(sheet1, estilo);
}
} catch(Exception exception){
System.err.println(sheetName);
continue;
}
popularPlanilha(sheet1, obj, estilo, coeficiente, contRow++);
}
}

View File

@ -171,13 +171,11 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
continue;
}
boolean retorno = false;
boolean retorno = true;
if (componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao())){
retorno = validarTodosComponentes(row);
} else{
if (!componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao())){
retorno = validarComponenteEspecifico(row);
}
}
if (!retorno){
continue;
@ -597,13 +595,4 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
return true;
}
private boolean validarTodosComponentes(Row row){
if (row.getCell(CELL_NOVO_PRECIO) == null || row.getCell(CELL_NOVO_PEAJE) == null || row.getCell(CELL_NOVO_TX_EMBARQUE) == null ||
row.getCell(CELL_NOVO_SEGURO) == null){
return false;
}
return true;
}
}