fixes bug#22049
qua:junia,waly,willian dev: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@106650 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
28194c46b0
commit
b76f901e18
|
@ -5,6 +5,7 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -16,6 +17,7 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Combobox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||
|
@ -60,9 +62,14 @@ public class BusquedaConexionController extends MyGenericForwardComposer {
|
|||
Map args = new HashMap();
|
||||
args.put("conexionCtrlId", conexionCtrlId);
|
||||
args.put("conexionesList", conexionesList);
|
||||
|
||||
openWindow("/gui/esquema_operacional/editarConexion.zul",
|
||||
Labels.getLabel("editarConexionController.window.title"), args, MODAL);
|
||||
|
||||
if(conexionService.buscarPorConexionCtrl(conexionCtrlId).get(0).getRutaId() != null) {
|
||||
openWindow("/gui/esquema_operacional/editarConexionRuta.zul",
|
||||
Labels.getLabel("editarConexionController.window.title"), args, MODAL);
|
||||
}else {
|
||||
openWindow("/gui/esquema_operacional/editarConexion.zul",
|
||||
Labels.getLabel("editarConexionController.window.title"), args, MODAL);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Geneciones de Conexiones Desabilitado
|
||||
|
|
|
@ -0,0 +1,796 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionExcepcionRuta;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionPtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionTipoPtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaTramoCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionConfService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionDescuentoService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionExcepcionRutaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaExcepcionPtoVtaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaExcepcionTipoPtoVtaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaTramoCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||
import com.rjconsultores.ventaboletos.service.CorridaService;
|
||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||
import com.rjconsultores.ventaboletos.service.TramoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionExcepcionRuta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEditarConexion;
|
||||
|
||||
@Controller("editarConexionRutaController")
|
||||
@Scope("prototype")
|
||||
public class EditarConexionRutaController extends MyGenericForwardComposer {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
private ConexionExcepcionRutaService conexionExcepcionRutaService;
|
||||
@Autowired
|
||||
private ConexionService conexionService;
|
||||
@Autowired
|
||||
private ConexionCtrlService conexionCtrlService;
|
||||
@Autowired
|
||||
private ConexionConfService conexionConfService;
|
||||
@Autowired
|
||||
private ParadaService paradaService;
|
||||
@Autowired
|
||||
private RutaService rutaService;
|
||||
@Autowired
|
||||
private CorridaService corridaService;
|
||||
@Autowired
|
||||
ConexionDescuentoService conexionDescuentoService;
|
||||
@Autowired
|
||||
TramoService tramoService;
|
||||
|
||||
@Autowired
|
||||
private ConexionRutaExcepcionTipoPtoVtaService conexionRutaExcepcionTipoPtoVtaService;
|
||||
@Autowired
|
||||
private ConexionRutaTramoCtrlService conexionRutaTramoCtrlService;
|
||||
@Autowired
|
||||
private ConexionRutaExcepcionPtoVtaService conexionRutaRestricaoPtoVtaService;
|
||||
@Autowired
|
||||
private TipoPuntoVentaService tipoPuntoVentaService;
|
||||
|
||||
private ConexionRutaCtrl conexionRutaCtrl;
|
||||
private List<TipoPuntoVenta> lsTipoPtovta;
|
||||
|
||||
|
||||
private Button btnSalvar;
|
||||
private Button btnApagar;
|
||||
private Intbox txtTiempoMin;
|
||||
private Intbox txtTiempoMax;
|
||||
private MyListbox conexionesEditarList;
|
||||
private MyListbox conexionesList;
|
||||
private MyListbox conexionExcepcionRutaList;
|
||||
private MyListbox conexionRutaPuntoVentaList;
|
||||
private MyListbox conexionRutaTipoPuntoVentaList;
|
||||
private MyComboboxParada cmbOrigemCntrl;
|
||||
private MyComboboxParada cmbDestinoCntrl;
|
||||
private MyComboboxParada cmbOrigemConexao;
|
||||
private MyComboboxParada cmbDestinoConexao;
|
||||
private MyComboboxEstandar cmbRuta;
|
||||
|
||||
private ConexionCtrl conexionCtrl;
|
||||
private Parada origemCntrl;
|
||||
private Parada destinoCntrl;
|
||||
private Integer grupo;
|
||||
private Integer grupoInsercao;
|
||||
private Short secuencia;
|
||||
|
||||
private List<Ruta> lsRutas;
|
||||
private List<Conexion> conexoesRemovidas;
|
||||
private List<Intbox> lsIntBox;
|
||||
private HashMap<Integer, ConexionConf> conexionesConfHash;
|
||||
private List<ConexionDescuento> conexoesDescontoRemovidas;
|
||||
private Combobox cmbTipoPtovta;
|
||||
private Combobox cmbPtovta;
|
||||
private Long conexionCtrlId;
|
||||
|
||||
public ConexionCtrl getConexionCtrl() {
|
||||
return conexionCtrl;
|
||||
}
|
||||
|
||||
public void setConexionCtrl(ConexionCtrl conexionCtrl) {
|
||||
this.conexionCtrl = conexionCtrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
grupo = 1;
|
||||
secuencia = 1;
|
||||
conexoesRemovidas = new ArrayList<Conexion>();
|
||||
conexoesDescontoRemovidas = new ArrayList<ConexionDescuento>();
|
||||
conexionesConfHash = new HashMap<Integer, ConexionConf>();
|
||||
|
||||
lsRutas = rutaService.obtenerTodos();
|
||||
lsTipoPtovta = tipoPuntoVentaService.obtenerTodos();
|
||||
conexionesList = (MyListbox) Executions.getCurrent().getArg().get("conexionesList");
|
||||
|
||||
conexionCtrlId = (Long) Executions.getCurrent().getArg().get("conexionCtrlId");
|
||||
if (conexionCtrlId != null) {
|
||||
conexionCtrl = conexionCtrlService.obtenerID(conexionCtrlId);
|
||||
buscaConfiguraciones();
|
||||
|
||||
origemCntrl = paradaService.obtenerID(conexionCtrl.getOrigenId());
|
||||
cmbOrigemCntrl.setInitialValue(origemCntrl);
|
||||
cmbOrigemCntrl.setDisabled(Boolean.TRUE);
|
||||
cmbOrigemConexao.setInitialValue(origemCntrl);
|
||||
cmbDestinoConexao.setDisabled(false);
|
||||
|
||||
destinoCntrl = paradaService.obtenerID(conexionCtrl.getDestinoId());
|
||||
cmbDestinoCntrl.setDisabled(Boolean.TRUE);
|
||||
cmbDestinoCntrl.setInitialValue(destinoCntrl);
|
||||
} else {
|
||||
conexionCtrl = null;
|
||||
btnApagar.setVisible(Boolean.FALSE);
|
||||
}
|
||||
|
||||
List<Conexion> lsConexiones = getConexiones(conexionCtrlId);
|
||||
iniciaIntBoxes(lsConexiones);
|
||||
iniciaListBoxes();
|
||||
|
||||
conexionesEditarList.setData(lsConexiones);
|
||||
conexionExcepcionRutaList.setData(conexionExcepcionRutaService.obtenerConexionExcepcionsActivo(conexionCtrlId));
|
||||
|
||||
ConexionRutaTramoCtrl conexionRutaTramoCtrl = conexionRutaTramoCtrlService.buscarPorId(ConexionRutaTramoCtrl.getConexionRutaTramoConexionId(lsConexiones));
|
||||
conexionRutaCtrl = conexionRutaTramoCtrl.getConexionRutaCtrl();
|
||||
conexionRutaPuntoVentaList.setData(conexionRutaRestricaoPtoVtaService.obtenerConexionRutaExcepcionPtoVtasActivo(conexionRutaTramoCtrl.getConexionRutaCtrl()));
|
||||
conexionRutaTipoPuntoVentaList.setData(conexionRutaExcepcionTipoPtoVtaService.obtenerConexionRutaExcepcionPtoVtasActivo(conexionRutaTramoCtrl.getConexionRutaCtrl()));
|
||||
}
|
||||
|
||||
public void onBlur$cmbOrigemCntrl(Event event) throws InterruptedException {
|
||||
origemCntrl = cmbOrigemCntrl.getSelectedObject();
|
||||
cmbOrigemConexao.setInitialValue(origemCntrl);
|
||||
verificarConexionContr(cmbOrigemCntrl);
|
||||
}
|
||||
|
||||
public void onBlur$cmbDestinoCntrl(Event event) throws InterruptedException {
|
||||
destinoCntrl = cmbDestinoCntrl.getSelectedObject();
|
||||
if (verificarConexionContr(cmbDestinoCntrl)) {
|
||||
cmbOrigemCntrl.setDisabled(true);
|
||||
cmbDestinoCntrl.setDisabled(true);
|
||||
cmbDestinoConexao.setDisabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean verificarConexionContr(MyComboboxParada combo) throws InterruptedException {
|
||||
if (origemCntrl != null
|
||||
&& destinoCntrl != null && conexionCtrl == null
|
||||
&& !conexionService.buscarConexiones(origemCntrl.getParadaId(), destinoCntrl.getParadaId()).isEmpty()) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionConfController.MSG.conexionCtrlExistente"));
|
||||
combo.setSelectedIndex(-1);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void buscaConfiguraciones() {
|
||||
conexionesConfHash = new HashMap<Integer, ConexionConf>();
|
||||
for (ConexionConf conexionConf : conexionConfService.buscarPorConexionCtrl(conexionCtrl)) {
|
||||
conexionesConfHash.put(conexionConf.getGrupo(), conexionConf);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Conexion> getConexiones(Long conexionCtrlId) {
|
||||
List<Conexion> lsConexiones = new ArrayList<Conexion>();
|
||||
if (conexionCtrlId != null) {
|
||||
lsConexiones = conexionService.buscarPorConexionCtrl(conexionCtrlId);
|
||||
|
||||
if (!lsConexiones.isEmpty()) {
|
||||
Conexion conexion = lsConexiones.get(lsConexiones.size() - 1);
|
||||
grupo = conexion.getNumgrupo() + 1;
|
||||
}
|
||||
}
|
||||
return lsConexiones;
|
||||
}
|
||||
|
||||
private void iniciaIntBoxes(List<Conexion> conexiones) {
|
||||
lsIntBox = new ArrayList<Intbox>();
|
||||
for (int i = 0; i < conexiones.size(); i++) {
|
||||
addIntBox();
|
||||
}
|
||||
}
|
||||
|
||||
private void addIntBox() {
|
||||
final Intbox intbox = new Intbox();
|
||||
intbox.setStyle("border:0;");
|
||||
|
||||
intbox.addEventListener("onClick", new EventListener() {
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
Integer position = lsIntBox.indexOf(intbox);
|
||||
conexionesEditarList.setSelectedIndex(position);
|
||||
}
|
||||
});
|
||||
|
||||
intbox.addEventListener("onBlur", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
Integer position = lsIntBox.indexOf(intbox);
|
||||
Long corridaId = new Long(intbox.getText().isEmpty() ? "0" : intbox.getText());
|
||||
((Conexion) conexionesEditarList.getModel().getElementAt(position))
|
||||
.setCorridaId(validarServico(corridaId));
|
||||
}
|
||||
});
|
||||
lsIntBox.add(intbox);
|
||||
}
|
||||
|
||||
private void iniciaListBoxes() {
|
||||
conexionesEditarList.setItemRenderer(new RenderEditarConexion(lsIntBox, conexionesConfHash));
|
||||
conexionExcepcionRutaList.setItemRenderer(new RenderConexionExcepcionRuta());
|
||||
|
||||
conexionesEditarList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
verConfiguracaoConexao();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnAddConexao(Event ev) throws InterruptedException {
|
||||
modoInsercao(true);
|
||||
|
||||
Parada origem = cmbOrigemConexao.getSelectedObject();
|
||||
Parada destino = cmbDestinoConexao.getSelectedObject();
|
||||
Integer tempoMin = txtTiempoMin.getValue();
|
||||
Integer tempoMax = txtTiempoMax.getValue();
|
||||
|
||||
Conexion conexion = new Conexion();
|
||||
conexion.setOrigenId(origem.getParadaId());
|
||||
conexion.setDestinoId(destino.getParadaId());
|
||||
conexion.setActivo(true);
|
||||
conexion.setNumgrupo(grupo);
|
||||
conexion.setNumsecuencia(secuencia);
|
||||
adicionarTrecho(destino, conexion, tempoMax, tempoMin);
|
||||
}
|
||||
|
||||
private void adicionarTrecho(Parada destino, Conexion conexion, Integer tempoMax, Integer tempoMin) throws InterruptedException {
|
||||
cmbDestinoConexao.setConstraint("no empty");
|
||||
|
||||
if (insercaoValida()) {
|
||||
criaConfiguracaoConexao(tempoMax, tempoMin);
|
||||
addIntBox();
|
||||
conexionesEditarList.addItemNovo(conexion);
|
||||
|
||||
cmbOrigemConexao.setInitialValue(destino);
|
||||
cmbDestinoConexao.setInitialValue(destinoCntrl);
|
||||
cmbDestinoConexao.setFocus(true);
|
||||
|
||||
if (destino.equals(destinoCntrl)) {
|
||||
finalizarInsercao();
|
||||
}
|
||||
secuencia++;
|
||||
}
|
||||
|
||||
if (secuencia < 2) {
|
||||
cmbDestinoConexao.setConstraint("");
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean insercaoValida() throws InterruptedException {
|
||||
Parada origem = cmbOrigemConexao.getSelectedObject();
|
||||
Parada destino = cmbDestinoConexao.getSelectedObject();
|
||||
if (secuencia == 1 && destino.equals(destinoCntrl)) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.minimoTrechos"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!tramoService.existe(origem, destino)) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.trechoInexistente"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (secuencia > 3 && !destino.equals(destinoCntrl)) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.trechoFinal")
|
||||
+ " " + destinoCntrl.getDescparada());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
protected Long validarServico(Long corridaId) throws InterruptedException {
|
||||
if (corridaId != null && corridaId != 0) {
|
||||
if (corridaService.existeCorrida(corridaId)) {
|
||||
return corridaId;
|
||||
} else {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.servicoInvalido"));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void criaConfiguracaoConexao(Integer tempoMax, Integer tempoMin) {
|
||||
if (secuencia == 1) {
|
||||
ConexionConf conexionConf = new ConexionConf();
|
||||
conexionConf.setGrupo(grupo);
|
||||
conexionConf.setTiempoMax(tempoMax);
|
||||
conexionConf.setTiempoMin(tempoMin);
|
||||
conexionConf.setIndisponible(false);
|
||||
conexionConf.setActivo(true);
|
||||
|
||||
conexionesConfHash.put(grupo, conexionConf);
|
||||
txtTiempoMax.setDisabled(true);
|
||||
txtTiempoMin.setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void finalizarInsercao() {
|
||||
secuencia = 1;
|
||||
grupo++;
|
||||
cmbOrigemConexao.setInitialValue(origemCntrl);
|
||||
cmbDestinoConexao.setSelectedIndex(-1);
|
||||
|
||||
modoInsercao(false);
|
||||
}
|
||||
|
||||
public void onClick$btnModificarConexao(Event ev) throws InterruptedException {
|
||||
verConfiguracaoConexao();
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws Exception {
|
||||
|
||||
Parada origem = cmbOrigemCntrl.getSelectedObject();
|
||||
Parada destino = cmbDestinoCntrl.getSelectedObject();
|
||||
|
||||
if (!verificarConexoesFixas()) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.conexaoInvalida"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (conexionesEditarList.getSize() == 0) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.conexaoInexistente"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (conexionCtrl == null) {
|
||||
conexionCtrl = new ConexionCtrl();
|
||||
|
||||
conexionCtrl.setOrigenId(origem.getParadaId());
|
||||
conexionCtrl.setDestinoId(destino.getParadaId());
|
||||
conexionCtrlService.suscribir(conexionCtrl);
|
||||
} else {
|
||||
conexionCtrlService.actualizacion(conexionCtrl);
|
||||
}
|
||||
salvarConexiones();
|
||||
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.suscribirOK"));
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Boolean verificarConexoesFixas() throws InterruptedException {
|
||||
Conexion conexionAnterior = null;
|
||||
Boolean valida = true;
|
||||
Boolean fixa = null;
|
||||
|
||||
for (Conexion conexion : (List<Conexion>) conexionesEditarList.getListData()) {
|
||||
if (conexionAnterior != null && conexionAnterior.getNumgrupo() != conexion.getNumgrupo()) {
|
||||
valida = true;
|
||||
fixa = null;
|
||||
}
|
||||
|
||||
if (fixa == null) {
|
||||
fixa = conexion.getCorridaId() != null;
|
||||
}
|
||||
|
||||
if (fixa) {
|
||||
valida = valida && conexion.getCorridaId() != null;
|
||||
} else {
|
||||
valida = valida && conexion.getCorridaId() == null;
|
||||
}
|
||||
|
||||
conexionAnterior = conexion;
|
||||
}
|
||||
|
||||
return valida;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void salvarConexiones() {
|
||||
List<ConexionDescuento> conexionesDescuentos = new ArrayList<ConexionDescuento>();
|
||||
conexionesDescuentos.addAll(conexoesDescontoRemovidas);
|
||||
|
||||
List<Conexion> conexoesSalvar = new ArrayList<Conexion>();
|
||||
conexoesSalvar.addAll((List<Conexion>) conexionesEditarList.getListData());
|
||||
conexoesSalvar.addAll(conexoesRemovidas);
|
||||
|
||||
for (Conexion conexion : conexoesSalvar) {
|
||||
conexion.setConexionctrlId(conexionCtrl.getConexionctrlId());
|
||||
conexion.setFecmodif(Calendar.getInstance().getTime());
|
||||
conexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
conexionesDescuentos.addAll(conexion.getConexionesDescuentos());
|
||||
}
|
||||
|
||||
for (ConexionDescuento conexionDescuento : conexionesDescuentos) {
|
||||
conexionDescuento.setFecModif(Calendar.getInstance().getTime());
|
||||
}
|
||||
|
||||
conexionService.suscribirTodos(conexoesSalvar);
|
||||
conexionDescuentoService.suscribirTodos(conexionesDescuentos);
|
||||
salvarConexionesConf();
|
||||
salvarExcecionPuntoVenta();
|
||||
salvarExcecionCanalVenta();
|
||||
}
|
||||
|
||||
private void salvarConexionesConf() {
|
||||
for (ConexionConf conexionConf : conexionesConfHash.values()) {
|
||||
conexionConf.setConexionCtrl(conexionCtrl);
|
||||
conexionConf.setFecmodif(Calendar.getInstance().getTime());
|
||||
conexionConf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
}
|
||||
conexionConfService.suscribirTodos(conexionesConfHash.values());
|
||||
}
|
||||
|
||||
private void salvarExcecionCanalVenta() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ConexionRutaExcepcionTipoPtoVta> conexionRutaTipoPuntoVentas = conexionRutaTipoPuntoVentaList.getListData();
|
||||
|
||||
ConexionRutaTramoCtrl conexionRutaTramoCtrl = conexionRutaTramoCtrlService.buscarPorId(ConexionRutaTramoCtrl.getConexionRutaTramoConexionId(getConexiones(conexionCtrlId)));
|
||||
conexionRutaExcepcionTipoPtoVtaService.borrar(conexionRutaExcepcionTipoPtoVtaService.obtenerConexionRutaExcepcionPtoVtasActivo(conexionRutaTramoCtrl.getConexionRutaCtrl()));
|
||||
conexionRutaExcepcionTipoPtoVtaService.suscribirTodos(conexionRutaTipoPuntoVentas);
|
||||
|
||||
}
|
||||
|
||||
private void salvarExcecionPuntoVenta() {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ConexionRutaExcepcionPtoVta> conexionRutapuntoVentas = conexionRutaPuntoVentaList.getListData();
|
||||
|
||||
ConexionRutaTramoCtrl conexionRutaTramoCtrl = conexionRutaTramoCtrlService.buscarPorId(ConexionRutaTramoCtrl.getConexionRutaTramoConexionId(getConexiones(conexionCtrlId)));
|
||||
conexionRutaRestricaoPtoVtaService.borrar(conexionRutaRestricaoPtoVtaService.obtenerConexionRutaExcepcionPtoVtasActivo(conexionRutaTramoCtrl.getConexionRutaCtrl()));
|
||||
conexionRutaRestricaoPtoVtaService.suscribirTodos(conexionRutapuntoVentas);
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverConexao(Event ev) throws Exception {
|
||||
Conexion conexao = (Conexion) conexionesEditarList.getSelected();
|
||||
if (conexao == null) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.selecionarConexion"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (grupoInsercao != null && !grupoInsercao.equals(conexao.getNumgrupo())) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.emInsercao") + " " + grupo);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Messagebox.show(
|
||||
Labels.getLabel("editarConexionController.MSG.borrarConexionPergunta"),
|
||||
Labels.getLabel("editarConexionController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION) == Messagebox.YES) {
|
||||
|
||||
removerConexoes(conexao.getNumgrupo());
|
||||
|
||||
if (conexionesConfHash.get(conexao.getNumgrupo()) != null) {
|
||||
conexionesConfHash.get(conexao.getNumgrupo()).setActivo(false);
|
||||
}
|
||||
modoInsercao(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnDesativar(Event event) throws InterruptedException {
|
||||
Conexion conexao = (Conexion) conexionesEditarList.getSelected();
|
||||
if (conexao == null) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.selecionarConexion"));
|
||||
return;
|
||||
}
|
||||
|
||||
conexionesConfHash.get(conexao.getNumgrupo()).setIndisponible(true);
|
||||
conexionesEditarList.updateItem(conexionesEditarList.getItemAtIndex(0).getValue());
|
||||
}
|
||||
|
||||
public void onClick$btnAtivar(Event event) throws InterruptedException {
|
||||
|
||||
Conexion conexao = (Conexion) conexionesEditarList.getSelected();
|
||||
if (conexao == null) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.selecionarConexion"));
|
||||
return;
|
||||
}
|
||||
|
||||
conexionesConfHash.get(conexao.getNumgrupo()).setIndisponible(false);
|
||||
conexionesEditarList.updateItem(conexionesEditarList.getItemAtIndex(0).getValue());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void removerConexoes(Integer numgrupo) {
|
||||
List<Conexion> conexiones = new ArrayList<Conexion>();
|
||||
conexiones.addAll((List<Conexion>) conexionesEditarList.getListData());
|
||||
|
||||
for (Conexion conexion : conexiones) {
|
||||
if (conexion.getNumgrupo() == numgrupo) {
|
||||
conexion.setActivo(false);
|
||||
|
||||
lsIntBox.remove(((List<Conexion>) conexionesEditarList.getListData()).indexOf(conexion));
|
||||
conexionesEditarList.removeItem(conexion);
|
||||
|
||||
if (conexion.getConexionctrlId() != null) {
|
||||
conexoesRemovidas.add(conexion);
|
||||
conexoesDescontoRemovidas.addAll(setConexeosDescontoInativa(conexion.getConexionesDescuentos()));
|
||||
} else {
|
||||
conexionesConfHash.remove(numgrupo);
|
||||
}
|
||||
|
||||
conexion.getConexionesDescuentos().clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (conexionesConfHash.get(numgrupo) != null) {
|
||||
conexionesConfHash.get(numgrupo).setActivo(false);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ConexionDescuento> setConexeosDescontoInativa(List<ConexionDescuento> conexionesDescuentos) {
|
||||
for (ConexionDescuento conexionDescuento : conexionesDescuentos) {
|
||||
conexionDescuento.setActivo(false);
|
||||
}
|
||||
return conexionesDescuentos;
|
||||
}
|
||||
|
||||
public void onClick$btnNovoCanalVenta(Event ev) throws InterruptedException {
|
||||
|
||||
if(cmbTipoPtovta.getSelectedItem() == null){
|
||||
return;
|
||||
}
|
||||
TipoPuntoVenta ptovta = (TipoPuntoVenta) cmbTipoPtovta.getSelectedItem().getValue();
|
||||
|
||||
ConexionRutaExcepcionTipoPtoVta conexionRutaExcepcionTipoPtoVta = new ConexionRutaExcepcionTipoPtoVta();
|
||||
conexionRutaExcepcionTipoPtoVta.setConexionRutaCtrl(conexionRutaCtrl);
|
||||
conexionRutaExcepcionTipoPtoVta.setTipoPtovta(ptovta);
|
||||
|
||||
if (conexionRutaTipoPuntoVentaList.getListData().contains(ptovta)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarPricingEspecificoOcupacionController.MSG.noPricingEspecificoCanalJaCadastrado"),
|
||||
Labels.getLabel("busquedaPricingEspecificoController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else {
|
||||
if(ptovta.getTipoptovtaId() == -1){
|
||||
conexionRutaTipoPuntoVentaList.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ConexionRutaExcepcionTipoPtoVta> canaisVenta = conexionRutaTipoPuntoVentaList.getListData();
|
||||
for (ConexionRutaExcepcionTipoPtoVta tipoPuntoVenta : canaisVenta) {
|
||||
if(tipoPuntoVenta.getTipoPtovta().getTipoptovtaId() == -1){
|
||||
conexionRutaTipoPuntoVentaList.clear();
|
||||
conexionRutaTipoPuntoVentaList.addItemNovo(tipoPuntoVenta);
|
||||
ptovta = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ptovta != null) {
|
||||
conexionRutaTipoPuntoVentaList.addItemNovo(conexionRutaExcepcionTipoPtoVta);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cmbTipoPtovta.setValue("");
|
||||
}
|
||||
|
||||
public void onClick$btnApagarCanalVenta(Event ev) throws InterruptedException {
|
||||
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionExcepcionController.MSG.borrarConexionPergunta"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
if (conexionRutaTipoPuntoVentaList.getSelected() != null) {
|
||||
conexionRutaTipoPuntoVentaList.removeItem((ConexionRutaExcepcionTipoPtoVta) conexionRutaTipoPuntoVentaList.getSelectedItem().getValue());
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnNovoPuntoVenta(Event ev) throws InterruptedException {
|
||||
|
||||
if(cmbPtovta.getSelectedItem() == null){
|
||||
return;
|
||||
}
|
||||
PuntoVenta puntoVenta = (PuntoVenta) cmbPtovta.getSelectedItem().getValue();
|
||||
|
||||
ConexionRutaExcepcionPtoVta conexionRutaExcepcionPtoVta = new ConexionRutaExcepcionPtoVta();
|
||||
conexionRutaExcepcionPtoVta.setConexionRutaCtrl(conexionRutaCtrl);
|
||||
conexionRutaExcepcionPtoVta.setPuntoVenta(puntoVenta);
|
||||
|
||||
if (conexionRutaPuntoVentaList.getListData().contains(puntoVenta)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConexionPorRutaController.MSG.noPuntoVentaJaCadastrado"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else {
|
||||
if(puntoVenta.getPuntoventaId() == -1){
|
||||
conexionRutaPuntoVentaList.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ConexionRutaExcepcionPtoVta> canaisVenta = conexionRutaPuntoVentaList.getListData();
|
||||
for (ConexionRutaExcepcionPtoVta puntoVentaAux : canaisVenta) {
|
||||
if(puntoVentaAux.getPuntoVenta().getPuntoventaId() == -1){
|
||||
conexionRutaPuntoVentaList.clear();
|
||||
conexionRutaPuntoVentaList.addItemNovo(puntoVentaAux);
|
||||
puntoVenta = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(puntoVenta != null) {
|
||||
conexionRutaPuntoVentaList.addItemNovo(conexionRutaExcepcionPtoVta);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cmbTipoPtovta.setValue("");
|
||||
}
|
||||
|
||||
public void onClick$btnApagarPuntoVenta(Event ev) throws InterruptedException {
|
||||
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionExcepcionController.MSG.borrarPuntoVentaPergunta"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
if (conexionRutaPuntoVentaList.getSelected() != null) {
|
||||
conexionRutaPuntoVentaList.removeItem((ConexionRutaExcepcionPtoVta) conexionRutaPuntoVentaList.getSelectedItem().getValue());
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnApagar(Event ev) throws Exception {
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionController.MSG.borrarConexionCtrlPergunta"),
|
||||
Labels.getLabel("editarConexionController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
conexionCtrlService.borrar(conexionCtrl);
|
||||
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.borrarConexionCtrlSucesso"));
|
||||
|
||||
conexionesList.setData(new ArrayList<ConexionVO>());
|
||||
|
||||
closeWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void verConfiguracaoConexao() throws InterruptedException {
|
||||
Map args = new HashMap();
|
||||
Conexion conexion = (Conexion) conexionesEditarList.getSelected();
|
||||
if(conexion ==null) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
|
||||
args.put("conexion", conexion);
|
||||
args.put("conexionConfHash", conexionesConfHash);
|
||||
args.put("listBoxConexoes", conexionesEditarList);
|
||||
args.put("conexoesDescontoRemovidas", conexoesDescontoRemovidas);
|
||||
|
||||
openWindow("/gui/esquema_operacional/editarConexionConf.zul",
|
||||
Labels.getLabel("editarConexionConfController.window.title"), args, MODAL);
|
||||
}
|
||||
|
||||
public void onClick$btnAddConexaoRutaExcepcion(Event ev) throws InterruptedException {
|
||||
ConexionExcepcionRuta ce = new ConexionExcepcionRuta();
|
||||
ce.setActivo(true);
|
||||
ce.setConexionctrlId(conexionCtrl.getConexionctrlId());
|
||||
ce.setRuta(((Ruta) cmbRuta.getSelectedItem().getValue()));
|
||||
conexionExcepcionRutaService.suscribir(ce);
|
||||
conexionExcepcionRutaList.addItemNovo(ce);
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnRemoverConexaoRutaExcepcion(Event ev) throws InterruptedException {
|
||||
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionExcepcionController.MSG.borrarConexionPergunta"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
if (conexionExcepcionRutaList.getSelected() != null) {
|
||||
conexionExcepcionRutaService.borrar((ConexionExcepcionRuta) conexionExcepcionRutaList.getSelected());
|
||||
conexionExcepcionRutaList.removeItem((ConexionExcepcionRuta) conexionExcepcionRutaList.getSelected());
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Ruta> getLsRutas() {
|
||||
return lsRutas;
|
||||
}
|
||||
|
||||
public void setLsRutas(List<Ruta> lsRutas) {
|
||||
this.lsRutas = lsRutas;
|
||||
}
|
||||
|
||||
public List<TipoPuntoVenta> getLsTipoPtovta() {
|
||||
return lsTipoPtovta;
|
||||
}
|
||||
|
||||
public void setLsTipoPtovta(List<TipoPuntoVenta> lsTipoPtovta) {
|
||||
this.lsTipoPtovta = lsTipoPtovta;
|
||||
}
|
||||
|
||||
private void mostraMensagem(String msg) throws InterruptedException {
|
||||
Messagebox.show(msg, Labels.getLabel("editarConexionController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
|
||||
private void modoInsercao(Boolean indInsercao) {
|
||||
btnSalvar.setVisible(!indInsercao);
|
||||
grupoInsercao = indInsercao ? grupo : null;
|
||||
|
||||
if (indInsercao) {
|
||||
txtTiempoMax.setConstraint("no empty");
|
||||
txtTiempoMin.setConstraint("no empty");
|
||||
cmbDestinoConexao.setConstraint("no empty");
|
||||
} else {
|
||||
txtTiempoMax.setConstraint("");
|
||||
txtTiempoMin.setConstraint("");
|
||||
txtTiempoMax.setDisabled(false);
|
||||
txtTiempoMin.setDisabled(false);
|
||||
txtTiempoMax.setText("");
|
||||
txtTiempoMin.setText("");
|
||||
txtTiempoMin.setFocus(true);
|
||||
cmbDestinoConexao.setConstraint("");
|
||||
|
||||
secuencia = 1;
|
||||
cmbOrigemConexao.setSelectedIndex(-1);
|
||||
cmbDestinoConexao.setSelectedIndex(-1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,871 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Intbox;
|
||||
import org.zkoss.zul.ListModelList;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Tab;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionPtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionTipoPtoVta;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionRutaTramoCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionConfService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionDescuentoService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaExcepcionPtoVtaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaExcepcionTipoPtoVtaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionRutaTramoCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.parada.ParadaVOConexionRuta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionPorRuta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionRuta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConexionRutaRemoveSelecionada;
|
||||
|
||||
@Controller("gerarConexionPorRutaController")
|
||||
@Scope("prototype")
|
||||
public class GerarConexionPorRutaController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger log = Logger.getLogger(GerarConexionPorRutaController.class);
|
||||
|
||||
@Autowired
|
||||
private ConexionService conexionService;
|
||||
@Autowired
|
||||
private ConexionCtrlService conexionCtrlService;
|
||||
@Autowired
|
||||
private ConexionConfService conexionConfService;
|
||||
@Autowired
|
||||
private ConexionRutaCtrlService conexionRutaCtrlService;
|
||||
@Autowired
|
||||
private ConexionRutaTramoCtrlService conexionRutaTramoCtrlService;
|
||||
@Autowired
|
||||
private RutaService rutaService;
|
||||
@Autowired
|
||||
private ConexionDescuentoService conexionDescuentoService;
|
||||
@Autowired
|
||||
private TipoPuntoVentaService tipoPuntoVentaService;
|
||||
@Autowired
|
||||
private ConexionRutaExcepcionPtoVtaService conexionRutaRestricaoPtoVtaService;
|
||||
@Autowired
|
||||
private ConexionRutaExcepcionTipoPtoVtaService conexionRutaExcepcionTipoPtoVtaService;
|
||||
@Autowired
|
||||
private RutaCombinacionService rutaCombinacionService;
|
||||
|
||||
private List<Parada> lsOrigens;
|
||||
private List<Parada> lsDestino;
|
||||
private MyListbox localidadesOrigemlList;
|
||||
private MyListbox localidadesDestinoList;
|
||||
private MyListbox localidadesOrigenSelecionadaList;
|
||||
private MyListbox localidadesDestinoSelecionadaList;
|
||||
private Tab resultadoCombinacao;
|
||||
private Button btnSalvar;
|
||||
private Intbox txtTiempoMin;
|
||||
private Intbox txtTiempoMax;
|
||||
private MyListbox localidadesCombinadasList;
|
||||
private MyListbox localidadesComunsList;
|
||||
private MyListbox listEspCanal;
|
||||
private MyListbox listPuntoVenta;
|
||||
private MyComboboxEstandar cmbRutaOrigem;
|
||||
private MyComboboxEstandar cmbRutaDestino;
|
||||
private List<Parada> lsLocalidadesComuns;
|
||||
private Combobox cmbTipoPtovta;
|
||||
private Combobox cmbPtovta;
|
||||
private List<TipoPuntoVenta> lsTipoPtovta;
|
||||
private List<Conexion> lsConexoes;
|
||||
private Integer grupo;
|
||||
private Short secuencia;
|
||||
|
||||
private List<Ruta> lsRutas;
|
||||
private HashMap<Integer, ConexionConf> conexionesConfHash;
|
||||
private List<ConexionDescuento> conexoesDescontoRemovidas;
|
||||
private Map<Integer, Parada> cacheLocalidades;
|
||||
private List<ConexionCtrl> conexoesCtrl;
|
||||
private List<ConexionRutaTramoCtrl> lsConexionRutaTramo;
|
||||
private List<ConexionRutaTramoCtrl> lsConexionExistentesRutaTramo;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
grupo = 1;
|
||||
secuencia = 1;
|
||||
conexoesDescontoRemovidas = new ArrayList<ConexionDescuento>();
|
||||
conexionesConfHash = new HashMap<Integer, ConexionConf>();
|
||||
txtTiempoMax.setConstraint("no empty");
|
||||
txtTiempoMin.setConstraint("no empty");
|
||||
|
||||
lsRutas = rutaService.obtenerTodos();
|
||||
lsTipoPtovta = tipoPuntoVentaService.obtenerTodos();
|
||||
|
||||
localidadesOrigenSelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada parada = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesOrigenSelecionadaList.getListData()) {
|
||||
if (((Parada) objectParada).equals(parada)) {
|
||||
localidadesOrigenSelecionadaList.removeItem(parada);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
localidadesDestinoSelecionadaList.setItemRenderer(new RenderConexionRutaRemoveSelecionada(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
|
||||
Parada parada = (Parada) arg0.getTarget().getAttribute("data");
|
||||
for (Object objectParada : localidadesDestinoSelecionadaList.getListData()) {
|
||||
if (((Parada) objectParada).equals(parada)) {
|
||||
localidadesDestinoSelecionadaList.removeItem(parada);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addConexao( ConexionCtrl conexionCtrl) throws InterruptedException{
|
||||
lsConexoes = new ArrayList<Conexion>();
|
||||
|
||||
Integer tempoMin = txtTiempoMin.getValue();
|
||||
Integer tempoMax = txtTiempoMax.getValue();
|
||||
|
||||
secuencia = 1;
|
||||
|
||||
LOPP_EXTERNO: for (ParadaVOConexionRuta vo : (List<ParadaVOConexionRuta> )localidadesCombinadasList.getListData()) {
|
||||
Conexion conexion = new Conexion();
|
||||
conexion.setOrigenId(vo.getParadaOrigem().getParadaId());
|
||||
conexion.setDestinoId(vo.getParadaDestino().getParadaId());
|
||||
conexion.setRutaId(vo.getRutaId());
|
||||
conexion.setActivo(true);
|
||||
conexion.setNumgrupo(grupo);
|
||||
for (ConexionRutaTramoCtrl conexionRutaTramoCtrl : lsConexionRutaTramo) {
|
||||
if(conexionRutaTramoCtrl.getOrigenId().equals(vo.getParadaOrigem().getParadaId()) && conexionRutaTramoCtrl.getDestinoId().equals(vo.getParadaDestino().getParadaId()) && secuencia == vo.getSecuencia() && vo.isValido()) {
|
||||
conexion.setConexionRutaTramoId(conexionRutaTramoCtrl.getConexionRutaTramoId());
|
||||
conexion.setNumsecuencia(secuencia);
|
||||
vo.setValido(false);
|
||||
adicionarTrecho(vo.getParadaDestino(), conexion, tempoMax, tempoMin, conexionCtrl);
|
||||
}else if(secuencia > vo.getSecuencia()) {
|
||||
continue LOPP_EXTERNO;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void adicionarTrecho(Parada destino, Conexion conexion, Integer tempoMax, Integer tempoMin, ConexionCtrl conexionCtrl) throws InterruptedException {
|
||||
|
||||
criaConfiguracaoConexao(tempoMax, tempoMin, conexionCtrl);
|
||||
lsConexoes.add(conexion);
|
||||
secuencia++;
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean validarTrechos() throws InterruptedException {
|
||||
|
||||
Ruta rutaOrigem = (Ruta) cmbRutaOrigem.getSelectedItem().getValue();
|
||||
List<Parada> paradasOrigen = localidadesOrigenSelecionadaList.getListData();
|
||||
|
||||
for (Parada paradaOrigem : paradasOrigen) {
|
||||
for (Parada paradaComum : lsLocalidadesComuns) {
|
||||
if (!rutaCombinacionService.busquedaRutaTramo(rutaOrigem, rutaCombinacionService.busqueda(rutaOrigem, paradaOrigem, paradaComum), Boolean.TRUE)) {
|
||||
mostraMensagem(Labels.getLabel("editarConexionController.MSG.trechoInexistente")+" " + paradaOrigem + " - " + paradaComum);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void criaConfiguracaoConexao(Integer tempoMax, Integer tempoMin, ConexionCtrl conexionCtrl) {
|
||||
if (secuencia == 1) {
|
||||
ConexionConf conexionConf = new ConexionConf();
|
||||
conexionConf.setGrupo(grupo);
|
||||
conexionConf.setTiempoMax(tempoMax);
|
||||
conexionConf.setTiempoMin(tempoMin);
|
||||
conexionConf.setIndisponible(false);
|
||||
conexionConf.setActivo(true);
|
||||
conexionConf.setConexionCtrl(conexionCtrl);
|
||||
|
||||
conexionesConfHash.put(grupo, conexionConf);
|
||||
txtTiempoMax.setDisabled(true);
|
||||
txtTiempoMin.setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void finalizarInsercao() {
|
||||
secuencia = 1;
|
||||
grupo++;
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws Exception {
|
||||
|
||||
if(!validarItensSalvar()) {
|
||||
return;
|
||||
}
|
||||
if (validarConexioneRutasExistentes()) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (ConexionRutaTramoCtrl conexionRutaTramoCtrl : lsConexionExistentesRutaTramo) {
|
||||
sb.append(cacheLocalidades.get(conexionRutaTramoCtrl.getOrigenId()).getDescparada() + " - " + cacheLocalidades.get(conexionRutaTramoCtrl.getDestinoId()).getDescparada());
|
||||
sb.append("\n");
|
||||
}
|
||||
mostraMensagem(Labels.getLabel("editarConexionPorRutaController.MSG.suscribirOBSOK")+ "\n - " + sb.toString());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ConexionRutaCtrl conexionRutaCtrl = new ConexionRutaCtrl();
|
||||
|
||||
salvarConexionesRutaCtrl(conexionRutaCtrl);
|
||||
salvarPuntoVentasRutaCtrl(conexionRutaCtrl);
|
||||
salvarCanalVentasRutaCtrl(conexionRutaCtrl);
|
||||
|
||||
for (ConexionCtrl conexionCtrl : conexoesCtrl) {
|
||||
|
||||
if (conexionCtrl.getConexionctrlId() == null) {
|
||||
|
||||
conexionCtrlService.suscribir(conexionCtrl);
|
||||
} else {
|
||||
conexionCtrlService.actualizacion(conexionCtrl);
|
||||
}
|
||||
salvarConexiones(conexionCtrl);
|
||||
}
|
||||
if(!lsConexionExistentesRutaTramo.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (ConexionRutaTramoCtrl conexionRutaTramoCtrl : lsConexionExistentesRutaTramo) {
|
||||
sb.append(cacheLocalidades.get(conexionRutaTramoCtrl.getOrigenId()).getDescparada() + " - " + cacheLocalidades.get(conexionRutaTramoCtrl.getDestinoId()).getDescparada());
|
||||
sb.append("\n");
|
||||
}
|
||||
mostraMensagem(Labels.getLabel("editarConexionPorRutaController.MSG.suscribirOBSOK")+ "\n - " + sb.toString());
|
||||
|
||||
}
|
||||
mostraMensagem(Labels.getLabel("editarConexionPorRutaController.MSG.suscribirOK"));
|
||||
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean validarConexioneRutasExistentes() {
|
||||
|
||||
Ruta rutaOrigem = (Ruta) cmbRutaOrigem.getSelectedItem().getValue();
|
||||
Ruta rutaDestino = (Ruta) cmbRutaDestino.getSelectedItem().getValue();
|
||||
boolean conexaoExistente = false;
|
||||
lsConexionRutaTramo = new ArrayList<ConexionRutaTramoCtrl>();
|
||||
lsConexionExistentesRutaTramo = new ArrayList<ConexionRutaTramoCtrl>();
|
||||
|
||||
for (ParadaVOConexionRuta vo : (List<ParadaVOConexionRuta>) localidadesCombinadasList.getListData()) {
|
||||
|
||||
ConexionRutaTramoCtrl conexionRutaTramoCtrl = new ConexionRutaTramoCtrl();
|
||||
conexionRutaTramoCtrl.setOrigenId(vo.getParadaOrigem().getParadaId());
|
||||
conexionRutaTramoCtrl.setDestinoId(vo.getParadaDestino().getParadaId());
|
||||
|
||||
conexaoExistente = conexionRutaTramoCtrlService.validarConexioneRutasExistentes(rutaOrigem.getRutaId(), rutaDestino.getRutaId(),
|
||||
vo.getParadaOrigem().getParadaId(), vo.getParadaDestino().getParadaId(), vo.getParadaOrigemTrecho().getParadaId(), vo.getParadaDestinoTrecho().getParadaId());
|
||||
|
||||
if (conexaoExistente) {
|
||||
lsConexionExistentesRutaTramo.add(conexionRutaTramoCtrl);
|
||||
Iterator<ConexionCtrl> it = conexoesCtrl.iterator();
|
||||
while(it.hasNext()) {
|
||||
ConexionCtrl cc = it.next();
|
||||
if(cc.getOrigenId().equals(vo.getParadaOrigemTrecho().getParadaId()) && cc.getDestinoId().equals(vo.getParadaDestinoTrecho().getParadaId())) {
|
||||
conexoesCtrl.remove(cc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
lsConexionRutaTramo.add(conexionRutaTramoCtrl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return lsConexionRutaTramo.isEmpty();
|
||||
}
|
||||
|
||||
private void salvarConexiones(ConexionCtrl conexionCtrl) {
|
||||
|
||||
try {
|
||||
addConexao(conexionCtrl);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<ConexionDescuento> conexionesDescuentos = new ArrayList<ConexionDescuento>();
|
||||
conexionesDescuentos.addAll(conexoesDescontoRemovidas);
|
||||
|
||||
Collections.sort(lsConexoes, new Comparator<Conexion>() {
|
||||
|
||||
@Override
|
||||
public int compare(Conexion o1, Conexion o2) {
|
||||
o1.getNumsecuencia().compareTo(o2.getNumsecuencia());
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
for (Conexion conexion : lsConexoes) {
|
||||
conexion.setConexionctrlId(conexionCtrl.getConexionctrlId());
|
||||
conexion.setFecmodif(Calendar.getInstance().getTime());
|
||||
conexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
conexionesDescuentos.addAll(conexion.getConexionesDescuentos());
|
||||
}
|
||||
|
||||
for (ConexionDescuento conexionDescuento : conexionesDescuentos) {
|
||||
conexionDescuento.setFecModif(Calendar.getInstance().getTime());
|
||||
}
|
||||
|
||||
conexionService.suscribirTodos(lsConexoes);
|
||||
conexionDescuentoService.suscribirTodos(conexionesDescuentos);
|
||||
salvarConexionesConf(conexionCtrl);
|
||||
}
|
||||
|
||||
private void salvarConexionesConf(ConexionCtrl conexionCtrl) {
|
||||
for (ConexionConf conexionConf : conexionesConfHash.values()) {
|
||||
conexionConf.setConexionCtrl(conexionCtrl);
|
||||
conexionConf.setFecmodif(Calendar.getInstance().getTime());
|
||||
conexionConf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
}
|
||||
conexionConfService.suscribirTodos(conexionesConfHash.values());
|
||||
}
|
||||
|
||||
private void salvarConexionesRutaCtrl(ConexionRutaCtrl conecionRuta) {
|
||||
|
||||
Ruta rutaOrigem = (Ruta) cmbRutaOrigem.getSelectedItem().getValue();
|
||||
Ruta rutaDestino = (Ruta) cmbRutaDestino.getSelectedItem().getValue();
|
||||
|
||||
conecionRuta.setRutaOrigenId(rutaOrigem.getRutaId());
|
||||
conecionRuta.setRutaDestinoId(rutaDestino.getRutaId());
|
||||
|
||||
conexionRutaCtrlService.suscribir(conecionRuta);
|
||||
salvarConexionesRutaTramoCtrl(conecionRuta);
|
||||
}
|
||||
|
||||
private void salvarConexionesRutaTramoCtrl(ConexionRutaCtrl conecionRuta) {
|
||||
|
||||
for (ConexionRutaTramoCtrl conexionRutaTramoCtrl : lsConexionRutaTramo) {
|
||||
conexionRutaTramoCtrl.setConexionRutaCtrl(conecionRuta);
|
||||
}
|
||||
|
||||
conexionRutaTramoCtrlService.suscribirTodos(lsConexionRutaTramo);
|
||||
}
|
||||
|
||||
private void salvarCanalVentasRutaCtrl(ConexionRutaCtrl conexionRutaCtrl) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<TipoPuntoVenta> puntoVentas = listEspCanal.getListData();
|
||||
List<ConexionRutaExcepcionTipoPtoVta> canalVentaConexionRutas = new ArrayList<ConexionRutaExcepcionTipoPtoVta>();
|
||||
|
||||
for (TipoPuntoVenta vo : puntoVentas) {
|
||||
|
||||
ConexionRutaExcepcionTipoPtoVta conexionRutaPtoVta = new ConexionRutaExcepcionTipoPtoVta();
|
||||
conexionRutaPtoVta.setConexionRutaCtrl(conexionRutaCtrl);
|
||||
conexionRutaPtoVta.setTipoPtovta(vo);
|
||||
canalVentaConexionRutas.add(conexionRutaPtoVta);
|
||||
}
|
||||
conexionRutaExcepcionTipoPtoVtaService.suscribirTodos(canalVentaConexionRutas);
|
||||
|
||||
}
|
||||
|
||||
private void salvarPuntoVentasRutaCtrl(ConexionRutaCtrl conexionRutaCtrl) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<PuntoVenta> puntoVentas = listPuntoVenta.getListData();
|
||||
List<ConexionRutaExcepcionPtoVta> puntoVentasConexionRuta = new ArrayList<ConexionRutaExcepcionPtoVta>();
|
||||
|
||||
for (PuntoVenta vo : puntoVentas) {
|
||||
|
||||
ConexionRutaExcepcionPtoVta conexionRutaPtoVta = new ConexionRutaExcepcionPtoVta();
|
||||
conexionRutaPtoVta.setConexionRutaCtrl(conexionRutaCtrl);
|
||||
conexionRutaPtoVta.setPuntoVenta(vo);
|
||||
puntoVentasConexionRuta.add(conexionRutaPtoVta);
|
||||
}
|
||||
conexionRutaRestricaoPtoVtaService.suscribirTodos(puntoVentasConexionRuta);
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnPesquisaPermissao(Event ev) throws InterruptedException {
|
||||
executarPesquisaLocalidadesOrigen();
|
||||
}
|
||||
|
||||
public void onClick$btnPesquisaLocalidadesDestino(Event ev) throws InterruptedException {
|
||||
executarPesquisaLocalidadesDestino();
|
||||
}
|
||||
|
||||
private void executarPesquisaLocalidadesOrigen() throws InterruptedException {
|
||||
|
||||
if (!validarLinhaJaSelecionada()) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionPorRutaController.MSG.rutaJaSelecionada"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
// localidadesOrigenSelecionadaList.clear();
|
||||
localidadesCombinadasList.clear();
|
||||
localidadesComunsList.setModel(new ListModelList(new ArrayList<Parada>()));
|
||||
localidadesDestinoList.setModel(new ListModelList(new ArrayList<Parada>()));
|
||||
localidadesDestinoSelecionadaList.setModel(new ListModelList(new ArrayList<Parada>()));
|
||||
|
||||
Set<Parada> lsParadas = new HashSet<Parada>(0);
|
||||
try {
|
||||
Ruta ruta = cmbRutaOrigem.getSelectedItem() != null ? (Ruta) cmbRutaOrigem.getSelectedItem().getValue() : null;
|
||||
if (localidadesOrigemlList.getItems() != null) {
|
||||
localidadesOrigemlList.getItems().clear();
|
||||
}
|
||||
if (ruta != null) {
|
||||
|
||||
ruta = rutaService.obtenerID(ruta.getRutaId());
|
||||
if (ruta != null && ruta.getRutaCombinacionList() != null) {
|
||||
for (RutaCombinacion rc : ruta.getRutaCombinacionList()) {
|
||||
if (rc.getTramo() != null) {
|
||||
lsParadas.add(rc.getTramo().getOrigem());
|
||||
lsParadas.add(rc.getTramo().getDestino());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lsOrigens = new ArrayList<Parada>(lsParadas);
|
||||
localidadesOrigenSelecionadaList.setData(lsOrigens);
|
||||
localidadesOrigemlList.setData(lsOrigens);
|
||||
}
|
||||
|
||||
localidadesOrigemlList.setItemRenderer(new RenderConexionRuta(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
Parada parada = (Parada) arg0.getTarget().getAttribute("data");
|
||||
if (arg0.getTarget().getAttribute("tipo").equals(RenderConexionRuta.BOTAO_ADICIONAR_PERMISSAO)) {
|
||||
if (localidadesOrigenSelecionadaList.getListData().isEmpty()) {
|
||||
localidadesOrigenSelecionadaList.addItemNovo(parada);
|
||||
} else {
|
||||
for (Object objectParada : localidadesOrigenSelecionadaList.getListData()) {
|
||||
if (localidadesOrigenSelecionadaList.getListData().contains(parada) || (getLsLocalidadesComuns() != null && getLsLocalidadesComuns().contains(parada))) {
|
||||
return;
|
||||
}
|
||||
if (!((Parada) objectParada).equals(parada)) {
|
||||
localidadesOrigenSelecionadaList.addItemNovo(parada);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
localidadesOrigemlList.removeItem(parada);
|
||||
}
|
||||
}
|
||||
}));
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void executarPesquisaLocalidadesDestino() throws InterruptedException {
|
||||
|
||||
if (!validarLinhaJaSelecionada()) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionPorRutaController.MSG.rutaJaSelecionada"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
localidadesCombinadasList.clear();
|
||||
|
||||
|
||||
Set<Parada> lsParadas = new HashSet<Parada>(0);
|
||||
try {
|
||||
Ruta ruta = cmbRutaDestino.getSelectedItem() != null ? (Ruta) cmbRutaDestino.getSelectedItem().getValue() : null;
|
||||
if (localidadesDestinoList.getItems() != null) {
|
||||
localidadesDestinoList.getItems().clear();
|
||||
}
|
||||
if (ruta != null) {
|
||||
|
||||
ruta = rutaService.obtenerID(ruta.getRutaId());
|
||||
if (ruta != null && ruta.getRutaCombinacionList() != null) {
|
||||
for (RutaCombinacion rc : ruta.getRutaCombinacionList()) {
|
||||
if (rc.getTramo() != null) {
|
||||
lsParadas.add(rc.getTramo().getOrigem());
|
||||
lsParadas.add(rc.getTramo().getDestino());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lsDestino = new ArrayList<Parada>(lsParadas);
|
||||
localidadesDestinoSelecionadaList.setData(new ListModelList(lsDestino));
|
||||
localidadesDestinoList.setModel(new ListModelList(lsDestino));
|
||||
}
|
||||
|
||||
localidadesDestinoList.setItemRenderer(new RenderConexionRuta(new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event arg0) throws Exception {
|
||||
Parada parada = (Parada) arg0.getTarget().getAttribute("data");
|
||||
if (arg0.getTarget().getAttribute("tipo").equals(RenderConexionRuta.BOTAO_ADICIONAR_PERMISSAO)) {
|
||||
if (localidadesDestinoSelecionadaList.getListData().isEmpty()) {
|
||||
localidadesDestinoSelecionadaList.addItemNovo(parada);
|
||||
} else {
|
||||
for (Object objectParada : localidadesDestinoSelecionadaList.getListData()) {
|
||||
if (localidadesDestinoSelecionadaList.getListData().contains(parada) || (getLsLocalidadesComuns() != null && getLsLocalidadesComuns().contains(parada))) {
|
||||
return;
|
||||
}
|
||||
if (!((Parada) objectParada).equals(parada)) {
|
||||
localidadesDestinoSelecionadaList.addItemNovo(parada);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
localidadesDestinoList.removeItem(parada);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
lsParadas = new HashSet<Parada>(0);
|
||||
ruta = cmbRutaOrigem.getSelectedItem() != null ? (Ruta) cmbRutaOrigem.getSelectedItem().getValue() : null;
|
||||
ruta = rutaService.obtenerID(ruta.getRutaId());
|
||||
if (ruta != null && ruta.getRutaCombinacionList() != null) {
|
||||
for (RutaCombinacion rc : ruta.getRutaCombinacionList()) {
|
||||
if (rc.getTramo() != null) {
|
||||
lsParadas.add(rc.getTramo().getOrigem());
|
||||
lsParadas.add(rc.getTramo().getDestino());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<Parada> paradasDuplicadas = new ArrayList<Parada>(lsParadas);
|
||||
paradasDuplicadas.retainAll(localidadesDestinoSelecionadaList.getListData());
|
||||
|
||||
localidadesOrigenSelecionadaList.getListData().removeAll(paradasDuplicadas);
|
||||
localidadesDestinoSelecionadaList.getListData().removeAll(paradasDuplicadas);
|
||||
|
||||
localidadesComunsList.setModel(new ListModelList(paradasDuplicadas));
|
||||
lsLocalidadesComuns = paradasDuplicadas;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onSelect$cmbRutaOrigem(Event ev) throws Exception {
|
||||
executarPesquisaLocalidadesOrigen();
|
||||
}
|
||||
|
||||
public void onSelect$cmbRutaDestino(Event ev) throws Exception {
|
||||
executarPesquisaLocalidadesDestino();
|
||||
}
|
||||
|
||||
public void onClick$btnCombinarTrechos(Event ev) throws InterruptedException {
|
||||
if (lsLocalidadesComuns == null || lsLocalidadesComuns.isEmpty()) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionPorRutaController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
if(!validarTrechos() ) {
|
||||
return;
|
||||
}
|
||||
gerarCombinacao();
|
||||
}
|
||||
|
||||
private boolean validarItensSalvar() throws InterruptedException {
|
||||
|
||||
|
||||
if (localidadesCombinadasList.getListData().isEmpty()) {
|
||||
Messagebox.show(Labels.getLabel("editarConexionPorRutaController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
return false;
|
||||
}
|
||||
|
||||
txtTiempoMax.getValue();
|
||||
txtTiempoMin.getValue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void onClick$btnNovoCanalVenta(Event ev) throws InterruptedException {
|
||||
|
||||
if(cmbTipoPtovta.getSelectedItem() == null){
|
||||
return;
|
||||
}
|
||||
TipoPuntoVenta ptovta = (TipoPuntoVenta) cmbTipoPtovta.getSelectedItem().getValue();
|
||||
|
||||
if (listEspCanal.getListData().contains(ptovta)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarPricingEspecificoOcupacionController.MSG.noPricingEspecificoCanalJaCadastrado"),
|
||||
Labels.getLabel("busquedaPricingEspecificoController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else {
|
||||
if(ptovta.getTipoptovtaId() == -1){
|
||||
listEspCanal.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<TipoPuntoVenta> canaisVenta = listEspCanal.getListData();
|
||||
for (TipoPuntoVenta tipoPuntoVenta : canaisVenta) {
|
||||
if(tipoPuntoVenta.getTipoptovtaId() == -1){
|
||||
listEspCanal.clear();
|
||||
listEspCanal.addItemNovo(tipoPuntoVenta);
|
||||
ptovta = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ptovta != null) {
|
||||
listEspCanal.addItemNovo(ptovta);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cmbTipoPtovta.setValue("");
|
||||
}
|
||||
|
||||
public void onClick$btnApagarCanalVenta(Event ev) throws InterruptedException {
|
||||
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionExcepcionController.MSG.borrarConexionPergunta"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
if (listEspCanal.getSelected() != null) {
|
||||
listEspCanal.removeItem((TipoPuntoVenta) listEspCanal.getSelectedItem().getValue());
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnNovoPuntoVenta(Event ev) throws InterruptedException {
|
||||
|
||||
if(cmbPtovta.getSelectedItem() == null){
|
||||
return;
|
||||
}
|
||||
PuntoVenta puntoVenta = (PuntoVenta) cmbPtovta.getSelectedItem().getValue();
|
||||
|
||||
if (listPuntoVenta.getListData().contains(puntoVenta)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConexionPorRutaController.MSG.noPuntoVentaJaCadastrado"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
} else {
|
||||
if(puntoVenta.getPuntoventaId() == -1){
|
||||
listPuntoVenta.clear();
|
||||
}else {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<PuntoVenta> canaisVenta = listPuntoVenta.getListData();
|
||||
for (PuntoVenta puntoVentaAux : canaisVenta) {
|
||||
if(puntoVentaAux.getPuntoventaId() == -1){
|
||||
listPuntoVenta.clear();
|
||||
listPuntoVenta.addItemNovo(puntoVentaAux);
|
||||
puntoVenta = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(puntoVenta != null) {
|
||||
listPuntoVenta.addItemNovo(puntoVenta);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cmbTipoPtovta.setValue("");
|
||||
}
|
||||
|
||||
public void onClick$btnApagarPuntoVenta(Event ev) throws InterruptedException {
|
||||
|
||||
int resp = Messagebox.show(
|
||||
Labels.getLabel("editarConexionExcepcionController.MSG.borrarPuntoVentaPergunta"),
|
||||
Labels.getLabel("editarConexionPorRutaController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (resp == Messagebox.YES) {
|
||||
if (listPuntoVenta.getSelected() != null) {
|
||||
listPuntoVenta.removeItem((PuntoVenta) listPuntoVenta.getSelectedItem().getValue());
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("editarConexionExcepcionController.MSG.selecionarConexion"),
|
||||
Labels.getLabel("editarConexionExcepcionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Ruta> getLsRutas() {
|
||||
return lsRutas;
|
||||
}
|
||||
|
||||
public void setLsRutas(List<Ruta> lsRutas) {
|
||||
this.lsRutas = lsRutas;
|
||||
}
|
||||
/**
|
||||
* @return the lsPtovata
|
||||
*/
|
||||
public List<TipoPuntoVenta> getLsTipoPtovta() {
|
||||
return lsTipoPtovta;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lsPtovata
|
||||
* the lsPtovata to set
|
||||
*/
|
||||
public void setLsPtovata(List<TipoPuntoVenta> lsTipoPtovta) {
|
||||
this.lsTipoPtovta = lsTipoPtovta;
|
||||
}
|
||||
|
||||
private void mostraMensagem(String msg) throws InterruptedException {
|
||||
Messagebox.show(msg, Labels.getLabel("editarConexionController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
|
||||
public List<Parada> getLsLocalidadesComuns() {
|
||||
return lsLocalidadesComuns;
|
||||
}
|
||||
|
||||
public void setLsLocalidadesComuns(List<Parada> lsLocalidadesComuns) {
|
||||
this.lsLocalidadesComuns = lsLocalidadesComuns;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void gerarCombinacao() {
|
||||
|
||||
List<Parada> listParada1 = localidadesOrigenSelecionadaList.getListData();
|
||||
|
||||
for (int i = 0; i < getLsLocalidadesComuns().size(); i++) {
|
||||
|
||||
List<Parada> listParada2 = getLsLocalidadesComuns();
|
||||
List<Parada> listParada3 = Arrays.asList(getLsLocalidadesComuns().get(i));
|
||||
List<Parada> listParada4 = localidadesDestinoSelecionadaList.getListData();
|
||||
|
||||
LinkedList<List<Parada>> lists = new LinkedList<List<Parada>>();
|
||||
|
||||
lists.add(listParada1);
|
||||
lists.add(listParada2);
|
||||
lists.add(listParada3);
|
||||
lists.add(listParada4);
|
||||
|
||||
List<Parada> localidades = new ArrayList<Parada>();
|
||||
localidades.addAll(listParada1);
|
||||
localidades.addAll(listParada2);
|
||||
localidades.addAll(listParada3);
|
||||
localidades.addAll(listParada4);
|
||||
|
||||
cacheLocalidades = criandoCacheLocalidades(localidades);
|
||||
gerarCombinacao(lists);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Map<Integer, Parada> criandoCacheLocalidades(List<Parada> list) {
|
||||
Map<Integer, Parada> map = new HashMap<Integer, Parada>();
|
||||
for (Parada parada : list) {
|
||||
map.put(parada.getParadaId(), parada);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void gerarCombinacao(LinkedList<List<Parada>> lists) {
|
||||
|
||||
List<ParadaVOConexionRuta> lsLocalidades = new ArrayList<ParadaVOConexionRuta>();
|
||||
|
||||
Set<String> combinations = new TreeSet<String>();
|
||||
Set<String> newCombinations;
|
||||
|
||||
for (Parada s : lists.removeFirst())
|
||||
combinations.add(s.getParadaId().toString());
|
||||
|
||||
while (!lists.isEmpty()) {
|
||||
List<Parada> next = lists.removeFirst();
|
||||
newCombinations = new TreeSet<String>();
|
||||
for (String s1 : combinations)
|
||||
for (Parada s2 : next) {
|
||||
newCombinations.add(s1 + ";" + s2.getParadaId());
|
||||
}
|
||||
|
||||
combinations = newCombinations;
|
||||
}
|
||||
|
||||
String[] valoresCalculados = new String[3];
|
||||
short i = 1;
|
||||
Ruta rutaOrigem = (Ruta) cmbRutaOrigem.getSelectedItem().getValue();
|
||||
Ruta rutaDestino = (Ruta) cmbRutaDestino.getSelectedItem().getValue();
|
||||
conexoesCtrl = new ArrayList<ConexionCtrl>();
|
||||
|
||||
for (String comb : combinations) {
|
||||
|
||||
valoresCalculados = comb.split(";");
|
||||
lsLocalidades.add(new ParadaVOConexionRuta(cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[1])),rutaOrigem.getRutaId(),i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3]))));
|
||||
i++;
|
||||
lsLocalidades.add(new ParadaVOConexionRuta(cacheLocalidades.get(Integer.parseInt(valoresCalculados[2])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])), rutaDestino.getRutaId() ,i, true,
|
||||
cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3]))));
|
||||
conexoesCtrl.add(new ConexionCtrl(cacheLocalidades.get(Integer.parseInt(valoresCalculados[0])).getParadaId(), cacheLocalidades.get(Integer.parseInt(valoresCalculados[3])).getParadaId()));
|
||||
i = 1;
|
||||
}
|
||||
|
||||
localidadesCombinadasList.setData(lsLocalidades);
|
||||
localidadesCombinadasList.setItemRenderer(new RenderConexionPorRuta());
|
||||
|
||||
for (ParadaVOConexionRuta localidade : lsLocalidades) {
|
||||
log.info(localidade);
|
||||
}
|
||||
|
||||
resultadoCombinacao.setSelected(true);
|
||||
btnSalvar.setDisabled(Boolean.FALSE);
|
||||
}
|
||||
|
||||
private boolean validarLinhaJaSelecionada() {
|
||||
if (cmbRutaOrigem.getSelectedItem() != null && cmbRutaDestino.getSelectedItem() != null) {
|
||||
if (cmbRutaOrigem.getSelectedItem().getValue().equals(cmbRutaDestino.getSelectedItem().getValue())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuConexionPorRuta extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuConexionPorRuta() {
|
||||
super("indexController.mniConexionPorRuta.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONEXIONPORRUTA";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/esquema_operacional/gerarConexionPorRuta.zul",
|
||||
Labels.getLabel("busquedaConexionPorRutaController.window.title"), getArgs() ,desktop);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zkplus.spring.SpringUtil;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||
import com.rjconsultores.ventaboletos.service.ConexionConfService;
|
||||
import com.rjconsultores.ventaboletos.vo.parada.ParadaVOConexionRuta;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author wallace
|
||||
*/
|
||||
public class RenderConexionPorRuta implements ListitemRenderer {
|
||||
private boolean changeColor = true;
|
||||
private static long grupo = 0;
|
||||
private static long grupoConexionCtrl = 0;
|
||||
private ConexionConfService conexionConfService = (ConexionConfService) SpringUtil.getBean("conexionConfService");
|
||||
private String style1 = "Font-weight:bold;background-color: #858a8a";
|
||||
private String style2 = "Font-weight:bold;background-color: #535757";
|
||||
private String styleDesativada1 = "Font-weight:bold;background-color: #A52A2A";
|
||||
private String styleDesativada2 = "Font-weight:bold;background-color: #800000";
|
||||
|
||||
private void setStyle(Listcell lc, ConexionConf conexionConf) {
|
||||
lc.setStyle(changeColor ? style1 : style2);
|
||||
if (conexionConf != null && conexionConf.getIndisponible() != null && conexionConf.getIndisponible()) {
|
||||
lc.setStyle(changeColor ? styleDesativada1 : styleDesativada2);
|
||||
}
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
|
||||
ParadaVOConexionRuta conexion = (ParadaVOConexionRuta) o;
|
||||
ConexionConf conexionConf = null;
|
||||
|
||||
Listcell lc = new Listcell(conexion.getParadaOrigem().getDescparada());
|
||||
// setStyle(lc, conexionConf);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(conexion.getParadaDestino().getDescparada());
|
||||
// setStyle(lc, conexionConf);
|
||||
lc.setParent(lstm);
|
||||
|
||||
|
||||
lstm.setValue(conexion);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author wallace
|
||||
*/
|
||||
public class RenderConexionRuta implements ListitemRenderer {
|
||||
|
||||
private EventListener listenerGenerico;
|
||||
public static final String BOTAO_ADICIONAR_PERMISSAO = "btnAdicionarPermissao";
|
||||
|
||||
public RenderConexionRuta(EventListener listenerGenerico) {
|
||||
super();
|
||||
this.listenerGenerico = listenerGenerico;
|
||||
}
|
||||
|
||||
public RenderConexionRuta() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
|
||||
Parada parada = (Parada) o;
|
||||
|
||||
Listcell lc = new Listcell(parada.getDescparada().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
Button btnAdicionarPermissao = new Button("");
|
||||
btnAdicionarPermissao.setAttribute("data", o);
|
||||
btnAdicionarPermissao.setAttribute("tipo", "btnAdicionarPermissao");
|
||||
btnAdicionarPermissao.addEventListener("onClick", listenerGenerico);
|
||||
btnAdicionarPermissao.setImage("/gui/img/add.png");
|
||||
lc.appendChild(btnAdicionarPermissao);
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", parada);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public class RenderConexionRutaRemoveSelecionada implements ListitemRenderer {
|
||||
|
||||
private EventListener listenerGenerico;
|
||||
|
||||
public RenderConexionRutaRemoveSelecionada(EventListener listenerGenerico) {
|
||||
super();
|
||||
this.listenerGenerico = listenerGenerico;
|
||||
}
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
Parada parada = (Parada) o;
|
||||
|
||||
Listcell lc = new Listcell(parada.getCveparada().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(parada.getDescparada().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell();
|
||||
|
||||
Button btnRemoverPermissao = new Button();
|
||||
btnRemoverPermissao.setAttribute("data", o);
|
||||
btnRemoverPermissao.addEventListener("onClick", listenerGenerico);
|
||||
btnRemoverPermissao.setImage("/gui/img/remove.png");
|
||||
lc.appendChild(btnRemoverPermissao);
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", parada);
|
||||
}
|
||||
}
|
|
@ -12,11 +12,13 @@ import org.zkoss.zul.ListitemRenderer;
|
|||
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||
|
||||
public class RenderEditarConexion implements ListitemRenderer {
|
||||
private ParadaService paradaService = (ParadaService) SpringUtil.getBean("paradaService");
|
||||
private RutaService rutaService = (RutaService) SpringUtil.getBean("rutaService");
|
||||
private static int grupo = 0;
|
||||
private boolean changeColor = true;
|
||||
private Conexion conexion;
|
||||
|
@ -68,6 +70,9 @@ public class RenderEditarConexion implements ListitemRenderer {
|
|||
lc.setParent(listItem);
|
||||
|
||||
setupCelServico(conexionConf);
|
||||
Ruta ruta = rutaService.obtenerID(conexion.getRutaId());
|
||||
lc = new Listcell(ruta.getNumRuta()+ " -"+ ruta.getDescruta());
|
||||
lc.setParent(listItem);
|
||||
|
||||
listItem.setValue(conexion);
|
||||
}
|
||||
|
@ -77,6 +82,8 @@ public class RenderEditarConexion implements ListitemRenderer {
|
|||
|
||||
if (conexion.getCorridaId() != null) {
|
||||
intBox.setValue(conexion.getCorridaId().intValue());
|
||||
}else if(conexion.getRutaId() != null){
|
||||
intBox.setDisabled(true);
|
||||
}
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
|
|
|
@ -503,7 +503,11 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.EmbarcadaDispOperador</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.AgrupamentoParada</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaEmailFlexBus</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConexionRutaCtrl</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConexionRutaTramoCtrl</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionTipoPtoVta</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConexionRutaExcepcionPtoVta</value>
|
||||
</list>
|
||||
</property>
|
||||
|
||||
|
|
|
@ -6965,6 +6965,44 @@ editarConexionController.lblNServico2=N. Serviço
|
|||
editarConexionController.lblNServico3=N. Serviço
|
||||
editarConexionController.lblNServico3=N. Serviço
|
||||
|
||||
|
||||
#Editar conexion por ruta
|
||||
editarConexionPorRutaController.window.title=Generar Conexiones entre Rutas
|
||||
editarConexionPorRutaController.lhOrigenConexion.label=Ori. Conexion
|
||||
editarConexionPorRutaController.lhDestinoConexion.label= Dest. Conexão
|
||||
editarConexionPorRutaController.lhGrupo.label=Grupo
|
||||
editarConexionPorRutaController.lhSecuencia.label = Secuencia
|
||||
editarConexionPorRutaController.lhOrigenTrecho.label=Ori. Trecho
|
||||
editarConexionPorRutaController.lhDestinoTrecho.label=Dest. Trecho
|
||||
editarConexionPorRutaController.btnCerrar.tooltiptext=Fechar
|
||||
editarConexionPorRutaController.btnGenerarConexiones.tooltiptext=Generar Conexões
|
||||
editarConexionPorRutaController.msgGerarCombincoes=Quieres generar las combinaciones de conexiones?
|
||||
editarConexionPorRutaController.msgCombincoesGeradas=Combinações Geradas com Sucesso
|
||||
editarConexionPorRutaController.btnNovo.tooltiptext = Nuevo
|
||||
editarConexionPorRutaController.btnPesquisa.label = Pesquisa
|
||||
editarConexionPorRutaController.msg.erroConfConexion = Error al cargar la conexión de origen {0} e destino {1} para grupo {2}
|
||||
editarConexionPorRutaController.labelLocalidades.value = Paradas
|
||||
editarConexionPorRutaController.labelLocalidadesDescricao.value = Descrição
|
||||
editarConexionPorRutaController.labelLocalidadesCodigo.value = Cód.
|
||||
editarConexionPorRutaController.labelLinhaOrigem.value =Linha Origem
|
||||
editarConexionPorRutaController.labelLinhaDestino.value =Linha Destino
|
||||
editarConexionPorRutaController.labelLocalidadesComuns.value = Paradas comunes
|
||||
editarConexionPorRutaController.labelAdicionarLocalidade.value = Adicionar
|
||||
editarConexionPorRutaController.labelOrigemTrecho.value = De Tramo
|
||||
editarConexionPorRutaController.labelDestinoTrecho.value = Hasta Tramo
|
||||
editarConexionPorRutaController.MSG.selecionarConexion= Seleccione las líneas para generar las combinaciones
|
||||
editarConexionPorRutaController.MSG.rutaJaSelecionada= Ruta ya seleccionado !
|
||||
editarConexionPorRutaController.tabResultadoCombinacao = Resultado Combinação
|
||||
editarConexionPorRutaController.labelExcecaoCanalVenta.value = Exceção Canal de Venda
|
||||
editarConexionController.tabConfiguracaoTempo.value = Tiempo de conección
|
||||
editarConexionPorRutaController.labelExcecaoPuntoVenta.value = Exceção Agências
|
||||
editarConexionPorRutaController.MSG.noPuntoVentaJaCadastrado = Punto Venta ya seleccionado
|
||||
editarConexionExcepcionController.MSG.borrarPuntoVentaPergunta = Deseja remover essa Agência?
|
||||
editarConexionPorRutaController.labelIDPuntoVenta = ID
|
||||
editarConexionPorRutaController.labelDescPuntoVenta = Punto Venta
|
||||
editarConexionPorRutaController.MSG.suscribirOK = Conexão salva com sucesso.
|
||||
editarConexionPorRutaController.MSG.suscribirOBSOK = Já existem conexões criadas para os seguintes trechos.
|
||||
|
||||
# Editar Configuracao de Conexion
|
||||
editarConexionConfController.window.title = Editar configuración de la conexión
|
||||
editarConexionConfController.MSG.suscribirOK = Configuración de conexión se guardó exitosamente.
|
||||
|
|
|
@ -137,6 +137,7 @@ indexController.mniGrupoRuta.label = Grupo de Linha
|
|||
indexController.mniCorrida.label = Configuração de Serviços
|
||||
indexController.mniIdentificacaoTrem.label = Identificação Trem
|
||||
indexController.mniConexion.label = Conexões
|
||||
indexController.mniConexionPorRuta.label = Geração de Conexões entre Linhas
|
||||
indexController.mniParamConexion.label = Parâmetros de Conexão
|
||||
indexController.mniGeracionCorrida.label = Geração de Serviço
|
||||
indexController.mniFormaPago.label = Forma de Pagamento
|
||||
|
@ -6648,6 +6649,7 @@ editarSeguroTarifaController.MSG.existe= Já existe um registro com esse Tarifa.
|
|||
TarifaOficialServiceImpl.msg.validacion.orgaoObligatorio=Informe o Órgão Concedente
|
||||
#Búsqueda conexion
|
||||
busquedaConexionController.window.title=Conexões entre Localidades
|
||||
busquedaConexionPorRutaController.window.title=Gerar Conexões entre Linhas
|
||||
busquedaConexionController.lhOrigenConexion.label=Ori. Conexão
|
||||
busquedaConexionController.lhDestinoConexion.label= Dest. Conexão
|
||||
busquedaConexionController.lhGrupo.label=Grupo
|
||||
|
@ -6662,6 +6664,45 @@ busquedaConexionController.btnNovo.tooltiptext = Novo
|
|||
busquedaConexionController.btnPesquisa.label = Pesquisa
|
||||
busquedaConexionController.msg.erroConfConexion = Erro ao carregar a conexão origem {0} e destino {1} para grupo {2}
|
||||
|
||||
|
||||
#Editar conexion por ruta
|
||||
editarConexionPorRutaController.window.title=Gerar Conexões entre Linhas
|
||||
editarConexionPorRutaController.lhOrigenConexion.label=Ori. Conexão
|
||||
editarConexionPorRutaController.lhDestinoConexion.label= Dest. Conexão
|
||||
editarConexionPorRutaController.lhGrupo.label=Grupo
|
||||
editarConexionPorRutaController.lhSecuencia.label = Sequencia
|
||||
editarConexionPorRutaController.lhOrigenTrecho.label=Ori. Trecho
|
||||
editarConexionPorRutaController.lhDestinoTrecho.label=Dest. Trecho
|
||||
editarConexionPorRutaController.btnCerrar.tooltiptext=Fechar
|
||||
editarConexionPorRutaController.btnGenerarConexiones.tooltiptext=Gerar Conexões
|
||||
editarConexionPorRutaController.msgGerarCombincoes=Deseja gerar as combinações de conexões?
|
||||
editarConexionPorRutaController.msgCombincoesGeradas=Combinações Geradas com Sucesso
|
||||
editarConexionPorRutaController.btnNovo.tooltiptext = Novo
|
||||
editarConexionPorRutaController.btnPesquisa.label = Pesquisa
|
||||
editarConexionPorRutaController.msg.erroConfConexion = Erro ao carregar a conexão origem {0} e destino {1} para grupo {2}
|
||||
editarConexionPorRutaController.labelLocalidades.value = Localidades
|
||||
editarConexionPorRutaController.labelLocalidadesDescricao.value = Descrição
|
||||
editarConexionPorRutaController.labelLocalidadesCodigo.value = Cód.
|
||||
editarConexionPorRutaController.labelLinhaOrigem.value =Linha Origem
|
||||
editarConexionPorRutaController.labelLinhaDestino.value =Linha Destino
|
||||
editarConexionPorRutaController.labelLocalidadesComuns.value = Localidades Comuns
|
||||
editarConexionPorRutaController.labelAdicionarLocalidade.value = Adicionar
|
||||
editarConexionPorRutaController.labelOrigemTrecho.value = Origem Trecho
|
||||
editarConexionPorRutaController.labelDestinoTrecho.value = Destino Trecho
|
||||
editarConexionPorRutaController.MSG.selecionarConexion= Favor selecionar as linhas para gerar as combinações
|
||||
editarConexionPorRutaController.MSG.rutaJaSelecionada= Linha Já selecionada !
|
||||
editarConexionPorRutaController.tabResultadoCombinacao = Resultado Combinação
|
||||
editarConexionPorRutaController.labelExcecaoCanalVenta.value = Exceção Canal de Venda
|
||||
editarConexionController.tabConfiguracaoTempo.value = Tempo Conexão
|
||||
editarConexionPorRutaController.labelExcecaoPuntoVenta.value = Exceção Agências
|
||||
editarConexionPorRutaController.MSG.noPuntoVentaJaCadastrado = Ponto de Venda já cadastrado
|
||||
editarConexionExcepcionController.MSG.borrarPuntoVentaPergunta = Deseja remover essa Agência?
|
||||
editarConexionPorRutaController.labelIDPuntoVenta = ID
|
||||
editarConexionPorRutaController.labelDescPuntoVenta = Agência
|
||||
editarConexionPorRutaController.MSG.suscribirOK = Conexão salva com sucesso.
|
||||
editarConexionPorRutaController.MSG.suscribirOBSOK = Já existem conexões criadas para os seguintes trechos.
|
||||
|
||||
|
||||
#Busqueda param conexion
|
||||
busquedaParamConexionController.window.title=Parâmetros de Conexão
|
||||
busquedaParamConexionController.btnRefresh.tooltiptext=Atualizar
|
||||
|
@ -7286,6 +7327,12 @@ editarConexionController.btnRemoverConexao.tooltiptext = Remover Conexão
|
|||
editarConexionController.btnAddConexaoRuta.tooltiptext=Adicionar Exceção Linha
|
||||
editarConexionController.btnRemoverConexaoRuta.tooltiptext = Remover Exceção Linha
|
||||
editarConexionController.btnModificarRuta.value = Modificar Exceção Linha
|
||||
editarConexionController.labelLocalidades.value = Localidades
|
||||
editarConexionController.labelLocalidadesDescricao.value = Descrição
|
||||
editarConexionController.labelLocalidadesCodigo.value = Cód.
|
||||
editarConexionController.labelLinha.value = Linha
|
||||
editarConexionController.labelLocalidadesComuns.value = Localidades Comuns
|
||||
editarConexionController.labelAdicionarLocalidade.value = Adicionar
|
||||
|
||||
editarConexionController.lblNServico1=N. Serviço
|
||||
editarConexionController.lblNServico2=N. Serviço
|
||||
|
|
|
@ -0,0 +1,288 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winEditarConexion"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winEditarConexion"
|
||||
title="${c:l('editarConexionController.window.title')}"
|
||||
apply="${editarConexionRutaController}" contentStyle="overflow:auto"
|
||||
height="550px" width="1000px" border="normal">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<button id="btnApagar" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarConexionController.btnApagar.tooltiptext')}" />
|
||||
<button id="btnSalvar" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarConexionController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarConexion.detach()"
|
||||
tooltiptext="${c:l('editarConexionController.btnFechar.tooltiptext')}" />
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<tabbox id="tb">
|
||||
<tabs id="tabs">
|
||||
<tab id="A"
|
||||
label="${c:l('editarConexionController.tabConexion.value')}" />
|
||||
<tab id="B"
|
||||
label="${c:l('editarConexionController.tabConexionRutaException.value')}" />
|
||||
<tab id="C"
|
||||
label="${c:l('editarConexionPorRutaController.labelExcecaoCanalVenta.value')}" />
|
||||
<tab id="D"
|
||||
label="${c:l('editarConexionPorRutaController.labelExcecaoPuntoVenta.value')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<!-- CONEXION -->
|
||||
<tabpanel>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="15%" />
|
||||
<column width="35%" />
|
||||
<column width="15%" />
|
||||
<column width="35%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelOrigenInicial.value')}" />
|
||||
<combobox id="cmbOrigemCntrl"
|
||||
constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
|
||||
mold="rounded" buttonVisible="true" width="100%" />
|
||||
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelDestinoFinal.value')}" />
|
||||
<combobox id="cmbDestinoCntrl"
|
||||
constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
|
||||
mold="rounded" buttonVisible="true" width="100%" />
|
||||
</row>
|
||||
|
||||
<row spans="1,3">
|
||||
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelTiempoEspera.value')}" />
|
||||
<hlayout>
|
||||
<label style="padding-right:35px"
|
||||
value="${c:l('editarConexionController.labelTiempoMin.value')}" />
|
||||
<intbox id="txtTiempoMin" />
|
||||
<label
|
||||
style="padding-left:70px; padding-right:35px"
|
||||
value="${c:l('editarConexionController.labelTiempoMax.value')}" />
|
||||
<intbox id="txtTiempoMax" />
|
||||
</hlayout>
|
||||
</row>
|
||||
|
||||
<row spans="4">
|
||||
<hlayout>
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelOrigenConexaoPasso1.value')}" />
|
||||
<combobox id="cmbOrigemConexao"
|
||||
disabled="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
|
||||
mold="rounded" buttonVisible="true" width="250px" />
|
||||
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelDestinoConexaoPasso1.value')}" />
|
||||
<combobox id="cmbDestinoConexao"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada"
|
||||
mold="rounded" buttonVisible="true" width="250px"
|
||||
disabled="true" />
|
||||
|
||||
<button id="btnAddConexao"
|
||||
image="/gui/img/add.png" width="35px" height="25px"
|
||||
tooltiptext="${c:l('editarConexionController.btnAddConexao.tooltiptext')}" />
|
||||
</hlayout>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnRemoverConexao" height="25px"
|
||||
width="35px" image="/gui/img/remove.png"
|
||||
tooltiptext="${c:l('editarConexionController.btnRemoverConexao.tooltiptext')}" />
|
||||
|
||||
<button id="btnAtivar" height="25px"
|
||||
width="35px" image="/gui/img/icon-active.gif"
|
||||
tooltiptext="${c:l('editarPricingController.btnAtivar.tooltiptext')}" />
|
||||
|
||||
<button id="btnDesativar" height="25px"
|
||||
width="35px" image="/gui/img/close_icon_inactive.png"
|
||||
tooltiptext="${c:l('editarConexionController.btnInativar.tooltiptext')}" />
|
||||
|
||||
<button id="btnModificarConexao" height="25px"
|
||||
label="${c:l('editarConexionController.btnModificar.value')}" />
|
||||
<separator orient="vertical" />
|
||||
<separator orient="vertical" />
|
||||
|
||||
<label style="color:#535757;"
|
||||
value="${c:l('editarConexionController.labelAtivo.value')}" />
|
||||
<separator orient="vertical" />
|
||||
<label style="color:#A52A2A;"
|
||||
value="${c:l('editarConexionController.labelInativo.value')}" />
|
||||
</toolbar>
|
||||
|
||||
<style>
|
||||
tr.z-listitem td.z-listitem-focus
|
||||
{background-image: none;}
|
||||
|
||||
tr.z-listitem-seld { background-color: #84C5D6;
|
||||
border: none; -moz-box-shadow: 0 0 5px 2px
|
||||
#707070 inset; -webkit-box-shadow: 0 0 5px 2px
|
||||
#707070 inset; box-shadow: 0 0 5px 2px #707070
|
||||
inset; color: #ffffff; text-shadow: 1px 1px 1px
|
||||
#000000; }
|
||||
|
||||
tr.z-listitem-over { background-color: #84C5D6;
|
||||
border: none; color: #ffffff; -moz-box-shadow: 0
|
||||
0 5px 2px #8e8e8e inset; -webkit-box-shadow: 0 0
|
||||
5px 2px #8e8e8e inset; box-shadow: 0 0 5px 2px
|
||||
#8e8e8e inset; cursor: pointer; text-shadow:
|
||||
0.3px 0.3px 0.3px #ffffff; }
|
||||
</style>
|
||||
|
||||
<listbox id="conexionesEditarList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false" vflex="true" height="280px">
|
||||
<listhead sizable="true">
|
||||
<listheader width="20%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConexionController.labelOrigen.value')}" />
|
||||
<listheader width="20%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConexionController.labelDestino.value')}" />
|
||||
<listheader width="10%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConexionController.lhGrupo.label')}" />
|
||||
<listheader width="10%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConexionController.lhSecuencia.label')}" />
|
||||
<listheader label="Serviço" width="11%" />
|
||||
<listheader label="Linha" width="30%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
|
||||
<!-- CONEXION EXCEPCION RUTA -->
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="80%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConexionController.lbRuta')}" />
|
||||
<combobox id="cmbRuta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarConexion$composer.lsRutas}" mold="rounded"
|
||||
buttonVisible="true" width="100%" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<toolbar>
|
||||
<button id="btnAddConexaoRutaExcepcion"
|
||||
image="/gui/img/add.png" width="35px" height="30px"
|
||||
tooltiptext="${c:l('editarConexionController.btnAddConexaoRuta.tooltiptext')}" />
|
||||
<button id="btnRemoverConexaoRutaExcepcion"
|
||||
height="30px" width="35px" image="/gui/img/remove.png"
|
||||
tooltiptext="${c:l('editarConexionController.btnRemoverConexaoRuta.tooltiptext')}" />
|
||||
|
||||
<separator orient="vertical" />
|
||||
<separator orient="vertical" />
|
||||
|
||||
</toolbar>
|
||||
<listbox id="conexionExcepcionRutaList"
|
||||
mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="250px" width="100%">
|
||||
<listhead sizable="true">
|
||||
<listheader width="100%"
|
||||
image="/gui/img/builder.gif"
|
||||
label="${c:l('editarConexionController.lbRuta')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
<!-- CANAIS DE VENDAS -->
|
||||
<tabpanel height="100%">
|
||||
<grid height="100%">
|
||||
<rows>
|
||||
<row>
|
||||
<vbox height="100%" width="100%">
|
||||
<hbox>
|
||||
<label
|
||||
value="${c:l('editarPricingController.ptovta.value')}" />
|
||||
<combobox id="cmbTipoPtovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
model="@{winEditarConexion$composer.lsTipoPtovta}" />
|
||||
<button id="btnNovoCanalVenta"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnAgencia.tooltiptext')}">
|
||||
</button>
|
||||
<button id="btnApagarCanalVenta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnApagarAgencia.tooltiptext')}" />
|
||||
</hbox>
|
||||
<listbox id="conexionRutaTipoPuntoVentaList"
|
||||
height="400px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
sort="auto(ocupacioninicial)"
|
||||
label="${c:l('editarPricingController.ptovta.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
<!-- AGENCIAS -->
|
||||
|
||||
<tabpanel>
|
||||
<grid>
|
||||
<rows>
|
||||
<row>
|
||||
<vbox height="100%" width="100%">
|
||||
<hbox>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelDescPuntoVenta')}" />
|
||||
<combobox id="cmbPtovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||
mold="rounded" buttonVisible="true" width="90%" />
|
||||
<button id="btnNovoPuntoVenta"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnAgencia.tooltiptext')}" />
|
||||
<button id="btnApagarPuntoVenta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnApagarAgencia.tooltiptext')}" />
|
||||
</hbox>
|
||||
<listbox id="conexionRutaPuntoVentaList"
|
||||
height="400px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
sort="auto(ocupacioninicial)"
|
||||
label="${c:l('editarConexionPorRutaController.labelDescPuntoVenta')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
</zk>
|
|
@ -0,0 +1,375 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winEditarConexionPorRuta"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winEditarConexionPorRuta" border="normal" width="955px"
|
||||
apply="${gerarConexionPorRutaController}" height="600px">
|
||||
<style dynamic="true">
|
||||
.z-textbox{background: #ffa99c}
|
||||
.z-spinner-inp{background:#ffa99c} .z-textbox-real-readonly,
|
||||
.z-textbox-readonly{background:#99beff} .z-spinner-readonly,
|
||||
.z-spinner-text-disd{background:#99beff}
|
||||
</style>
|
||||
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
|
||||
<button id="btnSalvar" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarConexionPorRutaController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarConexionPorRuta.detach()"
|
||||
tooltiptext="${c:l('editarConexionPorRuta.btnFechar.tooltiptext')}" />
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
|
||||
<tabbox id="tb">
|
||||
<tabs id="tabs">
|
||||
<tab id="A"
|
||||
label="${c:l('editarConexionController.tabConexion.value')}" />
|
||||
<tab id="resultadoCombinacao"
|
||||
label="${c:l('editarConexionPorRutaController.tabResultadoCombinacao')}" />
|
||||
<tab id="C"
|
||||
label="${c:l('editarConexionController.tabConfiguracaoTempo.value')}" />
|
||||
<tab id="D"
|
||||
label="${c:l('editarConexionPorRutaController.labelExcecaoCanalVenta.value')}" height="100%" />
|
||||
<tab id="E"
|
||||
label="${c:l('editarConexionPorRutaController.labelExcecaoPuntoVenta.value')}" height="100%"/>
|
||||
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="10%" />
|
||||
<column width="25%" />
|
||||
<column width="10%" />
|
||||
<column width="10%" />
|
||||
<column width="25%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelLinhaOrigem.value')}" />
|
||||
<combobox id="cmbRutaOrigem"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarConexionPorRuta$composer.lsRutas}"
|
||||
mold="rounded" buttonVisible="true" width="100%" />
|
||||
<label></label>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelLinhaDestino.value')}" />
|
||||
<combobox id="cmbRutaDestino"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarConexionPorRuta$composer.lsRutas}"
|
||||
mold="rounded" buttonVisible="true" width="100%" />
|
||||
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="15%" />
|
||||
<column width="30%" />
|
||||
<column width="15%" />
|
||||
<column width="30%" />
|
||||
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelLocalidades.value')}" />
|
||||
<bandbox id="bbPesquisaLinha"
|
||||
width="65%" mold="rounded" readonly="true">
|
||||
<bandpopup>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<textbox
|
||||
id="txtPalavraPesquisaPermissao" />
|
||||
<button
|
||||
id="btnPesquisaPermissao" image="/gui/img/find.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnPesquisa.label')}" />
|
||||
<button
|
||||
id="btnLimparLinha" image="/gui/img/eraser.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnLimpar.label')}" />
|
||||
</hbox>
|
||||
<listbox
|
||||
id="localidadesOrigemlList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false" height="60%" width="710px">
|
||||
<listhead>
|
||||
<listheader
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesDescricao.value')}"
|
||||
width="65%" />
|
||||
<listheader
|
||||
label="${c:l('editarConexionPorRutaController.labelAdicionarLocalidade.value')}"
|
||||
width="29%" />
|
||||
<listheader
|
||||
align="center" label=" " width="6%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingLinha"
|
||||
pageSize="10" />
|
||||
</vbox>
|
||||
</bandpopup>
|
||||
</bandbox>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelLocalidades.value')}" />
|
||||
<bandbox id="bbPesquisaLinha1"
|
||||
width="65%" mold="rounded" readonly="true">
|
||||
<bandpopup>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<textbox
|
||||
id="txtPalavraPesquisaLocalidadesDestino" />
|
||||
<button
|
||||
id="btnPesquisaLocalidadesDestino"
|
||||
image="/gui/img/find.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnPesquisa.label')}" />
|
||||
<button
|
||||
id="btnLimparLocalidadeDestino" image="/gui/img/eraser.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnLimpar.label')}" />
|
||||
</hbox>
|
||||
<listbox
|
||||
id="localidadesDestinoList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false" height="60%" width="710px">
|
||||
<listhead>
|
||||
<listheader
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesDescricao.value')}"
|
||||
width="65%" />
|
||||
<listheader
|
||||
label="${c:l('editarConexionPorRutaController.labelAdicionarLocalidade.value')}"
|
||||
width="29%" />
|
||||
<listheader
|
||||
align="center" label=" " width="6%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingLinhaq"
|
||||
pageSize="10" />
|
||||
</vbox>
|
||||
</bandpopup>
|
||||
</bandbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<grid fixedLayout="true" height="400px">
|
||||
<columns>
|
||||
<column width="35%" />
|
||||
<column width="30%" />
|
||||
<column width="35%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<cell>
|
||||
<borderlayout height="400px"
|
||||
width="100%">
|
||||
<center border="0">
|
||||
<listbox
|
||||
id="localidadesOrigenSelecionadaList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="100%" width="100%">
|
||||
<listhead>
|
||||
<listheader
|
||||
id="lhPermisoAux" image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesCodigo.value')}"
|
||||
sort="auto(funcionSistema.nombfuncion)" width="20%" />
|
||||
<listheader
|
||||
align="center" image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesDescricao.value')}"
|
||||
width="65%" />
|
||||
<listheader
|
||||
align="center" label="" width="15%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
</borderlayout>
|
||||
</cell>
|
||||
<cell>
|
||||
<borderlayout height="400px"
|
||||
width="100%">
|
||||
<center border="0">
|
||||
<listbox
|
||||
id="localidadesComunsList" style="background: #ffa99c"
|
||||
mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="50%" width="100%">
|
||||
<listhead
|
||||
style="background: #ffa99c">
|
||||
<listheader
|
||||
align="center" style="background: #ffa99c"
|
||||
image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesComuns.value')}"
|
||||
width="100%" />
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
</borderlayout>
|
||||
</cell>
|
||||
<cell>
|
||||
<borderlayout height="400px"
|
||||
width="100%">
|
||||
<center border="0">
|
||||
<listbox
|
||||
id="localidadesDestinoSelecionadaList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="50%" width="100%">
|
||||
<listhead>
|
||||
<listheader
|
||||
id="lhPermisoAuxx" image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesCodigo.value')}"
|
||||
sort="auto(funcionSistema.nombfuncion)" width="20%" />
|
||||
<listheader
|
||||
align="center" image="/gui/img/create_doc.gif"
|
||||
label="${c:l('editarConexionPorRutaController.labelLocalidadesDescricao.value')}"
|
||||
width="65%" />
|
||||
<listheader
|
||||
align="center" label="" width="15%" />
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
</borderlayout>
|
||||
</cell>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<toolbar align="center">
|
||||
<button id="btnCombinarTrechos" height="15"
|
||||
label="Combinar Trechos"
|
||||
tooltiptext="${c:l('editarConexionPorRutaController.btnFechar.tooltiptext')}" />
|
||||
</toolbar>
|
||||
</div>
|
||||
|
||||
</tabpanel>
|
||||
<tabpanel height="100%">
|
||||
<listbox id="localidadesCombinadasList"
|
||||
mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="100%" width="100%">
|
||||
<listhead>
|
||||
<listheader id="lhPermisoAux1x"
|
||||
label="${c:l('editarConexionPorRutaController.labelOrigemTrecho.value')}"
|
||||
width="50%" />
|
||||
<listheader align="center"
|
||||
label="${c:l('editarConexionPorRutaController.labelDestinoTrecho.value')}"
|
||||
width="50%" />
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="15%" />
|
||||
<column width="35%" />
|
||||
<column width="15%" />
|
||||
<column width="35%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row spans="1,3">
|
||||
<label
|
||||
value="${c:l('editarConexionController.labelTiempoEspera.value')}" />
|
||||
<hlayout>
|
||||
<label style="padding-right:35px"
|
||||
value="${c:l('editarConexionController.labelTiempoMin.value')}" />
|
||||
<intbox id="txtTiempoMin" />
|
||||
<label
|
||||
style="padding-left:70px; padding-right:35px"
|
||||
value="${c:l('editarConexionController.labelTiempoMax.value')}" />
|
||||
<intbox id="txtTiempoMax" />
|
||||
</hlayout>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
<!-- CANAIS DE VENDAS -->
|
||||
<tabpanel height="100%">
|
||||
<grid height="100%">
|
||||
<rows>
|
||||
<row>
|
||||
<vbox height="100%" width="100%">
|
||||
<hbox>
|
||||
<label
|
||||
value="${c:l('editarPricingController.ptovta.value')}" />
|
||||
<combobox id="cmbTipoPtovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
model="@{winEditarConexionPorRuta$composer.lsTipoPtovta}" />
|
||||
<button id="btnNovoCanalVenta"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnAgencia.tooltiptext')}">
|
||||
</button>
|
||||
<button id="btnApagarCanalVenta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnApagarAgencia.tooltiptext')}" />
|
||||
</hbox>
|
||||
<listbox id="listEspCanal"
|
||||
height="400px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
sort="auto(ocupacioninicial)"
|
||||
label="${c:l('editarPricingController.ptovta.value')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
<!-- AGENCIAS -->
|
||||
|
||||
<tabpanel>
|
||||
<grid>
|
||||
<rows>
|
||||
<row>
|
||||
<vbox height="100%" width="100%">
|
||||
<hbox>
|
||||
<label
|
||||
value="${c:l('editarConexionPorRutaController.labelDescPuntoVenta')}" />
|
||||
<combobox id="cmbPtovta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||
mold="rounded" buttonVisible="true" width="90%" />
|
||||
<button id="btnNovoPuntoVenta"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnAgencia.tooltiptext')}" />
|
||||
<button id="btnApagarPuntoVenta"
|
||||
height="20" image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('editarPricingController.btnApagarAgencia.tooltiptext')}" />
|
||||
</hbox>
|
||||
<listbox id="listPuntoVenta" height="400px"
|
||||
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
<listhead sizable="true">
|
||||
<listheader
|
||||
image="/gui/img/create_doc.gif"
|
||||
sort="auto(ocupacioninicial)"
|
||||
label="${c:l('editarConexionPorRutaController.labelDescPuntoVenta')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
|
||||
|
||||
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue