Criação tela cadastro do sifet
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@22353 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
71678187ba
commit
212f5514fc
|
@ -7,12 +7,14 @@ package com.rjconsultores.ventaboletos.entidad;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
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.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.OneToOne;
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.SequenceGenerator;
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
@ -69,11 +71,17 @@ public class Estacion implements Serializable {
|
||||||
@Column(name = "NOMEIMPRESSORARELATORIO")
|
@Column(name = "NOMEIMPRESSORARELATORIO")
|
||||||
private String nomeImpressoraRelatorio;
|
private String nomeImpressoraRelatorio;
|
||||||
|
|
||||||
|
@JoinColumn(name = "ESTACIONSITEF_ID")
|
||||||
|
@ManyToOne(cascade=CascadeType.ALL)
|
||||||
|
private EstacionSitef estacionSitefId;
|
||||||
|
|
||||||
public Estacion() {
|
public Estacion() {
|
||||||
|
this.estacionSitefId = new EstacionSitef();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Estacion(Integer estacionId) {
|
public Estacion(Integer estacionId) {
|
||||||
this.estacionId = estacionId;
|
this.estacionId = estacionId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getEstacionId() {
|
public Integer getEstacionId() {
|
||||||
|
@ -188,6 +196,15 @@ public class Estacion implements Serializable {
|
||||||
this.nomeImpressoraRelatorio = nomeImpressoraRelatorio;
|
this.nomeImpressoraRelatorio = nomeImpressoraRelatorio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public EstacionSitef getEstacionSitefId() {
|
||||||
|
return estacionSitefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstacionSitefId(EstacionSitef estacionSitefId) {
|
||||||
|
this.estacionSitefId = estacionSitefId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
|
|
|
@ -0,0 +1,156 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
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.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author RJ
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "ESTACION_SITEF")
|
||||||
|
@SequenceGenerator(name = "ESTACION_SITEF_SEQ", sequenceName = "ESTACION_SITEF_SEQ", allocationSize = 1)
|
||||||
|
public class EstacionSitef implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ESTACION_SITEF_SEQ")
|
||||||
|
@Column(name = "ESTACIONSITEF_ID")
|
||||||
|
private Integer estacionsitefId;
|
||||||
|
@Column(name = "NUMEMPRESA")
|
||||||
|
private Integer numempresa;
|
||||||
|
@Column(name = "NUMFILIAL")
|
||||||
|
private Integer numfilial;
|
||||||
|
@Column(name = "NUMPDV")
|
||||||
|
private Integer numpdv;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "estacionSitefId")
|
||||||
|
private List<Estacion> estacionList;
|
||||||
|
|
||||||
|
public EstacionSitef() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public EstacionSitef(Integer estacionsitefId) {
|
||||||
|
this.estacionsitefId = estacionsitefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEstacionsitefId() {
|
||||||
|
return estacionsitefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstacionsitefId(Integer estacionsitefId) {
|
||||||
|
this.estacionsitefId = estacionsitefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumempresa() {
|
||||||
|
return numempresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumempresa(Integer numempresa) {
|
||||||
|
this.numempresa = numempresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumfilial() {
|
||||||
|
return numfilial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumfilial(Integer numfilial) {
|
||||||
|
this.numfilial = numfilial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumpdv() {
|
||||||
|
return numpdv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumpdv(Integer numpdv) {
|
||||||
|
this.numpdv = numpdv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Estacion> getEstacionList() {
|
||||||
|
return estacionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstacionList(List<Estacion> estacionList) {
|
||||||
|
this.estacionList = estacionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (estacionsitefId != null ? estacionsitefId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||||
|
if (!(object instanceof EstacionSitef)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EstacionSitef other = (EstacionSitef) object;
|
||||||
|
if ((this.estacionsitefId == null && other.estacionsitefId != null) || (this.estacionsitefId != null && !this.estacionsitefId.equals(other.estacionsitefId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "com.rjconsultores.ventaboletos.entidad.EstacionSitef[ estacionsitefId=" + estacionsitefId + " ]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -117,19 +117,19 @@ public class PuntoVenta implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
@JoinColumn(name = "PTOVTACOMISSAO_ID")
|
@JoinColumn(name = "PTOVTACOMISSAO_ID")
|
||||||
@OneToOne(cascade=CascadeType.ALL)
|
@ManyToOne(cascade=CascadeType.ALL)
|
||||||
private PtovtaComissao comissaoId;
|
private PtovtaComissao comissaoId;
|
||||||
|
|
||||||
@JoinColumn(name = "PTOVTADIVERSOS_ID")
|
@JoinColumn(name = "PTOVTADIVERSOS_ID")
|
||||||
@OneToOne(cascade=CascadeType.ALL)
|
@ManyToOne(cascade=CascadeType.ALL)
|
||||||
private PtovtaDiversos diversosId;
|
private PtovtaDiversos diversosId;
|
||||||
|
|
||||||
@JoinColumn(name = "PTOVTAAGENCIA_ID")
|
@JoinColumn(name = "PTOVTAAGENCIA_ID")
|
||||||
@OneToOne(cascade=CascadeType.ALL)
|
@ManyToOne(cascade=CascadeType.ALL)
|
||||||
private PtovtaAgencia agenciaId;
|
private PtovtaAgencia agenciaId;
|
||||||
|
|
||||||
@JoinColumn(name = "PTOVTATITULAR_ID")
|
@JoinColumn(name = "PTOVTATITULAR_ID")
|
||||||
@OneToOne(cascade=CascadeType.ALL)
|
@ManyToOne(cascade=CascadeType.ALL)
|
||||||
private PtovtaTitular titularId;
|
private PtovtaTitular titularId;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,12 @@ public class EstacionServiceImpl implements EstacionService {
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
if(entidad.getEstacionSitefId() != null){
|
||||||
|
entidad.getEstacionSitefId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.getEstacionSitefId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.getEstacionSitefId().setActivo(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
estacionDAO.actualizacion(entidad);
|
estacionDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.service.impl;
|
||||||
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
|
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaEstoque;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService;
|
import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
|
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
|
||||||
|
@ -65,6 +66,38 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
forma.setActivo(Boolean.FALSE);
|
forma.setActivo(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for (PtovtaEstoque forma : entidad.getPtovtaEstoqueList()) {
|
||||||
|
// forma.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
// forma.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
// forma.setActivo(Boolean.FALSE);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(entidad.getAgenciaId() != null){
|
||||||
|
|
||||||
|
entidad.getAgenciaId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.getAgenciaId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.getAgenciaId().setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entidad.getComissaoId() != null){
|
||||||
|
entidad.getComissaoId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.getComissaoId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.getComissaoId().setActivo(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entidad.getDiversosId() != null){
|
||||||
|
entidad.getDiversosId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.getDiversosId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.getDiversosId().setActivo(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entidad.getTitularId() != null){
|
||||||
|
entidad.getTitularId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.getTitularId().setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.getTitularId().setActivo(Boolean.FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue