Erro - Modificação Massiva de Preços (fixes bug #6227)

Tempo: 02 horas

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@43435 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2015-04-27 20:14:23 +00:00
parent 25b6eb51da
commit 6acaf374b2
1 changed files with 134 additions and 135 deletions

View File

@ -304,7 +304,7 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.error("",e); log.error("", e);
log.debug("Porcentagem Zero"); log.debug("Porcentagem Zero");
} }
@ -329,7 +329,7 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
String ruta = ""; String ruta = "";
int contRow = 0; int contRow = 0;
if(!lsRutaCombinacion.isEmpty()){ if (!lsRutaCombinacion.isEmpty()) {
for (int i = 0; i < lsRutaCombinacion.size(); i++) { for (int i = 0; i < lsRutaCombinacion.size(); i++) {
Object[] obj = (Object[]) lsRutaCombinacion.get(i); Object[] obj = (Object[]) lsRutaCombinacion.get(i);
@ -339,12 +339,13 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
ruta = obj[4].toString().concat(obj[12].toString()); ruta = obj[4].toString().concat(obj[12].toString());
String sheetName = ""; String sheetName = "";
if (obj[4].toString().length() > 26) { if (obj[4].toString().length() > 26) {
sheetName = (obj[4].toString().substring(0, 26).concat(" (").concat(obj[12].toString()).concat(")")); sheetName = (obj[12].toString().concat("-").concat(obj[4].toString().substring(0, 26)));
} else { } else {
sheetName = (obj[4].toString().concat(" (").concat(obj[12].toString()).concat(")")); sheetName = (obj[12].toString().concat("-").concat(obj[4].toString()));
} }
sheetName = sheetName.replaceAll("/", "-"); sheetName = sheetName.replaceAll("/", "-");
log.debug("Aba: " + sheetName); log.debug("Aba: " + sheetName);
sheet1 = wb.createSheet(sheetName); sheet1 = wb.createSheet(sheetName);
contRow = 1; contRow = 1;
@ -416,7 +417,6 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label"));
cell10.setCellStyle(estilo); cell10.setCellStyle(estilo);
HSSFCell cell12 = rowCabecalho.createCell(12); HSSFCell cell12 = rowCabecalho.createCell(12);
cell12.setCellValue( cell12.setCellValue(
Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label")); Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label"));
@ -476,20 +476,19 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
wb.write(stream); wb.write(stream);
stream.close(); stream.close();
InputStream is = null; InputStream is = null;
is = new FileInputStream(fNomeArquivo); is = new FileInputStream(fNomeArquivo);
Filedownload.save(is, "application/xls", "modificacionMasivaTarifa.xls"); Filedownload.save(is, "application/xls", "modificacionMasivaTarifa.xls");
fNomeArquivo.delete(); fNomeArquivo.delete();
}else{ } else {
Messagebox.show(Labels.getLabel("modificacionMasivaTarifasUploadController.MSG.excelVazio"), Messagebox.show(Labels.getLabel("modificacionMasivaTarifasUploadController.MSG.excelVazio"),
Labels.getLabel("modificacionMasivaTarifasController.window.title"), Messagebox.OK, Messagebox.INFORMATION); Labels.getLabel("modificacionMasivaTarifasController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
} }
} catch (Exception ex) { } catch (Exception ex) {
log.error("",ex); log.error("", ex);
} }
} }