fixes bug#24160
qua: dev:Valdevir Apenas Melhorias codigo tela gerar conexão entre linhas. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@111302 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9d30216061
commit
b3e603c7a2
|
@ -125,12 +125,6 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
conexionRutaConf = (ConexionRutaConf) Executions.getCurrent().getArg().get("conexionRutaConf");
|
||||
conexionRutaConfList = (MyListbox) Executions.getCurrent().getArg().get("conexionRutaConfList");
|
||||
|
||||
Set<Parada> lsParadasOrigemA = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasTodasOrigemA = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasDestinoB = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasTodasDestinoB = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasDestinoC = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasTodasDestinoC = new HashSet<Parada>();
|
||||
|
||||
if (conexionRutaConf != null) {
|
||||
|
||||
|
@ -141,46 +135,23 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
txtTiempoMin.setValue(conexionRutaConf.getTiempoMin());
|
||||
txtTiempoMax.setValue(conexionRutaConf.getTiempoMax());
|
||||
|
||||
for (ConexionRutaExcepcionPtoVta conexionRutaExcepcionPtoVta : conexionRutaRestricaoPtoVtaService.buscarPorConexionConf(conexionRutaConf)) {
|
||||
listPuntoVenta.addItemNovo(conexionRutaExcepcionPtoVta.getPuntoVenta());
|
||||
}
|
||||
|
||||
for (ConexionRutaExcepcionTipoPtoVta conexionRutaExcepcionTipoPtoVta: conexionRutaExcepcionTipoPtoVtaService.buscarPorConexionConf(conexionRutaConf)) {
|
||||
listEspCanal.addItemNovo(conexionRutaExcepcionTipoPtoVta.getTipoPtovta());
|
||||
}
|
||||
|
||||
List<List<Ruta>> rutas = conexionRutaConfService.buscarRutasPorConexionConf(conexionRutaConf.getConexionRutaConfId());
|
||||
List<Ruta> lsRutaA = rutas.get(0);
|
||||
List<Ruta> lsRutaB = rutas.get(1);
|
||||
List<Ruta> lsRutaC = rutas.get(2);
|
||||
configuraExcecaoPorPontoVenda();
|
||||
|
||||
lsParadasOrigemA.addAll(conexionRutaTramoCtrlService.buscarLocalidadesOrigem(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasDestinoB.addAll(conexionRutaTramoCtrlService.buscarLocalidadesDestino(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasDestinoC.addAll(conexionRutaTramoCtrlService.buscarLocalidadesDestinoC(conexionRutaConf.getConexionRutaConfId()));
|
||||
configuraExcecaoPorTipoVenda();
|
||||
|
||||
lsParadasTodasOrigemA.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesOrigem(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasOrigemA.removeAll(lsParadasOrigemA);
|
||||
|
||||
lsParadasTodasDestinoB.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesDestino(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasDestinoB.removeAll(lsParadasDestinoB);
|
||||
|
||||
lsParadasTodasDestinoC.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesDestinoC(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasDestinoC.removeAll(lsParadasDestinoC);
|
||||
|
||||
localidadesLinhaASelecionadaList.setData(new ArrayList<Parada>(lsParadasOrigemA));
|
||||
localidadesOrigemlList.setData(new ArrayList<Parada>(lsParadasTodasOrigemA));
|
||||
localidadesLinhaBSelecionadaList.setData(new ArrayList<Parada>(lsParadasDestinoB));
|
||||
localidadesDestinoList.setData(new ArrayList<Parada>(lsParadasTodasDestinoB));
|
||||
localidadesLinhaCSelecionadaList.setData(new ArrayList<Parada>(lsParadasDestinoC));
|
||||
localidadesDestinoLinhaCList.setData(new ArrayList<Parada>(lsParadasTodasDestinoC));
|
||||
configuraRutasPorEixo();
|
||||
|
||||
//Eixo A
|
||||
configuraLocalidadesEixoA();
|
||||
|
||||
//Eixo B
|
||||
configuraLocalidadesEixoB();
|
||||
|
||||
//Eixo C
|
||||
configuraLocalidadesEixoC();
|
||||
|
||||
executarPesquisaLocalidadesOrigen();
|
||||
executarPesquisaLocalidadesDestino();
|
||||
executarPesquisaLocalidadesDestinoLinhasC();
|
||||
|
||||
rutasAList.setData(lsRutaA);
|
||||
rutasBList.setData(lsRutaB);
|
||||
rutasCList.setData(lsRutaC);
|
||||
|
||||
gerarCombinacao(true);
|
||||
}else{
|
||||
|
@ -188,23 +159,37 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
btnApagar.setDisabled(true);
|
||||
}
|
||||
|
||||
localidadesLinhaASelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
configuraRendererListaLocalidadesSelecionadasEixoA();
|
||||
|
||||
configuraRendererListaLocalidadesSelecionadasEixoB();
|
||||
|
||||
configuraRendererListaLocalidadesSelecionadasEixoC();
|
||||
|
||||
resultadoCombinacao.setSelected(false);
|
||||
|
||||
}
|
||||
|
||||
private void configuraRendererListaLocalidadesSelecionadasEixoC() {
|
||||
localidadesLinhaCSelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada conexionRutaVO = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesLinhaASelecionadaList.getListData()) {
|
||||
for (Object objectParada : localidadesLinhaCSelecionadaList.getListData()) {
|
||||
if (((Parada) objectParada).equals(conexionRutaVO)) {
|
||||
localidadesLinhaASelecionadaList.removeItem(conexionRutaVO);
|
||||
if(!localidadesOrigemlList.getListData().contains(conexionRutaVO)) {
|
||||
localidadesOrigemlList.addItemNovo(conexionRutaVO);
|
||||
localidadesLinhaCSelecionadaList.removeItem(conexionRutaVO);
|
||||
if(!localidadesDestinoLinhaCList.getListData().contains(conexionRutaVO)) {
|
||||
localidadesDestinoLinhaCList.addItemNovo(conexionRutaVO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private void configuraRendererListaLocalidadesSelecionadasEixoB() {
|
||||
localidadesLinhaBSelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
|
@ -223,26 +208,107 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
gerarLocalidadesComunsBC();
|
||||
}
|
||||
}));
|
||||
localidadesLinhaCSelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
}
|
||||
|
||||
private void configuraRendererListaLocalidadesSelecionadasEixoA() {
|
||||
localidadesLinhaASelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada conexionRutaVO = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesLinhaCSelecionadaList.getListData()) {
|
||||
for (Object objectParada : localidadesLinhaASelecionadaList.getListData()) {
|
||||
if (((Parada) objectParada).equals(conexionRutaVO)) {
|
||||
localidadesLinhaCSelecionadaList.removeItem(conexionRutaVO);
|
||||
if(!localidadesDestinoLinhaCList.getListData().contains(conexionRutaVO)) {
|
||||
localidadesDestinoLinhaCList.addItemNovo(conexionRutaVO);
|
||||
localidadesLinhaASelecionadaList.removeItem(conexionRutaVO);
|
||||
if(!localidadesOrigemlList.getListData().contains(conexionRutaVO)) {
|
||||
localidadesOrigemlList.addItemNovo(conexionRutaVO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
resultadoCombinacao.setSelected(false);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura localidades eixo C
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void configuraLocalidadesEixoC() throws InterruptedException {
|
||||
Set<Parada> lsParadasTodasPossiveisEixoC = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasCadastradasEixoC = new HashSet<Parada>();
|
||||
lsParadasCadastradasEixoC.addAll(conexionRutaTramoCtrlService.buscarLocalidadesEixoC(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoC.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesDestinoC(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoC.removeAll(lsParadasCadastradasEixoC);
|
||||
localidadesLinhaCSelecionadaList.setData(new ArrayList<Parada>(lsParadasCadastradasEixoC));
|
||||
localidadesDestinoLinhaCList.setData(new ArrayList<Parada>(lsParadasTodasPossiveisEixoC));
|
||||
executarPesquisaLocalidadesDestinoLinhasC();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura localidades eixo B
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void configuraLocalidadesEixoB() throws InterruptedException {
|
||||
Set<Parada> lsParadasTodasPossiveisEixoB = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasCadastradasEixoB = new HashSet<Parada>();
|
||||
lsParadasCadastradasEixoB.addAll(conexionRutaTramoCtrlService.buscarLocalidadeEixoB(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoB.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesDestino(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoB.removeAll(lsParadasCadastradasEixoB);
|
||||
localidadesLinhaBSelecionadaList.setData(new ArrayList<Parada>(lsParadasCadastradasEixoB));
|
||||
localidadesDestinoList.setData(new ArrayList<Parada>(lsParadasTodasPossiveisEixoB));
|
||||
executarPesquisaLocalidadesDestino();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura localidades eixo A
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private void configuraLocalidadesEixoA() throws InterruptedException {
|
||||
Set<Parada> lsParadasTodasPossiveisEixoA = new HashSet<Parada>();
|
||||
Set<Parada> lsParadasCadastradasEixoA = new HashSet<Parada>();
|
||||
lsParadasCadastradasEixoA.addAll(conexionRutaTramoCtrlService.buscarLocalidadesEixoA(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoA.addAll(conexionRutaTramoCtrlService.buscarTodasLocalidadesOrigem(conexionRutaConf.getConexionRutaConfId()));
|
||||
lsParadasTodasPossiveisEixoA.removeAll(lsParadasCadastradasEixoA);
|
||||
localidadesLinhaASelecionadaList.setData(new ArrayList<Parada>(lsParadasCadastradasEixoA));
|
||||
localidadesOrigemlList.setData(new ArrayList<Parada>(lsParadasTodasPossiveisEixoA));
|
||||
executarPesquisaLocalidadesOrigen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura as rutas (linhas) para cada eixo
|
||||
*/
|
||||
private void configuraRutasPorEixo() {
|
||||
//Busca uma lista de linhas (rutas), esta lista contem 3 sub-listas (1 para cada eixo de conexão A, B e C)
|
||||
List<List<Ruta>> rutas = conexionRutaConfService.buscarRutasPorConexionConf(conexionRutaConf.getConexionRutaConfId());
|
||||
List<Ruta> lsRutaA = rutas.get(0);
|
||||
List<Ruta> lsRutaB = rutas.get(1);
|
||||
List<Ruta> lsRutaC = rutas.get(2);
|
||||
rutasAList.setData(lsRutaA);
|
||||
rutasBList.setData(lsRutaB);
|
||||
rutasCList.setData(lsRutaC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura a lista de exceções por tipo de venda (canal de venda)
|
||||
*/
|
||||
private void configuraExcecaoPorTipoVenda() {
|
||||
//Busca a lista de exceções por tipo de venda (canal de venda)
|
||||
List<ConexionRutaExcepcionTipoPtoVta> conexionRutaExcepcionTipoPtoVtaList = conexionRutaExcepcionTipoPtoVtaService.buscarPorConexionConf(conexionRutaConf);
|
||||
for (ConexionRutaExcepcionTipoPtoVta conexionRutaExcepcionTipoPtoVta:conexionRutaExcepcionTipoPtoVtaList ) {
|
||||
listEspCanal.addItemNovo(conexionRutaExcepcionTipoPtoVta.getTipoPtovta());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configura a lista de exceções por ponto de venda
|
||||
*/
|
||||
private void configuraExcecaoPorPontoVenda() {
|
||||
//Busca a lista de exceções por ponto de venda
|
||||
List<ConexionRutaExcepcionPtoVta> conexionRutaExcepcionPtoVtaList = conexionRutaRestricaoPtoVtaService.buscarPorConexionConf(conexionRutaConf);
|
||||
for (ConexionRutaExcepcionPtoVta conexionRutaExcepcionPtoVta : conexionRutaExcepcionPtoVtaList) {
|
||||
listPuntoVenta.addItemNovo(conexionRutaExcepcionPtoVta.getPuntoVenta());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -311,6 +377,7 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
public void onClick$btnPesquisaLocalidadesDestino(Event ev) throws InterruptedException {
|
||||
executarPesquisaLocalidadesDestino();
|
||||
}
|
||||
|
||||
public void renderizarLinhasAB() {
|
||||
localidadesComunsList.setItemRenderer(new RenderEixoConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
|
@ -687,6 +754,7 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onClick$btnNovoRutaB(Event ev) throws InterruptedException {
|
||||
|
||||
if (!validarLinhaJaSelecionada()) {
|
||||
|
@ -710,7 +778,6 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
if(rutaB.getRutaId() == -1){
|
||||
rutasBList.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Ruta> canaisVenta = rutasBList.getListData();
|
||||
for (Ruta rutaAux : canaisVenta) {
|
||||
if(rutaB.getRutaId() == -1){
|
||||
|
@ -761,6 +828,7 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onClick$btnNovoRutaC(Event ev) throws InterruptedException {
|
||||
|
||||
|
||||
|
@ -785,7 +853,6 @@ public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
|||
if(rutaC.getRutaId() == -1){
|
||||
rutasCList.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Ruta> canaisVenta = rutasCList.getListData();
|
||||
for (Ruta rutaAux : canaisVenta) {
|
||||
if(rutaC.getRutaId() == -1){
|
||||
|
|
Loading…
Reference in New Issue