|
|
@ -8,13 +8,13 @@ import java.math.BigDecimal;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.context.annotation.Scope;
|
|
|
|
import org.springframework.context.annotation.Scope;
|
|
|
@ -168,6 +168,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
private Row rowTrecho;
|
|
|
|
private Row rowTrecho;
|
|
|
|
private Row rowTiempo;
|
|
|
|
private Row rowTiempo;
|
|
|
|
private Radio rdTrecho;
|
|
|
|
private Radio rdTrecho;
|
|
|
|
|
|
|
|
private Radio rdNuncaLiberar;
|
|
|
|
private Timebox timeTempoPermitir;
|
|
|
|
private Timebox timeTempoPermitir;
|
|
|
|
private Tab tabEmpresa;
|
|
|
|
private Tab tabEmpresa;
|
|
|
|
private Tab tabDesconto;
|
|
|
|
private Tab tabDesconto;
|
|
|
@ -448,7 +449,6 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
|
|
|
|
|
|
|
|
popularCombobox(cmbIndGeneraFeriado);
|
|
|
|
popularCombobox(cmbIndGeneraFeriado);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
categoriaCtrlList = (MyListbox) Executions.getCurrent().getArg().get("categoriaCtrlList");
|
|
|
|
categoriaCtrlList = (MyListbox) Executions.getCurrent().getArg().get("categoriaCtrlList");
|
|
|
|
categoriaCtrl = (CategoriaCtrl) Executions.getCurrent().getArg().get("categoriaCtrl");
|
|
|
|
categoriaCtrl = (CategoriaCtrl) Executions.getCurrent().getArg().get("categoriaCtrl");
|
|
|
|
|
|
|
|
|
|
|
@ -503,7 +503,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
|
|
|
|
|
|
|
|
lsCategoriaCorrida = categoriaCtrl.getCategoriaCorridaList();
|
|
|
|
lsCategoriaCorrida = categoriaCtrl.getCategoriaCorridaList();
|
|
|
|
categoriaCorridaList.setData(lsCategoriaCorrida);
|
|
|
|
categoriaCorridaList.setData(lsCategoriaCorrida);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
descuentoImporte.setValue(BigDecimal.ZERO);
|
|
|
|
descuentoImporte.setValue(BigDecimal.ZERO);
|
|
|
@ -619,12 +619,11 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
tabEmpresa.setSelected(Boolean.TRUE);
|
|
|
|
tabEmpresa.setSelected(Boolean.TRUE);
|
|
|
|
cmbEmpresas.getValue();
|
|
|
|
cmbEmpresas.getValue();
|
|
|
|
txtDescricao.getValue();
|
|
|
|
txtDescricao.getValue();
|
|
|
|
|
|
|
|
|
|
|
|
if (!validaObligatorios()) {
|
|
|
|
if (!validaObligatorios()) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (categoriaCtrl.getCategoriactrlId() != null) {
|
|
|
|
if (categoriaCtrl.getCategoriactrlId() != null) {
|
|
|
|
for (CategoriaDescuento cd : lsCategoriaDescuento) {
|
|
|
|
for (CategoriaDescuento cd : lsCategoriaDescuento) {
|
|
|
|
if ((cd.getCategoriadescuentoId() != null) && (cd.getActivo())) {
|
|
|
|
if ((cd.getCategoriadescuentoId() != null) && (cd.getActivo())) {
|
|
|
@ -633,15 +632,15 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.categoriaPeriodoObligatorio"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.categoriaPeriodoObligatorio"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"), Messagebox.OK | Messagebox.CANCEL,
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"), Messagebox.OK | Messagebox.CANCEL,
|
|
|
|
Messagebox.QUESTION);
|
|
|
|
Messagebox.QUESTION);
|
|
|
|
if (!(resp == Messagebox.OK)){
|
|
|
|
if (!(resp == Messagebox.OK)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
categoriaCtrl.setActivo(true);
|
|
|
|
categoriaCtrl.setActivo(true);
|
|
|
|
categoriaCtrl.setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
categoriaCtrl.setFecmodif(Calendar.getInstance().getTime());
|
|
|
|
categoriaCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
|
categoriaCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
|
@ -673,7 +672,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuentoNova);
|
|
|
|
categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuentoNova);
|
|
|
|
categoriaCtrl.setDescricao(txtDescricao.getValue());
|
|
|
|
categoriaCtrl.setDescricao(txtDescricao.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
if (clone) {
|
|
|
|
if (clone) {
|
|
|
|
setValores();
|
|
|
|
setValores();
|
|
|
|
categoriaCtrlService.suscribir(nuevo);
|
|
|
|
categoriaCtrlService.suscribir(nuevo);
|
|
|
@ -691,7 +690,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
closeWindow();
|
|
|
|
closeWindow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -701,47 +700,47 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
private void setValores() {
|
|
|
|
private void setValores() {
|
|
|
|
|
|
|
|
|
|
|
|
nuevo.setDescricao(txtDescricao.getValue());
|
|
|
|
nuevo.setDescricao(txtDescricao.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaMarca> lsCategoriaMarca = nuevo.addNuevoCloneCategoriaMarca((List<CategoriaMarca>) categoriaMarcaList.getListData(), nuevo);
|
|
|
|
List<CategoriaMarca> lsCategoriaMarca = nuevo.addNuevoCloneCategoriaMarca((List<CategoriaMarca>) categoriaMarcaList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaMarcaList(lsCategoriaMarca);
|
|
|
|
nuevo.setCategoriaMarcaList(lsCategoriaMarca);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaOrgao> lsCategoriaOrgao = nuevo.addNuevoCloneCategoriaOrgao((List<CategoriaOrgao>) categoriaOrgaoList.getListData(), nuevo);
|
|
|
|
List<CategoriaOrgao> lsCategoriaOrgao = nuevo.addNuevoCloneCategoriaOrgao((List<CategoriaOrgao>) categoriaOrgaoList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaorgaoList(lsCategoriaOrgao);
|
|
|
|
nuevo.setCategoriaorgaoList(lsCategoriaOrgao);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaRuta> lsCategoriaRuta = nuevo.addNuevoCloneCategoriaRuta( (List<CategoriaRuta>) categoriaRutaList.getListData(), nuevo);
|
|
|
|
List<CategoriaRuta> lsCategoriaRuta = nuevo.addNuevoCloneCategoriaRuta((List<CategoriaRuta>) categoriaRutaList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriarutaList(lsCategoriaRuta);
|
|
|
|
nuevo.setCategoriarutaList(lsCategoriaRuta);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaCorrida> lsCategoriaCorrida = nuevo.addNuevoCloneCategoriaCorrida((List<CategoriaCorrida>) categoriaCorridaList.getListData(), nuevo);
|
|
|
|
List<CategoriaCorrida> lsCategoriaCorrida = nuevo.addNuevoCloneCategoriaCorrida((List<CategoriaCorrida>) categoriaCorridaList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaCorridaList(lsCategoriaCorrida);
|
|
|
|
nuevo.setCategoriaCorridaList(lsCategoriaCorrida);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaClase> lsCategoriaClasse = nuevo.addNuevoCloneCategoriaClase((List<CategoriaClase>) categoriaClaseList.getListData(), nuevo);
|
|
|
|
List<CategoriaClase> lsCategoriaClasse = nuevo.addNuevoCloneCategoriaClase((List<CategoriaClase>) categoriaClaseList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaClaseList(lsCategoriaClasse);
|
|
|
|
nuevo.setCategoriaClaseList(lsCategoriaClasse);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaDescuento> lsCategoriaDescuento = nuevo.addNuevoCloneCategoriaDescuento((List<CategoriaDescuento>) categoriaDescuentoList.getListData(), nuevo);
|
|
|
|
List<CategoriaDescuento> lsCategoriaDescuento = nuevo.addNuevoCloneCategoriaDescuento((List<CategoriaDescuento>) categoriaDescuentoList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaDescuentoList(lsCategoriaDescuento);
|
|
|
|
nuevo.setCategoriaDescuentoList(lsCategoriaDescuento);
|
|
|
|
|
|
|
|
|
|
|
|
List<CategoriaMercado> lsCategoriaMercado = nuevo.addNuevoCloneCategoriaMercado((List<CategoriaMercado>) categoriaMercadoList.getListData(), nuevo);
|
|
|
|
List<CategoriaMercado> lsCategoriaMercado = nuevo.addNuevoCloneCategoriaMercado((List<CategoriaMercado>) categoriaMercadoList.getListData(), nuevo);
|
|
|
|
nuevo.setCategoriaMercadoList(lsCategoriaMercado);
|
|
|
|
nuevo.setCategoriaMercadoList(lsCategoriaMercado);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void onClick$btnCopiar(Event ev) throws CloneNotSupportedException, InterruptedException {
|
|
|
|
public void onClick$btnCopiar(Event ev) throws CloneNotSupportedException, InterruptedException {
|
|
|
|
if (!clone) {
|
|
|
|
if (!clone) {
|
|
|
|
|
|
|
|
|
|
|
|
if (txtDescricao.getValue().isEmpty()) {
|
|
|
|
if (txtDescricao.getValue().isEmpty()) {
|
|
|
|
txtDescricao.setConstraint("no empty");
|
|
|
|
txtDescricao.setConstraint("no empty");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (CategoriaDescuento categoriaDescuento : lsCategoriaDescuento) {
|
|
|
|
for (CategoriaDescuento categoriaDescuento : lsCategoriaDescuento) {
|
|
|
|
if(categoriaDescuento.getCategoria().getCategoriaId().intValue() != 1) {
|
|
|
|
if (categoriaDescuento.getCategoria().getCategoriaId().intValue() != 1) {
|
|
|
|
categoriaDescuento.setCategoriaPeriodoList(new ArrayList<CategoriaPeriodo>());
|
|
|
|
categoriaDescuento.setCategoriaPeriodoList(new ArrayList<CategoriaPeriodo>());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(CategoriaPeriodo tempRef: categoriaDescuento.getCategoriaPeriodoList()) {
|
|
|
|
for (CategoriaPeriodo tempRef : categoriaDescuento.getCategoriaPeriodoList()) {
|
|
|
|
tempRef.setCategoriaperiodoId(null);
|
|
|
|
tempRef.setCategoriaperiodoId(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
categoriaDescuentoList.setData(lsCategoriaDescuento);
|
|
|
|
categoriaDescuentoList.setData(lsCategoriaDescuento);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nuevo = (CategoriaCtrl) categoriaCtrl.clone();
|
|
|
|
nuevo = (CategoriaCtrl) categoriaCtrl.clone();
|
|
|
|
nuevo.setCategoriactrlId(null);
|
|
|
|
nuevo.setCategoriactrlId(null);
|
|
|
@ -749,8 +748,9 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.show(Labels.getLabel("editarConfiguracionCategoriaController.MSG.cloneOK.value"),
|
|
|
|
Messagebox.show(Labels.getLabel("editarConfiguracionCategoriaController.MSG.cloneOK.value"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Messagebox.OK, Messagebox.INFORMATION);
|
|
|
|
Messagebox.OK, Messagebox.INFORMATION);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void onClick$btnApagar(Event ev) {
|
|
|
|
public void onClick$btnApagar(Event ev) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
int resp = Messagebox.show(
|
|
|
@ -770,7 +770,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
closeWindow();
|
|
|
|
closeWindow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -778,37 +778,37 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Boolean validarCampoAssentosReservados() throws InterruptedException{
|
|
|
|
private Boolean validarCampoAssentosReservados() throws InterruptedException {
|
|
|
|
|
|
|
|
|
|
|
|
//Verifica se o campo possui números separados por ponto e vírgula.
|
|
|
|
// Verifica se o campo possui números separados por ponto e vírgula.
|
|
|
|
//Não permite que outros caracteres sejam digitados.
|
|
|
|
// Não permite que outros caracteres sejam digitados.
|
|
|
|
if (!asientosReservados.getValue().equals("") && !asientosReservados.getValue().toString().matches("(([1-9]([0-9])+;)|([1-9]([0-9])+)|([1-9];)|([1-9][1-9][1-9])|[1-9])+")){
|
|
|
|
if (!asientosReservados.getValue().equals("") && !asientosReservados.getValue().toString().matches("(([1-9]([0-9])+;)|([1-9]([0-9])+)|([1-9];)|([1-9][1-9][1-9])|[1-9])+")) {
|
|
|
|
Messagebox.show(
|
|
|
|
Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.validacaoAssentosReservadosPontoeVirgula"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.validacaoAssentosReservadosPontoeVirgula"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//Verifica se a quantidade de assentos reservados é menor que a quantidade de assentos autorizados.
|
|
|
|
// Verifica se a quantidade de assentos reservados é menor que a quantidade de assentos autorizados.
|
|
|
|
String assentosReservados[] = asientosReservados.getValue().toString().split(";");
|
|
|
|
String assentosReservados[] = asientosReservados.getValue().toString().split(";");
|
|
|
|
if(assentosReservados.length > cantAutorizada.getValue()){
|
|
|
|
if (assentosReservados.length > cantAutorizada.getValue()) {
|
|
|
|
Messagebox.show(
|
|
|
|
Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.validacaoAssentosReservados"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.validacaoAssentosReservados"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Retira possíveis assentos em duplicidade utilizando Set
|
|
|
|
// Retira possíveis assentos em duplicidade utilizando Set
|
|
|
|
if(!asientosReservados.getValue().equals("") && assentosReservados.length > 0){
|
|
|
|
if (!asientosReservados.getValue().equals("") && assentosReservados.length > 0) {
|
|
|
|
Set<String> assentosSemDuplicacao = new HashSet<String>();
|
|
|
|
Set<String> assentosSemDuplicacao = new HashSet<String>();
|
|
|
|
StringBuilder assentos = new StringBuilder();
|
|
|
|
StringBuilder assentos = new StringBuilder();
|
|
|
|
assentosSemDuplicacao.addAll(Arrays.asList(assentosReservados));
|
|
|
|
assentosSemDuplicacao.addAll(Arrays.asList(assentosReservados));
|
|
|
|
assentosReservados = assentosSemDuplicacao.toArray(new String[assentosSemDuplicacao.size()]);
|
|
|
|
assentosReservados = assentosSemDuplicacao.toArray(new String[assentosSemDuplicacao.size()]);
|
|
|
|
for(String assento :assentosReservados){
|
|
|
|
for (String assento : assentosReservados) {
|
|
|
|
assentos.append(assento.trim()).append(";");
|
|
|
|
assentos.append(assento.trim()).append(";");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assentos.replace(assentos.length()-1, assentos.length(),"");
|
|
|
|
assentos.replace(assentos.length() - 1, assentos.length(), "");
|
|
|
|
asientosReservados.setValue(assentos.toString());
|
|
|
|
asientosReservados.setValue(assentos.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -825,7 +825,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
cmbCategorias.focus();
|
|
|
|
cmbCategorias.focus();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!categoriaCtrlService.validaCategoriaProgramaFidelidade((Categoria) cmbCategorias.getSelectedItem().getValue())) {
|
|
|
|
if (!categoriaCtrlService.validaCategoriaProgramaFidelidade((Categoria) cmbCategorias.getSelectedItem().getValue())) {
|
|
|
|
Messagebox.show(
|
|
|
|
Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.modoFidelidadeNaoCinfigurado"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.modoFidelidadeNaoCinfigurado"),
|
|
|
@ -906,11 +906,10 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
cDescuento.setIndExigeEmailPassageiro(chkExigeEmailpasajero.isChecked());
|
|
|
|
cDescuento.setIndExigeEmailPassageiro(chkExigeEmailpasajero.isChecked());
|
|
|
|
cDescuento.setIndExigeEnderecoPassageiro(chkExigeEnderecopasajero.isChecked());
|
|
|
|
cDescuento.setIndExigeEnderecoPassageiro(chkExigeEnderecopasajero.isChecked());
|
|
|
|
cDescuento.setIndtipoocupacao(chkIndtipoocupacao.isChecked());
|
|
|
|
cDescuento.setIndtipoocupacao(chkIndtipoocupacao.isChecked());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(radioHorarioLiberacaoVendaOrigem.isChecked()) {
|
|
|
|
if (radioHorarioLiberacaoVendaOrigem.isChecked()) {
|
|
|
|
cDescuento.setHorarioLiberacaoVendaPassagem(HorarioLiberacaoVendaPassagem.HORARIO_LIBERACAO_VENDA_ORIGEM);
|
|
|
|
cDescuento.setHorarioLiberacaoVendaPassagem(HorarioLiberacaoVendaPassagem.HORARIO_LIBERACAO_VENDA_ORIGEM);
|
|
|
|
} else if(radioHorarioLiberacaoVendaTrecho.isChecked()) {
|
|
|
|
} else if (radioHorarioLiberacaoVendaTrecho.isChecked()) {
|
|
|
|
cDescuento.setHorarioLiberacaoVendaPassagem(HorarioLiberacaoVendaPassagem.HORARIO_LIBERACAO_VENDA_TRECHO);
|
|
|
|
cDescuento.setHorarioLiberacaoVendaPassagem(HorarioLiberacaoVendaPassagem.HORARIO_LIBERACAO_VENDA_TRECHO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -941,17 +940,30 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
cDescuento.setIndCuota(true);
|
|
|
|
cDescuento.setIndCuota(true);
|
|
|
|
cDescuento.setIndCuotaTramo(rdTrecho.isChecked());
|
|
|
|
cDescuento.setIndCuotaTramo(rdTrecho.isChecked());
|
|
|
|
cDescuento.setTiempoCuota(timeTempoPermitir.getValue());
|
|
|
|
cDescuento.setTiempoCuota(timeTempoPermitir.getValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean isNuncaLiberarCota = rdNuncaLiberar.isChecked();
|
|
|
|
|
|
|
|
cDescuento.setIndCuotaNuncaLiberar(isNuncaLiberarCota);
|
|
|
|
|
|
|
|
if (isNuncaLiberarCota) {
|
|
|
|
|
|
|
|
String assentosReservados = asientosReservados.getValue();
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(assentosReservados)) {
|
|
|
|
|
|
|
|
Messagebox.show(
|
|
|
|
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.msg.nuncaLiberarAssentosReservados"),
|
|
|
|
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
|
|
|
|
Messagebox.OK, Messagebox.ERROR);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(radioCompPrecoImp.isChecked()) {
|
|
|
|
if (radioCompPrecoImp.isChecked()) {
|
|
|
|
cDescuento.setTipodesccomppreco(TipoDescontoComponentePreco.DESCONTO_COMPONENTE_PRECO_VALOR.getValor());
|
|
|
|
cDescuento.setTipodesccomppreco(TipoDescontoComponentePreco.DESCONTO_COMPONENTE_PRECO_VALOR.getValor());
|
|
|
|
} else if(radioCompPrecoPor.isChecked()) {
|
|
|
|
} else if (radioCompPrecoPor.isChecked()) {
|
|
|
|
cDescuento.setTipodesccomppreco(TipoDescontoComponentePreco.DESCONTO_COMPONENTE_PRECO_PERC.getValor());
|
|
|
|
cDescuento.setTipodesccomppreco(TipoDescontoComponentePreco.DESCONTO_COMPONENTE_PRECO_PERC.getValor());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(radioCorLaranja.isChecked()) {
|
|
|
|
if (radioCorLaranja.isChecked()) {
|
|
|
|
cDescuento.setCorpoltrona(TipoPassagemCores.LARANJA);
|
|
|
|
cDescuento.setCorpoltrona(TipoPassagemCores.LARANJA);
|
|
|
|
} else if(radioCorVerde.isChecked()) {
|
|
|
|
} else if (radioCorVerde.isChecked()) {
|
|
|
|
cDescuento.setCorpoltrona(TipoPassagemCores.VERDE);
|
|
|
|
cDescuento.setCorpoltrona(TipoPassagemCores.VERDE);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
cDescuento.setCorpoltrona(null);
|
|
|
|
cDescuento.setCorpoltrona(null);
|
|
|
@ -998,7 +1010,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1068,7 +1080,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1097,7 +1109,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1142,7 +1154,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1155,9 +1167,9 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
CategoriaRuta cRuta = (CategoriaRuta) categoriaRutaList.getSelected();
|
|
|
|
CategoriaRuta cRuta = (CategoriaRuta) categoriaRutaList.getSelected();
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
|
|
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
|
|
|
if (resp == Messagebox.YES) {
|
|
|
|
if (resp == Messagebox.YES) {
|
|
|
|
if (cRuta != null) {
|
|
|
|
if (cRuta != null) {
|
|
|
|
// removo o antigo
|
|
|
|
// removo o antigo
|
|
|
@ -1176,7 +1188,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1246,7 +1258,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1258,9 +1270,9 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
CategoriaOrgao cOrgao = (CategoriaOrgao) categoriaOrgaoList.getSelected();
|
|
|
|
CategoriaOrgao cOrgao = (CategoriaOrgao) categoriaOrgaoList.getSelected();
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
int resp = Messagebox.show(
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
|
|
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
|
|
|
if (resp == Messagebox.YES) {
|
|
|
|
if (resp == Messagebox.YES) {
|
|
|
|
if (cOrgao != null) {
|
|
|
|
if (cOrgao != null) {
|
|
|
|
// removo o antigo
|
|
|
|
// removo o antigo
|
|
|
@ -1279,7 +1291,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1290,7 +1302,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
public void onClick$btnAdicionarCorrida(Event ev) {
|
|
|
|
public void onClick$btnAdicionarCorrida(Event ev) {
|
|
|
|
idCorrida.getValue();
|
|
|
|
idCorrida.getValue();
|
|
|
|
|
|
|
|
|
|
|
|
corrida = corridaCtrlService.obtenerID(idCorrida.getValue());
|
|
|
|
corrida = corridaCtrlService.obtenerID(idCorrida.getValue());
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (corrida == null) {
|
|
|
|
if (corrida == null) {
|
|
|
|
Messagebox.show(
|
|
|
|
Messagebox.show(
|
|
|
@ -1305,7 +1317,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!existe) {
|
|
|
|
if (!existe) {
|
|
|
|
|
|
|
|
|
|
|
|
CategoriaCorrida cc = new CategoriaCorrida();
|
|
|
|
CategoriaCorrida cc = new CategoriaCorrida();
|
|
|
|
cc.setCategoriaCtrl(categoriaCtrl);
|
|
|
|
cc.setCategoriaCtrl(categoriaCtrl);
|
|
|
|
cc.setActivo(Boolean.TRUE);
|
|
|
|
cc.setActivo(Boolean.TRUE);
|
|
|
@ -1323,7 +1335,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1349,7 +1361,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1411,7 +1423,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1437,7 +1449,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1480,7 +1492,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1506,7 +1518,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1526,7 +1538,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
log.error("",ex);
|
|
|
|
log.error("", ex);
|
|
|
|
Clients.alert(
|
|
|
|
Clients.alert(
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("MSG.Error"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
|
Labels.getLabel("editarConfiguracionCategoriaController.window.title"),
|
|
|
@ -1602,7 +1614,7 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean isDescontoComponentePreco() {
|
|
|
|
public Boolean isDescontoComponentePreco() {
|
|
|
|
Constante constante = constanteService.buscarPorNomeConstante(Constantes.DESCONTO_COMPONENTE_PRECO);
|
|
|
|
Constante constante = constanteService.buscarPorNomeConstante(Constantes.DESCONTO_COMPONENTE_PRECO);
|
|
|
|
if(constante != null) {
|
|
|
|
if (constante != null) {
|
|
|
|
return Boolean.valueOf(constante.getValorconstante());
|
|
|
|
return Boolean.valueOf(constante.getValorconstante());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -1632,7 +1644,4 @@ public class EditarConfiguracionCategoriaController extends MyGenericForwardComp
|
|
|
|
this.chkExigeEmailpasajero = chkExigeEmailpasajero;
|
|
|
|
this.chkExigeEmailpasajero = chkExigeEmailpasajero;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|