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.Temporal;
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
@SequenceGenerator(name = "ALIQUOTAESTADODESTINO_SEQ", sequenceName = "ALIQUOTAESTADODESTINO_SEQ", allocationSize = 1)
@Table(name = "ALIQUOTA_ESTADO_DESTINO")
public class AliquotaEstadoDestino implements Serializable {
public class AliquotaEstadoDestino implements Serializable, Auditavel<AliquotaEstadoDestino> {
private static final long serialVersionUID = 1L;
@Id
@ -51,6 +57,11 @@ public class AliquotaEstadoDestino implements Serializable {
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@Transient
@NaoAuditar
private AliquotaEstadoDestino aliquotaEstadoDestinoClone;
@Override
public boolean equals(Object object) {
@ -120,4 +131,23 @@ public class AliquotaEstadoDestino implements Serializable {
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.TipoDescontoMonitrip;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
/**
*
* @author Administrador
@ -68,6 +70,7 @@ public class Categoria implements Serializable {
private GrupoCategoria grupoCategoria;
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
@AuditarLista(auditarEntidades = true, nome = "Categoria Orgao")
private List<OrgaoConcedente> orgaosConcedentes;
@Column(name = "INDCONFERENCIAFISICACOMISSAO")

View File

@ -10,11 +10,19 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
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
@SequenceGenerator(name = "CAT_BLOQ_IMPPOSTERIOR_SEQ", sequenceName = "CAT_BLOQ_IMPPOSTERIOR_SEQ", allocationSize = 1)
@Table(name = "CATEGORIA_BLOQ_IMPPOSTERIOR")
public class CategoriaBloqueioImpPosterior {
public class CategoriaBloqueioImpPosterior implements Auditavel<CategoriaBloqueioImpPosterior> {
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CAT_BLOQ_IMPPOSTERIOR_SEQ")
@ -26,6 +34,11 @@ public class CategoriaBloqueioImpPosterior {
@ManyToOne()
@JoinColumn(name = "CATEGORIA_ID")
private Categoria categoria;
@Transient
@NaoAuditar
private CategoriaBloqueioImpPosterior categoriaBloqueioImpPosteriorClone;
public Integer getCategoriaBloqueioImpPosteriorId() {
return categoriaBloqueioImpPosteriorId;
}
@ -65,4 +78,22 @@ public class CategoriaBloqueioImpPosterior {
}
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.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
@SequenceGenerator(name = "CATEGORIA_ORGAO_SEQ", sequenceName = "CATEGORIA_ORGAO_SEQ", allocationSize = 1)
@Table(name = "CATEGORIA_ORGAO")
public class CategoriaOrgao implements Serializable {
public class CategoriaOrgao implements Serializable, Auditavel<CategoriaOrgao> {
private static final long serialVersionUID = 1L;
@Id
@ -36,11 +45,16 @@ public class CategoriaOrgao implements Serializable {
private Integer usuarioId;
@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
@ManyToOne
@AuditarEntidade
private OrgaoConcedente orgao;
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
@ManyToOne
private CategoriaCtrl categoriaCtrl;
@Transient
@NaoAuditar
private CategoriaOrgao categoriaOrgaoClone;
public CategoriaOrgao() {
}
@ -130,4 +144,23 @@ public class CategoriaOrgao implements Serializable {
public String toString() {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
* @author vjcor
*
*/
@AuditarClasse(nome = "CobrancaAdcPuntoVenta", tela = "Alteração Cobrança de Ponto de Venda")
@Entity
@SequenceGenerator(name = "COBRANCA_ADC_SEQ", sequenceName = "COBRANCA_ADC_SEQ", allocationSize = 1)
@Table(name = "COBRANCA_ADC_PUNTO_VENTA")
public class CobrancaAdcPuntoVenta implements Serializable {
public class CobrancaAdcPuntoVenta implements Serializable, Auditavel<CobrancaAdcPuntoVenta> {
private static final long serialVersionUID = 1L;
@ -103,6 +111,10 @@ public class CobrancaAdcPuntoVenta implements Serializable {
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@Transient
@NaoAuditar
private CobrancaAdcPuntoVenta cobrancaAdcPuntoVentaClone;
private Boolean getBoolean(Boolean valor) {
return valor == null ? false : valor;
}
@ -315,5 +327,22 @@ public class CobrancaAdcPuntoVenta implements Serializable {
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.Temporal;
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
@SequenceGenerator(name = "COEFICIENTE_TARIFA_SEQ", sequenceName = "COEFICIENTE_TARIFA_SEQ", allocationSize = 1)
@Table(name = "COEFICIENTE_TARIFA")
public class CoeficienteTarifa implements Serializable {
public class CoeficienteTarifa implements Serializable, Auditavel<CoeficienteTarifa> {
private static final long serialVersionUID = 1L;
@Id
@ -38,6 +44,10 @@ public class CoeficienteTarifa implements Serializable {
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@Transient
@NaoAuditar
private CoeficienteTarifa coeficienteTarifaClone;
public Integer getCoeficienteId() {
return coeficienteId;
}
@ -86,6 +96,23 @@ public class CoeficienteTarifa implements Serializable {
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
public String toString() {
return descCoeficiente + " - " + coeficiente;

View File

@ -24,11 +24,16 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
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
@SequenceGenerator(name = "EMPRESA_IMPOSTO_SEQ", sequenceName = "EMPRESA_IMPOSTO_SEQ", allocationSize = 1)
@Table(name = "EMPRESA_IMPOSTO")
public class EmpresaImposto implements Serializable {
public class EmpresaImposto implements Serializable, Auditavel<EmpresaImposto> {
private static final long serialVersionUID = 1L;
@Id
@ -161,9 +166,13 @@ public class EmpresaImposto implements Serializable {
@Column(name = "PORCFECP")
private BigDecimal porcFECP;
@Transient
private EmpresaImposto empresaImpostoClone;
@OneToMany(mappedBy = "empresaImposto", cascade = CascadeType.ALL, orphanRemoval=true)
@NaoAuditar
private List<AliquotaEstadoDestino> lsAliquotaEstadoDestino;
@ -819,4 +828,23 @@ public class EmpresaImposto implements Serializable {
public void setLsAliquotaEstadoDestino(List<AliquotaEstadoDestino> 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.Temporal;
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
@Table(name = "FECHAMENTO_PARAMPTOVTA")
public class FechamentoParamptovta implements Serializable {
public class FechamentoParamptovta implements Serializable, Auditavel<FechamentoParamptovta> {
private static final long serialVersionUID = 1L;
@ -30,6 +36,9 @@ public class FechamentoParamptovta implements Serializable {
private Boolean activo;
private Integer diasemtransito;
private String tipopagamento;
@Transient
@NaoAuditar
private FechamentoParamptovta fechamentoParamptovtaClone;
public FechamentoParamptovta() {
}
@ -146,7 +155,20 @@ public class FechamentoParamptovta implements Serializable {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;
import com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital;
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
*/
@AuditarClasse(nome = "Forma Pagamento", tela = "Forma Pagamento")
@Entity
@SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1)
@Table(name = "FORMA_PAGO")
public class FormaPago implements Serializable {
public class FormaPago implements Serializable, Auditavel<FormaPago> {
private static final long serialVersionUID = 1L;
@ -61,8 +67,10 @@ public class FormaPago implements Serializable {
private String cvePago;
@Column(name = "IMPFISCAL")
private Boolean impfiscal;
@NaoAuditar
@OneToMany(mappedBy = "formaPago")
private List<ConfigRestriccionPago> configRestriccionPagoList;
@NaoAuditar
@OneToMany(mappedBy = "formaPago")
private List<PricingFormapago> pricingFormapagoList;
@Column(name = "INDCONFERENCIAFISICACOMISSAO")
@ -90,6 +98,10 @@ public class FormaPago implements Serializable {
@Column(name = "TIPOEVENTOEXTRA_ID")
private Long tipoEventoExtraId;
@Transient
@NaoAuditar
private FormaPago formaPagoClone;
public FormaPago() {
super();
}
@ -312,4 +324,22 @@ public class FormaPago implements Serializable {
public void setTipoEventoExtraId(Long 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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Administrador
*/
@AuditarClasse(nome = "FormaPagoDet", tela = "Alteração de Forma Pago Detalhe Ponto de Venda")
@Entity
@SequenceGenerator(name = "FORMA_PAGO_DET_SEQ", sequenceName = "FORMA_PAGO_DET_SEQ", allocationSize = 1)
@Table(name = "FORMA_PAGO_DET")
public class FormaPagoDet implements Serializable {
public class FormaPagoDet implements Serializable, Auditavel<FormaPagoDet> {
private static final long serialVersionUID = 1L;
@Id
@ -60,6 +68,9 @@ public class FormaPagoDet implements Serializable {
private Boolean indTotalBus;
@Column(name = "INDEMBARCADA")
private Boolean indEmbarcada;
@Transient
@NaoAuditar
private FormaPagoDet formaPagoDetClone;
public FormaPagoDet() {
}
@ -180,4 +191,22 @@ public class FormaPagoDet implements Serializable {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "HistoricoPuntoVenta", tela = "Alteração Ponto de Venda/Historico")
@Entity
@SequenceGenerator(name = "HIST_PUNTOVENTA_SEQ", sequenceName = "HIST_PUNTOVENTA_SEQ", allocationSize = 1)
@Table(name = "HIST_PUNTOVENTA")
public class HistoricoPuntoVenta implements Serializable {
public class HistoricoPuntoVenta implements Serializable, Auditavel<HistoricoPuntoVenta> {
private static final long serialVersionUID = 1L;
@Id
@ -35,6 +43,7 @@ public class HistoricoPuntoVenta implements Serializable {
@Temporal(TemporalType.TIMESTAMP)
private Date fecBloqueio;
@NaoAuditar
@ManyToOne
@JoinColumn(name = "PUNTOVENTA_ID")
private PuntoVenta puntoVenta;
@ -49,6 +58,10 @@ public class HistoricoPuntoVenta implements Serializable {
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@Transient
@NaoAuditar
private HistoricoPuntoVenta historicoPuntoVentaClone;
public Integer getHistoricoPuntoVentaId() {
return historicoPuntoVentaId;
}
@ -105,6 +118,24 @@ public class HistoricoPuntoVenta implements Serializable {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "ORGAO_CANCELACION", tela = "Alteração de Orgao Cancelamento")
@Entity
@Table(name = "ORGAO_CANCELACION")
@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;
@ -109,6 +117,10 @@ public class OrgaoCancelacion implements Serializable {
@Column(name = "INDBLOQUEIOREMARCADO")
private Boolean indBloqueioRemarcado;
@Transient
@NaoAuditar
private OrgaoCancelacion orgaoCancelacionClone;
public Integer getOrgaoCancelacionId() {
return orgaoCancelacionId;
}
@ -365,5 +377,21 @@ public class OrgaoCancelacion implements Serializable {
public void setIndBloqueioRemarcado(Boolean 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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils;
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
@SequenceGenerator(name = "ORGAO_CONCEDENTE_SEQ", sequenceName = "ORGAO_CONCEDENTE_SEQ", allocationSize = 1)
@Table(name = "ORGAO_CONCEDENTE")
public class OrgaoConcedente implements Serializable {
public class OrgaoConcedente implements Serializable, Auditavel<OrgaoConcedente> {
private static final long serialVersionUID = 1L;
public final static Integer CODIGO_ARTESP = 21;
public final static Integer CODIGO_ANTT = 3;
@AuditarID
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ORGAO_CONCEDENTE_SEQ")
@Column(name = "ORGAOCONCEDENTE_ID")
private Integer orgaoConcedenteId;
@AuditarAtributo(nome = "DESC ORGAO")
@Column(name = "DESCORGAO")
private String descOrgao;
@Column(name = "INDDEFAULTSEGURO")
@ -50,14 +61,18 @@ public class OrgaoConcedente implements Serializable {
private Date fecmodif;
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@AuditarLista(auditarEntidades = true, nome = "CategoriaOrgao")
@OneToMany(mappedBy = "orgao")
private List<CategoriaOrgao> categoriaOrgaoList;
@Column(name = "INDNOMDOCOBLIGATORIO")
private Boolean indNomDocObligatorio;
@AuditarLista(auditarEntidades = true, nome = "OrgaoCancelacion")
@OneToMany(mappedBy = "orgao")
private List<OrgaoCancelacion> orgaoCancelacionList;
@AuditarAtributo(nome = "INDICE PEDADIO")
@Column(name = "INDICEPEAJE")
private BigDecimal indicePeaje;
@AuditarAtributo(nome = "Idade Idoso")
@Column(name = "IDADE_IDOSO")
private Integer idadeIdoso;
@Column(name = "IDADE_MINIMA")
@ -75,8 +90,10 @@ public class OrgaoConcedente implements Serializable {
private Boolean indValDocObligatorioEmbarcada;
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
@NaoAuditar
private List<ClasseIndicePeaje> classesIndicePeaje;
@AuditarLista(auditarEntidades = true, nome = "OrgaoEmpParam")
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
@Where(clause = "activo=1")
private List<OrgaoEmpParam> orgaoEmpParams;
@ -93,6 +110,10 @@ public class OrgaoConcedente implements Serializable {
@Column(name = "TAXA_CONVENIENCIA_SVI")
private BigDecimal taxaConvenienciaSVI;
@Transient
@NaoAuditar
private OrgaoConcedente orgaoConcedenteClone;
public void addParametro(OrgaoCancelacion param) {
this.orgaoCancelacionList.add(param);
}
@ -329,4 +350,43 @@ public class OrgaoConcedente implements Serializable {
public void setTaxaConvenienciaSVI(BigDecimal 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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "OrgaoEmpParam", tela = "Alteração de Orgao Empresa Parametro")
@Entity
@SequenceGenerator(name = "ORGAO_EMP_PARAM_SEQ", sequenceName = "ORGAO_EMP_PARAM_SEQ", allocationSize = 1)
@Table(name = "ORGAO_EMP_PARAM")
public class OrgaoEmpParam implements Serializable {
public class OrgaoEmpParam implements Serializable, Auditavel<OrgaoEmpParam> {
private static final long serialVersionUID = 1L;
@ -59,6 +66,10 @@ public class OrgaoEmpParam implements Serializable {
@Column(name = "CODEMPRESAPORORGAO", length=30)
private String codEmpresaPorOrgao;
@Transient
@NaoAuditar
private OrgaoEmpParam orgaoEmpParamClone;
public String getCodEmpresaPorOrgao() {
return codEmpresaPorOrgao;
}
@ -139,6 +150,23 @@ public class OrgaoEmpParam implements Serializable {
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
public int hashCode() {
final int prime = 31;

View File

@ -19,15 +19,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Desenvolvimento
*/
@AuditarClasse(nome = "ParamRecoleccion", tela = "Alteração de Param Coleccion Pnoto de Venda")
@Entity
@SequenceGenerator(name = "PARAM_RECOLECCION_SEQ", sequenceName = "PARAM_RECOLECCION_SEQ", allocationSize = 1)
@Table(name = "PARAM_RECOLECCION")
public class ParamRecoleccion implements Serializable {
public class ParamRecoleccion implements Serializable, Auditavel<ParamRecoleccion> {
private static final long serialVersionUID = 1L;
@Id
@ -49,6 +57,10 @@ public class ParamRecoleccion implements Serializable {
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne
private PuntoVenta puntoVenta;
@Transient
@NaoAuditar
private ParamRecoleccion paramRecoleccionClone;
public ParamRecoleccion() {
}
@ -137,4 +149,23 @@ public class ParamRecoleccion implements Serializable {
public String toString() {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author RJ
*/
@AuditarClasse(nome = "PtoVtaCheckin", tela = "Alteração de Localidades/Permitidas/Checkin Ponto de Venda")
@Entity
@SequenceGenerator(name = "PTOVTA_CHECKIN_SEQ", sequenceName = "PTOVTA_CHECKIN_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_CHECKIN")
public class PtoVtaCheckin implements Serializable {
public class PtoVtaCheckin implements Serializable, Auditavel<PtoVtaCheckin>{
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -55,6 +63,10 @@ public class PtoVtaCheckin implements Serializable {
@Column(name = "USUARIO_ID")
private int usuarioId;
@Transient
@NaoAuditar
private PtoVtaCheckin ptoVtaCheckinClone;
public PtoVtaCheckin() {
}
@ -110,6 +122,24 @@ public class PtoVtaCheckin implements Serializable {
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
public int hashCode() {
int hash = 0;

View File

@ -19,15 +19,23 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author RJ
*/
@AuditarClasse(nome = "PtoVtaSeguro", tela = "Alteração de Seguro no Ponto de Venda")
@Entity
@SequenceGenerator(name = "PTOVTA_SEGURO_SEQ", sequenceName = "PTOVTA_SEGURO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_SEGURO")
public class PtoVtaSeguro implements Serializable {
public class PtoVtaSeguro implements Serializable, Auditavel<PtoVtaSeguro>{
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -100,6 +108,10 @@ public class PtoVtaSeguro implements Serializable {
@Column(name = "INDTAXAEMBARQUEEMBARCADA")
private Boolean indTaxaEmbarqueEmbarcada;
@Transient
@NaoAuditar
private PtoVtaSeguro ptoVtaSeguroClone;
public PtoVtaSeguro() {
}
@ -267,4 +279,24 @@ public class PtoVtaSeguro implements Serializable {
public void setIndTaxaEmbarqueEmbarcada(Boolean 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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Desenvolvimento
*/
@AuditarClasse(nome = "PtoVtaUsuarioBancario", tela = "Alteração Ponto de Venda/Usuario Bancario")
@Entity
@Table(name = "PTOVTA_USUARIO_BANCARIO")
public class PtoVtaUsuarioBancario implements Serializable {
public class PtoVtaUsuarioBancario implements Serializable, Auditavel<PtoVtaUsuarioBancario> {
private static final long serialVersionUID = 1L;
@Id
@ -49,6 +57,10 @@ public class PtoVtaUsuarioBancario implements Serializable {
@ManyToOne
private UsuarioBancario usuarioBancario;
@Transient
@NaoAuditar
private PtoVtaUsuarioBancario ptoVtaUsuarioBancarioClone;
public PtoVtaUsuarioBancario() {
}
@ -108,6 +120,24 @@ public class PtoVtaUsuarioBancario implements Serializable {
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
public boolean equals(Object obj) {
if (obj == null) {

View File

@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -15,22 +16,28 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Rafael
*/
@AuditarClasse(nome = "PtovtaAntecipacomissao", tela = "Alteração Ponto de Venda/Antecipação Comissão")
@Entity
@SequenceGenerator(name = "PTOVTA_ANTECIPACOMISSAO_SEQ", sequenceName = "PTOVTA_ANTECIPACOMISSAO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_ANTECIPACOMISSAO")
public class PtovtaAntecipacomissao implements Serializable {
public class PtovtaAntecipacomissao implements Serializable, Auditavel<PtovtaAntecipacomissao>{
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -62,6 +69,10 @@ public class PtovtaAntecipacomissao implements Serializable {
@ManyToOne
private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaAntecipacomissao ptovtaAntecipacomissaoClone;
public PtovtaAntecipacomissao() {
}
@ -152,6 +163,24 @@ public class PtovtaAntecipacomissao implements Serializable {
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
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set

View File

@ -17,16 +17,24 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import 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
*/
@AuditarClasse(nome = "PtovtaAntifraude", tela = "Alteração Ponto de Venda/Antifraude")
@Entity
@SequenceGenerator(name = "PTOVTA_ANTIFRAUDE_SEQ", sequenceName = "PTOVTA_ANTIFRAUDE_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_ANTIFRAUDE")
public class PtovtaAntifraude implements Serializable {
public class PtovtaAntifraude implements Serializable , Auditavel<PtovtaAntifraude> {
private static final long serialVersionUID = 1L;
@ -61,6 +69,10 @@ public class PtovtaAntifraude implements Serializable {
@Column(name = "USUARIO_ID")
private int usuarioId;
@Transient
@NaoAuditar
private PtovtaAntifraude ptovtaAntifraudeClone;
public PtovtaAntifraude() {
super();
this.activo = true;
@ -160,4 +172,23 @@ public class PtovtaAntifraude implements Serializable {
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.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "PtovtaCatInd", tela = "Alteração de Categoria Ponto de Venda")
@Entity
@SequenceGenerator(name = "PTOVTA_CAT_IND_SEQ", sequenceName = "PTOVTA_CAT_IND_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_CAT_IND")
public class PtovtaCatInd implements Serializable {
public class PtovtaCatInd implements Serializable, Auditavel<PtovtaCatInd> {
private static final long serialVersionUID = 1L;
@Id
@ -51,6 +59,10 @@ public class PtovtaCatInd implements Serializable {
@Column(name = "INDEMBARCADA")
private Boolean indEmbarcada;
@Transient
@NaoAuditar
private PtovtaCatInd ptovtaCatIndConcedente;
public Integer getPtovtaCategoriaId() {
return ptovtaCategoriaId;
}
@ -134,6 +146,24 @@ public class PtovtaCatInd implements Serializable {
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
public int hashCode() {
final int prime = 31;

View File

@ -23,17 +23,25 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.apache.commons.lang.BooleanUtils;
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
*/
@AuditarClasse(nome = "PtovtaComissao", tela = "Alteração Ponto Veda/Comissão")
@Entity
@SequenceGenerator(name = "PTOVTA_COMISSAO_SEQ", sequenceName = "PTOVTA_COMISSAO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_COMISSAO")
public class PtovtaComissao implements Serializable {
public class PtovtaComissao implements Serializable, Auditavel<PtovtaComissao> {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -163,11 +171,15 @@ public class PtovtaComissao implements Serializable {
@Column(name = "SEGUROOBRIGATORIOBAIXA")
private BigDecimal seguroobrigatorioBaixa;
@Column(name = "RECARGACELULARALTA")
private BigDecimal recargaCelularAlta;
// @Column(name = "RECARGACELULARALTA")
// private BigDecimal recargaCelularAlta;
//
// @Column(name = "RECARGACELULARBAIXA")
// private BigDecimal recargaCelularBaixa;
@Column(name = "RECARGACELULARBAIXA")
private BigDecimal recargaCelularBaixa;
@Transient
@NaoAuditar
private PtovtaComissao ptovtaComissaoClone;
public PtovtaComissao() {
super();
@ -605,19 +617,45 @@ public class PtovtaComissao implements Serializable {
this.seguroobrigatorioBaixa = seguroobrigatorioBaixa;
}
public BigDecimal getRecargaCelularAlta() {
return recargaCelularAlta;
// public BigDecimal getRecargaCelularAlta() {
// 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) {
this.recargaCelularAlta = recargaCelularAlta;
}
public BigDecimal getRecargaCelularBaixa() {
return recargaCelularBaixa;
@Override
public PtovtaComissao getCloneObject() throws CloneNotSupportedException {
return ptovtaComissaoClone;
}
public void setRecargaCelularBaixa(BigDecimal recargaCelularBaixa) {
this.recargaCelularBaixa = recargaCelularBaixa;
@Override
public String getTextoInclusaoExclusao() {
return String.format("ID [%s]", getPtovtaComissaoId());
}
}

View File

@ -26,14 +26,21 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Desenvolvimento
*/
@AuditarClasse(nome = "PtovtaEmpresa", tela = "Alteração Ponto de Venda/de Empresas/Venda")
@Entity
@SequenceGenerator(name = "PTOVTA_EMPRESA_SEQ", sequenceName = "PTOVTA_EMPRESA_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_EMPRESA")
public class PtovtaEmpresa implements Serializable {
public class PtovtaEmpresa implements Serializable, Auditavel<PtovtaEmpresa>{
private static final long serialVersionUID = 1L;
@ -73,6 +80,7 @@ public class PtovtaEmpresa implements Serializable {
@Column(name = "NUMSITEF")
private String numeroSitef;
@NaoAuditar
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "PTOVTAEMPRESA_ID", referencedColumnName = "PTOVTAEMPRESA_ID")
private List<PtovtaEmpresaContaBancaria> lsPtovtaEmpresaContaBancaria;
@ -84,9 +92,14 @@ public class PtovtaEmpresa implements Serializable {
@Column(name = "INDIMPCOMPCARTAO")
private Boolean indImpCompCartao;
@NaoAuditar
@Transient
private List<EmpresaContaBancaria> contasBancaria;
@Transient
@NaoAuditar
private PtovtaEmpresa ptovtaEmpresaClone;
public PtovtaEmpresa() {
}
@ -238,6 +251,24 @@ public class PtovtaEmpresa implements Serializable {
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
public int hashCode() {
final int prime = 31;

View File

@ -15,11 +15,19 @@ import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
@AuditarClasse(nome = "PtovtaEmpresaBloqueada", tela = "Alteração Ponto de Venda/Empresa Bloqueada ")
@Entity
@SequenceGenerator(name = "PTOVTA_EMP_BLOQUEADA_SEQ", sequenceName = "PTOVTA_EMP_BLOQUEADA_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_EMP_BLOQUEADA")
public class PtovtaEmpresaBloqueada implements Serializable {
public class PtovtaEmpresaBloqueada implements Serializable, Auditavel<PtovtaEmpresaBloqueada> {
private static final long serialVersionUID = 1L;
@Id
@ -46,6 +54,10 @@ public class PtovtaEmpresaBloqueada implements Serializable {
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@Transient
@NaoAuditar
private PtovtaEmpresaBloqueada ptovtaEmpresaBloqueadaClone;
public Integer getPtovtaempbloqueadaId() {
return ptovtaempbloqueadaId;
}
@ -105,4 +117,22 @@ public class PtovtaEmpresaBloqueada implements Serializable {
}
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;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
@ -18,22 +15,28 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Rafael
*/
@AuditarClasse(nome = "PtoVtaUsuarioBancario", tela = "Alteração Estoque Ponto de Venda")
@Entity
@SequenceGenerator(name = "PTOVTA_ESTOQUE_SEQ ", sequenceName = "PTOVTA_ESTOQUE_SEQ ", allocationSize = 1)
@Table(name = "PTOVTA_ESTOQUE")
public class PtovtaEstoque implements Serializable {
public class PtovtaEstoque implements Serializable, Auditavel<PtovtaEstoque>{
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -67,6 +70,10 @@ public class PtovtaEstoque implements Serializable {
@ManyToOne
private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaEstoque ptovtaEstoqueClone;
public PtovtaEstoque() {
}
@ -215,4 +222,22 @@ public class PtovtaEstoque implements Serializable {
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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
/**
*
* @author Rafael
*/
@AuditarClasse(nome = "PtovtaHorario", tela = "Alteração Ponto Venda/Horario")
@Entity
@SequenceGenerator(name = "PTOVTA_HORARIO_SEQ", sequenceName = "PTOVTA_HORARIO_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_HORARIO")
public class PtovtaHorario implements Serializable {
public class PtovtaHorario implements Serializable, Auditavel<PtovtaHorario> {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@ -56,10 +62,16 @@ public class PtovtaHorario implements Serializable {
@Column(name = "USUARIO_ID")
private int usuarioId;
@NaoAuditar
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@ManyToOne
private PuntoVenta puntoventaId;
@Transient
@NaoAuditar
private PtovtaHorario ptovtaHorarioClone;
@Column(name = "INDLUNES")
private Boolean indlunes;
@Column(name = "INDMARTES")
@ -205,6 +217,24 @@ public class PtovtaHorario implements Serializable {
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
public int hashCode() {
int hash = 0;

View File

@ -5,6 +5,7 @@
package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -15,25 +16,31 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
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
*/
@AuditarClasse(nome = "PtovtaTitular", tela = "Alteração Ponto Veda/Titular/Foto")
@Entity
@Table(name = "PTOVTA_TITULAR")
@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;
@Id
@Basic(optional = false)
@ -41,6 +48,7 @@ public class PtovtaTitular implements Serializable {
@Column(name = "PTOVTATITULAR_ID")
private Integer ptovtaTitularId;
@AuditarAtributo(nome = "NOME TITULAR/FOTO")
@Column(name = "NOME")
private String nome;
@ -66,9 +74,15 @@ public class PtovtaTitular implements Serializable {
@Column(name = "USUARIO_ID")
private int usuarioId;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "titularId")
private List<PuntoVenta> puntoVentaList;
@Transient
@NaoAuditar
private PtovtaTitular ptovtaTitularClone;
public PtovtaTitular() {
}
@ -195,4 +209,33 @@ public class PtovtaTitular implements Serializable {
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,16 +17,26 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.hibernate.Hibernate;
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;
import javax.persistence.SequenceGenerator;
/**
*
* @author Rafius
*/
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Reserva Punto Venta")
@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")
public class ReservacionPuntoVenta implements Serializable {
public class ReservacionPuntoVenta implements Serializable, Auditavel<ReservacionPuntoVenta> {
private static final long serialVersionUID = 1L;
@Id
@ -41,13 +51,21 @@ public class ReservacionPuntoVenta implements Serializable {
private Date fecmodif;
@Column(name = "USUARIO_ID")
private Integer usuarioId;
@NaoAuditar
@JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID")
@ManyToOne
private ReservacionCtrl reservacionCtrl;
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
@NaoAuditar
@ManyToOne
private PuntoVenta puntoVenta;
@Transient
@NaoAuditar
private ReservacionPuntoVenta reservacionPuntoVentaClone;
public ReservacionPuntoVenta() {
}
@ -133,10 +151,26 @@ public class ReservacionPuntoVenta implements Serializable {
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.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.OrgaoTramoDAO;
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.LogAuditoriaService;
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -21,13 +26,26 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
private CoeficienteTarifaDAO coeficienteTarifaDAO;
@Autowired
private OrgaoTramoDAO orgaoTramoDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(OrgaoConcedenteServiceImpl.class);
public List<CoeficienteTarifa> obtenerTodos() {
return coeficienteTarifaDAO.obtenerTodos();
}
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
@ -36,16 +54,33 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return coeficienteTarifaDAO.suscribir(entidad);
entidad = coeficienteTarifaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
}
@Transactional
public CoeficienteTarifa actualizacion(CoeficienteTarifa entidad) {
try {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return coeficienteTarifaDAO.actualizacion(entidad);
CoeficienteTarifa originalClone = entidad.getCloneObject();
entidad = coeficienteTarifaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, null);
} catch (Exception e) {
log.error(e);
}
return entidad;
}
@Transactional
@ -63,7 +98,8 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
coeficienteTarifaDAO.actualizacion(entidad);
entidad = coeficienteTarifaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
}
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.List;
import org.apache.log4j.Logger;
import org.jfree.util.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.InscricaoEstadual;
import com.rjconsultores.ventaboletos.entidad.Marca;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.MarcaService;
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -46,13 +50,25 @@ public class EmpresaServiceImpl implements EmpresaService {
@Autowired
private EsquemaCorridaDAO esquemaCorridaDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(EmpresaServiceImpl.class);
public List<Empresa> obtenerTodos() {
return empresaDAO.obtenerTodos();
}
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
@ -69,11 +85,19 @@ public class EmpresaServiceImpl implements EmpresaService {
if (entidad.getEmpresaId() == null) {
entidad = empresaDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
gerarMarca(entidad);
} else {
try {
Empresa empresaClone = entidad.getCloneObject();
entidad = empresaDAO.actualizacion(entidad);
logAuditoriaService.auditar(empresaClone, entidad, entidad.getEmpresaId());
} catch (Exception e) {
log.error(e);
}
}
if (comEmpConferencia != null) {
@ -107,6 +131,8 @@ public class EmpresaServiceImpl implements EmpresaService {
entidad.setActivo(Boolean.FALSE);
empresaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad,null);
}
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.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.PuntoVenta;
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
@Service("fechamentoParamptovtaService")
public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaService {
@Autowired
private FechamentoParamptovtaDAO fechamentoParamptovtaDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(FechamentoParamptovtaServiceImpl.class);
@Override
public List<FechamentoParamptovta> obtenerTodos() {
@ -26,26 +32,47 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe
@Override
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
@Transactional
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
@Transactional
public FechamentoParamptovta actualizacion(FechamentoParamptovta entidad) {
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
@Transactional
public void borrar(FechamentoParamptovta 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;
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.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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
@ -25,13 +31,27 @@ public class FormaPagoServiceImpl implements FormaPagoService {
@Autowired
private FormaPagoDAO formaPagoDAO;
private static Logger log = LoggerFactory.getLogger(PuntoVentaServiceImpl.class);
@Autowired
private LogAuditoriaService logAuditoriaService;
public List<FormaPago> obtenerTodos() {
return formaPagoDAO.obtenerTodos();
}
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
@ -40,16 +60,31 @@ public class FormaPagoServiceImpl implements FormaPagoService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return formaPagoDAO.suscribir(entidad);
formaPagoDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
}
@Transactional
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.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return formaPagoDAO.actualizacion(entidad);
formaPagoDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, -1);
return entidad;
}
@Transactional
@ -59,6 +94,7 @@ public class FormaPagoServiceImpl implements FormaPagoService {
entidad.setActivo(Boolean.FALSE);
formaPagoDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
}
public List<FormaPago> buscarPorDescricao(String descpago) {

View File

@ -214,9 +214,20 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
Cell cell = cellIterator.next();
switch (cell.getColumnIndex()) {
case 0:
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
try {
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) {
log.error("Erro na gravação do registro. Favor revisar",e);
}
@ -230,7 +241,7 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
cliente.setTipodoc(cell.getStringCellValue());
break;
case 3:
cell.setCellType(Cell.CELL_TYPE_NUMERIC);
cell.setCellType(Cell.CELL_TYPE_STRING);
String numDocString = null;
try {
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.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.OrgaoConcedenteDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -17,13 +19,24 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
@Autowired
private OrgaoConcedenteDAO orgaoConcedenteDAO;
@Autowired
private LogAuditoriaService logAuditoriaService;
private static Logger log = Logger.getLogger(OrgaoConcedenteServiceImpl.class);
public List<OrgaoConcedente> obtenerTodos() {
return orgaoConcedenteDAO.obtenerTodos();
}
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
@ -32,16 +45,29 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return orgaoConcedenteDAO.suscribir(entidad);
orgaoConcedenteDAO.suscribir(entidad);
logAuditoriaService.auditar(null, entidad, null);
return entidad;
}
@Transactional
public OrgaoConcedente actualizacion(OrgaoConcedente entidad) {
try {
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
@ -51,6 +77,8 @@ public class OrgaoConcedenteServiceImpl implements OrgaoConcedenteService {
entidad.setActivo(Boolean.FALSE);
orgaoConcedenteDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, null);
}
public List<OrgaoConcedente> buscar(String desc) {

View File

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

View File

@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.PtovtaTitularDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.PtovtaTitular;
import com.rjconsultores.ventaboletos.service.PtovtaTitularService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -31,7 +32,14 @@ public class PtovtaTitularServiceImpl implements PtovtaTitularService {
}
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

View File

@ -38,6 +38,7 @@ import com.rjconsultores.ventaboletos.exception.IntegracionException;
import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
@ -82,6 +83,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
private UsuarioUbicacionDAO usuarioUbicacionDAO;
@Autowired
private DataSource dataSource;
@Autowired
private LogAuditoriaService logAuditoriaService;
// FIXME : Remover esse método de quem está usando. Esse método carrega muitos dados
@Deprecated
@ -90,7 +93,15 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
}
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})
@ -162,6 +173,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
}
}
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.
// Integração AG
@ -418,6 +431,14 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
@Transactional(noRollbackFor = { IntegracionException.class, ValidacionCampoException.class})
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.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
@ -475,7 +496,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
}
}
}
entidad = puntoVentaDAO.actualizacion(entidad);
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
if (respEx != null) {
if (respEx instanceof IntegracionException) {
@ -549,6 +572,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
entidad.setActivo(Boolean.FALSE);
puntoVentaDAO.actualizacion(entidad);
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
}
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos) {