julio 2016-02-22 20:08:25 +00:00
parent dc12ff25ac
commit 3e44eab998
2 changed files with 17 additions and 22 deletions

View File

@ -120,15 +120,10 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
public void onClick$btnSalvar(Event ev) throws IOException, InterruptedException { public void onClick$btnSalvar(Event ev) throws IOException, InterruptedException {
componentePreco = cmbComponentePreco.getValue(); componentePreco = cmbComponentePreco.getValue();
boolean salvarNuevos = false; if (rdSalvarNuevos.isChecked()) {
if (rdSalvarNuevos.isChecked()) salvarNuevos(false);
salvarNuevos = true; } else if (rdNoSalvarNuevos.isChecked()) {
salvarNuevos(true);
if (rdVigenciaAtual.isChecked()) {
salvarNuevos(salvarNuevos);
} else {
cmbVigenciaTarifa.getValue();
salvarNuevos(salvarNuevos);
} }
} }
@ -159,19 +154,19 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
for (int r = 0; r < rows; r++) { for (int r = 0; r < rows; r++) {
Row row = sheet.getRow(r); Row row = sheet.getRow(r);
if (row == null || (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && (row.getCell(0).getStringCellValue().startsWith("Linha") || row.getCell(0).getStringCellValue().isEmpty()))) { if (row == null || (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && (row.getCell(0).getStringCellValue().startsWith("Linha") || row.getCell(0).getStringCellValue().isEmpty()))) {
continue; continue;
} }
if (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && row.getCell(0).getStringCellValue().equalsIgnoreCase("id")){ if (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && row.getCell(0).getStringCellValue().equalsIgnoreCase("id")) {
continue; continue;
} }
if (row.getCell(0).getCellType() == Cell.CELL_TYPE_BLANK){ if (row.getCell(0).getCellType() == Cell.CELL_TYPE_BLANK) {
continue; continue;
} }
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())) { if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())) {
if (null == row.getCell(CELL_NOVO_PRECIO)) { if (null == row.getCell(CELL_NOVO_PRECIO)) {
continue; continue;
@ -378,19 +373,19 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
for (int r = 0; r < rows; r++) { for (int r = 0; r < rows; r++) {
Row row = sheet.getRow(r); Row row = sheet.getRow(r);
if (row == null || (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && (row.getCell(0).getStringCellValue().startsWith("Linha") || row.getCell(0).getStringCellValue().isEmpty()))) { if (row == null || (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && (row.getCell(0).getStringCellValue().startsWith("Linha") || row.getCell(0).getStringCellValue().isEmpty()))) {
continue; continue;
} }
if (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && row.getCell(0).getStringCellValue().equalsIgnoreCase("id")){ if (row.getCell(0).getCellType() == Cell.CELL_TYPE_STRING && row.getCell(0).getStringCellValue().equalsIgnoreCase("id")) {
continue; continue;
} }
if (row.getCell(0).getCellType() == Cell.CELL_TYPE_BLANK){ if (row.getCell(0).getCellType() == Cell.CELL_TYPE_BLANK) {
continue; continue;
} }
Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA); Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA);
BigDecimal bdId = new BigDecimal(cellIdTarifa.getNumericCellValue()); BigDecimal bdId = new BigDecimal(cellIdTarifa.getNumericCellValue());

View File

@ -7,7 +7,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winModificacionMasivaTarifaUpload" border="normal" <window id="winModificacionMasivaTarifaUpload" border="normal"
apply="${modificacionMasivaTarifasUploadController}" apply="${modificacionMasivaTarifasUploadController}"
width="700px" height="220px" contentStyle="overflow:auto" width="580px" height="275px" contentStyle="overflow:auto"
title="${c:l('editarTarifaController.window.title')}"> title="${c:l('editarTarifaController.window.title')}">
<toolbar> <toolbar>
<hbox spacing="5px" style="padding:1px" align="right"> <hbox spacing="5px" style="padding:1px" align="right">