fixed bug #6340
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@44491 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d1a49ebad6
commit
c0c5d03a3c
|
@ -479,6 +479,10 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
|||
novoPrecio = atual;
|
||||
celulaAlterada = 11;
|
||||
} else{
|
||||
if (obj[16]==null){
|
||||
continue;
|
||||
}
|
||||
|
||||
novoPrecio = BigDecimal.valueOf(Double.valueOf(obj[16].toString()));
|
||||
celulaAlterada = 13;
|
||||
}
|
||||
|
@ -558,6 +562,7 @@ 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);
|
||||
|
|
|
@ -63,6 +63,7 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
|||
private final Integer CELL_ID_TARIFA = 0;
|
||||
private final Integer CELL_NOVO_PRECIO = 11;
|
||||
private final Integer CELL_PEAJE = 12;
|
||||
private final Integer CELL_NOVO_PEAJE = 13;
|
||||
@Autowired
|
||||
private TarifaService tarifaService;
|
||||
@Autowired
|
||||
|
@ -80,6 +81,7 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
|||
private Radio rdVigenciaNueva;
|
||||
private Combobox cmbVigenciaTarifa;
|
||||
private Label lbVigencia;
|
||||
private String componentePreco;
|
||||
private static Logger log = Logger.getLogger(ModificacionMasivaTarifasUploadController.class);
|
||||
|
||||
@Override
|
||||
|
@ -88,6 +90,7 @@ 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);
|
||||
|
@ -178,7 +181,14 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
|||
boolean existeMercadoCompetido = mercadoCompetidoService.existe(claseServicio, origem, destino);
|
||||
if (!existeMercadoCompetido) {
|
||||
try {
|
||||
Cell cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO);
|
||||
Cell cellNovoPrecio = null;
|
||||
|
||||
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())){
|
||||
cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO);
|
||||
} else{
|
||||
cellNovoPrecio = row.getCell(CELL_NOVO_PEAJE);
|
||||
}
|
||||
|
||||
BigDecimal novoPrecio = new BigDecimal(cellNovoPrecio.getNumericCellValue());
|
||||
novoPrecio = novoPrecio.setScale(2, RoundingMode.HALF_UP);
|
||||
|
||||
|
@ -193,7 +203,13 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
|||
tarifaNueva.setClaseServicio(tarifa.getClaseServicio());
|
||||
tarifaNueva.setMarca(tarifa.getMarca());
|
||||
tarifaNueva.setMoneda(tarifa.getMoneda());
|
||||
tarifaNueva.setPrecio(novoPrecio);
|
||||
|
||||
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())){
|
||||
tarifa.setPrecio(novoPrecio);
|
||||
}else{
|
||||
tarifa.setImportepedagio(novoPrecio);
|
||||
}
|
||||
|
||||
tarifaNueva.setPreciooriginal(tarifa.getPreciooriginal());
|
||||
tarifaNueva.setPrecioredabierto(tarifa.getPrecioredabierto());
|
||||
tarifaNueva.setStatustarifa("A");
|
||||
|
@ -208,14 +224,18 @@ public class ModificacionMasivaTarifasUploadController extends MyGenericForwardC
|
|||
boolean existeTarifa = tarifaService.existe(tarifaNueva.getMarca(), tarifaNueva.getTramo(), tarifaNueva.getMoneda(),
|
||||
tarifaNueva.getClaseServicio(), nuevaVigencia, tarifaNueva.getRuta(), tarifaNueva.getOrgaoConcedente());
|
||||
|
||||
if (!existeTarifa) {
|
||||
if (existeTarifa) {
|
||||
strDuplicidade = strDuplicidade + Labels.getLabel("modificacionMasivaTarifasController.MSG.tarifaExiste") + " (" + tarifa.getTarifaId() + "). \n";
|
||||
} else {
|
||||
tarifa = tarifaService.suscribir(tarifaNueva);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (componentePreco.equals(EnumTarifaPedagio.TARIFA.getDescricao())){
|
||||
tarifa.setPrecio(novoPrecio);
|
||||
}else{
|
||||
tarifa.setImportepedagio(novoPrecio);
|
||||
}
|
||||
|
||||
tarifa.setStatustarifa("A");
|
||||
|
||||
|
|
Loading…
Reference in New Issue