Merge pull request 'fixes bug#AL-4844' (!273) from AL-4844 into master
Reviewed-on: adm/ModelWeb#273 Reviewed-by: pinheiro <valdevir@rjconsultores.com.br>master
commit
19945e1569
2
pom.xml
2
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>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.105.3</version>
|
<version>1.105.4</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -5,6 +5,10 @@ import org.brazilutils.br.cpfcnpj.Cnpj;
|
||||||
import org.brazilutils.br.cpfcnpj.Cpf;
|
import org.brazilutils.br.cpfcnpj.Cpf;
|
||||||
import org.brazilutils.validation.ValidationException;
|
import org.brazilutils.validation.ValidationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
**Criar Enumns com quantidade máxima de 10 caracteres, pois existe uma restrição com a Globus (Praxio)
|
||||||
|
***/
|
||||||
|
|
||||||
public enum TipoIdentificacionDoc {
|
public enum TipoIdentificacionDoc {
|
||||||
RG(1),
|
RG(1),
|
||||||
CPF(2),
|
CPF(2),
|
||||||
|
@ -22,7 +26,7 @@ public enum TipoIdentificacionDoc {
|
||||||
J_CARENTE(29),
|
J_CARENTE(29),
|
||||||
GRATUIDADE(30),
|
GRATUIDADE(30),
|
||||||
NIS(31),
|
NIS(31),
|
||||||
PASSE_LIVRE(32),
|
PASSELIVRE(32),
|
||||||
ID_JOVEM(33),
|
ID_JOVEM(33),
|
||||||
TODOS(0);
|
TODOS(0);
|
||||||
|
|
||||||
|
@ -88,7 +92,7 @@ public enum TipoIdentificacionDoc {
|
||||||
tmp = TipoIdentificacionDoc.NIS;
|
tmp = TipoIdentificacionDoc.NIS;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
tmp = TipoIdentificacionDoc.PASSE_LIVRE;
|
tmp = TipoIdentificacionDoc.PASSELIVRE;
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
tmp = TipoIdentificacionDoc.ID_JOVEM;
|
tmp = TipoIdentificacionDoc.ID_JOVEM;
|
||||||
|
@ -117,7 +121,7 @@ public enum TipoIdentificacionDoc {
|
||||||
TipoIdentificacionDoc.J_CARENTE,
|
TipoIdentificacionDoc.J_CARENTE,
|
||||||
TipoIdentificacionDoc.GRATUIDADE,
|
TipoIdentificacionDoc.GRATUIDADE,
|
||||||
TipoIdentificacionDoc.NIS,
|
TipoIdentificacionDoc.NIS,
|
||||||
TipoIdentificacionDoc.PASSE_LIVRE,
|
TipoIdentificacionDoc.PASSELIVRE,
|
||||||
TipoIdentificacionDoc.ID_JOVEM
|
TipoIdentificacionDoc.ID_JOVEM
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -128,44 +132,68 @@ public enum TipoIdentificacionDoc {
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
String descricao = "";
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 1: case 10:
|
case 1: case 10:
|
||||||
return "RG";
|
descricao= "RG";
|
||||||
|
break;
|
||||||
case 2: case 11:
|
case 2: case 11:
|
||||||
return "CPF";
|
descricao= "CPF";
|
||||||
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
return "CI";
|
descricao= "CI";
|
||||||
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
return "PASPT";
|
descricao= "PASPT";
|
||||||
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
return "RUT";
|
descricao= "RUT";
|
||||||
|
break;
|
||||||
case 22:
|
case 22:
|
||||||
return "DOCX";
|
descricao= "DOCX";
|
||||||
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
return "CNPJ";
|
descricao= "CNPJ";
|
||||||
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
return "CN";
|
descricao= "CN";
|
||||||
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
return "RNE";
|
descricao= "RNE";
|
||||||
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
return "DOC_IDOSO";
|
descricao= "DOC_IDOSO";
|
||||||
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
return "DNI";
|
descricao= "DNI";
|
||||||
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
return "RE_PM";
|
descricao= "RE_PM";
|
||||||
|
break;
|
||||||
case 28:
|
case 28:
|
||||||
return "D_FISICO";
|
descricao= "D_FISICO";
|
||||||
|
break;
|
||||||
case 29:
|
case 29:
|
||||||
return "J_CARENTE";
|
descricao= "J_CARENTE";
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
descricao= "GRATUIDADE";
|
||||||
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
return "NIS";
|
descricao= "NIS";
|
||||||
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
return "PASSE_LIVRE";
|
descricao= "PASSELIVRE";
|
||||||
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
return "ID_JOVEM";
|
descricao= "ID_JOVEM";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return "";
|
descricao= "";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return descricao.length()> 10 ? descricao.substring(0,10) : descricao;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TipoIdentificacionDoc[] getTipoDocExcluindoCPF() {
|
public static TipoIdentificacionDoc[] getTipoDocExcluindoCPF() {
|
||||||
|
@ -181,7 +209,7 @@ public enum TipoIdentificacionDoc {
|
||||||
TipoIdentificacionDoc.DNI,
|
TipoIdentificacionDoc.DNI,
|
||||||
TipoIdentificacionDoc.RE_PM,
|
TipoIdentificacionDoc.RE_PM,
|
||||||
TipoIdentificacionDoc.NIS,
|
TipoIdentificacionDoc.NIS,
|
||||||
TipoIdentificacionDoc.PASSE_LIVRE,
|
TipoIdentificacionDoc.PASSELIVRE,
|
||||||
TipoIdentificacionDoc.ID_JOVEM,
|
TipoIdentificacionDoc.ID_JOVEM,
|
||||||
TipoIdentificacionDoc.D_FISICO,
|
TipoIdentificacionDoc.D_FISICO,
|
||||||
TipoIdentificacionDoc.J_CARENTE
|
TipoIdentificacionDoc.J_CARENTE
|
||||||
|
@ -216,8 +244,10 @@ public enum TipoIdentificacionDoc {
|
||||||
return TipoIdentificacionDoc.RE_PM;
|
return TipoIdentificacionDoc.RE_PM;
|
||||||
}else if(descTipoDoc.equals("NIS")) {
|
}else if(descTipoDoc.equals("NIS")) {
|
||||||
return TipoIdentificacionDoc.NIS;
|
return TipoIdentificacionDoc.NIS;
|
||||||
}else if(descTipoDoc.equals("PASSE_LIVRE")) {
|
}
|
||||||
return TipoIdentificacionDoc.PASSE_LIVRE;
|
// mantendo a retrocompatibilidade
|
||||||
|
else if(descTipoDoc.equals("PASSE_LIVRE") || descTipoDoc.equals("PASSELIVRE")) {
|
||||||
|
return TipoIdentificacionDoc.PASSELIVRE;
|
||||||
}else if(descTipoDoc.equals("ID_JOVEM")) {
|
}else if(descTipoDoc.equals("ID_JOVEM")) {
|
||||||
return TipoIdentificacionDoc.ID_JOVEM;
|
return TipoIdentificacionDoc.ID_JOVEM;
|
||||||
}else if(descTipoDoc.equals("D_FISICO")) {
|
}else if(descTipoDoc.equals("D_FISICO")) {
|
||||||
|
|
Loading…
Reference in New Issue