fixes bug#AL-2835
parent
5a57d3ad8d
commit
6e57e8eef7
6
pom.xml
6
pom.xml
|
@ -4,12 +4,12 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ventaboletosadm</artifactId>
|
||||
<version>1.11.10</version>
|
||||
<version>1.12.0</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<properties>
|
||||
<modelWeb.version>1.8.1</modelWeb.version>
|
||||
<flyway.version>1.6.4</flyway.version>
|
||||
<modelWeb.version>1.9.0</modelWeb.version>
|
||||
<flyway.version>1.7.0</flyway.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|||
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorridaEmbarqueDesembarque;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorridaInfo;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaTramo;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
|
@ -71,6 +72,7 @@ import com.rjconsultores.ventaboletos.service.CorridaService;
|
|||
import com.rjconsultores.ventaboletos.service.DivisionService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaEmbarqueDesembarqueService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaInfoService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaTramoService;
|
||||
import com.rjconsultores.ventaboletos.service.MarcaClaseServicioService;
|
||||
|
@ -90,6 +92,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.MyComboRutaRenderer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCorridaTramo;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCorridaInfomacaoTramo;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEsquemaCorridaEmbarqueDesembarque;
|
||||
|
||||
/**
|
||||
|
@ -140,6 +143,8 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
private EsquemaCorridaEmbarqueDesembarqueService esquemaCorridaEmbarqueDesembarqueService;
|
||||
|
||||
private DivisionService divisionService;
|
||||
@Autowired
|
||||
private EsquemaCorridaInfoService esquemaCorridaInfoService;
|
||||
|
||||
//Radio
|
||||
private Radio porBloq;
|
||||
|
@ -157,6 +162,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
private MyListbox esquemaCorridaList;
|
||||
private MyListbox esquemaTramoList;
|
||||
private MyListbox esquemaCorridaEmbarqueDesembarqueListbox;
|
||||
private MyListbox lstTrechosInformacaoCorridaListbox;
|
||||
//Datebox
|
||||
private Datebox fecniciovigencia;
|
||||
private Datebox fecfinvigencia;
|
||||
|
@ -191,6 +197,8 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
private Combobox cmbEmbarqueDesembarque;
|
||||
private Combobox cmbLocalEmbarqueDesembarque;
|
||||
private Combobox cmbRolOperativoServicoExtra;
|
||||
private Combobox cmbParadaOrigem;
|
||||
private Combobox cmbParadaDestino;
|
||||
//Button
|
||||
private Button btnAsientos;
|
||||
private Button btnApagar;
|
||||
|
@ -215,6 +223,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
private Textbox txtIdCorridaRebote;
|
||||
private Textbox txtPlataforma;
|
||||
private Textbox txtInfoCorrida;
|
||||
private Textbox txtMensagemTrecho;
|
||||
//Checkbox
|
||||
private Checkbox chkDoblePiso;
|
||||
private Checkbox chkCorridaExtra;
|
||||
|
@ -247,6 +256,8 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
private List<RutaEmbarqueDesembarque> lsRutaEmbarqueDesembarque = new ArrayList<RutaEmbarqueDesembarque>();
|
||||
private List<EsquemaCorridaEmbarqueDesembarque> lsEsquemaCorridaEmbarqueDesembarqueSelected = new ArrayList<EsquemaCorridaEmbarqueDesembarque>();
|
||||
private List<EsquemaCorridaEmbarqueDesembarque> lsEsquemaCorridaEmbarqueDesembarqueBorrar = new ArrayList<EsquemaCorridaEmbarqueDesembarque>();
|
||||
private List<EsquemaCorridaInfo> lsEsquemaCorridaInfoSelected;
|
||||
private List<EsquemaCorridaInfo> lsEsquemaCorridaInfoBorrar;
|
||||
private List<Parada> lsEmbarqueDesembarque;
|
||||
//boolean
|
||||
private boolean isPrimeiraVez = true;
|
||||
|
@ -271,6 +282,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
popularCombobox(cmbIndGeneraFeriado);
|
||||
|
||||
esquemaCorridaEmbarqueDesembarqueListbox.setItemRenderer(new RenderEsquemaCorridaEmbarqueDesembarque());
|
||||
lstTrechosInformacaoCorridaListbox.setItemRenderer(new RenderCorridaInfomacaoTramo());
|
||||
|
||||
esquemaCorrida = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida");
|
||||
if (esquemaCorrida.getEsquemacorridaId() != null) {
|
||||
|
@ -296,6 +308,9 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
|
||||
lsAutoBus = autobusService.obtenerTodos();
|
||||
|
||||
lsEsquemaCorridaInfoSelected = new ArrayList<EsquemaCorridaInfo>();
|
||||
lsEsquemaCorridaInfoBorrar = new ArrayList<EsquemaCorridaInfo>();
|
||||
|
||||
if (esquemaCorrida.getEsquemacorridaId() != null) {
|
||||
|
||||
// 01 - não se pode mudar dados básicos da corrida.
|
||||
|
@ -307,8 +322,10 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
lsRutaEmbarqueDesembarque = rutaEmbarqueDesembarqueService.obtenerPorRuta(esquemaCorrida.getRuta());
|
||||
}
|
||||
lsEsquemaCorridaEmbarqueDesembarqueSelected = esquemaCorridaEmbarqueDesembarqueService.obtenerPorEsquemaCorrida(esquemaCorrida);
|
||||
lsEsquemaCorridaInfoSelected = esquemaCorridaInfoService.obtenerPorEsquemaCorrida(esquemaCorrida);
|
||||
|
||||
esquemaCorridaEmbarqueDesembarqueListbox.setData(lsEsquemaCorridaEmbarqueDesembarqueSelected);
|
||||
lstTrechosInformacaoCorridaListbox.setData(lsEsquemaCorridaInfoSelected);
|
||||
|
||||
if (esquemaCorrida.getRuta() != null) {
|
||||
embarqueDesembarqueDisabled = false;
|
||||
|
@ -696,6 +713,12 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
esquemaCorridaEmbarqueDesembarqueService.borrar(esquemaCorridaEmbarqueDesembarque);
|
||||
}
|
||||
}
|
||||
|
||||
for (EsquemaCorridaInfo esquemaCorridaInfo : lsEsquemaCorridaInfoBorrar) {
|
||||
if (esquemaCorridaInfo.getEsquemaCorridaInfoId() != null) {
|
||||
esquemaCorridaInfoService.borrar(esquemaCorridaInfo);
|
||||
}
|
||||
}
|
||||
//Imprimir ou não recibo BPE na embarcada
|
||||
validaNaoImprimeBpe(dataAteFecfinvigencia);
|
||||
|
||||
|
@ -1384,6 +1407,8 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
BindingListModelList listModelTramo = new BindingListModelList(
|
||||
lsTramos, true);
|
||||
cmbTramo.setModel(listModelTramo);
|
||||
cmbParadaOrigem.setModel(new BindingListModelList( lstPardasRuta, true));
|
||||
cmbParadaDestino.setModel(new BindingListModelList( lstPardasRuta, true));
|
||||
}
|
||||
|
||||
private void selecionarRuta() {
|
||||
|
@ -2615,7 +2640,66 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
|||
public void setIsVisualizarNaAPI(Boolean isVisualizarNaAPI) {
|
||||
this.isVisualizarNaAPI = isVisualizarNaAPI;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onClick$btnAdicionarTramoInformacaoCorrida(Event ev) {
|
||||
|
||||
try {
|
||||
cmbParadaOrigem.getValue();
|
||||
cmbParadaDestino.getValue();
|
||||
txtMensagemTrecho.getValue();
|
||||
|
||||
Parada origem = (Parada) cmbParadaOrigem.getSelectedItem().getValue();
|
||||
Parada destino = (Parada) cmbParadaDestino.getSelectedItem().getValue();
|
||||
|
||||
boolean existe = false;
|
||||
for (EsquemaCorridaInfo esquemaCorridaInfo : (List<EsquemaCorridaInfo>)lstTrechosInformacaoCorridaListbox.getListData()) {
|
||||
if(esquemaCorridaInfo.getOrigem().getDescparada().equals(origem.getDescparada()) && esquemaCorridaInfo.getDestino().getDescparada().equals(destino.getDescparada())) {
|
||||
existe = true;
|
||||
}
|
||||
}
|
||||
if(!existe) {
|
||||
EsquemaCorridaInfo esquemaCorridaInfo = new EsquemaCorridaInfo();
|
||||
esquemaCorridaInfo.setOrigem(origem);
|
||||
esquemaCorridaInfo.setDestino(destino);
|
||||
esquemaCorridaInfo.setActivo(true);
|
||||
esquemaCorridaInfo.setInfoCorrida(txtMensagemTrecho.getValue());
|
||||
esquemaCorridaInfo.setEsquemaCorrida(esquemaCorrida);
|
||||
esquemaCorridaInfo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
esquemaCorridaInfo.setFecmodif(Calendar.getInstance().getTime());
|
||||
esquemaCorridaInfo.setActivo(Boolean.TRUE);
|
||||
lsEsquemaCorridaInfoSelected.add(esquemaCorridaInfo);
|
||||
esquemaCorrida.setLsEsquemaCorridaInfo(lsEsquemaCorridaInfoSelected);
|
||||
lstTrechosInformacaoCorridaListbox.setData(lsEsquemaCorridaInfoSelected);
|
||||
|
||||
}else {
|
||||
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
|
||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||
Messagebox.OK,
|
||||
Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("ESQ CORRIDA INFO TRMO - Erro ao adicionar tramo: " + e, e);
|
||||
e.printStackTrace();
|
||||
onClick$btnAdicionarTramo(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnRemoverEsquemaCorridaInfoTramo(Event ev) throws InterruptedException {
|
||||
|
||||
EsquemaCorridaInfo esquemaCorridaInfo = (EsquemaCorridaInfo) lstTrechosInformacaoCorridaListbox.getSelected();
|
||||
|
||||
if (esquemaCorridaInfo != null) {
|
||||
lsEsquemaCorridaInfoSelected.remove(esquemaCorridaInfo);
|
||||
lsEsquemaCorridaInfoBorrar.add(esquemaCorridaInfo);
|
||||
esquemaCorrida.setLsEsquemaCorridaInfo(null);
|
||||
lstTrechosInformacaoCorridaListbox.setData(lsEsquemaCorridaInfoSelected);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorridaInfo;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public class RenderCorridaInfomacaoTramo implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
EsquemaCorridaInfo esquemaCorridaInfo = (EsquemaCorridaInfo) o;
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
Parada origem = esquemaCorridaInfo.getOrigem();
|
||||
if (origem != null) {
|
||||
lc = new Listcell(origem.getDescparada());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
Parada destino = esquemaCorridaInfo.getDestino();
|
||||
if (destino != null) {
|
||||
lc = new Listcell(destino.getDescparada());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
String informacao = esquemaCorridaInfo.getInfoCorrida();
|
||||
if (informacao != null) {
|
||||
lc = new Listcell(informacao);
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
lstm.setAttribute("data", esquemaCorridaInfo);
|
||||
}
|
||||
}
|
|
@ -81,6 +81,7 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.Corrida</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CorridaCtrl</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CorridaTramo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CorridaInfo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Cortesia</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CortesiaDireccion</value>
|
||||
|
@ -117,8 +118,10 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaAsiento</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaAgrupacion</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaCorrida</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaCorridaInfo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaOperacional</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EsquemaTramo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CorridaInfo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Estado</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Feriado</value>
|
||||
|
|
|
@ -3205,6 +3205,10 @@ editarConfiguracionCorridaController.rdSentado.value = Sentado
|
|||
editarConfiguracionCorridaController.rdEmPe.value = Em Pé
|
||||
editarConfiguracionCorridaController.rdAmbos.value = Ambos
|
||||
editarConfiguracionCorridaController.chkNaoIncluirLinhaInativa = Não incluir inativas
|
||||
editarConfiguracionCorridaController.lbLocalidadeOrigem.value= De
|
||||
editarConfiguracionCorridaController.lbLocalidadeDestino.value= Hasta
|
||||
editarConfiguracionCorridaController.lbMensagemTrecho.value= Mensagem por Trecho
|
||||
editarConfiguracionCorridaController.tabInformacaoCorridaPorTrecho.value= Información Corrida por Tramo
|
||||
|
||||
|
||||
#Planeacion de Poltrona Controller
|
||||
|
|
|
@ -3567,6 +3567,10 @@ editarConfiguracionCorridaController.rdSentado.value = Sentado
|
|||
editarConfiguracionCorridaController.rdEmPe.value = Em Pé
|
||||
editarConfiguracionCorridaController.rdAmbos.value = Ambos
|
||||
editarConfiguracionCorridaController.chkNaoIncluirLinhaInativa = Não incluir inativas
|
||||
editarConfiguracionCorridaController.lbLocalidadeOrigem.value= Origem
|
||||
editarConfiguracionCorridaController.lbLocalidadeDestino.value= Destino
|
||||
editarConfiguracionCorridaController.lbMensagemTrecho.value= Mensagem por Trecho
|
||||
editarConfiguracionCorridaController.tabInformacaoCorridaPorTrecho.value= Informação Corrida por Trecho
|
||||
|
||||
#Planeacion de Poltrona Controller
|
||||
editarConfiguracionCorridaAsientoController.window.title = Planejamento de poltronas
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
label="${c:l('editarConfiguracionCorridaController.lbFlexBus.value')}" />
|
||||
<tab id="tabHorarioExtra"
|
||||
label="${c:l('editarConfiguracionCorridaController.lbAutomatizacaoHorarioExtra.value')}" />
|
||||
<tab id="tabInformacaoCorridaTrecho"
|
||||
label="${c:l('editarConfiguracionCorridaController.tabInformacaoCorridaPorTrecho.value')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<!-- Aba Serviço -->
|
||||
|
@ -746,6 +748,60 @@
|
|||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
<!-- Informação corrida por trecho -->
|
||||
<tabpanel >
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCorridaController.lbLocalidadeOrigem.value')}" />
|
||||
<combobox id="cmbParadaOrigem" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="40%" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCorridaController.lbLocalidadeDestino.value')}" />
|
||||
<combobox id="cmbParadaDestino" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true"
|
||||
width="40%" disabled="false" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfiguracionCorridaController.lbMensagemTrecho.value')}" />
|
||||
<textbox id="txtMensagemTrecho" constraint="no empty"
|
||||
maxlength="40" width="80%"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<toolbar>
|
||||
<button id="btnAdicionarTramoInformacaoCorrida" height="20"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarConfiguracionCorridaController.btnAdcionarTramo.tooltiptext')}" />
|
||||
<button id="btnRemoverEsquemaCorridaInfoTramo" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarConfiguracionCorridaController.btnRemoverTramo.tooltiptext')}" />
|
||||
</toolbar>
|
||||
<listbox
|
||||
id="lstTrechosInformacaoCorridaListbox"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
height="360px">
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConfiguracionCorridaController.lbLocalidadeOrigem.value')}" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConfiguracionCorridaController.lbLocalidadeDestino.value')}" />
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConfiguracionCorridaController.tabInformacaoCorridaPorTrecho.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
|
|
Loading…
Reference in New Issue