fixes bug#24678
qua: dev:Valdir git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@113559 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d092463f4f
commit
288c0b72fe
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
public interface PtovtaExcecaoMultaCancDAO extends GenericDAO<PtovtaExcecaoMultaCanc, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.PtovtaExcecaoMultaCancDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
@Repository("ptovtaExcecaoMultaCancHibernateDAO")
|
||||||
|
public class PtovtaExcecaoMultaCancHibernateDAO extends GenericHibernateDAO<PtovtaExcecaoMultaCanc, Integer> implements PtovtaExcecaoMultaCancDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PtovtaExcecaoMultaCancHibernateDAO(
|
||||||
|
@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,184 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
|
import org.hibernate.Hibernate;
|
||||||
|
|
||||||
|
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||||
|
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||||
|
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Valdevir
|
||||||
|
*/
|
||||||
|
@AuditarClasse(nome = "PtovtaExcecaoMultaCanc", tela = "Alteração Ponto de Venda/Excecao Multa Canc")
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "PTOVTA_EXCECAO_MULTA_CANC_SEQ", sequenceName = "PTOVTA_EXCECAO_MULTA_CANC_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "PTOVTA_EXCECAO_MULTA_CANC")
|
||||||
|
public class PtovtaExcecaoMultaCanc implements Serializable , Auditavel<PtovtaExcecaoMultaCanc> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTA_EXCECAO_MULTA_CANC_SEQ")
|
||||||
|
@Column(name = "PTOVTAEXCECAOMULTACANC_ID")
|
||||||
|
private Integer ptovtaExcecaoMultaCancId;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "PUNTOVENTA_ID")
|
||||||
|
private PuntoVenta puntoventa;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ORGAOCONCEDENTE_ID")
|
||||||
|
private OrgaoConcedente orgaoConcedente;
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private int usuarioId;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private PtovtaExcecaoMultaCanc ptovtaExcecaoMultaCancClone;
|
||||||
|
|
||||||
|
public PtovtaExcecaoMultaCanc() {
|
||||||
|
super();
|
||||||
|
this.activo = true;
|
||||||
|
this.fecmodif = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPtovtaExcecaoMultaCancId() {
|
||||||
|
return ptovtaExcecaoMultaCancId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancId(Integer ptovtaExcecaoMultaCancId) {
|
||||||
|
this.ptovtaExcecaoMultaCancId = ptovtaExcecaoMultaCancId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrgaoConcedente getOrgaoConcedente() {
|
||||||
|
return orgaoConcedente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
|
||||||
|
this.orgaoConcedente = orgaoConcedente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtovtaExcecaoMultaCanc getPtovtaExcecaoMultaCancClone() {
|
||||||
|
return ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancClone(PtovtaExcecaoMultaCanc ptovtaExcecaoMultaCancClone) {
|
||||||
|
this.ptovtaExcecaoMultaCancClone = ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PuntoVenta getPuntoventa() {
|
||||||
|
return puntoventa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoventa(PuntoVenta puntoventa) {
|
||||||
|
this.puntoventa = puntoventa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(int usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((ptovtaExcecaoMultaCancId == null) ? 0 : ptovtaExcecaoMultaCancId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (!(obj instanceof PtovtaExcecaoMultaCanc))
|
||||||
|
return false;
|
||||||
|
PtovtaExcecaoMultaCanc other = (PtovtaExcecaoMultaCanc) obj;
|
||||||
|
if (ptovtaExcecaoMultaCancId == null) {
|
||||||
|
if (other.ptovtaExcecaoMultaCancId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!ptovtaExcecaoMultaCancId.equals(other.ptovtaExcecaoMultaCancId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
ptovtaExcecaoMultaCancClone = new PtovtaExcecaoMultaCanc();
|
||||||
|
ptovtaExcecaoMultaCancClone = (PtovtaExcecaoMultaCanc) this.clone();
|
||||||
|
Hibernate.initialize(ptovtaExcecaoMultaCancClone.getPuntoventa());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PtovtaExcecaoMultaCanc getCloneObject() throws CloneNotSupportedException {
|
||||||
|
return ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTextoInclusaoExclusao() {
|
||||||
|
return String.format("ID [%s]", getPtovtaExcecaoMultaCancId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -32,7 +32,6 @@ import javax.persistence.TemporalType;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
import org.apache.commons.lang.BooleanUtils;
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
import org.hibernate.Hibernate;
|
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
|
@ -286,6 +285,12 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
@Where(clause = "activo = 1")
|
@Where(clause = "activo = 1")
|
||||||
private List<PtovtaAntifraude> ptovtaAntifraudes;
|
private List<PtovtaAntifraude> ptovtaAntifraudes;
|
||||||
|
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "PtovtaExcecaoMultaCanc")
|
||||||
|
@OneToMany(mappedBy = "puntoventa", cascade = CascadeType.ALL)
|
||||||
|
@LazyCollection(LazyCollectionOption.FALSE)
|
||||||
|
@Where(clause = "activo = 1")
|
||||||
|
private List<PtovtaExcecaoMultaCanc> ptovtaExcecaoMultaCancList;
|
||||||
|
|
||||||
@Column(name = "INDBLOQUEIATIPOPASSAGEM")
|
@Column(name = "INDBLOQUEIATIPOPASSAGEM")
|
||||||
private Boolean indBloqueiaTipoPassagem;
|
private Boolean indBloqueiaTipoPassagem;
|
||||||
|
|
||||||
|
@ -1194,6 +1199,12 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removePtovtaExcecaoMultaCanc(PtovtaExcecaoMultaCanc excecaoMulta){
|
||||||
|
if(this.ptovtaExcecaoMultaCancList != null) {
|
||||||
|
this.ptovtaExcecaoMultaCancList.remove(excecaoMulta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean getIndBloqueiaTipoPassagem() {
|
public Boolean getIndBloqueiaTipoPassagem() {
|
||||||
return BooleanUtils.toBoolean(indBloqueiaTipoPassagem);
|
return BooleanUtils.toBoolean(indBloqueiaTipoPassagem);
|
||||||
}
|
}
|
||||||
|
@ -1259,6 +1270,16 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
this.indBloqueiaCancelamentoBilheteImpresso = indBloqueiaCancelamentoBilheteImpresso;
|
this.indBloqueiaCancelamentoBilheteImpresso = indBloqueiaCancelamentoBilheteImpresso;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<PtovtaExcecaoMultaCanc> getPtovtaExcecaoMultaCancList() {
|
||||||
|
return ptovtaExcecaoMultaCancList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancList(List<PtovtaExcecaoMultaCanc> ptovtaExcecaoMultaCanc) {
|
||||||
|
this.ptovtaExcecaoMultaCancList = ptovtaExcecaoMultaCanc;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clonar() throws CloneNotSupportedException {
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
public interface PtovtaExcecaoMultaCancService extends GenericService<PtovtaExcecaoMultaCanc, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.PtovtaExcecaoMultaCancDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
import com.rjconsultores.ventaboletos.service.PtovtaExcecaoMultaCancService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("ptovtaExcecaoMultaCancService")
|
||||||
|
public class PtovtaExcecaoMultaCancServiceImpl implements PtovtaExcecaoMultaCancService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PtovtaExcecaoMultaCancDAO ptovtaExcecaoMultaCancDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PtovtaExcecaoMultaCanc> obtenerTodos() {
|
||||||
|
return ptovtaExcecaoMultaCancDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PtovtaExcecaoMultaCanc obtenerID(Integer id) {
|
||||||
|
return ptovtaExcecaoMultaCancDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaExcecaoMultaCanc suscribir(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setActivo(true);
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return ptovtaExcecaoMultaCancDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaExcecaoMultaCanc actualizacion(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return ptovtaExcecaoMultaCancDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setActivo(false);
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
ptovtaExcecaoMultaCancDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -435,9 +435,11 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
PuntoVenta originalClone = null;
|
PuntoVenta originalClone = null;
|
||||||
try {
|
try {
|
||||||
originalClone = entidad.getCloneObject();
|
originalClone = entidad.getCloneObject();
|
||||||
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
|
if(entidad.getTitularId()!=null) {
|
||||||
|
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("",e);
|
log.error("Erro ao clonar TitularId",e);
|
||||||
}
|
}
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
|
Loading…
Reference in New Issue