fixes bug #AL-2734
parent
f8c26cc4d2
commit
285b39026d
|
@ -665,12 +665,11 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
salvar = false;
|
salvar = false;
|
||||||
|
txtNumCorrida.getValue();
|
||||||
|
Date dataDeFecInicioVigencia = fecniciovigencia.getValue();
|
||||||
|
Date dataAteFecfinvigencia = fecfinvigencia.getValue();
|
||||||
|
|
||||||
if (esquemaCorrida.getRuta().getIndRutaCancelada()) {
|
if(!realizaValidacoes()) {
|
||||||
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.rutaDesativadaId")
|
|
||||||
.concat(" " + esquemaCorrida.getRuta().getRutaId()+" ")
|
|
||||||
.concat(Labels.getLabel("editarCatalogoDeRutaController.msg.rutaDesativadaIdPt2")));
|
|
||||||
salvar = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,43 +678,45 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
esquemaCorridaEmbarqueDesembarqueService.borrar(esquemaCorridaEmbarqueDesembarque);
|
esquemaCorridaEmbarqueDesembarqueService.borrar(esquemaCorridaEmbarqueDesembarque);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//FlexBus
|
|
||||||
if(esquemaCorrida.getIsFlexBus() && (txtHorasParaConfirmacao.getValue() == null || txtMinutosParaConfirmacao.getValue() == null || txtOcupacaoMinima.getValue() == null)) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.inserirInformacoesFlexBus"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Automacao Horario Extra
|
|
||||||
if(esquemaCorrida.getIsAutomacaoHorarioExtra() && (txtHorasAutomacaoDE.getValue() == null || txtOcupacaoHorarioExtra.getValue() == null )) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.inserirInformacoesAutomacaoHorarioExtra"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(esquemaCorrida.getIsAutomacaoHorarioExtra() && !validarCorridaExtraAutomatica()) {
|
|
||||||
salvar = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Imprimir ou não recibo BPE na embarcada
|
//Imprimir ou não recibo BPE na embarcada
|
||||||
|
validaNaoImprimeBpe(dataAteFecfinvigencia);
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
dataAteFecfinvigencia.setSeconds(59);
|
||||||
|
|
||||||
|
if(!validaEsquemaTramo(dataDeFecInicioVigencia, dataAteFecfinvigencia)) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
salvaEsquemaTramo(dataDeFecInicioVigencia);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (WrongValueException ex) {
|
||||||
|
throw (WrongValueException) ex;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error("", ex);
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.Error").concat(" - ").concat(ex.toString()),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validaNaoImprimeBpe(Date dataAteFecfinvigencia) {
|
||||||
boolean isNaoImprimeBPE = esquemaCorrida.getIndNaoImprimeBpe() == null ? false : esquemaCorrida.getIndNaoImprimeBpe().equals("1");
|
boolean isNaoImprimeBPE = esquemaCorrida.getIndNaoImprimeBpe() == null ? false : esquemaCorrida.getIndNaoImprimeBpe().equals("1");
|
||||||
if(isNaoImprimeBPE) {
|
if(isNaoImprimeBPE) {
|
||||||
Date dataDe = horaIniNaoImpBpe.getValue();
|
Date dataDeNaoImpBpe = horaIniNaoImpBpe.getValue();
|
||||||
Date dataAte = horaFimNaoImpBpe.getValue();
|
Date dataAteNaoImpBpe = horaFimNaoImpBpe.getValue();
|
||||||
boolean isHoraValida = horaIniNaoImpBpe.getValue() == null || horaFimNaoImpBpe.getValue() == null ? false : true;
|
boolean isHoraValida = horaIniNaoImpBpe.getValue() == null || horaFimNaoImpBpe.getValue() == null ? false : true;
|
||||||
if(isHoraValida) {
|
if(isHoraValida) {
|
||||||
dataDe.setSeconds(59);
|
dataDeNaoImpBpe.setSeconds(59);
|
||||||
dataAte.setSeconds(59);
|
dataAteFecfinvigencia.setSeconds(59);
|
||||||
if(dataDe.after(dataAte)) {
|
if(dataDeNaoImpBpe.after(dataAteNaoImpBpe)) {
|
||||||
esquemaCorrida.setHoraIniNaoImpBPE(buscarHora(dataAte));
|
esquemaCorrida.setHoraIniNaoImpBPE(buscarHora(dataAteNaoImpBpe));
|
||||||
esquemaCorrida.setHoraFimNaoImpBPE(buscarHora(dataDe));
|
esquemaCorrida.setHoraFimNaoImpBPE(buscarHora(dataDeNaoImpBpe));
|
||||||
} else if(dataDe.before(dataAte)) {
|
} else if(dataDeNaoImpBpe.before(dataAteNaoImpBpe)) {
|
||||||
esquemaCorrida.setHoraIniNaoImpBPE(buscarHora(dataDe));
|
esquemaCorrida.setHoraIniNaoImpBPE(buscarHora(dataDeNaoImpBpe));
|
||||||
esquemaCorrida.setHoraFimNaoImpBPE(buscarHora(dataAte));
|
esquemaCorrida.setHoraFimNaoImpBPE(buscarHora(dataAteNaoImpBpe));
|
||||||
} else {
|
} else {
|
||||||
esquemaCorrida.setIndNaoImprimeBpe("0");
|
esquemaCorrida.setIndNaoImprimeBpe("0");
|
||||||
setSelecaoCboBPE();
|
setSelecaoCboBPE();
|
||||||
|
@ -726,322 +727,365 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Date dataDe = fecniciovigencia.getValue();
|
if (chkDoblePiso.isChecked()) {
|
||||||
Date dataAte = fecfinvigencia.getValue();
|
txtNumCorridaPisoExtra.getValue();
|
||||||
txtNumCorrida.getValue();
|
txtNumCorridaPisoExtra2.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean validaEsquemaTramo(Date dataDeFecInicioVigencia, Date dataAteFecfinvigencia ) throws InterruptedException {
|
||||||
|
Comboitem ciRuta = cmbRuta.getSelectedItem();
|
||||||
|
Ruta ruta = null;
|
||||||
|
if (ciRuta != null) {
|
||||||
|
ruta = (Ruta) ciRuta.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chkDoblePiso.isChecked() && !validarPisoExtra()) {
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataDeFecInicioVigencia.after(dataAteFecfinvigencia)) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.busquedaPeriodo"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ruta==null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaVazia"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lsEsquemaTramo.isEmpty()) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaSemTramos"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (esquemaCorrida.getClaseServicio() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Clase"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
} else if (esquemaCorrida.getMarca() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Marca"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
} else if (esquemaCorrida.getRuta() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Ruta"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
} else if (esquemaCorrida.getEmpresa() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
} else if (esquemaCorrida.getEmpresa1() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa1"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
} else if (esquemaCorrida.getRolOperativo() == null) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Rol"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void salvaEsquemaTramo(Date dataDeFecInicioVigencia) throws InterruptedException {
|
||||||
|
//FlexBus
|
||||||
|
if(esquemaCorrida.getIsFlexBus()) {
|
||||||
|
esquemaCorrida.setHorasParaConfirmacao(txtHorasParaConfirmacao.getValue());
|
||||||
|
esquemaCorrida.setMinutosParaConfirmacao(txtMinutosParaConfirmacao.getValue());
|
||||||
|
esquemaCorrida.setOcupacaoMinima(txtOcupacaoMinima.getValue());
|
||||||
|
} else {
|
||||||
|
esquemaCorrida.setHorasParaConfirmacao(null);
|
||||||
|
esquemaCorrida.setMinutosParaConfirmacao(null);
|
||||||
|
esquemaCorrida.setOcupacaoMinima(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Automacao Horario Extra
|
||||||
|
if(esquemaCorrida.getIsAutomacaoHorarioExtra()) {
|
||||||
|
esquemaCorrida.setHorasAutomacaoHEDe(txtHorasAutomacaoDE.getValue() == null ? 0 : txtHorasAutomacaoDE.getValue());
|
||||||
|
esquemaCorrida.setMinutosAutomacaoHEDe(txtMinutosAutomacaoDE.getValue() == null ? 0 : txtMinutosAutomacaoDE.getValue());
|
||||||
|
esquemaCorrida.setHorasAutomacaoHEAte(txtHorasAutomacaoATE.getValue() == null ? 0 : txtHorasAutomacaoATE.getValue());
|
||||||
|
esquemaCorrida.setMinutosAutomacaoHEAte(txtMinutosAutomacaoATE.getValue() == null ? 0 : txtMinutosAutomacaoATE.getValue());
|
||||||
|
esquemaCorrida.setTaxaOcupacao(txtOcupacaoHorarioExtra.getValue() == null ? 0 : txtOcupacaoHorarioExtra.getValue() );
|
||||||
|
esquemaCorrida.setNumCorridaServicoExtra(txtNumCorridaExtraAuto.getValue());
|
||||||
|
|
||||||
|
esquemaCorrida.setHorasalidaExtra(buscarHora(esquemaCorrida.getHorasalidaExtra()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (porBloq.isChecked()) {
|
||||||
|
de.getValue();
|
||||||
|
hasta.getValue();
|
||||||
|
minutos.getValue();
|
||||||
|
} else {
|
||||||
|
horasalida.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
esquemaCorrida.setInfoCorrida(txtInfoCorrida.getValue());
|
||||||
|
esquemaCorrida.setIndCorridaExtra(chkCorridaExtra.isChecked());
|
||||||
|
esquemaCorrida.setNumCorrida(txtNumCorrida.getValue());
|
||||||
|
esquemaCorrida.setActivo(Boolean.TRUE);
|
||||||
|
esquemaCorrida.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
esquemaCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
esquemaCorrida.setIndBloqueiaWebAposSaida(chkBloqueiaCorridaWebAposSaida.isChecked());
|
||||||
|
|
||||||
|
esquemaCorrida.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
||||||
|
|
||||||
|
if (cmbIndGeneraFeriado.getSelectedItem() != null) {
|
||||||
|
esquemaCorrida.setIndGeneraFeriado((String) cmbIndGeneraFeriado.getSelectedItem().getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (latente.isChecked()) {
|
||||||
|
esquemaCorrida.setStatusCorrida("L");
|
||||||
|
} else if (autorizada.isChecked()) {
|
||||||
|
esquemaCorrida.setStatusCorrida("A");
|
||||||
|
} else {
|
||||||
|
esquemaCorrida.setStatusCorrida("C");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fletes.isChecked()) {
|
||||||
|
esquemaCorrida.setTipocorrida("F");
|
||||||
|
} else if (viajesEspeciales.isChecked()) {
|
||||||
|
esquemaCorrida.setTipocorrida("S");
|
||||||
|
} else if (transportePasajeros.isChecked()) {
|
||||||
|
esquemaCorrida.setTipocorrida("P");
|
||||||
|
}
|
||||||
|
|
||||||
|
// nao gravar segundos:
|
||||||
|
esquemaCorrida.setHorasalida(buscarHora(esquemaCorrida.getHorasalida()));
|
||||||
|
|
||||||
|
List<EsquemaCorrida> lsEC = Collections.EMPTY_LIST;
|
||||||
|
|
||||||
|
if (esquemaCorrida.getEsquemacorridaId() == null) {
|
||||||
|
salvaNovoEsquemaCorrida(dataDeFecInicioVigencia, lsEC);
|
||||||
|
} else {
|
||||||
|
atualizaDadosEsquemaCorrida(lsEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void atualizaDadosEsquemaCorrida(List<EsquemaCorrida> lsEC) throws InterruptedException {
|
||||||
|
boolean podeSalvar = false;
|
||||||
|
if ((lsEC.isEmpty())) {
|
||||||
|
podeSalvar = true;
|
||||||
|
} else {
|
||||||
|
for (EsquemaCorrida ec : lsEC) {
|
||||||
|
if (ec.getEsquemacorridaId().equals(esquemaCorrida.getEsquemacorridaId())) {
|
||||||
|
podeSalvar = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (podeSalvar) {
|
||||||
|
if (!chkDoblePiso.isChecked()) {
|
||||||
|
esquemaCorrida.setNumCorridaPisoExtra(null);
|
||||||
|
}
|
||||||
|
esquemaCorridaService.actualizacion(esquemaCorrida);
|
||||||
|
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, esquemaCorrida);
|
||||||
|
|
||||||
|
esquemaCorridaList.updateItem(esquemaCorrida);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void salvaNovoEsquemaCorrida(Date dataDeFecInicioVigencia, List<EsquemaCorrida> lsEC)
|
||||||
|
throws InterruptedException {
|
||||||
|
Calendar agora = Calendar.getInstance();
|
||||||
|
agora.set(agora.get(Calendar.YEAR), agora.get(Calendar.MONTH), agora.get(Calendar.DATE),
|
||||||
|
NumberUtils.INTEGER_ZERO, NumberUtils.INTEGER_ZERO, NumberUtils.INTEGER_ZERO);
|
||||||
|
|
||||||
|
dataDeFecInicioVigencia.setSeconds(01);
|
||||||
|
if (dataDeFecInicioVigencia.before(agora.getTime())) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.fecha"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
} else {
|
||||||
|
if (lsEC.isEmpty()) {
|
||||||
|
Boolean existeNumCorrida = true;
|
||||||
|
|
||||||
|
EsquemaCorrida ecor = esquemaCorridaService.buscarPeloNumCorrida(esquemaCorrida.getNumCorrida());
|
||||||
|
existeNumCorrida = ecor != null;
|
||||||
|
|
||||||
|
if ((!existeNumCorrida) && !(esquemaCorrida.getNumCorrida().equals(esquemaCorrida.getNumCorridaPisoExtra()))) {
|
||||||
|
if (porBloq.isChecked()) {
|
||||||
|
Date des = de.getValue();
|
||||||
|
Date has = hasta.getValue();
|
||||||
|
has.setSeconds(1);
|
||||||
|
EsquemaOperacional eo = new EsquemaOperacional();
|
||||||
|
Integer numCorrida = esquemaCorrida.getNumCorrida();
|
||||||
|
while (des.before(has)) {
|
||||||
|
EsquemaCorrida ec = new EsquemaCorrida();
|
||||||
|
eo.setActivo(Boolean.TRUE);
|
||||||
|
eo.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
eo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
|
||||||
|
Date horaSalida = new Date();
|
||||||
|
horaSalida.setHours(des.getHours());
|
||||||
|
horaSalida.setMinutes(des.getMinutes());
|
||||||
|
horaSalida.setSeconds(0);
|
||||||
|
|
||||||
|
ec.setActivo(Boolean.TRUE);
|
||||||
|
ec.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
ec.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
ec.setClaseServicio(esquemaCorrida.getClaseServicio());
|
||||||
|
ec.setEmpresa(esquemaCorrida.getEmpresa());
|
||||||
|
ec.setEmpresa1(esquemaCorrida.getEmpresa1());
|
||||||
|
|
||||||
|
eo.setFecniciovigencia(esquemaCorrida.getEsquemaOperacional().getFecniciovigencia());
|
||||||
|
eo.setFecfinvigencia(esquemaCorrida.getEsquemaOperacional().getFecfinvigencia());
|
||||||
|
|
||||||
|
ec.setEsquemaOperacional(eo);
|
||||||
|
ec.setMarca(esquemaCorrida.getMarca());
|
||||||
|
ec.setRolOperativo(esquemaCorrida.getRolOperativo());
|
||||||
|
ec.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
||||||
|
ec.setRuta(esquemaCorrida.getRuta());
|
||||||
|
ec.setInddomingo(esquemaCorrida.getInddomingo());
|
||||||
|
ec.setIndjueves(esquemaCorrida.getIndjueves());
|
||||||
|
ec.setIndlunes(esquemaCorrida.getIndlunes());
|
||||||
|
ec.setIndmartes(esquemaCorrida.getIndmartes());
|
||||||
|
ec.setIndmiercoles(esquemaCorrida.getIndmiercoles());
|
||||||
|
ec.setIndsabado(esquemaCorrida.getIndsabado());
|
||||||
|
ec.setIndviernes(esquemaCorrida.getIndviernes());
|
||||||
|
ec.setStatusCorrida(esquemaCorrida.getStatusCorrida());
|
||||||
|
ec.setTipocorrida(esquemaCorrida.getTipocorrida());
|
||||||
|
ec.setCantparados(esquemaCorrida.getCantparados());
|
||||||
|
ec.setInfoCorrida(esquemaCorrida.getInfoCorrida());
|
||||||
|
ec.setHorasalida(horaSalida);
|
||||||
|
ec.setIndGeneraFeriado(esquemaCorrida.getIndGeneraFeriado());
|
||||||
|
|
||||||
|
ec.setPisoExtra(esquemaCorrida.getPisoExtra());
|
||||||
|
|
||||||
|
|
||||||
|
// Salva
|
||||||
|
Boolean existeNumCorridaBloco = true;
|
||||||
|
while (existeNumCorridaBloco) {
|
||||||
|
existeNumCorridaBloco = esquemaCorridaService.buscarNumCorrida(numCorrida, null,false);
|
||||||
|
ec.setNumCorrida(numCorrida);
|
||||||
|
numCorrida = numCorrida + 1;
|
||||||
|
}
|
||||||
|
ec = esquemaCorridaService.suscribir(ec);
|
||||||
|
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, ec);
|
||||||
|
|
||||||
|
// Acrescenta Minutos na Hora
|
||||||
|
des.setMinutes(des.getMinutes() + minutos.getValue());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
EsquemaOperacional eo = new EsquemaOperacional();
|
||||||
|
eo.setFecmodif(new Date());
|
||||||
|
eo.setUsuarioId(esquemaCorrida.getEsquemaOperacional().getUsuarioId());
|
||||||
|
eo.setActivo(Boolean.TRUE);
|
||||||
|
eo.setFecniciovigencia(fecniciovigencia.getValue());
|
||||||
|
eo.setFecfinvigencia(fecfinvigencia.getValue());
|
||||||
|
esquemaCorrida.setEsquemaOperacional(eo);
|
||||||
|
esquemaCorridaService.suscribir(esquemaCorrida);
|
||||||
|
|
||||||
|
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, esquemaCorrida);
|
||||||
|
isClone = false;
|
||||||
|
}
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.INFORMATION);
|
||||||
|
busquedaCorridaController.refreshLista();
|
||||||
|
closeWindow();
|
||||||
|
} else {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.NumCorrida"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
|
Messagebox.OK,
|
||||||
|
Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean realizaValidacoes() throws InterruptedException {
|
||||||
|
//Linha Destaivada
|
||||||
|
if (esquemaCorrida.getRuta().getIndRutaCancelada()) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.rutaDesativadaId")
|
||||||
|
.concat(" " + esquemaCorrida.getRuta().getRutaId()+" ")
|
||||||
|
.concat(Labels.getLabel("editarCatalogoDeRutaController.msg.rutaDesativadaIdPt2")));
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//FlexBus
|
||||||
|
if(esquemaCorrida.getIsFlexBus() && (txtHorasParaConfirmacao.getValue() == null || txtMinutosParaConfirmacao.getValue() == null || txtOcupacaoMinima.getValue() == null)) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.inserirInformacoesFlexBus"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Automacao Horario Extra
|
||||||
|
if(esquemaCorrida.getIsAutomacaoHorarioExtra() && (txtHorasAutomacaoDE.getValue() == null || txtOcupacaoHorarioExtra.getValue() == null )) {
|
||||||
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.inserirInformacoesAutomacaoHorarioExtra"),
|
||||||
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
salvar = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String numCorridaString = txtNumCorrida.getValue().toString();
|
||||||
Integer maxSizeNumCorrida = ApplicationProperties.getInstance().maxSizeNumCorrida();
|
Integer maxSizeNumCorrida = ApplicationProperties.getInstance().maxSizeNumCorrida();
|
||||||
if (maxSizeNumCorrida != -1) {
|
if (maxSizeNumCorrida != -1) {
|
||||||
if (txtNumCorrida.getValue().toString().length() > maxSizeNumCorrida) {
|
if (numCorridaString.length() > maxSizeNumCorrida) {
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.maxSizeNumCorrida").replace("@size", maxSizeNumCorrida.toString()),
|
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.maxSizeNumCorrida").replace("@size", maxSizeNumCorrida.toString()),
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
||||||
Messagebox.OK,
|
Messagebox.OK,
|
||||||
Messagebox.EXCLAMATION);
|
Messagebox.EXCLAMATION);
|
||||||
salvar = true;
|
salvar = true;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chkDoblePiso.isChecked()) {
|
if(esquemaCorrida.getIsAutomacaoHorarioExtra() && !validarCorridaExtraAutomatica()) {
|
||||||
txtNumCorridaPisoExtra.getValue();
|
|
||||||
txtNumCorridaPisoExtra2.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chkDoblePiso.isChecked() && !validarPisoExtra()) {
|
|
||||||
salvar = true;
|
salvar = true;
|
||||||
return;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Comboitem ciRuta = cmbRuta.getSelectedItem();
|
|
||||||
Ruta ruta = null;
|
|
||||||
if (ciRuta != null) {
|
|
||||||
ruta = (Ruta) ciRuta.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ruta != null) {
|
|
||||||
dataAte.setSeconds(59);
|
|
||||||
if (dataDe.before(dataAte)) {
|
|
||||||
if (!lsEsquemaTramo.isEmpty()) {
|
|
||||||
|
|
||||||
if (esquemaCorrida.getClaseServicio() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Clase"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else if (esquemaCorrida.getMarca() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Marca"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else if (esquemaCorrida.getRuta() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Ruta"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else if (esquemaCorrida.getEmpresa() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else if (esquemaCorrida.getEmpresa1() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa1"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else if (esquemaCorrida.getRolOperativo() == null) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Rol"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
//FlexBus
|
|
||||||
if(esquemaCorrida.getIsFlexBus()) {
|
|
||||||
esquemaCorrida.setHorasParaConfirmacao(txtHorasParaConfirmacao.getValue());
|
|
||||||
esquemaCorrida.setMinutosParaConfirmacao(txtMinutosParaConfirmacao.getValue());
|
|
||||||
esquemaCorrida.setOcupacaoMinima(txtOcupacaoMinima.getValue());
|
|
||||||
} else {
|
|
||||||
esquemaCorrida.setHorasParaConfirmacao(null);
|
|
||||||
esquemaCorrida.setMinutosParaConfirmacao(null);
|
|
||||||
esquemaCorrida.setOcupacaoMinima(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Automacao Horario Extra
|
|
||||||
if(esquemaCorrida.getIsAutomacaoHorarioExtra()) {
|
|
||||||
esquemaCorrida.setHorasAutomacaoHEDe(txtHorasAutomacaoDE.getValue() == null ? 0 : txtHorasAutomacaoDE.getValue());
|
|
||||||
esquemaCorrida.setMinutosAutomacaoHEDe(txtMinutosAutomacaoDE.getValue() == null ? 0 : txtMinutosAutomacaoDE.getValue());
|
|
||||||
esquemaCorrida.setHorasAutomacaoHEAte(txtHorasAutomacaoATE.getValue() == null ? 0 : txtHorasAutomacaoATE.getValue());
|
|
||||||
esquemaCorrida.setMinutosAutomacaoHEAte(txtMinutosAutomacaoATE.getValue() == null ? 0 : txtMinutosAutomacaoATE.getValue());
|
|
||||||
esquemaCorrida.setTaxaOcupacao(txtOcupacaoHorarioExtra.getValue() == null ? 0 : txtOcupacaoHorarioExtra.getValue() );
|
|
||||||
esquemaCorrida.setNumCorridaServicoExtra(txtNumCorridaExtraAuto.getValue());
|
|
||||||
|
|
||||||
esquemaCorrida.setHorasalidaExtra(buscarHora(esquemaCorrida.getHorasalidaExtra()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (porBloq.isChecked()) {
|
|
||||||
de.getValue();
|
|
||||||
hasta.getValue();
|
|
||||||
minutos.getValue();
|
|
||||||
} else {
|
|
||||||
horasalida.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
esquemaCorrida.setInfoCorrida(txtInfoCorrida.getValue());
|
|
||||||
esquemaCorrida.setIndCorridaExtra(chkCorridaExtra.isChecked());
|
|
||||||
esquemaCorrida.setNumCorrida(txtNumCorrida.getValue());
|
|
||||||
esquemaCorrida.setActivo(Boolean.TRUE);
|
|
||||||
esquemaCorrida.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
esquemaCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
esquemaCorrida.setIndBloqueiaWebAposSaida(chkBloqueiaCorridaWebAposSaida.isChecked());
|
|
||||||
|
|
||||||
esquemaCorrida.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
|
||||||
|
|
||||||
if (cmbIndGeneraFeriado.getSelectedItem() != null) {
|
|
||||||
esquemaCorrida.setIndGeneraFeriado((String) cmbIndGeneraFeriado.getSelectedItem().getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (latente.isChecked()) {
|
|
||||||
esquemaCorrida.setStatusCorrida("L");
|
|
||||||
} else if (autorizada.isChecked()) {
|
|
||||||
esquemaCorrida.setStatusCorrida("A");
|
|
||||||
} else {
|
|
||||||
esquemaCorrida.setStatusCorrida("C");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fletes.isChecked()) {
|
|
||||||
esquemaCorrida.setTipocorrida("F");
|
|
||||||
} else if (viajesEspeciales.isChecked()) {
|
|
||||||
esquemaCorrida.setTipocorrida("S");
|
|
||||||
} else if (transportePasajeros.isChecked()) {
|
|
||||||
esquemaCorrida.setTipocorrida("P");
|
|
||||||
}
|
|
||||||
|
|
||||||
// nao gravar segundos:
|
|
||||||
esquemaCorrida.setHorasalida(buscarHora(esquemaCorrida.getHorasalida()));
|
|
||||||
|
|
||||||
List<EsquemaCorrida> lsEC = Collections.EMPTY_LIST;
|
|
||||||
|
|
||||||
if (esquemaCorrida.getEsquemacorridaId() == null) {
|
|
||||||
|
|
||||||
Calendar agora = Calendar.getInstance();
|
|
||||||
agora.set(agora.get(Calendar.YEAR), agora.get(Calendar.MONTH), agora.get(Calendar.DATE),
|
|
||||||
NumberUtils.INTEGER_ZERO, NumberUtils.INTEGER_ZERO, NumberUtils.INTEGER_ZERO);
|
|
||||||
|
|
||||||
dataDe.setSeconds(01);
|
|
||||||
if (dataDe.before(agora.getTime())) {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.fecha"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
} else {
|
|
||||||
if (lsEC.isEmpty()) {
|
|
||||||
Boolean existeNumCorrida = true;
|
|
||||||
|
|
||||||
EsquemaCorrida ecor = esquemaCorridaService.buscarPeloNumCorrida(esquemaCorrida.getNumCorrida());
|
|
||||||
existeNumCorrida = ecor != null;
|
|
||||||
|
|
||||||
if ((!existeNumCorrida) && !(esquemaCorrida.getNumCorrida().equals(esquemaCorrida.getNumCorridaPisoExtra()))) {
|
|
||||||
if (porBloq.isChecked()) {
|
|
||||||
Date des = de.getValue();
|
|
||||||
Date has = hasta.getValue();
|
|
||||||
has.setSeconds(1);
|
|
||||||
EsquemaOperacional eo = new EsquemaOperacional();
|
|
||||||
Integer numCorrida = esquemaCorrida.getNumCorrida();
|
|
||||||
while (des.before(has)) {
|
|
||||||
EsquemaCorrida ec = new EsquemaCorrida();
|
|
||||||
eo.setActivo(Boolean.TRUE);
|
|
||||||
eo.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
eo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
|
|
||||||
Date horaSalida = new Date();
|
|
||||||
horaSalida.setHours(des.getHours());
|
|
||||||
horaSalida.setMinutes(des.getMinutes());
|
|
||||||
horaSalida.setSeconds(0);
|
|
||||||
|
|
||||||
ec.setActivo(Boolean.TRUE);
|
|
||||||
ec.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
ec.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
ec.setClaseServicio(esquemaCorrida.getClaseServicio());
|
|
||||||
ec.setEmpresa(esquemaCorrida.getEmpresa());
|
|
||||||
ec.setEmpresa1(esquemaCorrida.getEmpresa1());
|
|
||||||
|
|
||||||
eo.setFecniciovigencia(esquemaCorrida.getEsquemaOperacional().getFecniciovigencia());
|
|
||||||
eo.setFecfinvigencia(esquemaCorrida.getEsquemaOperacional().getFecfinvigencia());
|
|
||||||
|
|
||||||
ec.setEsquemaOperacional(eo);
|
|
||||||
ec.setMarca(esquemaCorrida.getMarca());
|
|
||||||
ec.setRolOperativo(esquemaCorrida.getRolOperativo());
|
|
||||||
ec.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
|
||||||
ec.setRuta(esquemaCorrida.getRuta());
|
|
||||||
ec.setInddomingo(esquemaCorrida.getInddomingo());
|
|
||||||
ec.setIndjueves(esquemaCorrida.getIndjueves());
|
|
||||||
ec.setIndlunes(esquemaCorrida.getIndlunes());
|
|
||||||
ec.setIndmartes(esquemaCorrida.getIndmartes());
|
|
||||||
ec.setIndmiercoles(esquemaCorrida.getIndmiercoles());
|
|
||||||
ec.setIndsabado(esquemaCorrida.getIndsabado());
|
|
||||||
ec.setIndviernes(esquemaCorrida.getIndviernes());
|
|
||||||
ec.setStatusCorrida(esquemaCorrida.getStatusCorrida());
|
|
||||||
ec.setTipocorrida(esquemaCorrida.getTipocorrida());
|
|
||||||
ec.setCantparados(esquemaCorrida.getCantparados());
|
|
||||||
ec.setInfoCorrida(esquemaCorrida.getInfoCorrida());
|
|
||||||
ec.setHorasalida(horaSalida);
|
|
||||||
ec.setIndGeneraFeriado(esquemaCorrida.getIndGeneraFeriado());
|
|
||||||
|
|
||||||
ec.setPisoExtra(esquemaCorrida.getPisoExtra());
|
|
||||||
|
|
||||||
|
|
||||||
// Salva
|
|
||||||
Boolean existeNumCorridaBloco = true;
|
|
||||||
while (existeNumCorridaBloco) {
|
|
||||||
existeNumCorridaBloco = esquemaCorridaService.buscarNumCorrida(numCorrida, null,false);
|
|
||||||
ec.setNumCorrida(numCorrida);
|
|
||||||
numCorrida = numCorrida + 1;
|
|
||||||
}
|
|
||||||
ec = esquemaCorridaService.suscribir(ec);
|
|
||||||
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, ec);
|
|
||||||
|
|
||||||
// Acrescenta Minutos na Hora
|
|
||||||
des.setMinutes(des.getMinutes() + minutos.getValue());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
EsquemaOperacional eo = new EsquemaOperacional();
|
|
||||||
eo.setFecmodif(new Date());
|
|
||||||
eo.setUsuarioId(esquemaCorrida.getEsquemaOperacional().getUsuarioId());
|
|
||||||
eo.setActivo(Boolean.TRUE);
|
|
||||||
eo.setFecniciovigencia(fecniciovigencia.getValue());
|
|
||||||
eo.setFecfinvigencia(fecfinvigencia.getValue());
|
|
||||||
esquemaCorrida.setEsquemaOperacional(eo);
|
|
||||||
esquemaCorridaService.suscribir(esquemaCorrida);
|
|
||||||
|
|
||||||
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, esquemaCorrida);
|
|
||||||
isClone = false;
|
|
||||||
}
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.INFORMATION);
|
|
||||||
busquedaCorridaController.refreshLista();
|
|
||||||
closeWindow();
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.NumCorrida"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
boolean podeSalvar = false;
|
|
||||||
if ((lsEC.isEmpty())) {
|
|
||||||
podeSalvar = true;
|
|
||||||
} else {
|
|
||||||
for (EsquemaCorrida ec : lsEC) {
|
|
||||||
if (ec.getEsquemacorridaId().equals(esquemaCorrida.getEsquemacorridaId())) {
|
|
||||||
podeSalvar = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (podeSalvar) {
|
|
||||||
if (!chkDoblePiso.isChecked()) {
|
|
||||||
esquemaCorrida.setNumCorridaPisoExtra(null);
|
|
||||||
}
|
|
||||||
esquemaCorridaService.actualizacion(esquemaCorrida);
|
|
||||||
esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema, esquemaCorrida);
|
|
||||||
|
|
||||||
esquemaCorridaList.updateItem(esquemaCorrida);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.EXCLAMATION);
|
|
||||||
salvar = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK,
|
|
||||||
Messagebox.INFORMATION);
|
|
||||||
|
|
||||||
closeWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaSemTramos"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.busquedaPeriodo"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaVazia"),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
|
||||||
} catch (WrongValueException ex) {
|
|
||||||
throw (WrongValueException) ex;
|
|
||||||
} catch (Exception ex) {
|
|
||||||
log.error("", ex);
|
|
||||||
Messagebox.show(Labels.getLabel("MSG.Error").concat(" - ").concat(ex.toString()),
|
|
||||||
Labels.getLabel("editarConfiguracionCorridaController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.ERROR);
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Date buscarHora(Date horasalidaExtra) {
|
private Date buscarHora(Date horasalidaExtra) {
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
label="${c:l('editarConfiguracionCorridaController.lbAutomatizacaoHorarioExtra.value')}" />
|
label="${c:l('editarConfiguracionCorridaController.lbAutomatizacaoHorarioExtra.value')}" />
|
||||||
</tabs>
|
</tabs>
|
||||||
<tabpanels>
|
<tabpanels>
|
||||||
|
<!-- Aba Serviço -->
|
||||||
<tabpanel>
|
<tabpanel>
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
|
@ -452,6 +453,7 @@
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
</tabpanel>
|
</tabpanel>
|
||||||
|
<!-- Aba Localidade -->
|
||||||
<tabpanel height="300px">
|
<tabpanel height="300px">
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
|
@ -529,6 +531,7 @@
|
||||||
</listhead>
|
</listhead>
|
||||||
</listbox>
|
</listbox>
|
||||||
</tabpanel>
|
</tabpanel>
|
||||||
|
<!-- Embarque / Desembarque -->
|
||||||
<tabpanel height="300px">
|
<tabpanel height="300px">
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
|
|
Loading…
Reference in New Issue