Merge pull request 'Inserido novo menu e tela Tipo de Documento. fixes bug #AL-4655' (!250) from AL-4655 into master

Reviewed-on: adm/ModelWeb#250
Reviewed-by: Valdir Cordeiro <valdir.cordeiro@totvs.com.br>
master
pinheiro 2024-08-14 19:47:09 +00:00
commit d56489469e
6 changed files with 68 additions and 2 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>ModelWeb</artifactId> <artifactId>ModelWeb</artifactId>
<version>1.94.0</version> <version>1.95.0</version>
<distributionManagement> <distributionManagement>
<repository> <repository>

View File

@ -8,4 +8,6 @@ public interface TipoIdentificacionDAO extends GenericDAO<TipoIdentificacion, In
public List<TipoIdentificacion> obtenerTodos(); public List<TipoIdentificacion> obtenerTodos();
public TipoIdentificacion buscarPorNome(String descTipoDoc);
} }

View File

@ -1,6 +1,8 @@
package com.rjconsultores.ventaboletos.dao.hibernate; package com.rjconsultores.ventaboletos.dao.hibernate;
import org.hibernate.Criteria;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -15,5 +17,13 @@ public class TipoIdentificacionHibernateDAO extends GenericHibernateDAO<TipoIden
public TipoIdentificacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { public TipoIdentificacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory); setSessionFactory(factory);
} }
@Override
public TipoIdentificacion buscarPorNome(String descTipoDoc) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("desctipo", descTipoDoc));
c.add(Restrictions.eq(ACTIVO, Boolean.TRUE));
return (TipoIdentificacion) c.uniqueResult();
}
} }

View File

@ -5,17 +5,22 @@ import java.util.Date;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
@Entity @Entity
@Table(name = "TIPO_IDENTIFICACION") @Table(name = "TIPO_IDENTIFICACION")
@SequenceGenerator(name = "TIPO_IDENTIFICACION_SEQ", sequenceName = "TIPO_IDENTIFICACION_SEQ", allocationSize = 1)
public class TipoIdentificacion implements Serializable { public class TipoIdentificacion implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Column(name = "TIPOIDENTIFICACION_ID") @Column(name = "TIPOIDENTIFICACION_ID")
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_IDENTIFICACION_SEQ")
private Integer tipoIdentificacionId; private Integer tipoIdentificacionId;
@Column(name = "DESCTIPO") @Column(name = "DESCTIPO")
@ -29,6 +34,9 @@ public class TipoIdentificacion implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Column(name = "INDEXIBECONFIRMACAOTOTALBUS")
private Boolean indExibeConfirmacaoTotalbus;
public Integer getTipoIdentificacionId() { public Integer getTipoIdentificacionId() {
return tipoIdentificacionId; return tipoIdentificacionId;
@ -75,6 +83,14 @@ public class TipoIdentificacion implements Serializable {
return getDesctipo(); return getDesctipo();
} }
public Boolean getIndExibeConfirmacaoTotalbus() {
return indExibeConfirmacaoTotalbus;
}
public void setIndExibeConfirmacaoTotalbus(Boolean indExibeConfirmacaoTotalbus) {
this.indExibeConfirmacaoTotalbus = indExibeConfirmacaoTotalbus;
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;

View File

@ -4,8 +4,16 @@ import java.util.List;
import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion;
public interface TipoIdentificacionService { public interface TipoIdentificacionService extends GenericService<TipoIdentificacion, Integer> {
public List<TipoIdentificacion> obtenerTodos(); public List<TipoIdentificacion> obtenerTodos();
public TipoIdentificacion suscribir(TipoIdentificacion tipoDocumento);
public void borrar(TipoIdentificacion tipoDocumento);
public TipoIdentificacion actualizacion(TipoIdentificacion tipoDocumento);
public TipoIdentificacion buscarPorNome(String descTipoDoc);
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.TipoIdentificacionDAO; import com.rjconsultores.ventaboletos.dao.TipoIdentificacionDAO;
import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion; import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion;
@ -20,4 +21,33 @@ public class TipoIdentificacionServiceImpl implements TipoIdentificacionService
return tipoIdentificacionDAO.obtenerTodos(); return tipoIdentificacionDAO.obtenerTodos();
} }
@Override
public TipoIdentificacion obtenerID(Integer id) {
return tipoIdentificacionDAO.obtenerID(id);
}
@Override
@Transactional
public TipoIdentificacion suscribir(TipoIdentificacion tipoDocumento) {
return tipoIdentificacionDAO.suscribir(tipoDocumento);
}
@Override
@Transactional
public void borrar(TipoIdentificacion tipoDocumento) {
tipoIdentificacionDAO.borrar(tipoDocumento);
}
@Override
@Transactional
public TipoIdentificacion actualizacion(TipoIdentificacion tipoDocumento) {
return tipoIdentificacionDAO.actualizacion(tipoDocumento);
}
@Override
public TipoIdentificacion buscarPorNome(String descTipoDoc) {
return tipoIdentificacionDAO.buscarPorNome(descTipoDoc);
}
} }