fixes bug#22458
dev:wilian qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@106955 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
f527f49c6d
commit
2ca7f0ec8e
|
@ -70,26 +70,31 @@ public class ConexionRutaCombinacionFactory {
|
|||
for (Ruta rutaEixoB : rutasEixoB) {
|
||||
for (String comb : combinacoes) {
|
||||
valoresCalculados = comb.split(";");
|
||||
|
||||
Integer origemConexaoCtrl = cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])).getParadaId();
|
||||
Integer destinoConexaoCtrl = cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])).getParadaId();
|
||||
|
||||
ConexionCtrlVO conexionCtrl = adicionarConexao(conexoesCtrl, origemConexaoCtrl, destinoConexaoCtrl);
|
||||
ConexionRutaCtrlVO conexionRutaCtrl = new ConexionRutaCtrlVO(rutaEixoA.getRutaId(), rutaEixoB.getRutaId(), null);
|
||||
|
||||
ParadaVOConexionRuta trechoA = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[1])), rutaEixoA.getRutaId(), rutaEixoA.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoA.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoB = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[2])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), rutaEixoB.getRutaId(), rutaEixoB.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
||||
i++;
|
||||
|
||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, null);
|
||||
|
||||
i = 1;
|
||||
if(valoresCalculados != null && valoresCalculados.length == 4) {
|
||||
Integer origemConexaoCtrl = Integer.parseInt(valoresCalculados[0]);
|
||||
Integer destinoConexaoCtrl = Integer.parseInt(valoresCalculados[3]);
|
||||
if(origemConexaoCtrl == null || cacheLocalidades.get(origemConexaoCtrl) == null ||
|
||||
destinoConexaoCtrl == null || cacheLocalidades.get(destinoConexaoCtrl) == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ConexionCtrlVO conexionCtrl = adicionarConexao(conexoesCtrl, origemConexaoCtrl, destinoConexaoCtrl);
|
||||
ConexionRutaCtrlVO conexionRutaCtrl = new ConexionRutaCtrlVO(rutaEixoA.getRutaId(), rutaEixoB.getRutaId(), null);
|
||||
|
||||
ParadaVOConexionRuta trechoA = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[1])), rutaEixoA.getRutaId(), rutaEixoA.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoA.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoB = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[2])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), rutaEixoB.getRutaId(), rutaEixoB.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
||||
i++;
|
||||
|
||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, null);
|
||||
|
||||
i = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -133,12 +138,24 @@ public class ConexionRutaCombinacionFactory {
|
|||
}
|
||||
|
||||
private static void adicionarLocalidadeGerada(ConexionCtrlVO conexionCtrl, List<ParadaVOConexionRuta> localidadesGeradas, ParadaVOConexionRuta trechoA, ParadaVOConexionRuta trechoB, ParadaVOConexionRuta trechoC) {
|
||||
boolean isTrechoAVende = rutaCombinacionService.isRutaCombinacionVenda(trechoA.getRutaId(), trechoA.getParadaOrigem().getParadaId(), trechoA.getParadaDestino().getParadaId());
|
||||
boolean isTrechoBVende = rutaCombinacionService.isRutaCombinacionVenda(trechoB.getRutaId(), trechoB.getParadaOrigem().getParadaId(), trechoB.getParadaDestino().getParadaId());
|
||||
boolean isTrechoAVende = false;
|
||||
boolean isTrechoBVende = false;
|
||||
|
||||
if(isDadosNotNull(trechoA)) {
|
||||
isTrechoAVende = rutaCombinacionService.isRutaCombinacionVenda(trechoA.getRutaId(), trechoA.getParadaOrigem().getParadaId(), trechoA.getParadaDestino().getParadaId());
|
||||
}
|
||||
|
||||
if(isDadosNotNull(trechoB)) {
|
||||
isTrechoBVende = rutaCombinacionService.isRutaCombinacionVenda(trechoB.getRutaId(), trechoB.getParadaOrigem().getParadaId(), trechoB.getParadaDestino().getParadaId());
|
||||
}
|
||||
|
||||
boolean isTrechoCVende = true;
|
||||
if(trechoC != null) {
|
||||
isTrechoCVende = rutaCombinacionService.isRutaCombinacionVenda(trechoC.getRutaId(), trechoC.getParadaOrigem().getParadaId(), trechoC.getParadaDestino().getParadaId());
|
||||
if(isDadosNotNull(trechoC)) {
|
||||
isTrechoCVende = rutaCombinacionService.isRutaCombinacionVenda(trechoC.getRutaId(), trechoC.getParadaOrigem().getParadaId(), trechoC.getParadaDestino().getParadaId());
|
||||
} else {
|
||||
isTrechoCVende = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(isTrechoAVende && isTrechoBVende && isTrechoCVende) {
|
||||
|
@ -163,30 +180,36 @@ public class ConexionRutaCombinacionFactory {
|
|||
for (Ruta rutaEixoC : rutasEixoC) {
|
||||
for (String comb : combinations) {
|
||||
valoresCalculados = comb.split(";");
|
||||
|
||||
Integer origemConexaoCtrl = cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])).getParadaId();
|
||||
Integer destinoConexaoCtrl = cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])).getParadaId();
|
||||
ConexionCtrlVO conexionCtrl = adicionarConexao(conexoesCtrl, origemConexaoCtrl, destinoConexaoCtrl);
|
||||
ConexionRutaCtrlVO conexionRutaCtrl = new ConexionRutaCtrlVO(rutaEixoA.getRutaId(), rutaEixoB.getRutaId(), rutaEixoC.getRutaId());
|
||||
|
||||
ParadaVOConexionRuta trechoA = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[1])), rutaEixoA.getRutaId(), rutaEixoA.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoA.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoB = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[2])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), rutaEixoB.getRutaId(), rutaEixoB.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoC = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])), rutaEixoC.getRutaId(), rutaEixoC.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoC.getDescSentido());
|
||||
i++;
|
||||
|
||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, trechoC);
|
||||
|
||||
i = 1;
|
||||
if(valoresCalculados != null && valoresCalculados.length == 5) {
|
||||
Integer origemConexaoCtrl = Integer.parseInt(valoresCalculados[0]);
|
||||
Integer destinoConexaoCtrl = Integer.parseInt(valoresCalculados[4]);
|
||||
if(origemConexaoCtrl == null || cacheLocalidades.get(origemConexaoCtrl) == null ||
|
||||
destinoConexaoCtrl == null || cacheLocalidades.get(destinoConexaoCtrl) == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ConexionCtrlVO conexionCtrl = adicionarConexao(conexoesCtrl, origemConexaoCtrl, destinoConexaoCtrl);
|
||||
ConexionRutaCtrlVO conexionRutaCtrl = new ConexionRutaCtrlVO(rutaEixoA.getRutaId(), rutaEixoB.getRutaId(), rutaEixoC.getRutaId());
|
||||
|
||||
ParadaVOConexionRuta trechoA = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[1])), rutaEixoA.getRutaId(), rutaEixoA.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoA.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoB = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[2])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), rutaEixoB.getRutaId(), rutaEixoB.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
||||
i++;
|
||||
|
||||
ParadaVOConexionRuta trechoC = new ParadaVOConexionRuta(conexionCtrl.getGrupo(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])), rutaEixoC.getRutaId(), rutaEixoC.getNumRuta(), i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[4])),
|
||||
conexionCtrl, conexionRutaCtrl, rutaEixoC.getDescSentido());
|
||||
i++;
|
||||
|
||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, trechoC);
|
||||
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,4 +299,11 @@ public class ConexionRutaCombinacionFactory {
|
|||
return list;
|
||||
}
|
||||
|
||||
private static boolean isDadosNotNull(ParadaVOConexionRuta trecho) {
|
||||
return trecho != null &&
|
||||
trecho.getRutaId() != null &&
|
||||
trecho.getParadaOrigem() != null &&
|
||||
trecho.getParadaDestino() != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue