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-87c2c4800839master
parent
e304ecdb76
commit
04aa465659
|
@ -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;
|
||||||
|
|
|
@ -182,11 +182,13 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
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);
|
||||||
|
|
||||||
|
@ -816,6 +818,14 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
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"));
|
||||||
cellOrgaoConcedente.setCellStyle(estilo);
|
cellOrgaoConcedente.setCellStyle(estilo);
|
||||||
|
@ -878,12 +888,16 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -472,6 +473,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");
|
||||||
tarifaNueva.setTramo(tarifa.getTramo());
|
tarifaNueva.setTramo(tarifa.getTramo());
|
||||||
|
@ -538,6 +548,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");
|
||||||
|
|
||||||
tarifa = tarifaService.actualizacion(tarifa);
|
tarifa = tarifaService.actualizacion(tarifa);
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue