From cafc3b5ae9b49505ad95236ed6c627632f1e0ab1 Mon Sep 17 00:00:00 2001 From: "thiago.penido" Date: Mon, 7 Mar 2016 21:15:07 +0000 Subject: [PATCH] bug 7170 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@53649 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../tarifas/EnumTarifaPedagio.java | 17 +- .../ModificacionMasivaTarifasController.java | 192 +++++++++++------- ...ficacionMasivaTarifasUploadController.java | 55 ++++- web/WEB-INF/i3-label_es_MX.label | 4 + web/WEB-INF/i3-label_pt_BR.label | 4 + 5 files changed, 177 insertions(+), 95 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EnumTarifaPedagio.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EnumTarifaPedagio.java index fba7e9bec..51d999097 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EnumTarifaPedagio.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EnumTarifaPedagio.java @@ -6,7 +6,10 @@ import java.util.List; import org.zkoss.util.resource.Labels; public enum EnumTarifaPedagio { - TARIFA(Labels.getLabel("busquedaTarifaController.lhPrecio.label")), PEDAGIO(Labels.getLabel("busquedaTarifaController.lhPedagio.label")); + TARIFA(Labels.getLabel("busquedaTarifaController.lhPrecio.label")), + PEDAGIO(Labels.getLabel("busquedaTarifaController.lhPedagio.label")), + TX_EMBARQUE(Labels.getLabel("busquedaTarifaController.lhTaxa.label")), + SEGURO(Labels.getLabel("busquedaTarifaController.lhPrecioSeguro.label")); private String descricao; @@ -23,13 +26,11 @@ public enum EnumTarifaPedagio { } public static List obterBundleValues(){ - List lst = new ArrayList(); - + List lst = new ArrayList(); lst.add(EnumTarifaPedagio.PEDAGIO.getDescricao()); lst.add(EnumTarifaPedagio.TARIFA.getDescricao()); - + lst.add(EnumTarifaPedagio.TX_EMBARQUE.getDescricao()); + lst.add(EnumTarifaPedagio.SEGURO.getDescricao()); return lst; - } - - -} + } +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java index 387175f72..4ad13feff 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java @@ -433,7 +433,6 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose if (mExcel != null) { Map args = new HashMap(); args.put("mExcel", mExcel); - // args.put("componentePreco", cmbComponentePreco.getValue()); openWindow("/gui/tarifas/modificacionMasivaTarifasUpload.zul", Labels.getLabel("modificacionMasivaTarifasController.window.title"), args, MODAL); @@ -654,85 +653,80 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose HSSFRow rowCabecalho = sheet1.createRow(0); HSSFCell cell = rowCabecalho.createCell(0); - cell.setCellValue( - Labels.getLabel("busquedaTarifaController.lhId.label")); + cell.setCellValue(Labels.getLabel("busquedaTarifaController.lhId.label")); cell.setCellStyle(estilo); HSSFCell cell0 = rowCabecalho.createCell(1); - cell0.setCellValue( - Labels.getLabel("busquedaTarifaController.lhTramo.label")); + cell0.setCellValue(Labels.getLabel("busquedaTarifaController.lhTramo.label")); cell0.setCellStyle(estilo); HSSFCell cell1 = rowCabecalho.createCell(2); - cell1.setCellValue( - Labels.getLabel("busquedaTarifaController.lhOrigen.label")); + cell1.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrigen.label")); cell1.setCellStyle(estilo); HSSFCell cell2 = rowCabecalho.createCell(3); - cell2.setCellValue( - Labels.getLabel("busquedaTarifaController.lhDestino.label")); + cell2.setCellValue(Labels.getLabel("busquedaTarifaController.lhDestino.label")); cell2.setCellStyle(estilo); HSSFCell cell3 = rowCabecalho.createCell(4); - cell3.setCellValue( - Labels.getLabel("busquedaTarifaController.lhRuta.label")); + cell3.setCellValue(Labels.getLabel("busquedaTarifaController.lhRuta.label")); cell3.setCellStyle(estilo); HSSFCell cell4 = rowCabecalho.createCell(5); - cell4.setCellValue( - Labels.getLabel("busquedaTarifaController.lhMarca.label")); + cell4.setCellValue(Labels.getLabel("busquedaTarifaController.lhMarca.label")); cell4.setCellStyle(estilo); - // Preco original I - 6 HSSFCell cell5 = rowCabecalho.createCell(6); - cell5.setCellValue( - Labels.getLabel("busquedaTarifaController.lhClaseServicio.label")); + cell5.setCellValue(Labels.getLabel("busquedaTarifaController.lhClaseServicio.label")); cell5.setCellStyle(estilo); - // H - 6 HSSFCell cell6 = rowCabecalho.createCell(7); - cell6.setCellValue( - Labels.getLabel("busquedaTarifaController.lhFeciniciovigencia.label")); + cell6.setCellValue(Labels.getLabel("busquedaTarifaController.lhFeciniciovigencia.label")); cell6.setCellStyle(estilo); - // I - 8 HSSFCell cell7 = rowCabecalho.createCell(8); - cell7.setCellValue( - Labels.getLabel("busquedaTarifaController.lhMoneda.label")); + cell7.setCellValue(Labels.getLabel("busquedaTarifaController.lhMoneda.label")); cell7.setCellStyle(estilo); - // J - 9 HSSFCell cell8 = rowCabecalho.createCell(9); - cell8.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label")); + cell8.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label")); cell8.setCellStyle(estilo); - // J - 9 HSSFCell cell9 = rowCabecalho.createCell(10); - cell9.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label")); + cell9.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label")); cell9.setCellStyle(estilo); - // h - 10 HSSFCell cell10 = rowCabecalho.createCell(11); - cell10.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); + cell10.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); cell10.setCellStyle(estilo); HSSFCell cell12 = rowCabecalho.createCell(12); - cell12.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label")); + cell12.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label")); cell12.setCellStyle(estilo); HSSFCell cell13 = rowCabecalho.createCell(13); - cell13.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioPedagioNuevo.label")); + cell13.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioPedagioNuevo.label")); cell13.setCellStyle(estilo); HSSFCell cell14 = rowCabecalho.createCell(14); - cell14.setCellValue( - Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label")); + cell14.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTxEmbarque.label")); cell14.setCellStyle(estilo); + + HSSFCell cell15 = rowCabecalho.createCell(15); + cell15.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label")); + cell15.setCellStyle(estilo); + + HSSFCell cell16 = rowCabecalho.createCell(16); + cell16.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroAtual.label")); + cell16.setCellStyle(estilo); + + HSSFCell cell17 = rowCabecalho.createCell(17); + cell17.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroSimulado.label")); + cell17.setCellStyle(estilo); + + HSSFCell cell18 = rowCabecalho.createCell(18); + cell18.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label")); + cell18.setCellStyle(estilo); } HSSFRow row = sheet1.createRow(contRow++); @@ -766,7 +760,15 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose BigDecimal pedVal = BigDecimal.valueOf(Double.valueOf(ped)); row.createCell(12).setCellValue(pedVal.setScale(2).doubleValue()); - row.createCell(14).setCellValue(obj[17].toString()); + String txEmbarque = getStringImporteSafe(obj[18]); + BigDecimal txEmbarqueVal = BigDecimal.valueOf(Double.valueOf(txEmbarque)); + row.createCell(14).setCellValue(txEmbarqueVal.setScale(2).doubleValue()); + + String seguro = getStringImporteSafe(obj[19]); + BigDecimal seguroVal = BigDecimal.valueOf(Double.valueOf(seguro)); + row.createCell(16).setCellValue(seguroVal.setScale(2).doubleValue()); + + row.createCell(18).setCellValue(obj[17].toString()); // novo preco: BigDecimal novoPrecio = null; @@ -775,13 +777,27 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TARIFA.getDescricao())){ novoPrecio = atual; celulaAlterada = 11; - } else{ + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { if (obj[16]==null){ continue; } novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[16]))); celulaAlterada = 13; + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + if (obj[18]==null){ + continue; + } + + novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[18]))); + celulaAlterada = 15; + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + if (obj[19]==null){ + continue; + } + + novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[19]))); + celulaAlterada = 17; } novoPrecio = novoPrecio.multiply(coeficiente).setScale(2, RoundingMode.HALF_UP); @@ -792,12 +808,14 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose } } - private void gerarExcelComAgrupamento(List lsRutaCombinacion, HSSFWorkbook wb, HSSFCellStyle estilo, BigDecimal coeficiente){ + private void gerarExcelComAgrupamento(List lsRutaCombinacion, HSSFWorkbook wb, HSSFCellStyle estilo, BigDecimal coeficiente) { + HSSFSheet sheet1 = null; String ruta = ""; int contRow = 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()))) { @@ -830,91 +848,85 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose HSSFCell cellTituloLinha = rowTituloLinha.createCell(0); sheet1.addMergedRegion(new CellRangeAddress(rowTituloLinha.getRowNum(), rowTituloLinha.getRowNum(), 0, 16)); cellTituloLinha.setCellValue(linha); - //estilo.setAlignment(org.apache.poi.ss.usermodel.CellStyle.ALIGN_CENTER); cellTituloLinha.setCellStyle(estilo); HSSFRow rowCabecalho = sheet1.createRow(contRow++); HSSFCell cell = rowCabecalho.createCell(contCell++); - cell.setCellValue( - Labels.getLabel("busquedaTarifaController.lhId.label")); + cell.setCellValue(Labels.getLabel("busquedaTarifaController.lhId.label")); cell.setCellStyle(estilo); HSSFCell cell0 = rowCabecalho.createCell(contCell++); - cell0.setCellValue( - Labels.getLabel("busquedaTarifaController.lhTramo.label")); + cell0.setCellValue(Labels.getLabel("busquedaTarifaController.lhTramo.label")); cell0.setCellStyle(estilo); HSSFCell cell1 = rowCabecalho.createCell(contCell++); - cell1.setCellValue( - Labels.getLabel("busquedaTarifaController.lhOrigen.label")); + cell1.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrigen.label")); cell1.setCellStyle(estilo); HSSFCell cell2 = rowCabecalho.createCell(contCell++); - cell2.setCellValue( - Labels.getLabel("busquedaTarifaController.lhDestino.label")); + cell2.setCellValue(Labels.getLabel("busquedaTarifaController.lhDestino.label")); cell2.setCellStyle(estilo); HSSFCell cell3 = rowCabecalho.createCell(contCell++); - cell3.setCellValue( - Labels.getLabel("busquedaTarifaController.lhRuta.label")); + cell3.setCellValue(Labels.getLabel("busquedaTarifaController.lhRuta.label")); cell3.setCellStyle(estilo); HSSFCell cell4 = rowCabecalho.createCell(contCell++); - cell4.setCellValue( - Labels.getLabel("busquedaTarifaController.lhMarca.label")); + cell4.setCellValue(Labels.getLabel("busquedaTarifaController.lhMarca.label")); cell4.setCellStyle(estilo); - // Preco original I - 6 HSSFCell cell5 = rowCabecalho.createCell(contCell++); - cell5.setCellValue( - Labels.getLabel("busquedaTarifaController.lhClaseServicio.label")); + cell5.setCellValue(Labels.getLabel("busquedaTarifaController.lhClaseServicio.label")); cell5.setCellStyle(estilo); - // H - 6 HSSFCell cell6 = rowCabecalho.createCell(contCell++); - cell6.setCellValue( - Labels.getLabel("busquedaTarifaController.lhFeciniciovigencia.label")); + cell6.setCellValue(Labels.getLabel("busquedaTarifaController.lhFeciniciovigencia.label")); cell6.setCellStyle(estilo); - // I - 8 HSSFCell cell7 = rowCabecalho.createCell(contCell++); - cell7.setCellValue( - Labels.getLabel("busquedaTarifaController.lhMoneda.label")); + cell7.setCellValue(Labels.getLabel("busquedaTarifaController.lhMoneda.label")); cell7.setCellStyle(estilo); - // J - 9 HSSFCell cell8 = rowCabecalho.createCell(contCell++); - cell8.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label")); + cell8.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label")); cell8.setCellStyle(estilo); - // J - 9 HSSFCell cell9 = rowCabecalho.createCell(contCell++); - cell9.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label")); + cell9.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label")); cell9.setCellStyle(estilo); - // h - 10 HSSFCell cell10 = rowCabecalho.createCell(contCell++); - cell10.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); + cell10.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); cell10.setCellStyle(estilo); HSSFCell cell12 = rowCabecalho.createCell(contCell++); - cell12.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label")); + cell12.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioPedagio.label")); cell12.setCellStyle(estilo); HSSFCell cell13 = rowCabecalho.createCell(contCell++); - cell13.setCellValue( - Labels.getLabel("busquedaTarifaController.lhPrecioPedagioNuevo.label")); + cell13.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioPedagioNuevo.label")); cell13.setCellStyle(estilo); HSSFCell cell14 = rowCabecalho.createCell(contCell++); - cell14.setCellValue( - Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label")); + cell14.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTxEmbarque.label")); cell14.setCellStyle(estilo); + + HSSFCell cell15 = rowCabecalho.createCell(contCell++); + cell15.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label")); + cell15.setCellStyle(estilo); + + HSSFCell cell16 = rowCabecalho.createCell(contCell++); + cell16.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroAtual.label")); + cell16.setCellStyle(estilo); + + HSSFCell cell17 = rowCabecalho.createCell(contCell++); + cell17.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroSimulado.label")); + cell17.setCellStyle(estilo); + + HSSFCell cell18 = rowCabecalho.createCell(contCell++); + cell18.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label")); + cell18.setCellStyle(estilo); } HSSFRow row = sheet1.createRow(contRow++); @@ -948,7 +960,15 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose BigDecimal pedVal = BigDecimal.valueOf(Double.valueOf(ped)); row.createCell(12).setCellValue(pedVal.setScale(2).doubleValue()); - row.createCell(14).setCellValue(obj[17].toString()); + String txEmbarque = getStringImporteSafe(obj[18]); + BigDecimal txEmbarqueVal = BigDecimal.valueOf(Double.valueOf(txEmbarque)); + row.createCell(14).setCellValue(txEmbarqueVal.setScale(2).doubleValue()); + + String seguro = getStringImporteSafe(obj[19]); + BigDecimal seguroVal = BigDecimal.valueOf(Double.valueOf(seguro)); + row.createCell(16).setCellValue(seguroVal.setScale(2).doubleValue()); + + row.createCell(18).setCellValue(obj[17].toString()); // novo preco: BigDecimal novoPrecio = null; @@ -957,13 +977,27 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TARIFA.getDescricao())){ novoPrecio = atual; celulaAlterada = 11; - } else{ + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { if (obj[16]==null){ continue; } novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[16]))); celulaAlterada = 13; + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + if (obj[18]==null){ + continue; + } + + novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[18]))); + celulaAlterada = 15; + } else if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + if (obj[19]==null){ + continue; + } + + novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[19]))); + celulaAlterada = 17; } novoPrecio = novoPrecio.multiply(coeficiente).setScale(2, RoundingMode.HALF_UP); diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java index 377cd4cda..fb1fb369e 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java @@ -63,6 +63,8 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC private final Integer CELL_NOVO_PRECIO = 11; // private final Integer CELL_PEAJE = 12; private final Integer CELL_NOVO_PEAJE = 13; + private final Integer CELL_NOVO_TX_EMBARQUE = 15; + private final Integer CELL_NOVO_SEGURO = 17; @Autowired private TarifaService tarifaService; @@ -94,7 +96,6 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC super.doAfterCompose(comp); mExcel = (Media) Executions.getCurrent().getArg().get("mExcel"); - // componentePreco = (String) Executions.getCurrent().getArg().get("componentePreco"); lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); lbVigencia.setVisible(Boolean.FALSE); @@ -145,14 +146,17 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); if (opcao.equals(Messagebox.YES)) { + InputStream isMExcel = mExcel.getStreamData(); HSSFWorkbook wb = new HSSFWorkbook(isMExcel); for (int k = 0; k < wb.getNumberOfSheets(); k++) { + Sheet sheet = wb.getSheetAt(k); int rows = sheet.getPhysicalNumberOfRows(); for (int r = 0; r < rows; 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()))) { @@ -171,10 +175,18 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC if (null == row.getCell(CELL_NOVO_PRECIO)) { continue; } - } else { + } else if (componentePreco.equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { if (null == row.getCell(CELL_NOVO_PEAJE)) { continue; } + } else if (componentePreco.equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + if (null == row.getCell(CELL_NOVO_TX_EMBARQUE)) { + continue; + } + } else if (componentePreco.equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + if (null == row.getCell(CELL_NOVO_SEGURO)) { + continue; + } } Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA); @@ -184,14 +196,19 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC Tarifa tarifa = tarifaService.obtenerID(idTarifa); if (tarifa != null) { + Tramo tramo = tarifa.getTramo(); + if (tramo != null) { + Parada origem = tarifa.getTramo().getOrigem(); Ciudad ciudad = origem.getCiudad(); Plaza plaza = null; + if (ciudad != null) { plaza = ciudad.getPlaza(); } + Parada destino = tarifa.getTramo().getDestino(); ClaseServicio claseServicio = tarifa.getClaseServicio(); Moneda moneda = tarifa.getMoneda(); @@ -204,8 +221,12 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())) { cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO); - } else { + } else if (componentePreco.equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { cellNovoPrecio = row.getCell(CELL_NOVO_PEAJE); + } else if (componentePreco.equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + cellNovoPrecio = row.getCell(CELL_NOVO_TX_EMBARQUE); + } else if (componentePreco.equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + cellNovoPrecio = row.getCell(CELL_NOVO_SEGURO); } BigDecimal novoPrecio = new BigDecimal(cellNovoPrecio.getNumericCellValue()); @@ -215,7 +236,9 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC origem, destino, claseServicio, plaza, moneda); if (podeSalvarTarifaMinima) { + if (salvarNuevos) { + Tarifa tarifaNueva = new Tarifa(); tarifaNueva.setClaseServicio(tarifa.getClaseServicio()); @@ -224,8 +247,12 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())) { tarifa.setPrecio(novoPrecio); - } else { + } else if (componentePreco.equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { tarifa.setImportepedagio(novoPrecio); + } else if (componentePreco.equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + tarifa.setImportetaxaembarque(novoPrecio); + } else if (componentePreco.equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + tarifa.setImporteseguro(novoPrecio); } tarifaNueva.setPreciooriginal(tarifa.getPreciooriginal()); @@ -236,9 +263,16 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC tarifaNueva.setOrgaoConcedente(tarifa.getOrgaoConcedente()); Comboitem cbiVt = cmbVigenciaTarifa.getSelectedItem(); - VigenciaTarifa nuevaVigencia = (VigenciaTarifa) cbiVt.getValue(); - tarifaNueva.setVigenciaTarifa(nuevaVigencia); + VigenciaTarifa nuevaVigencia; + if(getRdVigenciaAtual().isChecked()) { + tarifaNueva.setVigenciaTarifa(vigenciaTarifa); + nuevaVigencia = vigenciaTarifa; + } else { + nuevaVigencia = (VigenciaTarifa) cbiVt.getValue(); + tarifaNueva.setVigenciaTarifa(nuevaVigencia); + } + boolean existeTarifa = tarifaService.existe(tarifaNueva.getMarca(), tarifaNueva.getTramo(), tarifaNueva.getMoneda(), tarifaNueva.getClaseServicio(), nuevaVigencia, tarifaNueva.getRuta(), tarifaNueva.getOrgaoConcedente()); @@ -249,10 +283,15 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC } } else { + if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())) { tarifa.setPrecio(novoPrecio); - } else { + } else if (componentePreco.equals(EnumTarifaPedagio.PEDAGIO.getDescricao())) { tarifa.setImportepedagio(novoPrecio); + } else if (componentePreco.equals(EnumTarifaPedagio.TX_EMBARQUE.getDescricao())) { + tarifa.setImportetaxaembarque(novoPrecio); + } else if (componentePreco.equals(EnumTarifaPedagio.SEGURO.getDescricao())) { + tarifa.setImporteseguro(novoPrecio); } tarifa.setStatustarifa("A"); @@ -401,7 +440,7 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); - log.debug("Vigencia De: " + sf.format(v.getFeciniciovigencia()) + " até: " + sf.format(v.getFecfinvigencia())); + log.debug("Vigencia De: " + sf.format(v.getFeciniciovigencia()) + " até: " + sf.format(v.getFecfinvigencia())); rdVigenciaAtual.setLabel(Labels.getLabel("modificacionMasivaTarifasUploadController.MSG.radioUno", new Object[] { sf.format(v.getFeciniciovigencia()).concat(" ").concat(sf.format(v.getFecfinvigencia())) })); diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 425be614d..257cfdf60 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -2052,6 +2052,10 @@ busquedaTarifaController.lhPrecioSeguro.label = Seguro busquedaTarifaController.lhPrecioOutros.label = Otros busquedaTarifaController.lhPrecioPedagio.label = Peaje actual busquedaTarifaController.lhPrecioPedagioNuevo.label = Peaje simulada +busquedaTarifaController.lhPrecioSeguroAtual.label = Seguro Atual +busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado +busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual +busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado busquedaTarifaController.lhMarca.label = Marca busquedaTarifaController.lhOrigen.label = Origen busquedaTarifaController.lhDestino.label = Destino diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 4b23c7004..5ec4bdc1a 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -2096,6 +2096,10 @@ busquedaTarifaController.lhPrecioSeguro.label = Seguro busquedaTarifaController.lhPrecioOutros.label = Outros busquedaTarifaController.lhPrecioPedagio.label = Pedágio Atual busquedaTarifaController.lhPrecioPedagioNuevo.label = Pedágio Simulado +busquedaTarifaController.lhPrecioSeguroAtual.label = Seguro Atual +busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado +busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual +busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado busquedaTarifaController.lhMarca.label = Marca busquedaTarifaController.lhOrigen.label = Origem busquedaTarifaController.lhDestino.label = Destino