Espec Cadastrar Policiais pelo ponto de venda

bug#al-1294
master
valdir.cordeiro 2022-12-07 16:24:50 -03:00
parent d200fd8675
commit e63c7d70af
2 changed files with 69 additions and 17 deletions

View File

@ -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>

View File

@ -248,6 +248,8 @@ public class EditarClienteController extends MyGenericForwardComposer {
private Integer numAssentoIntReservaEspecial; private Integer numAssentoIntReservaEspecial;
private List<TipoOcupacion> tipoOcupacoesSemValidacaoList;
public void aplicarMascara() { public void aplicarMascara() {
Clients.evalJavaScript( Clients.evalJavaScript(
"jQuery('#" + txtNumFax.getUuid() + "').mask('(99)9999-9999');jQuery('#" "jQuery('#" + txtNumFax.getUuid() + "').mask('(99)9999-9999');jQuery('#"
@ -297,6 +299,7 @@ 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);
@ -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"));
} }
@ -645,6 +658,21 @@ public class EditarClienteController extends MyGenericForwardComposer {
} }
} }
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("");
txtNumRfc2.setValue(""); txtNumRfc2.setValue("");
@ -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() {
@ -1899,9 +1954,6 @@ public class EditarClienteController extends MyGenericForwardComposer {
} }
} }
private void limparInput() { private void limparInput() {
cmbLinha.setSelectedItem(null); cmbLinha.setSelectedItem(null);
cmbParadaOrigem.setSelectedItem(null); cmbParadaOrigem.setSelectedItem(null);