bug#20778
dev:wilian qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Outros/Auditador/trunk@104311 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
89ea4fae2d
commit
6539ddd920
|
@ -369,15 +369,15 @@ public class Auditador {
|
||||||
if(valor instanceof Number) {
|
if(valor instanceof Number) {
|
||||||
return Integer.valueOf(valor.toString());
|
return Integer.valueOf(valor.toString());
|
||||||
}
|
}
|
||||||
Long idEntidade = getIdEntidade(valor);
|
String idEntidade = getIdEntidade(valor);
|
||||||
if(idEntidade != null) {
|
if(StringUtils.isNotBlank(idEntidade)) {
|
||||||
return Integer.valueOf(idEntidade.toString());
|
return Integer.valueOf(idEntidade);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Long getIdEntidade(Object objeto) throws IllegalArgumentException, IllegalAccessException {
|
protected String getIdEntidade(Object objeto) throws IllegalArgumentException, IllegalAccessException {
|
||||||
Class<?> classe = objeto.getClass();
|
Class<?> classe = objeto.getClass();
|
||||||
Field[] campos = classe.getDeclaredFields();
|
Field[] campos = classe.getDeclaredFields();
|
||||||
for (Field field : campos) {
|
for (Field field : campos) {
|
||||||
|
@ -386,7 +386,7 @@ public class Auditador {
|
||||||
if(auditarID != null) {
|
if(auditarID != null) {
|
||||||
Object valor = field.get(objeto);
|
Object valor = field.get(objeto);
|
||||||
if(valor instanceof Number) {
|
if(valor instanceof Number) {
|
||||||
return Long.valueOf(valor.toString());
|
return valor.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class AuditadorObjects implements Cloneable {
|
||||||
private String tela;
|
private String tela;
|
||||||
private Integer empresaId;
|
private Integer empresaId;
|
||||||
private AuditadorTipoAlteracao tipoAlteracao;
|
private AuditadorTipoAlteracao tipoAlteracao;
|
||||||
private Long idAuditado;
|
private String idAuditado;
|
||||||
|
|
||||||
public String getValorAnterior() {
|
public String getValorAnterior() {
|
||||||
return valorAnterior;
|
return valorAnterior;
|
||||||
|
@ -78,11 +78,11 @@ public class AuditadorObjects implements Cloneable {
|
||||||
this.tipoAlteracao = tipoAlteracao;
|
this.tipoAlteracao = tipoAlteracao;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getIdAuditado() {
|
public String getIdAuditado() {
|
||||||
return idAuditado;
|
return idAuditado;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdAuditado(Long idAuditado) {
|
public void setIdAuditado(String idAuditado) {
|
||||||
this.idAuditado = idAuditado;
|
this.idAuditado = idAuditado;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue