fixed bug #10509 - Correção de erro ao copiar vigência, e modificação massiva de preços. Não buscava o TPP.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@78331 d1611594-4594-4d17-8e1d-87c2c4800839
master
thiago 2018-01-24 20:44:30 +00:00
parent e304ecdb76
commit 04aa465659
5 changed files with 62 additions and 10 deletions

View File

@ -10,6 +10,7 @@ public enum EnumTarifaPedagio {
PEDAGIO(Labels.getLabel("busquedaTarifaController.lhPedagio.label")), PEDAGIO(Labels.getLabel("busquedaTarifaController.lhPedagio.label")),
TX_EMBARQUE(Labels.getLabel("busquedaTarifaController.lhTaxa.label")), TX_EMBARQUE(Labels.getLabel("busquedaTarifaController.lhTaxa.label")),
SEGURO(Labels.getLabel("busquedaTarifaController.lhPrecioSeguro.label")), SEGURO(Labels.getLabel("busquedaTarifaController.lhPrecioSeguro.label")),
TPP(Labels.getLabel("busquedaTarifaController.lhPrecioTPP.label")),
TODOS(Labels.getLabel("busquedaTarifaController.lhTodos.label")); TODOS(Labels.getLabel("busquedaTarifaController.lhTodos.label"));
private String descricao; private String descricao;

View File

@ -181,12 +181,14 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
private final int IDX_CELL_TXEMBARQUEATUAL = 13; private final int IDX_CELL_TXEMBARQUEATUAL = 13;
private final int IDX_CELL_TXEMBARQUESIMULADO = 14; private final int IDX_CELL_TXEMBARQUESIMULADO = 14;
private final int IDX_CELL_SEGUROATUAL = 15; private final int IDX_CELL_SEGUROATUAL = 15;
private final int IDX_CELL_SEGUROSIMULADO = 16; private final int IDX_CELL_SEGUROSIMULADO = 16;
private final int IDX_CELL_ORGAOCONCEDENTE = 17; private final int IDX_CELL_TPPATUAL = 17;
private final int IDX_CELL_PREFIXO = 18; private final int IDX_CELL_TPPSIMULADO = 18;
private final int IDX_CELL_VIGENCIA = 19; private final int IDX_CELL_ORGAOCONCEDENTE = 19;
private final int IDX_CELL_MOEDA = 20; private final int IDX_CELL_PREFIXO = 20;
private final int IDX_CELL_SENTIDO = 21; private final int IDX_CELL_VIGENCIA = 21;
private final int IDX_CELL_MOEDA = 22;
private final int IDX_CELL_SENTIDO = 23;
private static Logger log = Logger.getLogger(ModificacionMasivaTarifasController.class); private static Logger log = Logger.getLogger(ModificacionMasivaTarifasController.class);
@ -815,6 +817,14 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
XSSFCell cellSeguroSimulado = rowCabecalho.createCell(IDX_CELL_SEGUROSIMULADO); XSSFCell cellSeguroSimulado = rowCabecalho.createCell(IDX_CELL_SEGUROSIMULADO);
cellSeguroSimulado.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroSimulado.label")); cellSeguroSimulado.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioSeguroSimulado.label"));
cellSeguroSimulado.setCellStyle(estilo); cellSeguroSimulado.setCellStyle(estilo);
XSSFCell cellTPPAtual = rowCabecalho.createCell(IDX_CELL_TPPATUAL);
cellTPPAtual.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTPPAtual.label"));
cellTPPAtual.setCellStyle(estilo);
XSSFCell cellTPPSimulado = rowCabecalho.createCell(IDX_CELL_TPPSIMULADO);
cellTPPSimulado.setCellValue(Labels.getLabel("busquedaTarifaController.lhPrecioTPPSimulado.label"));
cellTPPSimulado.setCellStyle(estilo);
XSSFCell cellOrgaoConcedente = rowCabecalho.createCell(IDX_CELL_ORGAOCONCEDENTE); XSSFCell cellOrgaoConcedente = rowCabecalho.createCell(IDX_CELL_ORGAOCONCEDENTE);
cellOrgaoConcedente.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label")); cellOrgaoConcedente.setCellValue(Labels.getLabel("busquedaTarifaController.lhOrgaoLabel.label"));
@ -876,14 +886,18 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
String seguro = getStringImporteSafe(obj[19]); String seguro = getStringImporteSafe(obj[19]);
BigDecimal seguroVal = BigDecimal.valueOf(Double.valueOf(seguro)); BigDecimal seguroVal = BigDecimal.valueOf(Double.valueOf(seguro));
row.createCell(IDX_CELL_SEGUROATUAL).setCellValue(seguroVal.setScale(2).doubleValue()); row.createCell(IDX_CELL_SEGUROATUAL).setCellValue(seguroVal.setScale(2).doubleValue());
String tpp = getStringImporteSafe(obj[20]);
BigDecimal tppVal = BigDecimal.valueOf(Double.valueOf(tpp));
row.createCell(IDX_CELL_TPPATUAL).setCellValue(tppVal.setScale(2).doubleValue());
row.createCell(IDX_CELL_ORGAOCONCEDENTE).setCellValue(obj[17].toString()); row.createCell(IDX_CELL_ORGAOCONCEDENTE).setCellValue(obj[17].toString());
row.createCell(IDX_CELL_NUMLINHA).setCellValue(obj[20] == null?"":obj[20].toString()); row.createCell(IDX_CELL_NUMLINHA).setCellValue(obj[21] == null?"":obj[21].toString());
row.createCell(IDX_CELL_PREFIXO).setCellValue(obj[21] == null?"":obj[21].toString()); row.createCell(IDX_CELL_PREFIXO).setCellValue(obj[22] == null?"":obj[22].toString());
String sentido = obj[22].toString(); String sentido = obj[23].toString();
row.createCell(IDX_CELL_SENTIDO).setCellValue(sentido.equals("1") ? "IDA" : "VOLTA"); row.createCell(IDX_CELL_SENTIDO).setCellValue(sentido.equals("1") ? "IDA" : "VOLTA");
// novo preco: // novo preco:
@ -945,6 +959,20 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
cellNovoPrecio.setCellStyle(estilo); cellNovoPrecio.setCellStyle(estilo);
} }
if (cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TPP.getDescricao())||
cmbComponentePreco.getSelectedItem().getValue().equals(EnumTarifaPedagio.TODOS.getDescricao())){
if (!validarComponente(obj, IDX_CELL_TPPATUAL)){
return false;
}
novoPrecio = BigDecimal.valueOf(Double.valueOf(getStringImporteSafe(obj[20])));
novoPrecio = novoPrecio.multiply(coeficiente).setScale(2, RoundingMode.HALF_UP);
XSSFCell cellNovoPrecio = row.createCell(IDX_CELL_TPPSIMULADO); //celula alterada
cellNovoPrecio.setCellValue(novoPrecio.setScale(2).doubleValue());
cellNovoPrecio.setCellStyle(estilo);
}
return true; return true;
} }
} }

View File

@ -66,6 +66,7 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
private final Integer CELL_NOVO_PEAJE = 12; private final Integer CELL_NOVO_PEAJE = 12;
private final Integer CELL_NOVO_TX_EMBARQUE = 14; private final Integer CELL_NOVO_TX_EMBARQUE = 14;
private final Integer CELL_NOVO_SEGURO = 16; private final Integer CELL_NOVO_SEGURO = 16;
private final Integer CELL_NOVO_TPP = 18;
@Autowired @Autowired
private TarifaService tarifaService; private TarifaService tarifaService;
@ -471,6 +472,15 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
tarifaNueva.setImporteseguro(novoPrecio); tarifaNueva.setImporteseguro(novoPrecio);
} }
if (componentePreco.equals(EnumTarifaPedagio.TPP.getDescricao()) ||
(componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao()) && row.getCell(CELL_NOVO_TPP) != null)){
cellNovoPrecio = row.getCell(CELL_NOVO_TPP);
BigDecimal novoPrecio = new BigDecimal(cellNovoPrecio.getNumericCellValue());
novoPrecio = novoPrecio.setScale(2, RoundingMode.HALF_UP);
tarifaNueva.setImporteTPP(novoPrecio);
}
tarifaNueva.setPrecioredabierto(tarifa.getPrecioredabierto()); tarifaNueva.setPrecioredabierto(tarifa.getPrecioredabierto());
tarifaNueva.setStatustarifa("A"); tarifaNueva.setStatustarifa("A");
@ -537,6 +547,15 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
tarifa.setImporteseguro(novoPrecio); tarifa.setImporteseguro(novoPrecio);
} }
if (componentePreco.equals(EnumTarifaPedagio.TPP.getDescricao()) ||
(componentePreco.equals(EnumTarifaPedagio.TODOS.getDescricao()) && row.getCell(CELL_NOVO_TPP) != null)) {
cellNovoPrecio = row.getCell(CELL_NOVO_TPP);
BigDecimal novoPrecio = new BigDecimal(cellNovoPrecio.getNumericCellValue());
novoPrecio = novoPrecio.setScale(2, RoundingMode.HALF_UP);
tarifa.setImporteTPP(novoPrecio);
}
tarifa.setStatustarifa("A"); tarifa.setStatustarifa("A");

View File

@ -2491,6 +2491,8 @@ busquedaTarifaController.lhPrecioSeguroAtual.label = Seguro Atual
busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado
busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual
busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado
busquedaTarifaController.lhPrecioTPPAtual.label = TPP Atual
busquedaTarifaController.lhPrecioTPPSimulado.label = TPP Simulado
busquedaTarifaController.lhMarca.label = Marca busquedaTarifaController.lhMarca.label = Marca
busquedaTarifaController.lhOrigen.label = Origen busquedaTarifaController.lhOrigen.label = Origen
busquedaTarifaController.lhDestino.label = Destino busquedaTarifaController.lhDestino.label = Destino

View File

@ -2674,6 +2674,8 @@ busquedaTarifaController.lhPrecioPedagio.label = Pedágio Atual
busquedaTarifaController.lhPrecioPedagioNuevo.label = Pedágio Simulado busquedaTarifaController.lhPrecioPedagioNuevo.label = Pedágio Simulado
busquedaTarifaController.lhPrecioSeguroAtual.label = Seguro Atual busquedaTarifaController.lhPrecioSeguroAtual.label = Seguro Atual
busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado busquedaTarifaController.lhPrecioSeguroSimulado.label = Seguro Simulado
busquedaTarifaController.lhPrecioTPPAtual.label = TPP Atual
busquedaTarifaController.lhPrecioTPPSimulado.label = TPP Simulado
busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual busquedaTarifaController.lhPrecioTxEmbarque.label = Tx. Embarque Atual
busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado busquedaTarifaController.lhPrecioTxEmbarqueSimulado.label = Tx. Embarque Simulado
busquedaTarifaController.lhMarca.label = Marca busquedaTarifaController.lhMarca.label = Marca