Portal intento arreglar batchUpdateException

This commit is contained in:
cruales 2023-02-13 12:44:59 -05:00
parent 435755380d
commit 7d50c36123
26 changed files with 101 additions and 95 deletions

View File

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Sun Feb 12 21:25:08 ECT 2023 #Mon Feb 13 12:18:59 ECT 2023
version=2.1 version=2.1
groupId=com.fp.armas groupId=com.fp.armas
artifactId=portal-ear artifactId=portal-ear

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -48,9 +48,9 @@ public class GenericDaoImpl<T extends Serializable> implements GenericDao<T>{
public void create(T entity) throws DaoException { public void create(T entity) throws DaoException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try{ try{
this.getEntityManager().clear(); //this.getEntityManager().clear();
this.getEntityManager().persist(entity); this.getEntityManager().persist(entity);
this.getEntityManager().flush(); //this.getEntityManager().flush();
} catch(PersistenceException e){ } catch(PersistenceException e){
throw transformDaoException(e); throw transformDaoException(e);
} catch (Throwable e) { } catch (Throwable e) {
@ -62,9 +62,9 @@ public class GenericDaoImpl<T extends Serializable> implements GenericDao<T>{
public void update(T entity) throws DaoException { public void update(T entity) throws DaoException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try { try {
this.getEntityManager().clear(); //this.getEntityManager().clear();
this.getEntityManager().merge(entity); this.getEntityManager().merge(entity);
this.getEntityManager().flush(); //this.getEntityManager().flush();
} catch(PersistenceException e){ } catch(PersistenceException e){
throw transformDaoException(e); throw transformDaoException(e);
} catch (Throwable e) { } catch (Throwable e) {
@ -76,9 +76,9 @@ public class GenericDaoImpl<T extends Serializable> implements GenericDao<T>{
public void delete(T entity) throws DaoException { public void delete(T entity) throws DaoException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try{ try{
this.getEntityManager().clear(); //this.getEntityManager().clear();
this.getEntityManager().remove(this.getEntityManager().contains(entity) ? entity : this.getEntityManager().merge(entity)); this.getEntityManager().remove(this.getEntityManager().contains(entity) ? entity : this.getEntityManager().merge(entity));
this.getEntityManager().flush(); //this.getEntityManager().flush();
} catch(PersistenceException e){ } catch(PersistenceException e){
throw transformDaoException(e); throw transformDaoException(e);
} catch (Throwable e) { } catch (Throwable e) {

View File

@ -11,14 +11,13 @@ import java.util.Date;
* The persistent class for the TCUSTCOMPANY database table. * The persistent class for the TCUSTCOMPANY database table.
* *
*/ */
@Entity(name = "Tcustcompany")
@Table(name = "TCUSTCOMPANY")
public class Tcustcompany implements Serializable { public class Tcustcompany implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@EmbeddedId @EmbeddedId
private TcustcompanyPK id; private TcustcompanyPK id;
@Column(name = "BUSINESSCLASSCATALOG", nullable = true)
private String businessclasscatalog; private String businessclasscatalog;
private String businessclasscatalogcode; private String businessclasscatalogcode;

View File

@ -2,6 +2,7 @@ package com.fp.armas.portal.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Objects;
import javax.persistence.*; import javax.persistence.*;
@ -15,7 +16,7 @@ public class TcustcompanyPK implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column @Column
private long personcode; private Long personcode;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private java.util.Date dateto; private java.util.Date dateto;
@ -23,7 +24,7 @@ public class TcustcompanyPK implements Serializable {
public TcustcompanyPK() { public TcustcompanyPK() {
} }
public TcustcompanyPK(long personcode, Date dateto) { public TcustcompanyPK(Long personcode, Date dateto) {
super(); super();
this.personcode = personcode; this.personcode = personcode;
this.dateto = dateto; this.dateto = dateto;
@ -31,10 +32,10 @@ public class TcustcompanyPK implements Serializable {
public long getPersoncode() { public Long getPersoncode() {
return this.personcode; return this.personcode;
} }
public void setPersoncode(long personcode) { public void setPersoncode(Long personcode) {
this.personcode = personcode; this.personcode = personcode;
} }
public java.util.Date getDateto() { public java.util.Date getDateto() {
@ -53,15 +54,15 @@ public class TcustcompanyPK implements Serializable {
} }
TcustcompanyPK castOther = (TcustcompanyPK)other; TcustcompanyPK castOther = (TcustcompanyPK)other;
return return
(this.personcode == castOther.personcode) (Objects.equals(this.personcode, castOther.personcode))
&& this.dateto.equals(castOther.dateto); && this.dateto.equals(castOther.dateto);
} }
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int hash = 17; int hash = 17;
hash = hash * prime + ((int) (this.personcode ^ (this.personcode >>> 32))); hash = hash * prime + ((int) (this.personcode ^ (this.personcode >>> 32)));
hash = hash * prime + this.dateto.hashCode(); hash = hash * prime + this.dateto.hashCode();
return hash; return hash;
} }

View File

@ -2,6 +2,7 @@ package com.fp.armas.portal.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Objects;
import javax.persistence.*; import javax.persistence.*;
@ -15,7 +16,7 @@ public class TcustpersondetailPK implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column @Column
private long personcode; private Long personcode;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private java.util.Date dateto; private java.util.Date dateto;
@ -23,7 +24,7 @@ public class TcustpersondetailPK implements Serializable {
public TcustpersondetailPK() { public TcustpersondetailPK() {
} }
public TcustpersondetailPK(long personcode, Date dateto) { public TcustpersondetailPK(Long personcode, Date dateto) {
super(); super();
this.personcode = personcode; this.personcode = personcode;
this.dateto = dateto; this.dateto = dateto;
@ -31,10 +32,10 @@ public class TcustpersondetailPK implements Serializable {
public long getPersoncode() { public Long getPersoncode() {
return this.personcode; return this.personcode;
} }
public void setPersoncode(long personcode) { public void setPersoncode(Long personcode) {
this.personcode = personcode; this.personcode = personcode;
} }
public java.util.Date getDateto() { public java.util.Date getDateto() {
@ -53,15 +54,16 @@ public class TcustpersondetailPK implements Serializable {
} }
TcustpersondetailPK castOther = (TcustpersondetailPK)other; TcustpersondetailPK castOther = (TcustpersondetailPK)other;
return return
(this.personcode == castOther.personcode) (Objects.equals(this.personcode, castOther.personcode))
&& this.dateto.equals(castOther.dateto); && this.dateto.equals(castOther.dateto);
} }
@Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int hash = 17; int hash = 17;
hash = hash * prime + ((int) (this.personcode ^ (this.personcode >>> 32))); hash = hash * prime + ((int) (this.personcode ^ (this.personcode >>> 32)));
hash = hash * prime + this.dateto.hashCode(); hash = hash * prime + this.dateto.hashCode();
return hash; return hash;
} }

View File

@ -2,7 +2,7 @@ package com.fp.armas.portal.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
import java.util.Set; import java.util.Set;
/** /**

View File

@ -324,7 +324,7 @@ public class RegistroBean {
Tcustpersonphone telefonoCelular, Tcustpeople adicionalPersona, Tcustcompany compania, Tgenefilesdetail foto) throws RegistroException { Tcustpersonphone telefonoCelular, Tcustpeople adicionalPersona, Tcustcompany compania, Tgenefilesdetail foto) throws RegistroException {
try { try {
Tcustperson personaExistente = null; Tcustperson personaExistente = null;
if(persona.getId() != null && persona.getId().getPersoncode() != 0){ if(persona.getId() != null && persona.getId().getPersoncode() != 0 && persona.getId().getPersoncode() == null){
personaExistente = personaDao.buscarPorId(persona.getId().getPersoncode()); personaExistente = personaDao.buscarPorId(persona.getId().getPersoncode());
} }
if(personaExistente == null){ if(personaExistente == null){
@ -390,7 +390,8 @@ public class RegistroBean {
public Tcustcompany obtenerCompania(Integer personcode) throws RegistroException{ public Tcustcompany obtenerCompania(Integer personcode) throws RegistroException{
try { try {
TcustcompanyPK pk = new TcustcompanyPK(); TcustcompanyPK pk = new TcustcompanyPK();
pk.setPersoncode(personcode);
pk.setPersoncode(Long.valueOf(personcode.toString()));
pk.setDateto(FechaUtil.obtenerFecha(2999, 11, 31)); pk.setDateto(FechaUtil.obtenerFecha(2999, 11, 31));
return companiaDao.buscarPorId(pk); return companiaDao.buscarPorId(pk);
} catch (Throwable e) { } catch (Throwable e) {
@ -737,7 +738,7 @@ public class RegistroBean {
if(!persona.getIdentificationcatalog().equals(PortalMessages.getInstancia().getString("catalogo.codigo.detalle.id.ruc"))){ if(!persona.getIdentificationcatalog().equals(PortalMessages.getInstancia().getString("catalogo.codigo.detalle.id.ruc"))){
return; return;
} }
if(compania.getId() == null || compania.getId().getPersoncode() == 0){ if(compania.getId() == null || compania.getId().getPersoncode() == 0 || compania.getId().getPersoncode() == null){
compania.setId(new TcustcompanyPK()); compania.setId(new TcustcompanyPK());
compania.getId().setDateto(FechaUtil.obtenerFecha(2999, 11, 31)); compania.getId().setDateto(FechaUtil.obtenerFecha(2999, 11, 31));
compania.getId().setPersoncode(persona.getId().getPersoncode()); compania.getId().setPersoncode(persona.getId().getPersoncode());
@ -745,7 +746,8 @@ public class RegistroBean {
compania.setLogo(guardaFoto(foto)); compania.setLogo(guardaFoto(foto));
compania.setRecordversion(0L); compania.setRecordversion(0L);
compania.setIngressuser(PortalMessages.getInstancia().getString("usuario.registro")); compania.setIngressuser(PortalMessages.getInstancia().getString("usuario.registro"));
companiaDao.create(compania);
companiaDao.create(compania);
} else{ } else{
Tcustcompany companiaAnterior = companiaDao.buscarPorId(new TcustcompanyPK(compania.getId().getPersoncode(), compania.getId().getDateto())); Tcustcompany companiaAnterior = companiaDao.buscarPorId(new TcustcompanyPK(compania.getId().getPersoncode(), compania.getId().getDateto()));
if(companiaAnterior != null){ if(companiaAnterior != null){

View File

@ -14,7 +14,7 @@
</attributes> </attributes>
</entity> </entity>
<!--
<entity class="Tcustpersondetail" name="Tcustpersondetail" access="FIELD"> <entity class="Tcustpersondetail" name="Tcustpersondetail" access="FIELD">
<table name="Tcustpersondetail"/> <table name="Tcustpersondetail"/>
<attributes> <attributes>
@ -23,7 +23,7 @@
</basic> </basic>
</attributes> </attributes>
</entity>--> </entity>
<entity class="Tcustcompany" name="Tcustcompany" access="FIELD"> <entity class="Tcustcompany" name="Tcustcompany" access="FIELD">
<table name="Tcustpersondetail"/> <table name="Tcustpersondetail"/>
<attributes> <attributes>

View File

@ -1,42 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <persistence-unit name="portalPU" transaction-type="JTA">
xsi:schemaLocation=" <provider>org.hibernate.ejb.HibernatePersistence</provider>
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="portalPU">
<!-- If you are running in a production environment, add a managed <!-- If you are running in a production environment, add a managed
data source, this example data source is just for development and testing! --> data source, this example data source is just for development and testing! -->
<!-- The datasource is deployed as <EAR>/META-INF/portal-ds.xml, you <!-- The datasource is deployed as <EAR>/META-INF/portal-ds.xml, you
can find it in the source at ear/src/main/application/META-INF/portal-ds.xml --> can find it in the source at ear/src/main/application/META-INF/portal-ds.xml -->
<jta-data-source>java:jboss/datasources/FLIPDS1</jta-data-source> <jta-data-source>java:jboss/datasources/FLIPDS1</jta-data-source>
<mapping-file>META-INF/ormPortal.xml</mapping-file> <mapping-file>META-INF/ormPortal.xml</mapping-file>
<class>com.fp.armas.portal.model.Tgenecatalog</class>
<class>com.fp.armas.portal.model.Tgenecatalog</class> <class>com.fp.armas.portal.model.Tgenecatalogdetail</class>
<class>com.fp.armas.portal.model.Tgenecatalogdetail</class> <class>com.fp.armas.portal.model.TgenecatalogdetailPK</class>
<class>com.fp.armas.portal.model.TgenecatalogdetailPK</class> <class>com.fp.armas.portal.model.Tgeneactivity</class>
<class>com.fp.armas.portal.model.Tgeneactivity</class> <class>com.fp.armas.portal.model.Tcustpeople</class>
<class>com.fp.armas.portal.model.Tcustpeople</class> <class>com.fp.armas.portal.model.TcustpeoplePK</class>
<class>com.fp.armas.portal.model.TcustpeoplePK</class> <class>com.fp.armas.portal.model.Tgenesequence</class>
<class>com.fp.armas.portal.model.Tgenesequence</class> <class>com.fp.armas.portal.model.TcustcompanyPK</class>
<class>com.fp.armas.portal.model.Tcustcompany</class> <class>com.fp.armas.portal.model.Tgenefile</class>
<class>com.fp.armas.portal.model.TcustcompanyPK</class> <class>com.fp.armas.portal.model.Tgenefilesdetail</class>
<class>com.fp.armas.portal.model.Tgenefile</class> <class>com.fp.armas.portal.model.TgenefilesdetailPK</class>
<class>com.fp.armas.portal.model.Tgenefilesdetail</class> <class>com.fp.armas.portal.model.Tcustpersondetail</class>
<class>com.fp.armas.portal.model.TgenefilesdetailPK</class> <class>com.fp.armas.portal.model.Tcustcompany</class>
<class>com.fp.armas.portal.model.Tcustpersondetail</class> <properties>
<properties>
<property name="hibernate.default_schema" value="comaco"/> <property name="hibernate.default_schema" value="comaco"/>
<property name="hibernate.show_sql" value="true"/> <property name="hibernate.show_sql" value="true"/>
<property name="hibernate.connection.autocommit" value="false"/> <property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.jdbc.fetch_size" value="50"/> <property name="hibernate.jdbc.fetch_size" value="50"/>
<property name="hibernate.jdbc.batch_size" value="200"/> <property name="hibernate.jdbc.batch_size" value="200"/>
<!-- Properties for Hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.id.new_generator_mappings" value="false" /> <!--property name="hibernate.ejb.cfgfile" value="hibernateFlipMapping.cfg.xml"/-->
<!-- Para hibernate 4 -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value = "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> <property name="hibernate.transaction.jta.platform" value = "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
<!--hibernate 3.xx property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /-->
</properties> </properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>

View File

@ -14,7 +14,7 @@
</attributes> </attributes>
</entity> </entity>
<!--
<entity class="Tcustpersondetail" name="Tcustpersondetail" access="FIELD"> <entity class="Tcustpersondetail" name="Tcustpersondetail" access="FIELD">
<table name="Tcustpersondetail"/> <table name="Tcustpersondetail"/>
<attributes> <attributes>
@ -23,7 +23,7 @@
</basic> </basic>
</attributes> </attributes>
</entity>--> </entity>
<entity class="Tcustcompany" name="Tcustcompany" access="FIELD"> <entity class="Tcustcompany" name="Tcustcompany" access="FIELD">
<table name="Tcustpersondetail"/> <table name="Tcustpersondetail"/>
<attributes> <attributes>

View File

@ -1,42 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <persistence-unit name="portalPU" transaction-type="JTA">
xsi:schemaLocation=" <provider>org.hibernate.ejb.HibernatePersistence</provider>
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="portalPU">
<!-- If you are running in a production environment, add a managed <!-- If you are running in a production environment, add a managed
data source, this example data source is just for development and testing! --> data source, this example data source is just for development and testing! -->
<!-- The datasource is deployed as <EAR>/META-INF/portal-ds.xml, you <!-- The datasource is deployed as <EAR>/META-INF/portal-ds.xml, you
can find it in the source at ear/src/main/application/META-INF/portal-ds.xml --> can find it in the source at ear/src/main/application/META-INF/portal-ds.xml -->
<jta-data-source>java:jboss/datasources/FLIPDS1</jta-data-source> <jta-data-source>java:jboss/datasources/FLIPDS1</jta-data-source>
<mapping-file>META-INF/ormPortal.xml</mapping-file> <mapping-file>META-INF/ormPortal.xml</mapping-file>
<class>com.fp.armas.portal.model.Tgenecatalog</class>
<class>com.fp.armas.portal.model.Tgenecatalog</class> <class>com.fp.armas.portal.model.Tgenecatalogdetail</class>
<class>com.fp.armas.portal.model.Tgenecatalogdetail</class> <class>com.fp.armas.portal.model.TgenecatalogdetailPK</class>
<class>com.fp.armas.portal.model.TgenecatalogdetailPK</class> <class>com.fp.armas.portal.model.Tgeneactivity</class>
<class>com.fp.armas.portal.model.Tgeneactivity</class> <class>com.fp.armas.portal.model.Tcustpeople</class>
<class>com.fp.armas.portal.model.Tcustpeople</class> <class>com.fp.armas.portal.model.TcustpeoplePK</class>
<class>com.fp.armas.portal.model.TcustpeoplePK</class> <class>com.fp.armas.portal.model.Tgenesequence</class>
<class>com.fp.armas.portal.model.Tgenesequence</class> <class>com.fp.armas.portal.model.TcustcompanyPK</class>
<class>com.fp.armas.portal.model.Tcustcompany</class> <class>com.fp.armas.portal.model.Tgenefile</class>
<class>com.fp.armas.portal.model.TcustcompanyPK</class> <class>com.fp.armas.portal.model.Tgenefilesdetail</class>
<class>com.fp.armas.portal.model.Tgenefile</class> <class>com.fp.armas.portal.model.TgenefilesdetailPK</class>
<class>com.fp.armas.portal.model.Tgenefilesdetail</class> <class>com.fp.armas.portal.model.Tcustpersondetail</class>
<class>com.fp.armas.portal.model.TgenefilesdetailPK</class> <class>com.fp.armas.portal.model.Tcustcompany</class>
<class>com.fp.armas.portal.model.Tcustpersondetail</class> <properties>
<properties>
<property name="hibernate.default_schema" value="comaco"/> <property name="hibernate.default_schema" value="comaco"/>
<property name="hibernate.show_sql" value="true"/> <property name="hibernate.show_sql" value="true"/>
<property name="hibernate.connection.autocommit" value="false"/> <property name="hibernate.connection.autocommit" value="false"/>
<property name="hibernate.jdbc.fetch_size" value="50"/> <property name="hibernate.jdbc.fetch_size" value="50"/>
<property name="hibernate.jdbc.batch_size" value="200"/> <property name="hibernate.jdbc.batch_size" value="200"/>
<!-- Properties for Hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.id.new_generator_mappings" value="false" /> <!--property name="hibernate.ejb.cfgfile" value="hibernateFlipMapping.cfg.xml"/-->
<!-- Para hibernate 4 -->
<property name="hibernate.id.new_generator_mappings" value="false" />
<property name="hibernate.transaction.jta.platform" value = "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> <property name="hibernate.transaction.jta.platform" value = "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
<!--hibernate 3.xx property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /-->
</properties> </properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>

View File

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Sun Feb 12 21:25:06 ECT 2023 #Mon Feb 13 12:18:57 ECT 2023
version=2.1 version=2.1
groupId=com.fp.armas groupId=com.fp.armas
artifactId=portal-ejb artifactId=portal-ejb

Binary file not shown.

View File

@ -335,8 +335,8 @@ public class RegistroController extends BaseController implements Serializable {
* @param personaDetalle * @param personaDetalle
*/ */
private void completaDatosCompania(Tcustpersondetail personaDetalle) { private void completaDatosCompania(Tcustpersondetail personaDetalle) {
if(personaDetalle.getId()!=null && personaDetalle.getId().getPersoncode()>0){ if(personaDetalle.getId()!=null && personaDetalle.getId().getPersoncode()>0 && personaDetalle.getId().getPersoncode()!= null){
registroDataManager.setCompania(portalService.obtenerCompaniaPorId((int)personaDetalle.getId().getPersoncode())); registroDataManager.setCompania(portalService.obtenerCompaniaPorId(personaDetalle.getId().getPersoncode().intValue()));
if(registroDataManager.getCompania()!=null && registroDataManager.getCompania().getId()!=null && registroDataManager.getCompania().getId().getPersoncode()>0 && registroDataManager.getCompania().getLogo()!=null){ if(registroDataManager.getCompania()!=null && registroDataManager.getCompania().getId()!=null && registroDataManager.getCompania().getId().getPersoncode()>0 && registroDataManager.getCompania().getLogo()!=null){
Tgenefilesdetail tgenefilesdetail= portalService.obtenerImagen(registroDataManager.getCompania().getLogo()); Tgenefilesdetail tgenefilesdetail= portalService.obtenerImagen(registroDataManager.getCompania().getLogo());
if(tgenefilesdetail!=null && tgenefilesdetail.getImage()!=null){ if(tgenefilesdetail!=null && tgenefilesdetail.getImage()!=null){
@ -354,8 +354,8 @@ public class RegistroController extends BaseController implements Serializable {
* @param personaDetalle * @param personaDetalle
*/ */
private void completaDatosPersonaNatural(Tcustpersondetail personaDetalle){ private void completaDatosPersonaNatural(Tcustpersondetail personaDetalle){
if(personaDetalle.getId() != null && personaDetalle.getId().getPersoncode() != 0){ if(personaDetalle.getId() != null && personaDetalle.getId().getPersoncode() != 0 && personaDetalle.getId().getPersoncode() != null){
registroDataManager.setAdicionalPersona(portalService.obtenerPersonaNaturalPorId((int)personaDetalle.getId().getPersoncode())); registroDataManager.setAdicionalPersona(portalService.obtenerPersonaNaturalPorId(personaDetalle.getId().getPersoncode().intValue()));
} }
} }
@ -392,21 +392,21 @@ public class RegistroController extends BaseController implements Serializable {
*/ */
private void completaDatosGenerales(Tcustpersondetail personaDetalle){ private void completaDatosGenerales(Tcustpersondetail personaDetalle){
if(personaDetalle != null){ if(personaDetalle != null){
Tcustpersonaddress direccionPrincipal = portalService.obtenerDireccionPrincipal((int)personaDetalle.getId().getPersoncode()); Tcustpersonaddress direccionPrincipal = portalService.obtenerDireccionPrincipal((int)personaDetalle.getId().getPersoncode().intValue());
if(direccionPrincipal == null){ if(direccionPrincipal == null){
registroDataManager.setDireccionPersona(new Tcustpersonaddress()); registroDataManager.setDireccionPersona(new Tcustpersonaddress());
registroDataManager.getDireccionPersona().setAddresstypecatalog(TIPO_DIRECCION); registroDataManager.getDireccionPersona().setAddresstypecatalog(TIPO_DIRECCION);
} else{ } else{
registroDataManager.setDireccionPersona(direccionPrincipal); registroDataManager.setDireccionPersona(direccionPrincipal);
} }
Tcustpersonaddress mail = portalService.obtenerCorreo((int)personaDetalle.getId().getPersoncode());; Tcustpersonaddress mail = portalService.obtenerCorreo((int)personaDetalle.getId().getPersoncode().intValue());
if(mail == null){ if(mail == null){
this.registroDataManager.getCorreoPersona().setAddresstypecatalogcode(TIPO_DIRECCION); this.registroDataManager.getCorreoPersona().setAddresstypecatalogcode(TIPO_DIRECCION);
this.registroDataManager.getCorreoPersona().setAddresstypecatalog("3"); this.registroDataManager.getCorreoPersona().setAddresstypecatalog("3");
} else{ } else{
registroDataManager.setCorreoPersona(mail); registroDataManager.setCorreoPersona(mail);
} }
Tcustpersonphone telefonoFijo = portalService.obtenerTelefonoFijo((int)personaDetalle.getId().getPersoncode()); Tcustpersonphone telefonoFijo = portalService.obtenerTelefonoFijo(personaDetalle.getId().getPersoncode().intValue());
if(telefonoFijo == null){ if(telefonoFijo == null){
this.registroDataManager.setTelefonoPersona(new Tcustpersonphone()); this.registroDataManager.setTelefonoPersona(new Tcustpersonphone());
this.registroDataManager.getTelefonoPersona().setAddressnumber(1L); this.registroDataManager.getTelefonoPersona().setAddressnumber(1L);
@ -415,7 +415,7 @@ public class RegistroController extends BaseController implements Serializable {
} else{ } else{
registroDataManager.setTelefonoPersona(telefonoFijo); registroDataManager.setTelefonoPersona(telefonoFijo);
} }
Tcustpersonphone telefonoCelular = portalService.obtenerTelefonoCelular((int)personaDetalle.getId().getPersoncode()); Tcustpersonphone telefonoCelular = portalService.obtenerTelefonoCelular(personaDetalle.getId().getPersoncode().intValue());
if(telefonoCelular == null){ if(telefonoCelular == null){
this.registroDataManager.setTelefonoCelular(new Tcustpersonphone()); this.registroDataManager.setTelefonoCelular(new Tcustpersonphone());
this.registroDataManager.getTelefonoCelular().setAddressnumber(2L); this.registroDataManager.getTelefonoCelular().setAddressnumber(2L);

View File

@ -1,5 +1,5 @@
#Generated by Maven #Generated by Maven
#Sun Feb 12 21:25:07 ECT 2023 #Mon Feb 13 12:18:58 ECT 2023
version=2.1 version=2.1
groupId=com.fp.armas groupId=com.fp.armas
artifactId=portal-web artifactId=portal-web

Binary file not shown.