revert mantis issue #7460
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@57148 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c6a35b5539
commit
bb3aa2935d
|
@ -12,7 +12,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -52,9 +51,7 @@ import org.zkoss.zul.ext.Constrainted;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.GrupoRuta;
|
import com.rjconsultores.ventaboletos.entidad.GrupoRuta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
@ -69,7 +66,6 @@ import com.rjconsultores.ventaboletos.entidad.TramoServicio;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||||
import com.rjconsultores.ventaboletos.service.CorridaService;
|
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.GrupoRutaService;
|
import com.rjconsultores.ventaboletos.service.GrupoRutaService;
|
||||||
|
@ -107,8 +103,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
@Autowired
|
@Autowired
|
||||||
private EsquemaCorridaService esquemaCorridaService;
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CorridaService corridaService;
|
|
||||||
@Autowired
|
|
||||||
private ClaseServicioService claseService;
|
private ClaseServicioService claseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TramoService tramoService;
|
private TramoService tramoService;
|
||||||
|
@ -169,7 +163,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
private Intbox txtCantAsientos;
|
private Intbox txtCantAsientos;
|
||||||
private Checkbox chkIndVentaRioCard;
|
private Checkbox chkIndVentaRioCard;
|
||||||
private MyTextbox txtNumRioCard;
|
private MyTextbox txtNumRioCard;
|
||||||
private Checkbox chkCancelarRuta;
|
|
||||||
|
|
||||||
public Ruta getRuta() {
|
public Ruta getRuta() {
|
||||||
return ruta;
|
return ruta;
|
||||||
|
@ -278,6 +271,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
ruta = (Ruta) Executions.getCurrent().getArg().get("ruta");
|
ruta = (Ruta) Executions.getCurrent().getArg().get("ruta");
|
||||||
rutaList = (MyListbox) Executions.getCurrent().getArg().get("rutaList");
|
rutaList = (MyListbox) Executions.getCurrent().getArg().get("rutaList");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
// Secuencia
|
// Secuencia
|
||||||
|
@ -288,18 +283,18 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(Event event) throws Exception {
|
public void onEvent(Event event) throws Exception {
|
||||||
if (ruta.getRutaId() == null) {
|
if(ruta.getRutaId() == null){
|
||||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.salvarRutaPrimeiro"),
|
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.salvarRutaPrimeiro"),
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ParadaSecuencia psOrigen = (ParadaSecuencia) rutaSecuenciaList.getSelected();
|
ParadaSecuencia psOrigen = (ParadaSecuencia)rutaSecuenciaList.getSelected();
|
||||||
int indexSelecto = rutaSecuenciaList.getSelectedIndex();
|
int indexSelecto = rutaSecuenciaList.getSelectedIndex();
|
||||||
ParadaSecuencia psDestino = new ParadaSecuencia();
|
ParadaSecuencia psDestino = new ParadaSecuencia();
|
||||||
try {
|
try{
|
||||||
psDestino = (ParadaSecuencia) lsParadasSequencia.get(indexSelecto + 1);
|
psDestino = (ParadaSecuencia)lsParadasSequencia.get(indexSelecto+1);
|
||||||
} catch (IndexOutOfBoundsException e) {
|
}catch(IndexOutOfBoundsException e){
|
||||||
|
|
||||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.finRuta"),
|
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.finRuta"),
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||||
|
@ -307,7 +302,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (psOrigen == null) { // lsRutaSecuencia <-- esse objeto ja tem o id da ruta secuencia ....
|
if (psOrigen == null) { //lsRutaSecuencia <-- esse objeto ja tem o id da ruta secuencia ....
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map args = new HashMap();
|
Map args = new HashMap();
|
||||||
|
@ -331,6 +326,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Combinacion
|
// Combinacion
|
||||||
rutaCombinacionList.setItemRenderer(this);
|
rutaCombinacionList.setItemRenderer(this);
|
||||||
lsRutaCombinacion = new ArrayList<RutaCombinacion>();
|
lsRutaCombinacion = new ArrayList<RutaCombinacion>();
|
||||||
|
@ -383,7 +379,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
private List<CasetaPeaje> getCasetasPeage(List<RutaCaseta> casetas) {
|
private List<CasetaPeaje> getCasetasPeage(List<RutaCaseta> casetas) {
|
||||||
List<CasetaPeaje> casetasPeage = new ArrayList<CasetaPeaje>();
|
List<CasetaPeaje> casetasPeage = new ArrayList<CasetaPeaje>();
|
||||||
|
|
||||||
if (casetas == null || casetas.isEmpty()) {
|
if(casetas == null || casetas.isEmpty()) {
|
||||||
return casetasPeage;
|
return casetasPeage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,39 +390,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
return casetasPeage;
|
return casetasPeage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCheck$chkCancelarRuta(Event ev) throws Exception {
|
|
||||||
if (chkCancelarRuta.isChecked() && !existeEsquemaCorridaVigente() && !existeCorridaVenda()) {
|
|
||||||
ruta.setIndRutaCancelada(true);
|
|
||||||
} else {
|
|
||||||
chkCancelarRuta.setChecked(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean existeCorridaVenda() throws InterruptedException {
|
|
||||||
Corrida corrida = corridaService.buscaCorrridaFutura(ruta, new Date());
|
|
||||||
if (corrida != null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.corridaGeradaVigente")
|
|
||||||
+ " " + corrida.getId().getCorridaId()
|
|
||||||
+ " "
|
|
||||||
+ Labels.getLabel("editarCatalogoDeRutaController.msg.corridaGeradaVigentePt2")
|
|
||||||
+ " " + corrida.getId().getFeccorrida());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Boolean existeEsquemaCorridaVigente() throws InterruptedException {
|
|
||||||
EsquemaCorrida esquemaCorrida = esquemaCorridaService.buscaEsquemaPorRuta(ruta);
|
|
||||||
if (esquemaCorrida != null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.existeEsquemaCorridaVigente")
|
|
||||||
+ " " + esquemaCorrida.getEsquemacorridaId());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void disableEnableNumRioCard() {
|
protected void disableEnableNumRioCard() {
|
||||||
if (chkIndVentaRioCard.isChecked()) {
|
if(chkIndVentaRioCard.isChecked()) {
|
||||||
txtNumRioCard.setDisabled(false);
|
txtNumRioCard.setDisabled(false);
|
||||||
txtNumRioCard.setConstraint("no empty");
|
txtNumRioCard.setConstraint("no empty");
|
||||||
} else {
|
} else {
|
||||||
|
@ -438,7 +403,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
|
|
||||||
private void paginarCombinacao() {
|
private void paginarCombinacao() {
|
||||||
if (ruta.getRutaId() != null) {
|
if (ruta.getRutaId() != null) {
|
||||||
HibernateSearchObject<RutaCombinacion> claseServicioBusqueda = new HibernateSearchObject<RutaCombinacion>(RutaCombinacion.class,
|
HibernateSearchObject<RutaCombinacion> claseServicioBusqueda =
|
||||||
|
new HibernateSearchObject<RutaCombinacion>(RutaCombinacion.class,
|
||||||
pagingRutaCombinacion.getPageSize());
|
pagingRutaCombinacion.getPageSize());
|
||||||
|
|
||||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
@ -455,7 +421,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
paradaSecuencia.setVia(via);
|
paradaSecuencia.setVia(via);
|
||||||
lsParadasSequencia.add(paradaSecuencia);
|
lsParadasSequencia.add(paradaSecuencia);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTramoPardaSecuencia(Parada parada, Via via, Short numsecuencia, List<RutaCaseta> lCas, String tempo, String km) {
|
private void addTramoPardaSecuencia(Parada parada, Via via, Short numsecuencia, List<RutaCaseta> lCas, String tempo, String km) {
|
||||||
ParadaSecuencia paradaSecuencia = new ParadaSecuencia();
|
ParadaSecuencia paradaSecuencia = new ParadaSecuencia();
|
||||||
paradaSecuencia.setParada(parada);
|
paradaSecuencia.setParada(parada);
|
||||||
|
@ -509,6 +474,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
return horas + ":" + ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos);
|
return horas + ":" + ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,14 +735,14 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
txtPrefixo.getValue();
|
txtPrefixo.getValue();
|
||||||
txtNumRioCard.getValue();
|
txtNumRioCard.getValue();
|
||||||
|
|
||||||
if (null != txtCantEixos && txtCantEixos.getValue() != null && txtCantEixos.getValue() == 0) {
|
if(null != txtCantEixos && txtCantEixos.getValue()!= null && txtCantEixos.getValue() == 0){
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.lblCantEixosZeroInvalido.value"),
|
Labels.getLabel("editarCatalogoDeRutaController.lblCantEixosZeroInvalido.value"),
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (null != txtCantAsientos && txtCantAsientos.getValue() != null && txtCantAsientos.getValue() == 0) {
|
if(null != txtCantAsientos && txtCantAsientos.getValue() != null && txtCantAsientos.getValue() == 0){
|
||||||
Messagebox.show(
|
Messagebox.show(
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.lblCantAsientosZeroInvalido.value"),
|
Labels.getLabel("editarCatalogoDeRutaController.lblCantAsientosZeroInvalido.value"),
|
||||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||||
|
@ -935,7 +901,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
op.add("Não");
|
op.add("Não");
|
||||||
comboVenda.setModel(new ListModelList(op));
|
comboVenda.setModel(new ListModelList(op));
|
||||||
comboVenda.setValue(rutaCombinacion.getIndventa() == Boolean.TRUE ? "Sim" : "Não");
|
comboVenda.setValue(rutaCombinacion.getIndventa() == Boolean.TRUE ? "Sim" : "Não");
|
||||||
if (rutaCombinacion.getRutacombinacionId() != null) {
|
if(rutaCombinacion.getRutacombinacionId() != null){
|
||||||
comboVenda.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
comboVenda.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
||||||
}
|
}
|
||||||
comboVenda.addEventListener("onChange", new EventListener() {
|
comboVenda.addEventListener("onChange", new EventListener() {
|
||||||
|
@ -950,10 +916,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
lc.appendChild(comboVenda);
|
lc.appendChild(comboVenda);
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
Tramo tramo = rutaCombinacion.getTramo();
|
|
||||||
String descTramoDetalhado = tramo.getOrigem().getDescparada() + "|" + tramo.getDestino().getDescparada();
|
|
||||||
|
|
||||||
lc = new Listcell(rutaCombinacion.getTramo().getDesctramo() + "(" + descTramoDetalhado + ")");
|
Tramo tramo = rutaCombinacion.getTramo();
|
||||||
|
String descTramoDetalhado = tramo.getOrigem().getDescparada() + "|" +tramo.getDestino().getDescparada();
|
||||||
|
|
||||||
|
lc = new Listcell(rutaCombinacion.getTramo().getDesctramo() + "("+descTramoDetalhado+")");
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
lc = new Listcell();
|
lc = new Listcell();
|
||||||
|
@ -961,7 +928,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
final Combobox comboVia = new Combobox();
|
final Combobox comboVia = new Combobox();
|
||||||
comboVia.setMold("rounded");
|
comboVia.setMold("rounded");
|
||||||
comboVia.setWidth("90%");
|
comboVia.setWidth("90%");
|
||||||
if (rutaCombinacion.getRutacombinacionId() != null) {
|
if(rutaCombinacion.getRutacombinacionId() != null){
|
||||||
comboVia.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
comboVia.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
||||||
}
|
}
|
||||||
List<Via> lsViaCombinacion = tramoService.obtenerViasOrigemDestino(
|
List<Via> lsViaCombinacion = tramoService.obtenerViasOrigemDestino(
|
||||||
|
@ -1071,7 +1038,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
||||||
|
|
||||||
List<RutaCombinacion> rutaCombinacions = new ArrayList<RutaCombinacion>();
|
List<RutaCombinacion> rutaCombinacions = new ArrayList<RutaCombinacion>();
|
||||||
|
|
||||||
for (RutaCombinacion rc : rutaCombinacionsAntiga) {
|
for (RutaCombinacion rc : rutaCombinacionsAntiga){
|
||||||
RutaCombinacion newrc = (RutaCombinacion) rc.clone();
|
RutaCombinacion newrc = (RutaCombinacion) rc.clone();
|
||||||
newrc.setRuta(ruta);
|
newrc.setRuta(ruta);
|
||||||
newrc.setRutacombinacionId(null);
|
newrc.setRutacombinacionId(null);
|
||||||
|
|
Loading…
Reference in New Issue