fixes bug#24412

qua:
dev:

Criado os mapeamentos de log de auditorias, para o menu/abas de ponto de venda

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@112005 d1611594-4594-4d17-8e1d-87c2c4800839
master
walace 2022-04-26 13:24:10 +00:00
parent fa101240c1
commit 8e46e7b0c1
37 changed files with 1273 additions and 188 deletions

View File

@ -17,11 +17,17 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@Entity @Entity
@SequenceGenerator(name = "ALIQUOTAESTADODESTINO_SEQ", sequenceName = "ALIQUOTAESTADODESTINO_SEQ", allocationSize = 1) @SequenceGenerator(name = "ALIQUOTAESTADODESTINO_SEQ", sequenceName = "ALIQUOTAESTADODESTINO_SEQ", allocationSize = 1)
@Table(name = "ALIQUOTA_ESTADO_DESTINO") @Table(name = "ALIQUOTA_ESTADO_DESTINO")
public class AliquotaEstadoDestino implements Serializable { public class AliquotaEstadoDestino implements Serializable, Auditavel<AliquotaEstadoDestino> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -50,6 +56,11 @@ public class AliquotaEstadoDestino implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Transient
@NaoAuditar
private AliquotaEstadoDestino aliquotaEstadoDestinoClone;
@Override @Override
@ -119,5 +130,24 @@ public class AliquotaEstadoDestino implements Serializable {
public void setUsuarioId(Integer usuarioId) { public void setUsuarioId(Integer usuarioId) {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@Override
public void clonar() throws CloneNotSupportedException {
aliquotaEstadoDestinoClone = new AliquotaEstadoDestino();
aliquotaEstadoDestinoClone = (AliquotaEstadoDestino) this.clone();
Hibernate.initialize(aliquotaEstadoDestinoClone.getEmpresaImposto());
}
@Override
public AliquotaEstadoDestino getCloneObject() throws CloneNotSupportedException {
return aliquotaEstadoDestinoClone;
}
@Override
public String getTextoInclusaoExclusao() {
// TODO Auto-generated method stub
return null;
}
} }

View File

@ -29,6 +29,8 @@ import javax.persistence.TemporalType;
import com.rjconsultores.ventaboletos.enums.TipoDescontoBPe; import com.rjconsultores.ventaboletos.enums.TipoDescontoBPe;
import com.rjconsultores.ventaboletos.enums.TipoDescontoMonitrip; import com.rjconsultores.ventaboletos.enums.TipoDescontoMonitrip;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
/** /**
* *
* @author Administrador * @author Administrador
@ -68,6 +70,7 @@ public class Categoria implements Serializable {
private GrupoCategoria grupoCategoria; private GrupoCategoria grupoCategoria;
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL) @OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
@AuditarLista(auditarEntidades = true, nome = "Categoria Orgao")
private List<OrgaoConcedente> orgaosConcedentes; private List<OrgaoConcedente> orgaosConcedentes;
@Column(name = "INDCONFERENCIAFISICACOMISSAO") @Column(name = "INDCONFERENCIAFISICACOMISSAO")

View File

@ -10,11 +10,19 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
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;
@AuditarClasse(nome = "CategoriaBloqueioImpPosterior", tela = "Alteração Ponto de Venda/Categoria/Bloqueio/ImpPosterior")
@Entity @Entity
@SequenceGenerator(name = "CAT_BLOQ_IMPPOSTERIOR_SEQ", sequenceName = "CAT_BLOQ_IMPPOSTERIOR_SEQ", allocationSize = 1) @SequenceGenerator(name = "CAT_BLOQ_IMPPOSTERIOR_SEQ", sequenceName = "CAT_BLOQ_IMPPOSTERIOR_SEQ", allocationSize = 1)
@Table(name = "CATEGORIA_BLOQ_IMPPOSTERIOR") @Table(name = "CATEGORIA_BLOQ_IMPPOSTERIOR")
public class CategoriaBloqueioImpPosterior { public class CategoriaBloqueioImpPosterior implements Auditavel<CategoriaBloqueioImpPosterior> {
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CAT_BLOQ_IMPPOSTERIOR_SEQ") @GeneratedValue(strategy = GenerationType.AUTO, generator = "CAT_BLOQ_IMPPOSTERIOR_SEQ")
@ -26,6 +34,11 @@ public class CategoriaBloqueioImpPosterior {
@ManyToOne() @ManyToOne()
@JoinColumn(name = "CATEGORIA_ID") @JoinColumn(name = "CATEGORIA_ID")
private Categoria categoria; private Categoria categoria;
@Transient
@NaoAuditar
private CategoriaBloqueioImpPosterior categoriaBloqueioImpPosteriorClone;
public Integer getCategoriaBloqueioImpPosteriorId() { public Integer getCategoriaBloqueioImpPosteriorId() {
return categoriaBloqueioImpPosteriorId; return categoriaBloqueioImpPosteriorId;
} }
@ -65,4 +78,22 @@ public class CategoriaBloqueioImpPosterior {
} }
return true; return true;
} }
@Override
public void clonar() throws CloneNotSupportedException {
categoriaBloqueioImpPosteriorClone = new CategoriaBloqueioImpPosterior();
categoriaBloqueioImpPosteriorClone = (CategoriaBloqueioImpPosterior) this.clone();
Hibernate.initialize(categoriaBloqueioImpPosteriorClone.getPuntoventa());
}
@Override
public CategoriaBloqueioImpPosterior getCloneObject() throws CloneNotSupportedException {
return categoriaBloqueioImpPosteriorClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getCategoriaBloqueioImpPosteriorId());
}
} }

View File

@ -15,11 +15,20 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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.AuditarEntidade;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "CategoriaOrgao", tela = "Alteração de Categoria Orgao Concedente")
@Entity @Entity
@SequenceGenerator(name = "CATEGORIA_ORGAO_SEQ", sequenceName = "CATEGORIA_ORGAO_SEQ", allocationSize = 1) @SequenceGenerator(name = "CATEGORIA_ORGAO_SEQ", sequenceName = "CATEGORIA_ORGAO_SEQ", allocationSize = 1)
@Table(name = "CATEGORIA_ORGAO") @Table(name = "CATEGORIA_ORGAO")
public class CategoriaOrgao implements Serializable { public class CategoriaOrgao implements Serializable, Auditavel<CategoriaOrgao> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -36,10 +45,15 @@ public class CategoriaOrgao implements Serializable {
private Integer usuarioId; private Integer usuarioId;
@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID") @JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
@ManyToOne @ManyToOne
@AuditarEntidade
private OrgaoConcedente orgao; private OrgaoConcedente orgao;
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
@ManyToOne @ManyToOne
private CategoriaCtrl categoriaCtrl; private CategoriaCtrl categoriaCtrl;
@Transient
@NaoAuditar
private CategoriaOrgao categoriaOrgaoClone;
public CategoriaOrgao() { public CategoriaOrgao() {
} }
@ -130,4 +144,23 @@ public class CategoriaOrgao implements Serializable {
public String toString() { public String toString() {
return "com.rjconsultores.ventaboletos.entidad.CategoriaOrgao[categoriaorgaoId=" + categoriaorgaoId + "]"; return "com.rjconsultores.ventaboletos.entidad.CategoriaOrgao[categoriaorgaoId=" + categoriaorgaoId + "]";
} }
@Override
public void clonar() throws CloneNotSupportedException {
categoriaOrgaoClone = new CategoriaOrgao();
categoriaOrgaoClone = (CategoriaOrgao) this.clone();
Hibernate.initialize(categoriaOrgaoClone.getOrgao());
}
@Override
public CategoriaOrgao getCloneObject() throws CloneNotSupportedException {
return categoriaOrgaoClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getCategoriaorgaoId());
}
} }

View File

@ -17,15 +17,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 vjcor * @author vjcor
* *
*/ */
@AuditarClasse(nome = "CobrancaAdcPuntoVenta", tela = "Alteração Cobrança de Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "COBRANCA_ADC_SEQ", sequenceName = "COBRANCA_ADC_SEQ", allocationSize = 1) @SequenceGenerator(name = "COBRANCA_ADC_SEQ", sequenceName = "COBRANCA_ADC_SEQ", allocationSize = 1)
@Table(name = "COBRANCA_ADC_PUNTO_VENTA") @Table(name = "COBRANCA_ADC_PUNTO_VENTA")
public class CobrancaAdcPuntoVenta implements Serializable { public class CobrancaAdcPuntoVenta implements Serializable, Auditavel<CobrancaAdcPuntoVenta> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -103,6 +111,10 @@ public class CobrancaAdcPuntoVenta implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Transient
@NaoAuditar
private CobrancaAdcPuntoVenta cobrancaAdcPuntoVentaClone;
private Boolean getBoolean(Boolean valor) { private Boolean getBoolean(Boolean valor) {
return valor == null ? false : valor; return valor == null ? false : valor;
} }
@ -315,5 +327,22 @@ public class CobrancaAdcPuntoVenta implements Serializable {
return this.getDescricao(); return this.getDescricao();
} }
@Override
public void clonar() throws CloneNotSupportedException {
cobrancaAdcPuntoVentaClone = new CobrancaAdcPuntoVenta();
cobrancaAdcPuntoVentaClone = (CobrancaAdcPuntoVenta) this.clone();
Hibernate.initialize(cobrancaAdcPuntoVentaClone.getPuntoVenta());
}
@Override
public CobrancaAdcPuntoVenta getCloneObject() throws CloneNotSupportedException {
return cobrancaAdcPuntoVentaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getCobrancaAddPuntoVenta_id());
}
} }

View File

@ -14,11 +14,17 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "CoeficienteTarifa", tela = "Alteração de Coeficiente Tarifario")
@Entity @Entity
@SequenceGenerator(name = "COEFICIENTE_TARIFA_SEQ", sequenceName = "COEFICIENTE_TARIFA_SEQ", allocationSize = 1) @SequenceGenerator(name = "COEFICIENTE_TARIFA_SEQ", sequenceName = "COEFICIENTE_TARIFA_SEQ", allocationSize = 1)
@Table(name = "COEFICIENTE_TARIFA") @Table(name = "COEFICIENTE_TARIFA")
public class CoeficienteTarifa implements Serializable { public class CoeficienteTarifa implements Serializable, Auditavel<CoeficienteTarifa> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -37,6 +43,10 @@ public class CoeficienteTarifa implements Serializable {
private Date fecmodif; private Date fecmodif;
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Transient
@NaoAuditar
private CoeficienteTarifa coeficienteTarifaClone;
public Integer getCoeficienteId() { public Integer getCoeficienteId() {
return coeficienteId; return coeficienteId;
@ -85,6 +95,23 @@ public class CoeficienteTarifa implements Serializable {
public void setUsuarioId(Integer usuarioId) { public void setUsuarioId(Integer usuarioId) {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@Override
public CoeficienteTarifa getCloneObject() throws CloneNotSupportedException {
return coeficienteTarifaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getCoeficienteId());
}
@Override
public void clonar() throws CloneNotSupportedException {
coeficienteTarifaClone = new CoeficienteTarifa();
coeficienteTarifaClone = (CoeficienteTarifa) this.clone();
}
@Override @Override
public String toString() { public String toString() {

View File

@ -24,11 +24,16 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@Entity @Entity
@SequenceGenerator(name = "EMPRESA_IMPOSTO_SEQ", sequenceName = "EMPRESA_IMPOSTO_SEQ", allocationSize = 1) @SequenceGenerator(name = "EMPRESA_IMPOSTO_SEQ", sequenceName = "EMPRESA_IMPOSTO_SEQ", allocationSize = 1)
@Table(name = "EMPRESA_IMPOSTO") @Table(name = "EMPRESA_IMPOSTO")
public class EmpresaImposto implements Serializable { public class EmpresaImposto implements Serializable, Auditavel<EmpresaImposto> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -161,9 +166,13 @@ public class EmpresaImposto implements Serializable {
@Column(name = "PORCFECP") @Column(name = "PORCFECP")
private BigDecimal porcFECP; private BigDecimal porcFECP;
@Transient
private EmpresaImposto empresaImpostoClone;
@OneToMany(mappedBy = "empresaImposto", cascade = CascadeType.ALL, orphanRemoval=true) @OneToMany(mappedBy = "empresaImposto", cascade = CascadeType.ALL, orphanRemoval=true)
@NaoAuditar
private List<AliquotaEstadoDestino> lsAliquotaEstadoDestino; private List<AliquotaEstadoDestino> lsAliquotaEstadoDestino;
@ -819,4 +828,23 @@ public class EmpresaImposto implements Serializable {
public void setLsAliquotaEstadoDestino(List<AliquotaEstadoDestino> lsAliquotaEstadoDestino) { public void setLsAliquotaEstadoDestino(List<AliquotaEstadoDestino> lsAliquotaEstadoDestino) {
this.lsAliquotaEstadoDestino = lsAliquotaEstadoDestino; this.lsAliquotaEstadoDestino = lsAliquotaEstadoDestino;
} }
@Override
public void clonar() throws CloneNotSupportedException {
empresaImpostoClone = new EmpresaImposto();
empresaImpostoClone = (EmpresaImposto) this.clone();
}
@Override
public EmpresaImposto getCloneObject() throws CloneNotSupportedException {
return empresaImpostoClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getEmpresaImpostoId());
}
} }

View File

@ -14,10 +14,16 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "FechamentoParamptovta", tela = "Alteração de Ponto de Venda/Fechamento Conta Corrente")
@Entity @Entity
@Table(name = "FECHAMENTO_PARAMPTOVTA") @Table(name = "FECHAMENTO_PARAMPTOVTA")
public class FechamentoParamptovta implements Serializable { public class FechamentoParamptovta implements Serializable, Auditavel<FechamentoParamptovta> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -30,6 +36,9 @@ public class FechamentoParamptovta implements Serializable {
private Boolean activo; private Boolean activo;
private Integer diasemtransito; private Integer diasemtransito;
private String tipopagamento; private String tipopagamento;
@Transient
@NaoAuditar
private FechamentoParamptovta fechamentoParamptovtaClone;
public FechamentoParamptovta() { public FechamentoParamptovta() {
} }
@ -146,7 +155,20 @@ public class FechamentoParamptovta implements Serializable {
this.tipopagamento = tipopagamento; this.tipopagamento = tipopagamento;
} }
public void clonar() throws CloneNotSupportedException {
fechamentoParamptovtaClone = new FechamentoParamptovta();
fechamentoParamptovtaClone = (FechamentoParamptovta) this.clone();
}
@Transient
public FechamentoParamptovta getCloneObject() throws CloneNotSupportedException {
return fechamentoParamptovtaClone;
}
@Transient
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getFechamentoparamptovtaId());
}
} }

View File

@ -21,20 +21,26 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital; import com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital;
import com.rjconsultores.ventaboletos.enums.TipoFormapago; import com.rjconsultores.ventaboletos.enums.TipoFormapago;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/** /**
* *
* @author Administrador * @author Administrador
*/ */
@AuditarClasse(nome = "Forma Pagamento", tela = "Forma Pagamento")
@Entity @Entity
@SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1) @SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1)
@Table(name = "FORMA_PAGO") @Table(name = "FORMA_PAGO")
public class FormaPago implements Serializable { public class FormaPago implements Serializable, Auditavel<FormaPago> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -61,8 +67,10 @@ public class FormaPago implements Serializable {
private String cvePago; private String cvePago;
@Column(name = "IMPFISCAL") @Column(name = "IMPFISCAL")
private Boolean impfiscal; private Boolean impfiscal;
@NaoAuditar
@OneToMany(mappedBy = "formaPago") @OneToMany(mappedBy = "formaPago")
private List<ConfigRestriccionPago> configRestriccionPagoList; private List<ConfigRestriccionPago> configRestriccionPagoList;
@NaoAuditar
@OneToMany(mappedBy = "formaPago") @OneToMany(mappedBy = "formaPago")
private List<PricingFormapago> pricingFormapagoList; private List<PricingFormapago> pricingFormapagoList;
@Column(name = "INDCONFERENCIAFISICACOMISSAO") @Column(name = "INDCONFERENCIAFISICACOMISSAO")
@ -90,6 +98,10 @@ public class FormaPago implements Serializable {
@Column(name = "TIPOEVENTOEXTRA_ID") @Column(name = "TIPOEVENTOEXTRA_ID")
private Long tipoEventoExtraId; private Long tipoEventoExtraId;
@Transient
@NaoAuditar
private FormaPago formaPagoClone;
public FormaPago() { public FormaPago() {
super(); super();
} }
@ -312,4 +324,22 @@ public class FormaPago implements Serializable {
public void setTipoEventoExtraId(Long tipoEventoExtraId) { public void setTipoEventoExtraId(Long tipoEventoExtraId) {
this.tipoEventoExtraId = tipoEventoExtraId; this.tipoEventoExtraId = tipoEventoExtraId;
} }
@Override
public FormaPago getCloneObject() throws CloneNotSupportedException {
return formaPagoClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getFormapagoId());
}
@Override
public void clonar() throws CloneNotSupportedException {
formaPagoClone = new FormaPago();
formaPagoClone = (FormaPago) this.clone();
}
} }

View File

@ -21,15 +21,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Administrador * @author Administrador
*/ */
@AuditarClasse(nome = "FormaPagoDet", tela = "Alteração de Forma Pago Detalhe Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "FORMA_PAGO_DET_SEQ", sequenceName = "FORMA_PAGO_DET_SEQ", allocationSize = 1) @SequenceGenerator(name = "FORMA_PAGO_DET_SEQ", sequenceName = "FORMA_PAGO_DET_SEQ", allocationSize = 1)
@Table(name = "FORMA_PAGO_DET") @Table(name = "FORMA_PAGO_DET")
public class FormaPagoDet implements Serializable { public class FormaPagoDet implements Serializable, Auditavel<FormaPagoDet> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -60,6 +68,9 @@ public class FormaPagoDet implements Serializable {
private Boolean indTotalBus; private Boolean indTotalBus;
@Column(name = "INDEMBARCADA") @Column(name = "INDEMBARCADA")
private Boolean indEmbarcada; private Boolean indEmbarcada;
@Transient
@NaoAuditar
private FormaPagoDet formaPagoDetClone;
public FormaPagoDet() { public FormaPagoDet() {
} }
@ -179,5 +190,23 @@ public class FormaPagoDet implements Serializable {
public void setIndEmbarcada(Boolean indEmbarcada) { public void setIndEmbarcada(Boolean indEmbarcada) {
this.indEmbarcada = indEmbarcada; this.indEmbarcada = indEmbarcada;
} }
@Override
public void clonar() throws CloneNotSupportedException {
formaPagoDetClone = new FormaPagoDet();
formaPagoDetClone = (FormaPagoDet) this.clone();
Hibernate.initialize(formaPagoDetClone.getPuntoVenta());
}
@Override
public FormaPagoDet getCloneObject() throws CloneNotSupportedException {
return formaPagoDetClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getFormapagodetId());
}
} }

View File

@ -15,11 +15,19 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
@AuditarClasse(nome = "HistoricoPuntoVenta", tela = "Alteração Ponto de Venda/Historico")
@Entity @Entity
@SequenceGenerator(name = "HIST_PUNTOVENTA_SEQ", sequenceName = "HIST_PUNTOVENTA_SEQ", allocationSize = 1) @SequenceGenerator(name = "HIST_PUNTOVENTA_SEQ", sequenceName = "HIST_PUNTOVENTA_SEQ", allocationSize = 1)
@Table(name = "HIST_PUNTOVENTA") @Table(name = "HIST_PUNTOVENTA")
public class HistoricoPuntoVenta implements Serializable { public class HistoricoPuntoVenta implements Serializable, Auditavel<HistoricoPuntoVenta> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -35,6 +43,7 @@ public class HistoricoPuntoVenta implements Serializable {
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date fecBloqueio; private Date fecBloqueio;
@NaoAuditar
@ManyToOne @ManyToOne
@JoinColumn(name = "PUNTOVENTA_ID") @JoinColumn(name = "PUNTOVENTA_ID")
private PuntoVenta puntoVenta; private PuntoVenta puntoVenta;
@ -49,6 +58,10 @@ public class HistoricoPuntoVenta implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Transient
@NaoAuditar
private HistoricoPuntoVenta historicoPuntoVentaClone;
public Integer getHistoricoPuntoVentaId() { public Integer getHistoricoPuntoVentaId() {
return historicoPuntoVentaId; return historicoPuntoVentaId;
} }
@ -105,6 +118,24 @@ public class HistoricoPuntoVenta implements Serializable {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@Override
public void clonar() throws CloneNotSupportedException {
historicoPuntoVentaClone = new HistoricoPuntoVenta();
historicoPuntoVentaClone = (HistoricoPuntoVenta) this.clone();
Hibernate.initialize(historicoPuntoVentaClone.getPuntoVenta());
}
@Override
public HistoricoPuntoVenta getCloneObject() throws CloneNotSupportedException {
return historicoPuntoVentaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getHistoricoPuntoVentaId());
}
} }

View File

@ -16,11 +16,19 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
@AuditarClasse(nome = "ORGAO_CANCELACION", tela = "Alteração de Orgao Cancelamento")
@Entity @Entity
@Table(name = "ORGAO_CANCELACION") @Table(name = "ORGAO_CANCELACION")
@SequenceGenerator(name = "ORGAO_CANCELACION_SEQ", sequenceName = "ORGAO_CANCELACION_SEQ", allocationSize = 1) @SequenceGenerator(name = "ORGAO_CANCELACION_SEQ", sequenceName = "ORGAO_CANCELACION_SEQ", allocationSize = 1)
public class OrgaoCancelacion implements Serializable { public class OrgaoCancelacion implements Serializable, Auditavel<OrgaoCancelacion> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -108,6 +116,10 @@ public class OrgaoCancelacion implements Serializable {
@Column(name = "INDBLOQUEIOREMARCADO") @Column(name = "INDBLOQUEIOREMARCADO")
private Boolean indBloqueioRemarcado; private Boolean indBloqueioRemarcado;
@Transient
@NaoAuditar
private OrgaoCancelacion orgaoCancelacionClone;
public Integer getOrgaoCancelacionId() { public Integer getOrgaoCancelacionId() {
return orgaoCancelacionId; return orgaoCancelacionId;
@ -364,6 +376,22 @@ public class OrgaoCancelacion implements Serializable {
public void setIndBloqueioRemarcado(Boolean indBloqueioRemarcado) { public void setIndBloqueioRemarcado(Boolean indBloqueioRemarcado) {
this.indBloqueioRemarcado = indBloqueioRemarcado; this.indBloqueioRemarcado = indBloqueioRemarcado;
}
@Override
public void clonar() throws CloneNotSupportedException {
orgaoCancelacionClone = new OrgaoCancelacion();
orgaoCancelacionClone = (OrgaoCancelacion) this.clone();
Hibernate.initialize(orgaoCancelacionClone.getOrgao());
}
@Override
public OrgaoCancelacion getCloneObject() throws CloneNotSupportedException {
return orgaoCancelacionClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getOrgaoCancelacionId());
} }
} }

View File

@ -20,23 +20,34 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.BooleanUtils;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
import br.com.rjconsultores.auditador.annotations.AuditarAtributo;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.AuditarID;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "OrgaoConcedente", tela = "Alteração de Orgao Concedente")
@Entity @Entity
@SequenceGenerator(name = "ORGAO_CONCEDENTE_SEQ", sequenceName = "ORGAO_CONCEDENTE_SEQ", allocationSize = 1) @SequenceGenerator(name = "ORGAO_CONCEDENTE_SEQ", sequenceName = "ORGAO_CONCEDENTE_SEQ", allocationSize = 1)
@Table(name = "ORGAO_CONCEDENTE") @Table(name = "ORGAO_CONCEDENTE")
public class OrgaoConcedente implements Serializable { public class OrgaoConcedente implements Serializable, Auditavel<OrgaoConcedente> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public final static Integer CODIGO_ARTESP = 21; public final static Integer CODIGO_ARTESP = 21;
public final static Integer CODIGO_ANTT = 3; public final static Integer CODIGO_ANTT = 3;
@AuditarID
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ORGAO_CONCEDENTE_SEQ") @GeneratedValue(strategy = GenerationType.AUTO, generator = "ORGAO_CONCEDENTE_SEQ")
@Column(name = "ORGAOCONCEDENTE_ID") @Column(name = "ORGAOCONCEDENTE_ID")
private Integer orgaoConcedenteId; private Integer orgaoConcedenteId;
@AuditarAtributo(nome = "DESC ORGAO")
@Column(name = "DESCORGAO") @Column(name = "DESCORGAO")
private String descOrgao; private String descOrgao;
@Column(name = "INDDEFAULTSEGURO") @Column(name = "INDDEFAULTSEGURO")
@ -50,14 +61,18 @@ public class OrgaoConcedente implements Serializable {
private Date fecmodif; private Date fecmodif;
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@AuditarLista(auditarEntidades = true, nome = "CategoriaOrgao")
@OneToMany(mappedBy = "orgao") @OneToMany(mappedBy = "orgao")
private List<CategoriaOrgao> categoriaOrgaoList; private List<CategoriaOrgao> categoriaOrgaoList;
@Column(name = "INDNOMDOCOBLIGATORIO") @Column(name = "INDNOMDOCOBLIGATORIO")
private Boolean indNomDocObligatorio; private Boolean indNomDocObligatorio;
@AuditarLista(auditarEntidades = true, nome = "OrgaoCancelacion")
@OneToMany(mappedBy = "orgao") @OneToMany(mappedBy = "orgao")
private List<OrgaoCancelacion> orgaoCancelacionList; private List<OrgaoCancelacion> orgaoCancelacionList;
@AuditarAtributo(nome = "INDICE PEDADIO")
@Column(name = "INDICEPEAJE") @Column(name = "INDICEPEAJE")
private BigDecimal indicePeaje; private BigDecimal indicePeaje;
@AuditarAtributo(nome = "Idade Idoso")
@Column(name = "IDADE_IDOSO") @Column(name = "IDADE_IDOSO")
private Integer idadeIdoso; private Integer idadeIdoso;
@Column(name = "IDADE_MINIMA") @Column(name = "IDADE_MINIMA")
@ -75,8 +90,10 @@ public class OrgaoConcedente implements Serializable {
private Boolean indValDocObligatorioEmbarcada; private Boolean indValDocObligatorioEmbarcada;
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL) @OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
@NaoAuditar
private List<ClasseIndicePeaje> classesIndicePeaje; private List<ClasseIndicePeaje> classesIndicePeaje;
@AuditarLista(auditarEntidades = true, nome = "OrgaoEmpParam")
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL) @OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
@Where(clause = "activo=1") @Where(clause = "activo=1")
private List<OrgaoEmpParam> orgaoEmpParams; private List<OrgaoEmpParam> orgaoEmpParams;
@ -92,6 +109,10 @@ public class OrgaoConcedente implements Serializable {
@Column(name = "TAXA_CONVENIENCIA_SVI") @Column(name = "TAXA_CONVENIENCIA_SVI")
private BigDecimal taxaConvenienciaSVI; private BigDecimal taxaConvenienciaSVI;
@Transient
@NaoAuditar
private OrgaoConcedente orgaoConcedenteClone;
public void addParametro(OrgaoCancelacion param) { public void addParametro(OrgaoCancelacion param) {
this.orgaoCancelacionList.add(param); this.orgaoCancelacionList.add(param);
@ -329,4 +350,43 @@ public class OrgaoConcedente implements Serializable {
public void setTaxaConvenienciaSVI(BigDecimal taxaConvenienciaSVI) { public void setTaxaConvenienciaSVI(BigDecimal taxaConvenienciaSVI) {
this.taxaConvenienciaSVI = taxaConvenienciaSVI; this.taxaConvenienciaSVI = taxaConvenienciaSVI;
} }
@Override
public void clonar() throws CloneNotSupportedException {
orgaoConcedenteClone = new OrgaoConcedente();
orgaoConcedenteClone = (OrgaoConcedente) this.clone();
if(this.getCategoriaOrgaoList() != null) {
List<CategoriaOrgao> lsClones = new ArrayList<CategoriaOrgao>();
for (CategoriaOrgao categoriaOrgao : this.getCategoriaOrgaoList()) {
if(BooleanUtils.isTrue(categoriaOrgao.getActivo())) {
categoriaOrgao.clonar();
lsClones.add(categoriaOrgao.getCloneObject());
}
}
orgaoConcedenteClone.setCategoriaOrgaoList(lsClones);
}
if(this.getOrgaoCancelacionList() != null) {
List<OrgaoCancelacion> lsClones = new ArrayList<OrgaoCancelacion>();
for (OrgaoCancelacion orgaoCancelacion : this.getOrgaoCancelacionList()) {
if(BooleanUtils.isTrue(orgaoCancelacion.getActivo())) {
orgaoCancelacion.clonar();
lsClones.add(orgaoCancelacion.getCloneObject());
}
}
orgaoConcedenteClone.setOrgaoCancelacionList(lsClones);
}
}
@Override
public OrgaoConcedente getCloneObject() throws CloneNotSupportedException {
return orgaoConcedenteClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getOrgaoConcedenteId());
}
} }

View File

@ -15,11 +15,18 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
@AuditarClasse(nome = "OrgaoEmpParam", tela = "Alteração de Orgao Empresa Parametro")
@Entity @Entity
@SequenceGenerator(name = "ORGAO_EMP_PARAM_SEQ", sequenceName = "ORGAO_EMP_PARAM_SEQ", allocationSize = 1) @SequenceGenerator(name = "ORGAO_EMP_PARAM_SEQ", sequenceName = "ORGAO_EMP_PARAM_SEQ", allocationSize = 1)
@Table(name = "ORGAO_EMP_PARAM") @Table(name = "ORGAO_EMP_PARAM")
public class OrgaoEmpParam implements Serializable { public class OrgaoEmpParam implements Serializable, Auditavel<OrgaoEmpParam> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -59,6 +66,10 @@ public class OrgaoEmpParam implements Serializable {
@Column(name = "CODEMPRESAPORORGAO", length=30) @Column(name = "CODEMPRESAPORORGAO", length=30)
private String codEmpresaPorOrgao; private String codEmpresaPorOrgao;
@Transient
@NaoAuditar
private OrgaoEmpParam orgaoEmpParamClone;
public String getCodEmpresaPorOrgao() { public String getCodEmpresaPorOrgao() {
return codEmpresaPorOrgao; return codEmpresaPorOrgao;
} }
@ -139,6 +150,23 @@ public class OrgaoEmpParam implements Serializable {
this.indNaoRestringe2ViaBPe = indNaoRestringe2ViaBPe; this.indNaoRestringe2ViaBPe = indNaoRestringe2ViaBPe;
} }
@Override
public void clonar() throws CloneNotSupportedException {
orgaoEmpParamClone = new OrgaoEmpParam();
orgaoEmpParamClone = (OrgaoEmpParam) this.clone();
Hibernate.initialize(orgaoEmpParamClone.getOrgaoConcedente());
}
@Override
public OrgaoEmpParam getCloneObject() throws CloneNotSupportedException {
return orgaoEmpParamClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getOrgaoempparamId());
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;

View File

@ -19,15 +19,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Desenvolvimento * @author Desenvolvimento
*/ */
@AuditarClasse(nome = "ParamRecoleccion", tela = "Alteração de Param Coleccion Pnoto de Venda")
@Entity @Entity
@SequenceGenerator(name = "PARAM_RECOLECCION_SEQ", sequenceName = "PARAM_RECOLECCION_SEQ", allocationSize = 1) @SequenceGenerator(name = "PARAM_RECOLECCION_SEQ", sequenceName = "PARAM_RECOLECCION_SEQ", allocationSize = 1)
@Table(name = "PARAM_RECOLECCION") @Table(name = "PARAM_RECOLECCION")
public class ParamRecoleccion implements Serializable { public class ParamRecoleccion implements Serializable, Auditavel<ParamRecoleccion> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -49,6 +57,10 @@ public class ParamRecoleccion implements Serializable {
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne @ManyToOne
private PuntoVenta puntoVenta; private PuntoVenta puntoVenta;
@Transient
@NaoAuditar
private ParamRecoleccion paramRecoleccionClone;
public ParamRecoleccion() { public ParamRecoleccion() {
} }
@ -137,4 +149,23 @@ public class ParamRecoleccion implements Serializable {
public String toString() { public String toString() {
return "com.rjconsultores.ventaboletos.entidad.ParamRecoleccion[paramrecoleccionId=" + paramrecoleccionId + "]"; return "com.rjconsultores.ventaboletos.entidad.ParamRecoleccion[paramrecoleccionId=" + paramrecoleccionId + "]";
} }
@Override
public void clonar() throws CloneNotSupportedException {
paramRecoleccionClone = new ParamRecoleccion();
paramRecoleccionClone = (ParamRecoleccion) this.clone();
Hibernate.initialize(paramRecoleccionClone.getPuntoVenta());
}
@Override
public ParamRecoleccion getCloneObject() throws CloneNotSupportedException {
return paramRecoleccionClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getParamrecoleccionId());
}
} }

View File

@ -20,15 +20,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 RJ * @author RJ
*/ */
@AuditarClasse(nome = "PtoVtaCheckin", tela = "Alteração de Localidades/Permitidas/Checkin Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_CHECKIN_SEQ", sequenceName = "PTOVTA_CHECKIN_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_CHECKIN_SEQ", sequenceName = "PTOVTA_CHECKIN_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_CHECKIN") @Table(name = "PTOVTA_CHECKIN")
public class PtoVtaCheckin implements Serializable { public class PtoVtaCheckin implements Serializable, Auditavel<PtoVtaCheckin>{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -54,6 +62,10 @@ public class PtoVtaCheckin implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private int usuarioId; private int usuarioId;
@Transient
@NaoAuditar
private PtoVtaCheckin ptoVtaCheckinClone;
public PtoVtaCheckin() { public PtoVtaCheckin() {
} }
@ -110,6 +122,24 @@ public class PtoVtaCheckin implements Serializable {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptoVtaCheckinClone = new PtoVtaCheckin();
ptoVtaCheckinClone = (PtoVtaCheckin) this.clone();
Hibernate.initialize(ptoVtaCheckinClone.getPuntoventaId());
}
@Override
public PtoVtaCheckin getCloneObject() throws CloneNotSupportedException {
return ptoVtaCheckinClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtoVtaCheckinId());
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 0; int hash = 0;

View File

@ -19,15 +19,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 RJ * @author RJ
*/ */
@AuditarClasse(nome = "PtoVtaSeguro", tela = "Alteração de Seguro no Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_SEGURO_SEQ", sequenceName = "PTOVTA_SEGURO_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_SEGURO_SEQ", sequenceName = "PTOVTA_SEGURO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_SEGURO") @Table(name = "PTOVTA_SEGURO")
public class PtoVtaSeguro implements Serializable { public class PtoVtaSeguro implements Serializable, Auditavel<PtoVtaSeguro>{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -100,6 +108,10 @@ public class PtoVtaSeguro implements Serializable {
@Column(name = "INDTAXAEMBARQUEEMBARCADA") @Column(name = "INDTAXAEMBARQUEEMBARCADA")
private Boolean indTaxaEmbarqueEmbarcada; private Boolean indTaxaEmbarqueEmbarcada;
@Transient
@NaoAuditar
private PtoVtaSeguro ptoVtaSeguroClone;
public PtoVtaSeguro() { public PtoVtaSeguro() {
} }
@ -267,4 +279,24 @@ public class PtoVtaSeguro implements Serializable {
public void setIndTaxaEmbarqueEmbarcada(Boolean indTaxaEmbarqueEmbarcada) { public void setIndTaxaEmbarqueEmbarcada(Boolean indTaxaEmbarqueEmbarcada) {
this.indTaxaEmbarqueEmbarcada = indTaxaEmbarqueEmbarcada; this.indTaxaEmbarqueEmbarcada = indTaxaEmbarqueEmbarcada;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptoVtaSeguroClone = new PtoVtaSeguro();
ptoVtaSeguroClone = (PtoVtaSeguro) this.clone();
Hibernate.initialize(ptoVtaSeguroClone.getPuntoventaId());
}
@Override
public PtoVtaSeguro getCloneObject() throws CloneNotSupportedException {
return ptoVtaSeguroClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtoVtaSeguroId());
}
} }

View File

@ -17,14 +17,22 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Desenvolvimento * @author Desenvolvimento
*/ */
@AuditarClasse(nome = "PtoVtaUsuarioBancario", tela = "Alteração Ponto de Venda/Usuario Bancario")
@Entity @Entity
@Table(name = "PTOVTA_USUARIO_BANCARIO") @Table(name = "PTOVTA_USUARIO_BANCARIO")
public class PtoVtaUsuarioBancario implements Serializable { public class PtoVtaUsuarioBancario implements Serializable, Auditavel<PtoVtaUsuarioBancario> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -48,6 +56,10 @@ public class PtoVtaUsuarioBancario implements Serializable {
@JoinColumn(name = "USUARIOBANCARIO_ID", referencedColumnName = "USUARIOBANCARIO_ID") @JoinColumn(name = "USUARIOBANCARIO_ID", referencedColumnName = "USUARIOBANCARIO_ID")
@ManyToOne @ManyToOne
private UsuarioBancario usuarioBancario; private UsuarioBancario usuarioBancario;
@Transient
@NaoAuditar
private PtoVtaUsuarioBancario ptoVtaUsuarioBancarioClone;
public PtoVtaUsuarioBancario() { public PtoVtaUsuarioBancario() {
} }
@ -107,6 +119,24 @@ public class PtoVtaUsuarioBancario implements Serializable {
public void setUsuarioId(Integer usuarioId) { public void setUsuarioId(Integer usuarioId) {
this.usuarioId = usuarioId; this.usuarioId = usuarioId;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptoVtaUsuarioBancarioClone = new PtoVtaUsuarioBancario();
ptoVtaUsuarioBancarioClone = (PtoVtaUsuarioBancario) this.clone();
Hibernate.initialize(ptoVtaUsuarioBancarioClone.getPuntoVenta());
}
@Override
public PtoVtaUsuarioBancario getCloneObject() throws CloneNotSupportedException {
return ptoVtaUsuarioBancarioClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaUsuarioBancarioID());
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {

View File

@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import javax.persistence.Basic; import javax.persistence.Basic;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -15,22 +16,28 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Rafael * @author Rafael
*/ */
@AuditarClasse(nome = "PtovtaAntecipacomissao", tela = "Alteração Ponto de Venda/Antecipação Comissão")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_ANTECIPACOMISSAO_SEQ", sequenceName = "PTOVTA_ANTECIPACOMISSAO_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_ANTECIPACOMISSAO_SEQ", sequenceName = "PTOVTA_ANTECIPACOMISSAO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_ANTECIPACOMISSAO") @Table(name = "PTOVTA_ANTECIPACOMISSAO")
public class PtovtaAntecipacomissao implements Serializable { public class PtovtaAntecipacomissao implements Serializable, Auditavel<PtovtaAntecipacomissao>{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -61,6 +68,10 @@ public class PtovtaAntecipacomissao implements Serializable {
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne @ManyToOne
private PuntoVenta puntoventaId; private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaAntecipacomissao ptovtaAntecipacomissaoClone;
public PtovtaAntecipacomissao() { public PtovtaAntecipacomissao() {
} }
@ -151,6 +162,24 @@ public class PtovtaAntecipacomissao implements Serializable {
hash += (ptovtaAntecipaComissaoId != null ? ptovtaAntecipaComissaoId.hashCode() : 0); hash += (ptovtaAntecipaComissaoId != null ? ptovtaAntecipaComissaoId.hashCode() : 0);
return hash; return hash;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaAntecipacomissaoClone = new PtovtaAntecipacomissao();
ptovtaAntecipacomissaoClone = (PtovtaAntecipacomissao) this.clone();
Hibernate.initialize(ptovtaAntecipacomissaoClone.getPuntoventaId());
}
@Override
public PtovtaAntecipacomissao getCloneObject() throws CloneNotSupportedException {
return ptovtaAntecipacomissaoClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaAntecipaComissaoId());
}
@Override @Override
public boolean equals(Object object) { public boolean equals(Object object) {

View File

@ -17,16 +17,24 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import com.rjconsultores.ventaboletos.enums.TipoAntifraude; import com.rjconsultores.ventaboletos.enums.TipoAntifraude;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/** /**
* @author Wilian * @author Wilian
*/ */
@AuditarClasse(nome = "PtovtaAntifraude", tela = "Alteração Ponto de Venda/Antifraude")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_ANTIFRAUDE_SEQ", sequenceName = "PTOVTA_ANTIFRAUDE_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_ANTIFRAUDE_SEQ", sequenceName = "PTOVTA_ANTIFRAUDE_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_ANTIFRAUDE") @Table(name = "PTOVTA_ANTIFRAUDE")
public class PtovtaAntifraude implements Serializable { public class PtovtaAntifraude implements Serializable , Auditavel<PtovtaAntifraude> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -60,6 +68,10 @@ public class PtovtaAntifraude implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private int usuarioId; private int usuarioId;
@Transient
@NaoAuditar
private PtovtaAntifraude ptovtaAntifraudeClone;
public PtovtaAntifraude() { public PtovtaAntifraude() {
super(); super();
@ -159,5 +171,24 @@ public class PtovtaAntifraude implements Serializable {
return false; return false;
return true; return true;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaAntifraudeClone = new PtovtaAntifraude();
ptovtaAntifraudeClone = (PtovtaAntifraude) this.clone();
Hibernate.initialize(ptovtaAntifraudeClone.getPuntoventa());
}
@Override
public PtovtaAntifraude getCloneObject() throws CloneNotSupportedException {
return ptovtaAntifraudeClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaAntifraudeId());
}
} }

View File

@ -15,11 +15,19 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
@AuditarClasse(nome = "PtovtaCatInd", tela = "Alteração de Categoria Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_CAT_IND_SEQ", sequenceName = "PTOVTA_CAT_IND_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_CAT_IND_SEQ", sequenceName = "PTOVTA_CAT_IND_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_CAT_IND") @Table(name = "PTOVTA_CAT_IND")
public class PtovtaCatInd implements Serializable { public class PtovtaCatInd implements Serializable, Auditavel<PtovtaCatInd> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -50,6 +58,10 @@ public class PtovtaCatInd implements Serializable {
private Boolean indTotalBus; private Boolean indTotalBus;
@Column(name = "INDEMBARCADA") @Column(name = "INDEMBARCADA")
private Boolean indEmbarcada; private Boolean indEmbarcada;
@Transient
@NaoAuditar
private PtovtaCatInd ptovtaCatIndConcedente;
public Integer getPtovtaCategoriaId() { public Integer getPtovtaCategoriaId() {
return ptovtaCategoriaId; return ptovtaCategoriaId;
@ -133,6 +145,24 @@ public class PtovtaCatInd implements Serializable {
public void setIndEmbarcada(Boolean indEmbarcada) { public void setIndEmbarcada(Boolean indEmbarcada) {
this.indEmbarcada = indEmbarcada; this.indEmbarcada = indEmbarcada;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaCatIndConcedente = new PtovtaCatInd();
ptovtaCatIndConcedente = (PtovtaCatInd) this.clone();
Hibernate.initialize(ptovtaCatIndConcedente.getPuntoVenta());
}
@Override
public PtovtaCatInd getCloneObject() throws CloneNotSupportedException {
return ptovtaCatIndConcedente;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaCategoriaId());
}
@Override @Override
public int hashCode() { public int hashCode() {

View File

@ -23,17 +23,25 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils;
import com.rjconsultores.ventaboletos.enums.ModeloComissaoImpressaoPosterior; import com.rjconsultores.ventaboletos.enums.ModeloComissaoImpressaoPosterior;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/** /**
* *
* @author Rafael * @author Rafael
*/ */
@AuditarClasse(nome = "PtovtaComissao", tela = "Alteração Ponto Veda/Comissão")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_COMISSAO_SEQ", sequenceName = "PTOVTA_COMISSAO_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_COMISSAO_SEQ", sequenceName = "PTOVTA_COMISSAO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_COMISSAO") @Table(name = "PTOVTA_COMISSAO")
public class PtovtaComissao implements Serializable { public class PtovtaComissao implements Serializable, Auditavel<PtovtaComissao> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -163,11 +171,15 @@ public class PtovtaComissao implements Serializable {
@Column(name = "SEGUROOBRIGATORIOBAIXA") @Column(name = "SEGUROOBRIGATORIOBAIXA")
private BigDecimal seguroobrigatorioBaixa; private BigDecimal seguroobrigatorioBaixa;
@Column(name = "RECARGACELULARALTA") // @Column(name = "RECARGACELULARALTA")
private BigDecimal recargaCelularAlta; // private BigDecimal recargaCelularAlta;
//
@Column(name = "RECARGACELULARBAIXA") // @Column(name = "RECARGACELULARBAIXA")
private BigDecimal recargaCelularBaixa; // private BigDecimal recargaCelularBaixa;
@Transient
@NaoAuditar
private PtovtaComissao ptovtaComissaoClone;
public PtovtaComissao() { public PtovtaComissao() {
super(); super();
@ -605,19 +617,45 @@ public class PtovtaComissao implements Serializable {
this.seguroobrigatorioBaixa = seguroobrigatorioBaixa; this.seguroobrigatorioBaixa = seguroobrigatorioBaixa;
} }
public BigDecimal getRecargaCelularAlta() { // public BigDecimal getRecargaCelularAlta() {
return recargaCelularAlta; // return recargaCelularAlta;
// }
//
// public void setRecargaCelularAlta(BigDecimal recargaCelularAlta) {
// this.recargaCelularAlta = recargaCelularAlta;
// }
//
// public BigDecimal getRecargaCelularBaixa() {
// return recargaCelularBaixa;
// }
//
// public void setRecargaCelularBaixa(BigDecimal recargaCelularBaixa) {
// this.recargaCelularBaixa = recargaCelularBaixa;
// }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaComissaoClone = new PtovtaComissao();
ptovtaComissaoClone = (PtovtaComissao) this.clone();
if (this.getPuntoventaId() != null) {
if (BooleanUtils.isTrue(getPuntoventaId().getActivo())) {
getPuntoventaId().clonar();
}
ptovtaComissaoClone.setPuntoventaId(getPuntoventaId());
}
} }
public void setRecargaCelularAlta(BigDecimal recargaCelularAlta) { @Override
this.recargaCelularAlta = recargaCelularAlta; public PtovtaComissao getCloneObject() throws CloneNotSupportedException {
return ptovtaComissaoClone;
} }
public BigDecimal getRecargaCelularBaixa() { @Override
return recargaCelularBaixa; public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaComissaoId());
} }
public void setRecargaCelularBaixa(BigDecimal recargaCelularBaixa) {
this.recargaCelularBaixa = recargaCelularBaixa;
}
} }

View File

@ -26,14 +26,21 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient; 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 Desenvolvimento * @author Desenvolvimento
*/ */
@AuditarClasse(nome = "PtovtaEmpresa", tela = "Alteração Ponto de Venda/de Empresas/Venda")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_EMPRESA_SEQ", sequenceName = "PTOVTA_EMPRESA_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_EMPRESA_SEQ", sequenceName = "PTOVTA_EMPRESA_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_EMPRESA") @Table(name = "PTOVTA_EMPRESA")
public class PtovtaEmpresa implements Serializable { public class PtovtaEmpresa implements Serializable, Auditavel<PtovtaEmpresa>{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -73,6 +80,7 @@ public class PtovtaEmpresa implements Serializable {
@Column(name = "NUMSITEF") @Column(name = "NUMSITEF")
private String numeroSitef; private String numeroSitef;
@NaoAuditar
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "PTOVTAEMPRESA_ID", referencedColumnName = "PTOVTAEMPRESA_ID") @JoinColumn(name = "PTOVTAEMPRESA_ID", referencedColumnName = "PTOVTAEMPRESA_ID")
private List<PtovtaEmpresaContaBancaria> lsPtovtaEmpresaContaBancaria; private List<PtovtaEmpresaContaBancaria> lsPtovtaEmpresaContaBancaria;
@ -84,9 +92,14 @@ public class PtovtaEmpresa implements Serializable {
@Column(name = "INDIMPCOMPCARTAO") @Column(name = "INDIMPCOMPCARTAO")
private Boolean indImpCompCartao; private Boolean indImpCompCartao;
@NaoAuditar
@Transient @Transient
private List<EmpresaContaBancaria> contasBancaria; private List<EmpresaContaBancaria> contasBancaria;
@Transient
@NaoAuditar
private PtovtaEmpresa ptovtaEmpresaClone;
public PtovtaEmpresa() { public PtovtaEmpresa() {
} }
@ -238,6 +251,24 @@ public class PtovtaEmpresa implements Serializable {
return null; return null;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaEmpresaClone = new PtovtaEmpresa();
ptovtaEmpresaClone = (PtovtaEmpresa) this.clone();
Hibernate.initialize(ptovtaEmpresaClone.getPuntoVenta());
}
@Override
public PtovtaEmpresa getCloneObject() throws CloneNotSupportedException {
return ptovtaEmpresaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaempresaId());
}
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;

View File

@ -15,11 +15,19 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
@AuditarClasse(nome = "PtovtaEmpresaBloqueada", tela = "Alteração Ponto de Venda/Empresa Bloqueada ")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_EMP_BLOQUEADA_SEQ", sequenceName = "PTOVTA_EMP_BLOQUEADA_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_EMP_BLOQUEADA_SEQ", sequenceName = "PTOVTA_EMP_BLOQUEADA_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_EMP_BLOQUEADA") @Table(name = "PTOVTA_EMP_BLOQUEADA")
public class PtovtaEmpresaBloqueada implements Serializable { public class PtovtaEmpresaBloqueada implements Serializable, Auditavel<PtovtaEmpresaBloqueada> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@ -45,6 +53,10 @@ public class PtovtaEmpresaBloqueada implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@Transient
@NaoAuditar
private PtovtaEmpresaBloqueada ptovtaEmpresaBloqueadaClone;
public Integer getPtovtaempbloqueadaId() { public Integer getPtovtaempbloqueadaId() {
return ptovtaempbloqueadaId; return ptovtaempbloqueadaId;
@ -105,4 +117,22 @@ public class PtovtaEmpresaBloqueada implements Serializable {
} }
return true; return true;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaEmpresaBloqueadaClone = new PtovtaEmpresaBloqueada();
ptovtaEmpresaBloqueadaClone = (PtovtaEmpresaBloqueada) this.clone();
Hibernate.initialize(ptovtaEmpresaBloqueadaClone.getPuntoventaId());
}
@Override
public PtovtaEmpresaBloqueada getCloneObject() throws CloneNotSupportedException {
return ptovtaEmpresaBloqueadaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaempbloqueadaId());
}
} }

View File

@ -5,10 +5,7 @@
package com.rjconsultores.ventaboletos.entidad; package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.Basic; import javax.persistence.Basic;
import javax.persistence.Column; import javax.persistence.Column;
@ -18,22 +15,28 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Rafael * @author Rafael
*/ */
@AuditarClasse(nome = "PtoVtaUsuarioBancario", tela = "Alteração Estoque Ponto de Venda")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_ESTOQUE_SEQ ", sequenceName = "PTOVTA_ESTOQUE_SEQ ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_ESTOQUE_SEQ ", sequenceName = "PTOVTA_ESTOQUE_SEQ ", allocationSize = 1)
@Table(name = "PTOVTA_ESTOQUE") @Table(name = "PTOVTA_ESTOQUE")
public class PtovtaEstoque implements Serializable { public class PtovtaEstoque implements Serializable, Auditavel<PtovtaEstoque>{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -66,6 +69,10 @@ public class PtovtaEstoque implements Serializable {
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne @ManyToOne
private PuntoVenta puntoventaId; private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaEstoque ptovtaEstoqueClone;
public PtovtaEstoque() { public PtovtaEstoque() {
} }
@ -215,4 +222,22 @@ public class PtovtaEstoque implements Serializable {
return "com.rjconsultores.ventaboletos.entidad.PtovtaEstoque[ ptovtaEstoqueId=" + ptovtaEstoqueId + " ]"; return "com.rjconsultores.ventaboletos.entidad.PtovtaEstoque[ ptovtaEstoqueId=" + ptovtaEstoqueId + " ]";
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaEstoqueClone = new PtovtaEstoque();
ptovtaEstoqueClone = (PtovtaEstoque) this.clone();
Hibernate.initialize(ptovtaEstoqueClone.getPuntoventaId());
}
@Override
public PtovtaEstoque getCloneObject() throws CloneNotSupportedException {
return ptovtaEstoqueClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaEstoqueId());
}
} }

View File

@ -15,22 +15,28 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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 Rafael * @author Rafael
*/ */
@AuditarClasse(nome = "PtovtaHorario", tela = "Alteração Ponto Venda/Horario")
@Entity @Entity
@SequenceGenerator(name = "PTOVTA_HORARIO_SEQ", sequenceName = "PTOVTA_HORARIO_SEQ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_HORARIO_SEQ", sequenceName = "PTOVTA_HORARIO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_HORARIO") @Table(name = "PTOVTA_HORARIO")
public class PtovtaHorario implements Serializable { public class PtovtaHorario implements Serializable, Auditavel<PtovtaHorario> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -56,10 +62,16 @@ public class PtovtaHorario implements Serializable {
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private int usuarioId; private int usuarioId;
@NaoAuditar
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne @ManyToOne
private PuntoVenta puntoventaId; private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaHorario ptovtaHorarioClone;
@Column(name = "INDLUNES") @Column(name = "INDLUNES")
private Boolean indlunes; private Boolean indlunes;
@Column(name = "INDMARTES") @Column(name = "INDMARTES")
@ -204,6 +216,24 @@ public class PtovtaHorario implements Serializable {
public void setInddomingo(Boolean inddomingo) { public void setInddomingo(Boolean inddomingo) {
this.inddomingo = inddomingo; this.inddomingo = inddomingo;
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaHorarioClone = new PtovtaHorario();
ptovtaHorarioClone = (PtovtaHorario) this.clone();
Hibernate.initialize(ptovtaHorarioClone.getPuntoventaId());
}
@Override
public PtovtaHorario getCloneObject() throws CloneNotSupportedException {
return ptovtaHorarioClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaHorarioId());
}
@Override @Override
public int hashCode() { public int hashCode() {

View File

@ -5,6 +5,7 @@
package com.rjconsultores.ventaboletos.entidad; package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -15,25 +16,31 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob; import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany; import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils;
import br.com.rjconsultores.auditador.annotations.AuditarAtributo;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/** /**
* *
* @author Rafael * @author Rafael
*/ */
@AuditarClasse(nome = "PtovtaTitular", tela = "Alteração Ponto Veda/Titular/Foto")
@Entity @Entity
@Table(name = "PTOVTA_TITULAR") @Table(name = "PTOVTA_TITULAR")
@SequenceGenerator(name = "PTOVTA_TITULAR_SEQ ", sequenceName = "PTOVTA_TITULAR_SEQ ", allocationSize = 1) @SequenceGenerator(name = "PTOVTA_TITULAR_SEQ ", sequenceName = "PTOVTA_TITULAR_SEQ ", allocationSize = 1)
public class PtovtaTitular implements Serializable { public class PtovtaTitular implements Serializable, Auditavel<PtovtaTitular> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@ -41,6 +48,7 @@ public class PtovtaTitular implements Serializable {
@Column(name = "PTOVTATITULAR_ID") @Column(name = "PTOVTATITULAR_ID")
private Integer ptovtaTitularId; private Integer ptovtaTitularId;
@AuditarAtributo(nome = "NOME TITULAR/FOTO")
@Column(name = "NOME") @Column(name = "NOME")
private String nome; private String nome;
@ -65,9 +73,15 @@ public class PtovtaTitular implements Serializable {
private Date fecmodif; private Date fecmodif;
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private int usuarioId; private int usuarioId;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "titularId") @OneToMany(cascade = CascadeType.ALL, mappedBy = "titularId")
private List<PuntoVenta> puntoVentaList; private List<PuntoVenta> puntoVentaList;
@Transient
@NaoAuditar
private PtovtaTitular ptovtaTitularClone;
public PtovtaTitular() { public PtovtaTitular() {
} }
@ -195,4 +209,33 @@ public class PtovtaTitular implements Serializable {
return "com.rjconsultores.ventaboletos.entidad.PtovtaTitular[ ptovtaTitularId=" + ptovtaTitularId + " ]"; return "com.rjconsultores.ventaboletos.entidad.PtovtaTitular[ ptovtaTitularId=" + ptovtaTitularId + " ]";
} }
@Override
public void clonar() throws CloneNotSupportedException {
ptovtaTitularClone = new PtovtaTitular();
ptovtaTitularClone = (PtovtaTitular) this.clone();
if(this.getPuntoVentaList() != null) {
List<PuntoVenta> lsClones = new ArrayList<PuntoVenta>();
for (PuntoVenta puntoVenta : this.getPuntoVentaList()) {
if(BooleanUtils.isTrue(puntoVenta.getActivo())) {
puntoVenta.clonar();
lsClones.add(puntoVenta.getCloneObject());
}
}
ptovtaTitularClone.setPuntoVentaList(lsClones);
}
}
@Override
public PtovtaTitular getCloneObject() throws CloneNotSupportedException {
return ptovtaTitularClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaTitularId());
}
} }

View File

@ -17,126 +17,160 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Temporal; import javax.persistence.Temporal;
import javax.persistence.TemporalType; 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;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
/** /**
* *
* @author Rafius * @author Rafius
*/ */
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Reserva Punto Venta")
@Entity @Entity
@SequenceGenerator(name = "RESERVACION_PUNTOVENTA_SEQ", sequenceName = "RESERVACION_PUNTOVENTA_SEQ", allocationSize=1) @SequenceGenerator(name = "RESERVACION_PUNTOVENTA_SEQ", sequenceName = "RESERVACION_PUNTOVENTA_SEQ", allocationSize = 1)
@Table(name = "RESERVACION_PUNTOVENTA") @Table(name = "RESERVACION_PUNTOVENTA")
public class ReservacionPuntoVenta implements Serializable { public class ReservacionPuntoVenta implements Serializable, Auditavel<ReservacionPuntoVenta> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_PUNTOVENTA_SEQ") @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_PUNTOVENTA_SEQ")
@Column(name = "RESERVACIONPTOVTA_ID") @Column(name = "RESERVACIONPTOVTA_ID")
private Integer reservacionptovtaId; private Integer reservacionptovtaId;
@Column(name = "ACTIVO") @Column(name = "ACTIVO")
private Boolean activo; private Boolean activo;
@Column(name = "FECMODIF") @Column(name = "FECMODIF")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date fecmodif; private Date fecmodif;
@Column(name = "USUARIO_ID") @Column(name = "USUARIO_ID")
private Integer usuarioId; private Integer usuarioId;
@JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID")
@ManyToOne
private ReservacionCtrl reservacionCtrl;
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne
private PuntoVenta puntoVenta;
public ReservacionPuntoVenta() { @NaoAuditar
} @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID")
@ManyToOne
private ReservacionCtrl reservacionCtrl;
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
public ReservacionPuntoVenta(Integer reservacionptovtaId) { @NaoAuditar
this.reservacionptovtaId = reservacionptovtaId; @ManyToOne
} private PuntoVenta puntoVenta;
public Integer getReservacionptovtaId() { @Transient
return reservacionptovtaId; @NaoAuditar
} private ReservacionPuntoVenta reservacionPuntoVentaClone;
public void setReservacionptovtaId(Integer reservacionptovtaId) { public ReservacionPuntoVenta() {
this.reservacionptovtaId = reservacionptovtaId; }
}
public Boolean getActivo() { public ReservacionPuntoVenta(Integer reservacionptovtaId) {
return activo; this.reservacionptovtaId = reservacionptovtaId;
} }
public void setActivo(Boolean activo) { public Integer getReservacionptovtaId() {
this.activo = activo; return reservacionptovtaId;
} }
public Date getFecmodif() { public void setReservacionptovtaId(Integer reservacionptovtaId) {
return fecmodif; this.reservacionptovtaId = reservacionptovtaId;
} }
public void setFecmodif(Date fecmodif) { public Boolean getActivo() {
this.fecmodif = fecmodif; return activo;
} }
public Integer getUsuarioId() { public void setActivo(Boolean activo) {
return usuarioId; this.activo = activo;
} }
public void setUsuarioId(Integer usuarioId) { public Date getFecmodif() {
this.usuarioId = usuarioId; return fecmodif;
} }
public ReservacionCtrl getReservacionCtrl() { public void setFecmodif(Date fecmodif) {
return reservacionCtrl; this.fecmodif = fecmodif;
} }
public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { public Integer getUsuarioId() {
this.reservacionCtrl = reservacionCtrl; return usuarioId;
} }
public PuntoVenta getPuntoVenta() { public void setUsuarioId(Integer usuarioId) {
return puntoVenta; this.usuarioId = usuarioId;
} }
public void setPuntoVenta(PuntoVenta puntoVenta) { public ReservacionCtrl getReservacionCtrl() {
this.puntoVenta = puntoVenta; return reservacionCtrl;
} }
@Override public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) {
public boolean equals(Object obj) { this.reservacionCtrl = reservacionCtrl;
if (obj == null) { }
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ReservacionPuntoVenta other = (ReservacionPuntoVenta) obj;
if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
return false;
}
if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) {
return false;
}
if (this.puntoVenta != other.puntoVenta && (this.puntoVenta == null || !this.puntoVenta.equals(other.puntoVenta))) {
return false;
}
return true;
}
@Override public PuntoVenta getPuntoVenta() {
public int hashCode() { return puntoVenta;
int hash = 7; }
hash = 79 * hash + (this.activo != null ? this.activo.hashCode() : 0);
hash = 79 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0);
hash = 79 * hash + (this.puntoVenta != null ? this.puntoVenta.hashCode() : 0);
return hash;
}
public void setPuntoVenta(PuntoVenta puntoVenta) {
this.puntoVenta = puntoVenta;
}
@Override @Override
public String toString() { public boolean equals(Object obj) {
return "com.rjconsultores.ventaboletos.entidad.ReservacionPuntoventa[reservacionptovtaId=" + reservacionptovtaId + "]"; if (obj == null) {
} return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ReservacionPuntoVenta other = (ReservacionPuntoVenta) obj;
if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
return false;
}
if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) {
return false;
}
if (this.puntoVenta != other.puntoVenta && (this.puntoVenta == null || !this.puntoVenta.equals(other.puntoVenta))) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + (this.activo != null ? this.activo.hashCode() : 0);
hash = 79 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0);
hash = 79 * hash + (this.puntoVenta != null ? this.puntoVenta.hashCode() : 0);
return hash;
}
@Override
public String toString() {
return "com.rjconsultores.ventaboletos.entidad.ReservacionPuntoventa[reservacionptovtaId=" + reservacionptovtaId + "]";
}
@Override
public void clonar() throws CloneNotSupportedException {
reservacionPuntoVentaClone = new ReservacionPuntoVenta();
reservacionPuntoVentaClone = (ReservacionPuntoVenta) this.clone();
Hibernate.initialize(reservacionPuntoVentaClone.getPuntoVenta());
}
@Override
public ReservacionPuntoVenta getCloneObject() throws CloneNotSupportedException {
return reservacionPuntoVentaClone;
}
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getReservacionptovtaId());
}
} }

View File

@ -3,6 +3,7 @@ package com.rjconsultores.ventaboletos.service.impl;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
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 org.springframework.transaction.annotation.Transactional;
@ -10,7 +11,11 @@ import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.CoeficienteTarifaDAO; import com.rjconsultores.ventaboletos.dao.CoeficienteTarifaDAO;
import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO; import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa; import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.service.CoeficienteTarifaService; import com.rjconsultores.ventaboletos.service.CoeficienteTarifaService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -21,13 +26,26 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
private CoeficienteTarifaDAO coeficienteTarifaDAO; private CoeficienteTarifaDAO coeficienteTarifaDAO;
@Autowired @Autowired
private OrgaoTramoDAO orgaoTramoDAO; private OrgaoTramoDAO orgaoTramoDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(OrgaoConcedenteServiceImpl.class);
public List<CoeficienteTarifa> obtenerTodos() { public List<CoeficienteTarifa> obtenerTodos() {
return coeficienteTarifaDAO.obtenerTodos(); return coeficienteTarifaDAO.obtenerTodos();
} }
public CoeficienteTarifa obtenerID(Integer id) { public CoeficienteTarifa obtenerID(Integer id) {
return coeficienteTarifaDAO.obtenerID(id);
CoeficienteTarifa coeficienteTarifa = coeficienteTarifaDAO.obtenerID(id);
try {
coeficienteTarifa.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return coeficienteTarifa;
} }
@Transactional @Transactional
@ -36,16 +54,33 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
return coeficienteTarifaDAO.suscribir(entidad);
entidad = coeficienteTarifaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
} }
@Transactional @Transactional
public CoeficienteTarifa actualizacion(CoeficienteTarifa entidad) { public CoeficienteTarifa actualizacion(CoeficienteTarifa entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); try {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
CoeficienteTarifa originalClone = entidad.getCloneObject();
entidad = coeficienteTarifaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, null);
return coeficienteTarifaDAO.actualizacion(entidad);
} catch (Exception e) {
log.error(e);
}
return entidad;
} }
@Transactional @Transactional
@ -62,8 +97,9 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE); entidad.setActivo(Boolean.FALSE);
coeficienteTarifaDAO.actualizacion(entidad); entidad = coeficienteTarifaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
} }
public List<CoeficienteTarifa> buscar(String nomb) { public List<CoeficienteTarifa> buscar(String nomb) {

View File

@ -7,6 +7,8 @@ package com.rjconsultores.ventaboletos.service.impl;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.jfree.util.Log;
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 org.springframework.transaction.annotation.Transactional;
@ -21,9 +23,11 @@ import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.InscricaoEstadual; import com.rjconsultores.ventaboletos.entidad.InscricaoEstadual;
import com.rjconsultores.ventaboletos.entidad.Marca; import com.rjconsultores.ventaboletos.entidad.Marca;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.exception.BusinessException; import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.MarcaService; import com.rjconsultores.ventaboletos.service.MarcaService;
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -46,13 +50,25 @@ public class EmpresaServiceImpl implements EmpresaService {
@Autowired @Autowired
private EsquemaCorridaDAO esquemaCorridaDAO; private EsquemaCorridaDAO esquemaCorridaDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(EmpresaServiceImpl.class);
public List<Empresa> obtenerTodos() { public List<Empresa> obtenerTodos() {
return empresaDAO.obtenerTodos(); return empresaDAO.obtenerTodos();
} }
public Empresa obtenerID(Integer id) { public Empresa obtenerID(Integer id) {
return empresaDAO.obtenerID(id);
Empresa empresa = empresaDAO.obtenerID(id);
try {
empresa.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return empresa;
} }
@Transactional @Transactional
@ -69,11 +85,19 @@ public class EmpresaServiceImpl implements EmpresaService {
if (entidad.getEmpresaId() == null) { if (entidad.getEmpresaId() == null) {
entidad = empresaDAO.suscribir(entidad); entidad = empresaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
gerarMarca(entidad); gerarMarca(entidad);
} else { } else {
entidad = empresaDAO.actualizacion(entidad); try {
Empresa empresaClone = entidad.getCloneObject();
entidad = empresaDAO.actualizacion(entidad);
logAuditoriaService.auditar(empresaClone, entidad, entidad.getEmpresaId());
} catch (Exception e) {
log.error(e);
}
} }
if (comEmpConferencia != null) { if (comEmpConferencia != null) {
@ -107,6 +131,8 @@ public class EmpresaServiceImpl implements EmpresaService {
entidad.setActivo(Boolean.FALSE); entidad.setActivo(Boolean.FALSE);
empresaDAO.actualizacion(entidad); empresaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad,null);
} }
public List<Empresa> buscar(String nombempresa, Boolean indExterna, Short indTipo) { public List<Empresa> buscar(String nombempresa, Boolean indExterna, Short indTipo) {

View File

@ -3,6 +3,7 @@ package com.rjconsultores.ventaboletos.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
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 org.springframework.transaction.annotation.Transactional;
@ -12,12 +13,17 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService; import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
@Service("fechamentoParamptovtaService") @Service("fechamentoParamptovtaService")
public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaService { public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaService {
@Autowired @Autowired
private FechamentoParamptovtaDAO fechamentoParamptovtaDAO; private FechamentoParamptovtaDAO fechamentoParamptovtaDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(FechamentoParamptovtaServiceImpl.class);
@Override @Override
public List<FechamentoParamptovta> obtenerTodos() { public List<FechamentoParamptovta> obtenerTodos() {
@ -26,26 +32,47 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe
@Override @Override
public FechamentoParamptovta obtenerID(Long id) { public FechamentoParamptovta obtenerID(Long id) {
return fechamentoParamptovtaDAO.obtenerID(id);
FechamentoParamptovta fechamentoParamptovta = fechamentoParamptovtaDAO.obtenerID(id);
try {
fechamentoParamptovta.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return fechamentoParamptovta;
} }
@Override @Override
@Transactional @Transactional
public FechamentoParamptovta suscribir(FechamentoParamptovta entidad) { public FechamentoParamptovta suscribir(FechamentoParamptovta entidad) {
return fechamentoParamptovtaDAO.suscribir(entidad);
fechamentoParamptovtaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
return entidad;
} }
@Override @Override
@Transactional @Transactional
public FechamentoParamptovta actualizacion(FechamentoParamptovta entidad) { public FechamentoParamptovta actualizacion(FechamentoParamptovta entidad) {
entidad.setFecmodif(new Date()); entidad.setFecmodif(new Date());
return fechamentoParamptovtaDAO.actualizacion(entidad); FechamentoParamptovta originalClone = null;
try {
originalClone = entidad.getCloneObject();
} catch (Exception e) {
log.error("",e);
}
fechamentoParamptovtaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
return entidad;
} }
@Override @Override
@Transactional @Transactional
public void borrar(FechamentoParamptovta entidad) { public void borrar(FechamentoParamptovta entidad) {
fechamentoParamptovtaDAO.borrar(entidad); fechamentoParamptovtaDAO.borrar(entidad);
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
} }

View File

@ -4,16 +4,22 @@
*/ */
package com.rjconsultores.ventaboletos.service.impl; package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.FormaPagoDAO;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.FormaPagoDAO;
import com.rjconsultores.ventaboletos.entidad.FormaPago;
import com.rjconsultores.ventaboletos.entidad.Tarifa;
import com.rjconsultores.ventaboletos.service.FormaPagoService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
/** /**
* *
* @author Administrador * @author Administrador
@ -25,13 +31,27 @@ public class FormaPagoServiceImpl implements FormaPagoService {
@Autowired @Autowired
private FormaPagoDAO formaPagoDAO; private FormaPagoDAO formaPagoDAO;
private static Logger log = LoggerFactory.getLogger(PuntoVentaServiceImpl.class);
@Autowired
private LogAuditoriaService logAuditoriaService;
public List<FormaPago> obtenerTodos() { public List<FormaPago> obtenerTodos() {
return formaPagoDAO.obtenerTodos(); return formaPagoDAO.obtenerTodos();
} }
public FormaPago obtenerID(Short id) { public FormaPago obtenerID(Short id) {
return formaPagoDAO.obtenerID(id);
FormaPago formaPago = formaPagoDAO.obtenerID(id);
try {
formaPago.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return formaPago;
} }
@Transactional @Transactional
@ -39,17 +59,32 @@ public class FormaPagoServiceImpl implements FormaPagoService {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
return formaPagoDAO.suscribir(entidad);
formaPagoDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
} }
@Transactional @Transactional
public FormaPago actualizacion(FormaPago entidad) { public FormaPago actualizacion(FormaPago entidad) {
FormaPago originalClone = null;
try {
originalClone = entidad.getCloneObject();
} catch (CloneNotSupportedException e) {
log.error(e.getMessage(), e);
}
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
return formaPagoDAO.actualizacion(entidad); formaPagoDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, -1);
return entidad;
} }
@Transactional @Transactional
@ -59,6 +94,7 @@ public class FormaPagoServiceImpl implements FormaPagoService {
entidad.setActivo(Boolean.FALSE); entidad.setActivo(Boolean.FALSE);
formaPagoDAO.actualizacion(entidad); formaPagoDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
} }
public List<FormaPago> buscarPorDescricao(String descpago) { public List<FormaPago> buscarPorDescricao(String descpago) {

View File

@ -214,9 +214,20 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
Cell cell = cellIterator.next(); Cell cell = cellIterator.next();
switch (cell.getColumnIndex()) { switch (cell.getColumnIndex()) {
case 0: case 0:
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
try { try {
cliente.setNumfidelidade(new Long(Math.round(cell.getNumericCellValue())).toString()); if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
cliente.setNumfidelidade(new Long(Math.round(cell.getNumericCellValue())).toString());
}else {
if(StringUtils.isNotBlank(cell.getStringCellValue())) {
try {
cliente.setNumfidelidade(new Long(cell.getStringCellValue().trim().replaceAll(" ","")).toString());
}catch (NumberFormatException e) {
cliente.setTelefone("");
erros.append(cliente.getNumfidelidade() + " - Numero de Telefone incorreto: " + cell.getStringCellValue().trim().replaceAll(" ","").toString());
erros.append("\n");
}
}
}
}catch(Exception e) { }catch(Exception e) {
log.error("Erro na gravação do registro. Favor revisar",e); log.error("Erro na gravação do registro. Favor revisar",e);
} }
@ -230,7 +241,7 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
cliente.setTipodoc(cell.getStringCellValue()); cliente.setTipodoc(cell.getStringCellValue());
break; break;
case 3: case 3:
cell.setCellType(Cell.CELL_TYPE_NUMERIC); cell.setCellType(Cell.CELL_TYPE_STRING);
String numDocString = null; String numDocString = null;
try { try {
numDocString = new Long(Math.round(cell.getNumericCellValue())).toString(); numDocString = new Long(Math.round(cell.getNumericCellValue())).toString();

View File

@ -3,12 +3,14 @@ package com.rjconsultores.ventaboletos.service.impl;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
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 org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.OrgaoConcedenteDAO; import com.rjconsultores.ventaboletos.dao.OrgaoConcedenteDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente; import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService; import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -17,13 +19,24 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
@Autowired @Autowired
private OrgaoConcedenteDAO orgaoConcedenteDAO; private OrgaoConcedenteDAO orgaoConcedenteDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(OrgaoConcedenteServiceImpl.class);
public List<OrgaoConcedente> obtenerTodos() { public List<OrgaoConcedente> obtenerTodos() {
return orgaoConcedenteDAO.obtenerTodos(); return orgaoConcedenteDAO.obtenerTodos();
} }
public OrgaoConcedente obtenerID(Integer id) { public OrgaoConcedente obtenerID(Integer id) {
return orgaoConcedenteDAO.obtenerID(id);
OrgaoConcedente orgaoConcedente = orgaoConcedenteDAO.obtenerID(id);
try {
orgaoConcedente.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return orgaoConcedente;
} }
@Transactional @Transactional
@ -31,17 +44,30 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
return orgaoConcedenteDAO.suscribir(entidad); orgaoConcedenteDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
} }
@Transactional @Transactional
public OrgaoConcedente actualizacion(OrgaoConcedente entidad) { public OrgaoConcedente actualizacion(OrgaoConcedente entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); try {
entidad.setActivo(Boolean.TRUE); OrgaoConcedente originalClone = entidad.getCloneObject();
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return orgaoConcedenteDAO.actualizacion(entidad); entidad = orgaoConcedenteDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, null);
} catch (Exception e) {
log.error(e);
}
return entidad;
} }
@Transactional @Transactional
@ -51,6 +77,8 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
entidad.setActivo(Boolean.FALSE); entidad.setActivo(Boolean.FALSE);
orgaoConcedenteDAO.actualizacion(entidad); orgaoConcedenteDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
} }
public List<OrgaoConcedente> buscar(String desc) { public List<OrgaoConcedente> buscar(String desc) {

View File

@ -5,14 +5,18 @@
package com.rjconsultores.ventaboletos.service.impl; package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.PtovtaComissaoDAO; import com.rjconsultores.ventaboletos.dao.PtovtaComissaoDAO;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PtovtaComissao; import com.rjconsultores.ventaboletos.entidad.PtovtaComissao;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.PtovtaComissaoService; import com.rjconsultores.ventaboletos.service.PtovtaComissaoService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 org.springframework.transaction.annotation.Transactional;
@ -24,15 +28,26 @@ import org.springframework.transaction.annotation.Transactional;
@Service("ptovtaComissaoService") @Service("ptovtaComissaoService")
public class PtovtaComissaoServiceImpl implements PtovtaComissaoService { public class PtovtaComissaoServiceImpl implements PtovtaComissaoService {
private static Logger log = LoggerFactory.getLogger(PtovtaComissaoServiceImpl.class);
@Autowired @Autowired
private PtovtaComissaoDAO ptovtaComissaoDAO; private PtovtaComissaoDAO ptovtaComissaoDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
public List<PtovtaComissao> obtenerTodos() { public List<PtovtaComissao> obtenerTodos() {
return ptovtaComissaoDAO.obtenerTodos(); return ptovtaComissaoDAO.obtenerTodos();
} }
public PtovtaComissao obtenerID(Integer id) { public PtovtaComissao obtenerID(Integer id) {
return ptovtaComissaoDAO.obtenerID(id);
PtovtaComissao ptovtaComissao = ptovtaComissaoDAO.obtenerID(id);
try {
ptovtaComissao.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return ptovtaComissao;
} }
@Transactional @Transactional
@ -41,16 +56,35 @@ public class PtovtaComissaoServiceImpl implements PtovtaComissaoService {
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
return ptovtaComissaoDAO.suscribir(entidad); ptovtaComissaoDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, entidad.getEmpresaId() != null ? entidad.getEmpresaId().getEmpresaId() : null);
return entidad;
} }
@Transactional @Transactional
public PtovtaComissao actualizacion(PtovtaComissao entidad) { public PtovtaComissao actualizacion(PtovtaComissao entidad) {
PtovtaComissao originalClone = null;
try {
originalClone = entidad.getCloneObject();
} catch (Exception e) {
log.error("",e);
}
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
ptovtaComissaoDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresaId() != null ? entidad.getEmpresaId().getEmpresaId() : null);
return entidad;
return ptovtaComissaoDAO.actualizacion(entidad);
} }
@Transactional @Transactional

View File

@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.PtovtaTitularDAO; import com.rjconsultores.ventaboletos.dao.PtovtaTitularDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.PtovtaTitular; import com.rjconsultores.ventaboletos.entidad.PtovtaTitular;
import com.rjconsultores.ventaboletos.service.PtovtaTitularService; import com.rjconsultores.ventaboletos.service.PtovtaTitularService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -31,7 +32,14 @@ public class PtovtaTitularServiceImpl implements PtovtaTitularService {
} }
public PtovtaTitular obtenerID(Integer id) { public PtovtaTitular obtenerID(Integer id) {
return ptovtaTitularDAO.obtenerID(id);
PtovtaTitular ptovtaTitular = ptovtaTitularDAO.obtenerID(id);
try {
ptovtaTitular.clonar();
} catch (Exception e) {
e.printStackTrace();
}
return ptovtaTitular;
} }
@Transactional @Transactional

View File

@ -38,6 +38,7 @@ import com.rjconsultores.ventaboletos.exception.IntegracionException;
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException; import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
import com.rjconsultores.ventaboletos.service.ConstanteService; import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.service.EstacionService; import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.PuntoVentaService; import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.utilerias.CustomEnum; import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
@ -82,6 +83,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
private UsuarioUbicacionDAO usuarioUbicacionDAO; private UsuarioUbicacionDAO usuarioUbicacionDAO;
@Autowired @Autowired
private DataSource dataSource; private DataSource dataSource;
@Autowired
private LogAuditoriaService logAuditoriaService;
// FIXME : Remover esse método de quem está usando. Esse método carrega muitos dados // FIXME : Remover esse método de quem está usando. Esse método carrega muitos dados
@Deprecated @Deprecated
@ -90,7 +93,15 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
} }
public PuntoVenta obtenerID(Integer id) { public PuntoVenta obtenerID(Integer id) {
return puntoVentaDAO.obtenerID(id);
PuntoVenta puntoVenta = puntoVentaDAO.obtenerID(id);
try {
puntoVenta.clonar();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return puntoVenta;
} }
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class}) @Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
@ -161,7 +172,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
throw (IntegracionException) respEx; throw (IntegracionException) respEx;
} }
} }
entidad = puntoVentaDAO.suscribir(entidad); entidad = puntoVentaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
// Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso. // Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso.
// Integração AG // Integração AG
@ -418,6 +431,14 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class}) @Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException { public PuntoVenta actualizacion(PuntoVenta entidad) throws IntegracionException, ValidacionCampoException {
PuntoVenta originalClone = null;
try {
originalClone = entidad.getCloneObject();
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
} catch (Exception e) {
log.error("",e);
}
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime()); entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE); entidad.setActivo(Boolean.TRUE);
@ -475,7 +496,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
} }
} }
} }
entidad = puntoVentaDAO.actualizacion(entidad); entidad = puntoVentaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
if (respEx != null) { if (respEx != null) {
if (respEx instanceof IntegracionException) { if (respEx instanceof IntegracionException) {
@ -549,6 +572,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
entidad.setActivo(Boolean.FALSE); entidad.setActivo(Boolean.FALSE);
puntoVentaDAO.actualizacion(entidad); puntoVentaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
} }
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos) { public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos) {