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.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Corrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoRuta;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
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.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||
import com.rjconsultores.ventaboletos.service.CorridaService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||
import com.rjconsultores.ventaboletos.service.GrupoRutaService;
|
||||
|
@ -107,8 +103,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
@Autowired
|
||||
private EsquemaCorridaService esquemaCorridaService;
|
||||
@Autowired
|
||||
private CorridaService corridaService;
|
||||
@Autowired
|
||||
private ClaseServicioService claseService;
|
||||
@Autowired
|
||||
private TramoService tramoService;
|
||||
|
@ -169,7 +163,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
private Intbox txtCantAsientos;
|
||||
private Checkbox chkIndVentaRioCard;
|
||||
private MyTextbox txtNumRioCard;
|
||||
private Checkbox chkCancelarRuta;
|
||||
|
||||
public Ruta getRuta() {
|
||||
return ruta;
|
||||
|
@ -278,6 +271,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
ruta = (Ruta) Executions.getCurrent().getArg().get("ruta");
|
||||
rutaList = (MyListbox) Executions.getCurrent().getArg().get("rutaList");
|
||||
|
||||
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
// Secuencia
|
||||
|
@ -288,18 +283,18 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
if (ruta.getRutaId() == null) {
|
||||
if(ruta.getRutaId() == null){
|
||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.salvarRutaPrimeiro"),
|
||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
ParadaSecuencia psOrigen = (ParadaSecuencia) rutaSecuenciaList.getSelected();
|
||||
ParadaSecuencia psOrigen = (ParadaSecuencia)rutaSecuenciaList.getSelected();
|
||||
int indexSelecto = rutaSecuenciaList.getSelectedIndex();
|
||||
ParadaSecuencia psDestino = new ParadaSecuencia();
|
||||
try {
|
||||
psDestino = (ParadaSecuencia) lsParadasSequencia.get(indexSelecto + 1);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
try{
|
||||
psDestino = (ParadaSecuencia)lsParadasSequencia.get(indexSelecto+1);
|
||||
}catch(IndexOutOfBoundsException e){
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.finRuta"),
|
||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||
|
@ -307,7 +302,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
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;
|
||||
}
|
||||
Map args = new HashMap();
|
||||
|
@ -331,6 +326,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
// Combinacion
|
||||
rutaCombinacionList.setItemRenderer(this);
|
||||
lsRutaCombinacion = new ArrayList<RutaCombinacion>();
|
||||
|
@ -383,7 +379,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
private List<CasetaPeaje> getCasetasPeage(List<RutaCaseta> casetas) {
|
||||
List<CasetaPeaje> casetasPeage = new ArrayList<CasetaPeaje>();
|
||||
|
||||
if (casetas == null || casetas.isEmpty()) {
|
||||
if(casetas == null || casetas.isEmpty()) {
|
||||
return casetasPeage;
|
||||
}
|
||||
|
||||
|
@ -394,39 +390,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
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() {
|
||||
if (chkIndVentaRioCard.isChecked()) {
|
||||
if(chkIndVentaRioCard.isChecked()) {
|
||||
txtNumRioCard.setDisabled(false);
|
||||
txtNumRioCard.setConstraint("no empty");
|
||||
} else {
|
||||
|
@ -438,7 +403,8 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
|
||||
private void paginarCombinacao() {
|
||||
if (ruta.getRutaId() != null) {
|
||||
HibernateSearchObject<RutaCombinacion> claseServicioBusqueda = new HibernateSearchObject<RutaCombinacion>(RutaCombinacion.class,
|
||||
HibernateSearchObject<RutaCombinacion> claseServicioBusqueda =
|
||||
new HibernateSearchObject<RutaCombinacion>(RutaCombinacion.class,
|
||||
pagingRutaCombinacion.getPageSize());
|
||||
|
||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
@ -455,7 +421,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
paradaSecuencia.setVia(via);
|
||||
lsParadasSequencia.add(paradaSecuencia);
|
||||
}
|
||||
|
||||
private void addTramoPardaSecuencia(Parada parada, Via via, Short numsecuencia, List<RutaCaseta> lCas, String tempo, String km) {
|
||||
ParadaSecuencia paradaSecuencia = new ParadaSecuencia();
|
||||
paradaSecuencia.setParada(parada);
|
||||
|
@ -509,6 +474,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
return horas + ":" + ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos);
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -769,14 +735,14 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
txtPrefixo.getValue();
|
||||
txtNumRioCard.getValue();
|
||||
|
||||
if (null != txtCantEixos && txtCantEixos.getValue() != null && txtCantEixos.getValue() == 0) {
|
||||
if(null != txtCantEixos && txtCantEixos.getValue()!= null && txtCantEixos.getValue() == 0){
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarCatalogoDeRutaController.lblCantEixosZeroInvalido.value"),
|
||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
if (null != txtCantAsientos && txtCantAsientos.getValue() != null && txtCantAsientos.getValue() == 0) {
|
||||
if(null != txtCantAsientos && txtCantAsientos.getValue() != null && txtCantAsientos.getValue() == 0){
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarCatalogoDeRutaController.lblCantAsientosZeroInvalido.value"),
|
||||
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
|
||||
|
@ -935,7 +901,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
op.add("Não");
|
||||
comboVenda.setModel(new ListModelList(op));
|
||||
comboVenda.setValue(rutaCombinacion.getIndventa() == Boolean.TRUE ? "Sim" : "Não");
|
||||
if (rutaCombinacion.getRutacombinacionId() != null) {
|
||||
if(rutaCombinacion.getRutacombinacionId() != null){
|
||||
comboVenda.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
||||
}
|
||||
comboVenda.addEventListener("onChange", new EventListener() {
|
||||
|
@ -950,10 +916,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
lc.appendChild(comboVenda);
|
||||
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 = new Listcell();
|
||||
|
@ -961,7 +928,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
final Combobox comboVia = new Combobox();
|
||||
comboVia.setMold("rounded");
|
||||
comboVia.setWidth("90%");
|
||||
if (rutaCombinacion.getRutacombinacionId() != null) {
|
||||
if(rutaCombinacion.getRutacombinacionId() != null){
|
||||
comboVia.setTooltip(rutaCombinacion.getRutacombinacionId().toString());
|
||||
}
|
||||
List<Via> lsViaCombinacion = tramoService.obtenerViasOrigemDestino(
|
||||
|
@ -1071,7 +1038,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
|
|||
|
||||
List<RutaCombinacion> rutaCombinacions = new ArrayList<RutaCombinacion>();
|
||||
|
||||
for (RutaCombinacion rc : rutaCombinacionsAntiga) {
|
||||
for (RutaCombinacion rc : rutaCombinacionsAntiga){
|
||||
RutaCombinacion newrc = (RutaCombinacion) rc.clone();
|
||||
newrc.setRuta(ruta);
|
||||
newrc.setRutacombinacionId(null);
|
||||
|
|
Loading…
Reference in New Issue