From 21e8fa1d543c9083cea9963d236b2f07b054fee6 Mon Sep 17 00:00:00 2001 From: valdir Date: Tue, 15 Dec 2020 13:33:42 +0000 Subject: [PATCH] =?UTF-8?q?0020761:=20ESPEC=20-=20Cria=C3=A7=C3=A3o=20de?= =?UTF-8?q?=203=20tr=C3=AAs=20servi=C3=A7os=20no=20Doble=20Decker=20bug#20?= =?UTF-8?q?761=20dev:fabio=20qua:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@104724 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../EditarCorridaController.java | 44 ++++++++++++++++--- web/WEB-INF/i3-label_es_MX.label | 4 +- web/WEB-INF/i3-label_pt_BR.label | 4 +- web/gui/esquema_operacional/editarCorrida.zul | 29 ++++++++++-- 4 files changed, 68 insertions(+), 13 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java index dc78674e8..7006a7566 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java @@ -161,6 +161,7 @@ public class EditarCorridaController extends MyGenericForwardComposer { private Textbox txtInfoCorrida; private Checkbox chkCorridaExtra; private Intbox txtNumCorridaPisoExtra; + private Intbox txtNumCorridaPisoExtra2; private Intbox txtQtdeDiasGeracao; private Combobox cmbClase; private Combobox cmbMarca; @@ -191,6 +192,7 @@ public class EditarCorridaController extends MyGenericForwardComposer { private Label lbDivision; private Label lbNumCorridaPisoExtra; + private Label lbNumCorridaPisoExtra2; private Button btnApagar; private Textbox txtIdCorridaRebote; private Textbox txtPlataforma; @@ -310,7 +312,9 @@ public class EditarCorridaController extends MyGenericForwardComposer { chkDoblePiso.setChecked(true); lbNumCorridaPisoExtra.setVisible(Boolean.TRUE); txtNumCorridaPisoExtra.setVisible(Boolean.TRUE); - txtNumCorridaPisoExtra.setDisabled(Boolean.TRUE); + + lbNumCorridaPisoExtra2.setVisible(Boolean.TRUE); + txtNumCorridaPisoExtra2.setVisible(Boolean.TRUE); } } @@ -611,6 +615,7 @@ public class EditarCorridaController extends MyGenericForwardComposer { if (chkDoblePiso.isChecked()) { txtNumCorridaPisoExtra.getValue(); + txtNumCorridaPisoExtra2.getValue(); } if (chkDoblePiso.isChecked() && !validarPisoExtra()) { @@ -1407,10 +1412,16 @@ public class EditarCorridaController extends MyGenericForwardComposer { lbNumCorridaPisoExtra.setVisible(Boolean.TRUE); txtNumCorridaPisoExtra.setVisible(Boolean.TRUE); + lbNumCorridaPisoExtra2.setVisible(Boolean.TRUE); + txtNumCorridaPisoExtra2.setVisible(Boolean.TRUE); + } else { esquemaCorrida.setPisoExtra(Boolean.FALSE); lbNumCorridaPisoExtra.setVisible(Boolean.FALSE); txtNumCorridaPisoExtra.setVisible(Boolean.FALSE); + + lbNumCorridaPisoExtra2.setVisible(Boolean.FALSE); + txtNumCorridaPisoExtra2.setVisible(Boolean.FALSE); } } @@ -1903,41 +1914,56 @@ public class EditarCorridaController extends MyGenericForwardComposer { private Boolean validarPisoExtra() throws InterruptedException { Boolean returnValue = true; EsquemaCorrida esquemaCorrida = esquemaCorridaService.obtenerByEsquemaCorrida(txtNumCorridaPisoExtra.getValue()); + + EsquemaCorrida esquemaCorrida2 = null; + Boolean isPisoExtra2 = txtNumCorridaPisoExtra2.getValue() != null; + + if(txtNumCorridaPisoExtra2.getValue() != null) { + esquemaCorrida2 = esquemaCorridaService.obtenerByEsquemaCorrida(txtNumCorridaPisoExtra2.getValue()); + } - if (esquemaCorrida == null) { + + if (esquemaCorrida == null || (isPisoExtra2 && esquemaCorrida2 == null)) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraExistente"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; - } else if (this.esquemaCorrida.equals(esquemaCorrida)) { + } else if (this.esquemaCorrida.equals(esquemaCorrida) || (isPisoExtra2 && this.esquemaCorrida.equals(esquemaCorrida2))) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraIgualServico"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; - } else if (esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra()) { + } else if ((esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra()) || (isPisoExtra2 && esquemaCorrida2.getPisoExtra() != null && esquemaCorrida2.getPisoExtra())) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraJaEPisoExtra"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; - } else if (!esquemaCorrida.getMarca().equals(this.esquemaCorrida.getMarca())) { + } else if (!esquemaCorrida.getMarca().equals(this.esquemaCorrida.getMarca()) || (isPisoExtra2 && !esquemaCorrida2.getMarca().equals(this.esquemaCorrida.getMarca()))) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraEmpresaDiferente"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; - } else if (!esquemaCorrida.getRuta().getOrgaoConcedente().equals(this.esquemaCorrida.getRuta().getOrgaoConcedente())) { + } else if (!esquemaCorrida.getRuta().getOrgaoConcedente().equals(this.esquemaCorrida.getRuta().getOrgaoConcedente()) + || (isPisoExtra2 && !esquemaCorrida2.getRuta().getOrgaoConcedente().equals(this.esquemaCorrida.getRuta().getOrgaoConcedente()))) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraOrgaoDiferente"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; - } else if (validarEsquemaTramo(esquemaCorrida)) { + } else if (validarEsquemaTramo(esquemaCorrida) || (isPisoExtra2 && validarEsquemaTramo(esquemaCorrida2))) { Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.servicoPisoExtraLocalidadeDiferente"), Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.ERROR); returnValue = false; + } else if(esquemaCorrida.equals(esquemaCorrida2)) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.pisoExtraIguais.label"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + returnValue = false; } if (!returnValue) { txtNumCorridaPisoExtra.setDisabled(false); + txtNumCorridaPisoExtra2.setDisabled(false); } return returnValue; @@ -1946,6 +1972,10 @@ public class EditarCorridaController extends MyGenericForwardComposer { public void onChange$txtNumCorridaPisoExtra() throws InterruptedException { validarPisoExtra(); } + + public void onChange$txtNumCorridaPisoExtra2() throws InterruptedException { + validarPisoExtra(); + } private boolean validarEsquemaTramo(EsquemaCorrida esquemaCorrida) { diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 75cd90104..613f0d264 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -2763,7 +2763,9 @@ editarConfiguracionCorridaController.btnAdcionarTramo.tooltiptext = Incluir editarConfiguracionCorridaController.lbVigencia.value = Vigencia editarConfiguracionCorridaController.lbQtdeDiasGeracao.value=Cant. dias generación editarConfiguracionCorridaController.lbNumCorrida.label = Numero servicio -editarConfiguracionCorridaController.lbNumCorridaPisoExtra.label = Numero del servicio del piso extra +editarConfiguracionCorridaController.lbNumCorridaPisoExtra.label = Numero del servicio del piso extra 1 +editarConfiguracionCorridaController.lbNumCorridaPisoExtra2.label = Numero del servicio del piso extra 2 +editarConfiguracionCorridaController.pisoExtraIguais.label=Os pisos extras não podem ser iguais. editarConfiguracionCorridaController.lbDe.value = Desde editarConfiguracionCorridaController.lbHasta.value = Hasta editarConfiguracionCorridaController.lbCada.value = Cada diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 1345debc9..2e81215b5 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -2962,7 +2962,9 @@ editarConfiguracionCorridaController.btnAdcionarTramo.tooltiptext = Incluir editarConfiguracionCorridaController.lbVigencia.value = Vigência editarConfiguracionCorridaController.lbQtdeDiasGeracao.value=Qtd. dias Geração editarConfiguracionCorridaController.lbNumCorrida.label = Número Serviço -editarConfiguracionCorridaController.lbNumCorridaPisoExtra.label = Número de Serviço do Piso Extra +editarConfiguracionCorridaController.lbNumCorridaPisoExtra.label = Número de Serviço do Piso Extra 1 +editarConfiguracionCorridaController.lbNumCorridaPisoExtra2.label = Número de Serviço do Piso Extra 2 +editarConfiguracionCorridaController.pisoExtraIguais.label=Os pisos extras não podem ser iguais. editarConfiguracionCorridaController.lbDe.value = De editarConfiguracionCorridaController.lbHasta.value = Até editarConfiguracionCorridaController.lbCada.value = Cada diff --git a/web/gui/esquema_operacional/editarCorrida.zul b/web/gui/esquema_operacional/editarCorrida.zul index 422fb68dc..b0d59dd37 100644 --- a/web/gui/esquema_operacional/editarCorrida.zul +++ b/web/gui/esquema_operacional/editarCorrida.zul @@ -361,10 +361,31 @@