parent
d200fd8675
commit
e63c7d70af
4
pom.xml
4
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ventaboletosadm</artifactId>
|
<artifactId>ventaboletosadm</artifactId>
|
||||||
<version>1.0.11</version>
|
<version>1.0.12</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -247,6 +247,8 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
private DiagramaAutobusService diagramaAutoBusService;
|
private DiagramaAutobusService diagramaAutoBusService;
|
||||||
|
|
||||||
private Integer numAssentoIntReservaEspecial;
|
private Integer numAssentoIntReservaEspecial;
|
||||||
|
|
||||||
|
private List<TipoOcupacion> tipoOcupacoesSemValidacaoList;
|
||||||
|
|
||||||
public void aplicarMascara() {
|
public void aplicarMascara() {
|
||||||
Clients.evalJavaScript(
|
Clients.evalJavaScript(
|
||||||
|
@ -297,7 +299,8 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
lsLinhas = rutaService.obtenerTodos();
|
lsLinhas = rutaService.obtenerTodos();
|
||||||
lsEmpresas = empresaService.obtenerTodos();
|
lsEmpresas = empresaService.obtenerTodos();
|
||||||
usaCPFComoFidelidade = ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.USA_CPF_COMO_FIDELIDADE.getDescricao());
|
usaCPFComoFidelidade = ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.USA_CPF_COMO_FIDELIDADE.getDescricao());
|
||||||
|
tipoOcupacoesSemValidacaoList = constanteService.BuscarTipoOcupacaoSemValidacao();
|
||||||
|
|
||||||
if (usaCPFComoFidelidade) {
|
if (usaCPFComoFidelidade) {
|
||||||
txtNumFidelidade.setDisabled(true);
|
txtNumFidelidade.setDisabled(true);
|
||||||
btnAdicionarFidelidade.setDisabled(true);
|
btnAdicionarFidelidade.setDisabled(true);
|
||||||
|
@ -599,11 +602,21 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setValidadoresCPF() {
|
private void setValidadoresCPF() {
|
||||||
|
|
||||||
|
if(isNaoValidarCamposOcupacao()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
txtNumRfc.setMaxlength(11);
|
txtNumRfc.setMaxlength(11);
|
||||||
txtNumRfc.setConstraint("/[0-9]{11}/ : " + Labels.getLabel("editarClienteController.MSG.validacaoCPF"));
|
txtNumRfc.setConstraint("/[0-9]{11}/ : " + Labels.getLabel("editarClienteController.MSG.validacaoCPF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setValidadoresCPF2() {
|
private void setValidadoresCPF2() {
|
||||||
|
|
||||||
|
if(isNaoValidarCamposOcupacao()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
txtNumRfc2.setMaxlength(11);
|
txtNumRfc2.setMaxlength(11);
|
||||||
txtNumRfc2.setConstraint("/[0-9]{11}/ : " + Labels.getLabel("editarClienteController.MSG.validacaoCPF"));
|
txtNumRfc2.setConstraint("/[0-9]{11}/ : " + Labels.getLabel("editarClienteController.MSG.validacaoCPF"));
|
||||||
}
|
}
|
||||||
|
@ -631,7 +644,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
public void onClick$btnNovoCurso(Event ev) throws InterruptedException {
|
public void onClick$btnNovoCurso(Event ev) throws InterruptedException {
|
||||||
novoClienteCurso();
|
novoClienteCurso();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSelect$cmbTipoIdentificacion(Event ev) throws InterruptedException {
|
public void onSelect$cmbTipoIdentificacion(Event ev) throws InterruptedException {
|
||||||
txtNumRfc.setConstraint("");
|
txtNumRfc.setConstraint("");
|
||||||
txtNumRfc.setValue("");
|
txtNumRfc.setValue("");
|
||||||
|
@ -644,6 +657,21 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
txtNumFidelidade.setText("");
|
txtNumFidelidade.setText("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onSelect$cmbOcupacion(Event ev) throws InterruptedException {
|
||||||
|
verificarERemoverValidacaoCPF();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void verificarERemoverValidacaoCPF() {
|
||||||
|
if(isNaoValidarCamposOcupacao()) {
|
||||||
|
txtNumRfc.setConstraint("");
|
||||||
|
txtNumRfc.setValue("");
|
||||||
|
|
||||||
|
txtNumRfc2.setConstraint("");
|
||||||
|
txtNumRfc2.setValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onSelect$cmbTipoIdentificacion2(Event ev) throws InterruptedException {
|
public void onSelect$cmbTipoIdentificacion2(Event ev) throws InterruptedException {
|
||||||
txtNumRfc2.setConstraint("");
|
txtNumRfc2.setConstraint("");
|
||||||
|
@ -944,7 +972,6 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
cmbMotivacionViaje.getValue();
|
cmbMotivacionViaje.getValue();
|
||||||
cmbOcupacion.getValue();
|
cmbOcupacion.getValue();
|
||||||
|
|
||||||
|
|
||||||
if(!validarCampos()) {
|
if(!validarCampos()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1022,9 +1049,40 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isNaoValidarCamposOcupacao() {
|
||||||
|
Boolean naoValidaCampos = false;
|
||||||
|
|
||||||
|
int ocupacion_id = buscarTipoOcupacionId();
|
||||||
|
|
||||||
|
if(tipoOcupacoesSemValidacaoList != null) {
|
||||||
|
|
||||||
|
for(TipoOcupacion tipoOcupacao : tipoOcupacoesSemValidacaoList) {
|
||||||
|
if(tipoOcupacao.getTipoocupacionId() == ocupacion_id) {
|
||||||
|
naoValidaCampos = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return naoValidaCampos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private int buscarTipoOcupacionId() {
|
||||||
|
int ocupacion_id = -1;
|
||||||
|
|
||||||
|
if (cliente != null && cliente.getTipoocupacionId() != null) {
|
||||||
|
ocupacion_id = cliente.getTipoocupacionId().getTipoocupacionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ocupacion_id;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean validarCampos() throws InterruptedException {
|
private boolean validarCampos() throws InterruptedException {
|
||||||
if (txtNumRfc.getText() != null && !txtNumRfc.getText().isEmpty()) {
|
|
||||||
|
Boolean isNaoValidarCampoOcupacao = isNaoValidarCamposOcupacao();
|
||||||
|
|
||||||
|
if (!isNaoValidarCampoOcupacao && txtNumRfc.getText() != null && !txtNumRfc.getText().isEmpty()) {
|
||||||
if ( cmbTipoIdentificacion != null
|
if ( cmbTipoIdentificacion != null
|
||||||
&& cmbTipoIdentificacion.getSelectedItem() != null
|
&& cmbTipoIdentificacion.getSelectedItem() != null
|
||||||
&& cmbTipoIdentificacion.getSelectedItem().getValue() != null
|
&& cmbTipoIdentificacion.getSelectedItem().getValue() != null
|
||||||
|
@ -1040,7 +1098,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty()) {
|
if (!isNaoValidarCampoOcupacao && txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty()) {
|
||||||
if ( cmbTipoIdentificacion2 != null
|
if ( cmbTipoIdentificacion2 != null
|
||||||
&& cmbTipoIdentificacion2.getSelectedItem() != null
|
&& cmbTipoIdentificacion2.getSelectedItem() != null
|
||||||
&& cmbTipoIdentificacion2.getSelectedItem().getValue() != null
|
&& cmbTipoIdentificacion2.getSelectedItem().getValue() != null
|
||||||
|
@ -1056,7 +1114,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<Cliente> lsCliente = new ArrayList<Cliente>();
|
List<Cliente> lsCliente = new ArrayList<Cliente>();
|
||||||
if ((txtNumRfc.getText() != null && !txtNumRfc.getText().isEmpty()) && cmbTipoIdentificacion != null
|
if (!isNaoValidarCampoOcupacao && (txtNumRfc.getText() != null && !txtNumRfc.getText().isEmpty()) && cmbTipoIdentificacion != null
|
||||||
&& cmbTipoIdentificacion.getSelectedItem() != null
|
&& cmbTipoIdentificacion.getSelectedItem() != null
|
||||||
&& cmbTipoIdentificacion.getSelectedItem().getValue() != null
|
&& cmbTipoIdentificacion.getSelectedItem().getValue() != null
|
||||||
&& CPF.equals(cmbTipoIdentificacion.getSelectedItem().getValue().toString())){
|
&& CPF.equals(cmbTipoIdentificacion.getSelectedItem().getValue().toString())){
|
||||||
|
@ -1071,7 +1129,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty() && cmbTipoIdentificacion2 != null
|
if (!isNaoValidarCampoOcupacao && txtNumRfc2.getText() != null && !txtNumRfc2.getText().isEmpty() && cmbTipoIdentificacion2 != null
|
||||||
&& cmbTipoIdentificacion2.getSelectedItem() != null
|
&& cmbTipoIdentificacion2.getSelectedItem() != null
|
||||||
&& cmbTipoIdentificacion2.getSelectedItem().getValue() != null
|
&& cmbTipoIdentificacion2.getSelectedItem().getValue() != null
|
||||||
&& CPF.equals(cmbTipoIdentificacion2.getSelectedItem().getValue().toString())) {
|
&& CPF.equals(cmbTipoIdentificacion2.getSelectedItem().getValue().toString())) {
|
||||||
|
@ -1096,7 +1154,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
boolean isEmailNaoInformado = StringUtils.isBlank(txtDescorreo.getValue());
|
boolean isEmailNaoInformado = StringUtils.isBlank(txtDescorreo.getValue());
|
||||||
|
|
||||||
if(isTelefoneNaoInformado && isEmailNaoInformado) {
|
if(!isNaoValidarCampoOcupacao && isTelefoneNaoInformado && isEmailNaoInformado) {
|
||||||
Messagebox.show(Labels.getLabel("editarClienteController.MSG.exigeEmailOuTelefone"),
|
Messagebox.show(Labels.getLabel("editarClienteController.MSG.exigeEmailOuTelefone"),
|
||||||
Labels.getLabel("editarClienteController.window.title"), Messagebox.OK,
|
Labels.getLabel("editarClienteController.window.title"), Messagebox.OK,
|
||||||
Messagebox.EXCLAMATION);
|
Messagebox.EXCLAMATION);
|
||||||
|
@ -1105,8 +1163,6 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1353,7 +1409,6 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
Messagebox.ERROR);
|
Messagebox.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getBoolVender1porCorrida() {
|
public Boolean getBoolVender1porCorrida() {
|
||||||
|
@ -1762,7 +1817,7 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
reservaEspecialCliente.setIndQuarta(indQuartaChk.isChecked());
|
reservaEspecialCliente.setIndQuarta(indQuartaChk.isChecked());
|
||||||
reservaEspecialCliente.setIndQuinta(indQuintaChk.isChecked());
|
reservaEspecialCliente.setIndQuinta(indQuintaChk.isChecked());
|
||||||
reservaEspecialCliente.setIndSexta(indSextaChk.isChecked());
|
reservaEspecialCliente.setIndSexta(indSextaChk.isChecked());
|
||||||
reservaEspecialCliente.setIndSabado(indSabadoChk.isChecked());
|
reservaEspecialCliente.setIndSabado(indSabadoChk.isChecked());
|
||||||
reservaEspecialClienteList.add(reservaEspecialCliente);
|
reservaEspecialClienteList.add(reservaEspecialCliente);
|
||||||
cliente.setListReservaEspecialCliente(reservaEspecialClienteList);
|
cliente.setListReservaEspecialCliente(reservaEspecialClienteList);
|
||||||
reservaEspecialMyListBox.setData(new ArrayList<ReservaEspecialCliente>(reservaEspecialClienteList));
|
reservaEspecialMyListBox.setData(new ArrayList<ReservaEspecialCliente>(reservaEspecialClienteList));
|
||||||
|
@ -1898,9 +1953,6 @@ public class EditarClienteController extends MyGenericForwardComposer {
|
||||||
txtNumFidelidade.setValue(null);
|
txtNumFidelidade.setValue(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void limparInput() {
|
private void limparInput() {
|
||||||
cmbLinha.setSelectedItem(null);
|
cmbLinha.setSelectedItem(null);
|
||||||
|
|
Loading…
Reference in New Issue