- Estrutura para tela de impostos por estado
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@28620 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e1e85ce5be
commit
ca48b5c846
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
// * To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Bruno H. G. Gouvêa <bruno@rjconsultores.com.br>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface EmpresaImpostoDAO extends GenericDAO<EmpresaImposto, Integer> {
|
||||||
|
public List<EmpresaImposto> buscarByEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -15,4 +16,6 @@ import java.util.List;
|
||||||
public interface EstadoDAO extends GenericDAO<Estado, Integer> {
|
public interface EstadoDAO extends GenericDAO<Estado, Integer> {
|
||||||
|
|
||||||
public List<Estado> buscar(String nombestado, Pais pais);
|
public List<Estado> buscar(String nombestado, Pais pais);
|
||||||
|
|
||||||
|
public List<Estado> buscarNotInEmpresaImposto(Empresa empresa);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Order;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaImpostoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Bruno H. G. Gouvêa <bruno@rjconsultores.com.br>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository("empresaImpostoDAO")
|
||||||
|
public class EmpresaImpostoHibernateDAO extends GenericHibernateDAO<EmpresaImposto, Integer>
|
||||||
|
implements EmpresaImpostoDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EmpresaImpostoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EmpresaImposto> buscarByEmpresa(Empresa empresa) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("empresa", empresa));
|
||||||
|
|
||||||
|
c.addOrder(Order.asc("estado"));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,10 +5,13 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.EstadoDAO;
|
import com.rjconsultores.ventaboletos.dao.EstadoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
@ -16,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author MCosso
|
* @author MCosso
|
||||||
|
@ -46,4 +50,28 @@ public class EstadoHibernateDAO extends GenericHibernateDAO<Estado, Integer>
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Estado> buscarNotInEmpresaImposto(Empresa empresa) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append(" select es ");
|
||||||
|
sb.append(" from Estado es ");
|
||||||
|
sb.append(" where es.activo = 1 ");
|
||||||
|
sb.append(" and es.estadoId not in ( ");
|
||||||
|
sb.append(" select ei.estado.estadoId from EmpresaImposto ei ");
|
||||||
|
sb.append(" where ei.activo = 1 and ei.empresa.empresaId =:empresaId ");
|
||||||
|
sb.append(" )");
|
||||||
|
sb.append(" order by es.nombestado");
|
||||||
|
|
||||||
|
|
||||||
|
Query query = getSession().createQuery(sb.toString());
|
||||||
|
query.setParameter("empresaId", empresa.getEmpresaId());
|
||||||
|
|
||||||
|
List<Estado> lsEstado = query.list();
|
||||||
|
|
||||||
|
|
||||||
|
return lsEstado;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ package com.rjconsultores.ventaboletos.entidad;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
|
@ -23,6 +22,7 @@ import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
|
@ -81,6 +81,8 @@ public class Empresa implements Serializable {
|
||||||
@OneToOne(cascade = CascadeType.MERGE)
|
@OneToOne(cascade = CascadeType.MERGE)
|
||||||
@JoinColumn(name = "CIUDAD_ID")
|
@JoinColumn(name = "CIUDAD_ID")
|
||||||
private Ciudad cidade;
|
private Ciudad cidade;
|
||||||
|
@OneToMany(mappedBy = "empresa")
|
||||||
|
private List<EmpresaImposto> empresaImpostoList;
|
||||||
|
|
||||||
public Empresa() {
|
public Empresa() {
|
||||||
}
|
}
|
||||||
|
@ -285,4 +287,13 @@ public class Empresa implements Serializable {
|
||||||
public void setCorridaList1(List<Corrida> corridaList1) {
|
public void setCorridaList1(List<Corrida> corridaList1) {
|
||||||
this.corridaList1 = corridaList1;
|
this.corridaList1 = corridaList1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<EmpresaImposto> getEmpresaImpostoList() {
|
||||||
|
|
||||||
|
return this.empresaImpostoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaImpostoList(List<EmpresaImposto> empresaImpostoList) {
|
||||||
|
this.empresaImpostoList = empresaImpostoList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,595 @@
|
||||||
|
/*
|
||||||
|
* 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.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "EMPRESA_IMPOSTO_SEQ", sequenceName = "EMPRESA_IMPOSTO_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "EMPRESA_IMPOSTO")
|
||||||
|
public class EmpresaImposto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_IMPOSTO_SEQ")
|
||||||
|
@Column(name = "EMPRESAIMPOSTO_ID")
|
||||||
|
private Integer empresaImpostoId;
|
||||||
|
|
||||||
|
@Column(name = "ICMS")
|
||||||
|
private BigDecimal icms;
|
||||||
|
|
||||||
|
@Column(name = "INDTARIFAMUNICIPAL")
|
||||||
|
private Boolean indTarifaMunicipal;
|
||||||
|
@Column(name = "INDSEGUROMUNICIPAL")
|
||||||
|
private Boolean indSeguroMunicipal;
|
||||||
|
@Column(name = "INDTXEMBARQUEMUNICIPAL")
|
||||||
|
private Boolean indTxEmbarqueMunicipal;
|
||||||
|
@Column(name = "INDPEDAGIOMUNICIPAL")
|
||||||
|
private Boolean indPedagioMunicipal;
|
||||||
|
@Column(name = "INDTARIFAESTADUAL")
|
||||||
|
private Boolean indTarifaEstadual;
|
||||||
|
@Column(name = "INDSEGUROESTADUAL")
|
||||||
|
private Boolean indSeguroEstadual;
|
||||||
|
@Column(name = "INDTXEMBARQUEESTADUAL")
|
||||||
|
private Boolean indTxEmbarqueEstadual;
|
||||||
|
@Column(name = "INDPEDAGIOESTDUAL")
|
||||||
|
private Boolean indPedadioEstdual;
|
||||||
|
|
||||||
|
@Column(name = "PORCREDMUNICIPAL")
|
||||||
|
private BigDecimal porCredMunicipal;
|
||||||
|
@Column(name = "PORCREDESTADUAL")
|
||||||
|
private BigDecimal porCredEstadual;
|
||||||
|
@Column(name = "PORCREDBASEICMS")
|
||||||
|
private BigDecimal porCredBaseIcms;
|
||||||
|
|
||||||
|
@Column(name = "INDJANEIRO")
|
||||||
|
private Boolean indJaneiro;
|
||||||
|
@Column(name = "INDFEVEREIRO")
|
||||||
|
private Boolean indFevereiro;
|
||||||
|
@Column(name = "INDMARCO")
|
||||||
|
private Boolean indMarco;
|
||||||
|
@Column(name = "INDABRIL")
|
||||||
|
private Boolean indAbril;
|
||||||
|
@Column(name = "INDMAIO")
|
||||||
|
private Boolean indMaio;
|
||||||
|
@Column(name = "INDJUNHO")
|
||||||
|
private Boolean indJunho;
|
||||||
|
@Column(name = "INDJULHO")
|
||||||
|
private Boolean indJulho;
|
||||||
|
@Column(name = "INDAGOSTO")
|
||||||
|
private Boolean indAgosto;
|
||||||
|
@Column(name = "INDSETEMBRO")
|
||||||
|
private Boolean indSetembro;
|
||||||
|
@Column(name = "INDOUTUBRO")
|
||||||
|
private Boolean indOutubro;
|
||||||
|
@Column(name = "INDNOVEMBRO")
|
||||||
|
private Boolean indNovembro;
|
||||||
|
@Column(name = "INDDEZEMBRO")
|
||||||
|
private Boolean indDezembro;
|
||||||
|
|
||||||
|
@Column(name = "INDOUTROSISENTO")
|
||||||
|
private Boolean indOutrosIsento;
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@JoinColumn(name = "ESTADO_ID", referencedColumnName = "ESTADO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Estado estado;
|
||||||
|
|
||||||
|
public EmpresaImposto() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the empresaImpostoId
|
||||||
|
*/
|
||||||
|
public Integer getEmpresaImpostoId() {
|
||||||
|
return empresaImpostoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param empresaImpostoId
|
||||||
|
* the empresaImpostoId to set
|
||||||
|
*/
|
||||||
|
public void setEmpresaImpostoId(Integer empresaImpostoId) {
|
||||||
|
this.empresaImpostoId = empresaImpostoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the icms
|
||||||
|
*/
|
||||||
|
public BigDecimal getIcms() {
|
||||||
|
return icms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param icms
|
||||||
|
* the icms to set
|
||||||
|
*/
|
||||||
|
public void setIcms(BigDecimal icms) {
|
||||||
|
this.icms = icms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indTarifaMunicipal
|
||||||
|
*/
|
||||||
|
public Boolean getIndTarifaMunicipal() {
|
||||||
|
return indTarifaMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indTarifaMunicipal
|
||||||
|
* the indTarifaMunicipal to set
|
||||||
|
*/
|
||||||
|
public void setIndTarifaMunicipal(Boolean indTarifaMunicipal) {
|
||||||
|
this.indTarifaMunicipal = indTarifaMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indSeguroMunicipal
|
||||||
|
*/
|
||||||
|
public Boolean getIndSeguroMunicipal() {
|
||||||
|
return indSeguroMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indSeguroMunicipal
|
||||||
|
* the indSeguroMunicipal to set
|
||||||
|
*/
|
||||||
|
public void setIndSeguroMunicipal(Boolean indSeguroMunicipal) {
|
||||||
|
this.indSeguroMunicipal = indSeguroMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indTxEmbarqueMunicipal
|
||||||
|
*/
|
||||||
|
public Boolean getIndTxEmbarqueMunicipal() {
|
||||||
|
return indTxEmbarqueMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indTxEmbarqueMunicipal
|
||||||
|
* the indTxEmbarqueMunicipal to set
|
||||||
|
*/
|
||||||
|
public void setIndTxEmbarqueMunicipal(Boolean indTxEmbarqueMunicipal) {
|
||||||
|
this.indTxEmbarqueMunicipal = indTxEmbarqueMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indPedagioMunicipal
|
||||||
|
*/
|
||||||
|
public Boolean getIndPedagioMunicipal() {
|
||||||
|
return indPedagioMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indPedagioMunicipal
|
||||||
|
* the indPedagioMunicipal to set
|
||||||
|
*/
|
||||||
|
public void setIndPedagioMunicipal(Boolean indPedagioMunicipal) {
|
||||||
|
this.indPedagioMunicipal = indPedagioMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indTarifaEstadual
|
||||||
|
*/
|
||||||
|
public Boolean getIndTarifaEstadual() {
|
||||||
|
return indTarifaEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indTarifaEstadual
|
||||||
|
* the indTarifaEstadual to set
|
||||||
|
*/
|
||||||
|
public void setIndTarifaEstadual(Boolean indTarifaEstadual) {
|
||||||
|
this.indTarifaEstadual = indTarifaEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indSeguroEstadual
|
||||||
|
*/
|
||||||
|
public Boolean getIndSeguroEstadual() {
|
||||||
|
return indSeguroEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indSeguroEstadual
|
||||||
|
* the indSeguroEstadual to set
|
||||||
|
*/
|
||||||
|
public void setIndSeguroEstadual(Boolean indSeguroEstadual) {
|
||||||
|
this.indSeguroEstadual = indSeguroEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indTxEmbarqueEstadual
|
||||||
|
*/
|
||||||
|
public Boolean getIndTxEmbarqueEstadual() {
|
||||||
|
return indTxEmbarqueEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indTxEmbarqueEstadual
|
||||||
|
* the indTxEmbarqueEstadual to set
|
||||||
|
*/
|
||||||
|
public void setIndTxEmbarqueEstadual(Boolean indTxEmbarqueEstadual) {
|
||||||
|
this.indTxEmbarqueEstadual = indTxEmbarqueEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indPedadioEstdual
|
||||||
|
*/
|
||||||
|
public Boolean getIndPedadioEstdual() {
|
||||||
|
return indPedadioEstdual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indPedadioEstdual
|
||||||
|
* the indPedadioEstdual to set
|
||||||
|
*/
|
||||||
|
public void setIndPedadioEstdual(Boolean indPedadioEstdual) {
|
||||||
|
this.indPedadioEstdual = indPedadioEstdual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the porCredMunicipal
|
||||||
|
*/
|
||||||
|
public BigDecimal getPorCredMunicipal() {
|
||||||
|
return porCredMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param porCredMunicipal
|
||||||
|
* the porCredMunicipal to set
|
||||||
|
*/
|
||||||
|
public void setPorCredMunicipal(BigDecimal porCredMunicipal) {
|
||||||
|
this.porCredMunicipal = porCredMunicipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the porCredEstadual
|
||||||
|
*/
|
||||||
|
public BigDecimal getPorCredEstadual() {
|
||||||
|
return porCredEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param porCredEstadual
|
||||||
|
* the porCredEstadual to set
|
||||||
|
*/
|
||||||
|
public void setPorCredEstadual(BigDecimal porCredEstadual) {
|
||||||
|
this.porCredEstadual = porCredEstadual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the porCredBaseIcms
|
||||||
|
*/
|
||||||
|
public BigDecimal getPorCredBaseIcms() {
|
||||||
|
return porCredBaseIcms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param porCredBaseIcms
|
||||||
|
* the porCredBaseIcms to set
|
||||||
|
*/
|
||||||
|
public void setPorCredBaseIcms(BigDecimal porCredBaseIcms) {
|
||||||
|
this.porCredBaseIcms = porCredBaseIcms;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indJaneiro
|
||||||
|
*/
|
||||||
|
public Boolean getIndJaneiro() {
|
||||||
|
return indJaneiro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indJaneiro
|
||||||
|
* the indJaneiro to set
|
||||||
|
*/
|
||||||
|
public void setIndJaneiro(Boolean indJaneiro) {
|
||||||
|
this.indJaneiro = indJaneiro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indFevereiro
|
||||||
|
*/
|
||||||
|
public Boolean getIndFevereiro() {
|
||||||
|
return indFevereiro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indFevereiro
|
||||||
|
* the indFevereiro to set
|
||||||
|
*/
|
||||||
|
public void setIndFevereiro(Boolean indFevereiro) {
|
||||||
|
this.indFevereiro = indFevereiro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indMarco
|
||||||
|
*/
|
||||||
|
public Boolean getIndMarco() {
|
||||||
|
return indMarco;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indMarco
|
||||||
|
* the indMarco to set
|
||||||
|
*/
|
||||||
|
public void setIndMarco(Boolean indMarco) {
|
||||||
|
this.indMarco = indMarco;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indAbril
|
||||||
|
*/
|
||||||
|
public Boolean getIndAbril() {
|
||||||
|
return indAbril;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indAbril
|
||||||
|
* the indAbril to set
|
||||||
|
*/
|
||||||
|
public void setIndAbril(Boolean indAbril) {
|
||||||
|
this.indAbril = indAbril;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indMaio
|
||||||
|
*/
|
||||||
|
public Boolean getIndMaio() {
|
||||||
|
return indMaio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indMaio
|
||||||
|
* the indMaio to set
|
||||||
|
*/
|
||||||
|
public void setIndMaio(Boolean indMaio) {
|
||||||
|
this.indMaio = indMaio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indJunho
|
||||||
|
*/
|
||||||
|
public Boolean getIndJunho() {
|
||||||
|
return indJunho;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indJunho
|
||||||
|
* the indJunho to set
|
||||||
|
*/
|
||||||
|
public void setIndJunho(Boolean indJunho) {
|
||||||
|
this.indJunho = indJunho;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indJulho
|
||||||
|
*/
|
||||||
|
public Boolean getIndJulho() {
|
||||||
|
return indJulho;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indJulho
|
||||||
|
* the indJulho to set
|
||||||
|
*/
|
||||||
|
public void setIndJulho(Boolean indJulho) {
|
||||||
|
this.indJulho = indJulho;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indAgosto
|
||||||
|
*/
|
||||||
|
public Boolean getIndAgosto() {
|
||||||
|
return indAgosto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indAgosto
|
||||||
|
* the indAgosto to set
|
||||||
|
*/
|
||||||
|
public void setIndAgosto(Boolean indAgosto) {
|
||||||
|
this.indAgosto = indAgosto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indSetembro
|
||||||
|
*/
|
||||||
|
public Boolean getIndSetembro() {
|
||||||
|
return indSetembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indSetembro
|
||||||
|
* the indSetembro to set
|
||||||
|
*/
|
||||||
|
public void setIndSetembro(Boolean indSetembro) {
|
||||||
|
this.indSetembro = indSetembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indOutubro
|
||||||
|
*/
|
||||||
|
public Boolean getIndOutubro() {
|
||||||
|
return indOutubro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indOutubro
|
||||||
|
* the indOutubro to set
|
||||||
|
*/
|
||||||
|
public void setIndOutubro(Boolean indOutubro) {
|
||||||
|
this.indOutubro = indOutubro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indNovembro
|
||||||
|
*/
|
||||||
|
public Boolean getIndNovembro() {
|
||||||
|
return indNovembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indNovembro
|
||||||
|
* the indNovembro to set
|
||||||
|
*/
|
||||||
|
public void setIndNovembro(Boolean indNovembro) {
|
||||||
|
this.indNovembro = indNovembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indDezembro
|
||||||
|
*/
|
||||||
|
public Boolean getIndDezembro() {
|
||||||
|
return indDezembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indDezembro
|
||||||
|
* the indDezembro to set
|
||||||
|
*/
|
||||||
|
public void setIndDezembro(Boolean indDezembro) {
|
||||||
|
this.indDezembro = indDezembro;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the indOutrosIsento
|
||||||
|
*/
|
||||||
|
public Boolean getIndOutrosIsento() {
|
||||||
|
return indOutrosIsento;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param indOutrosIsento
|
||||||
|
* the indOutrosIsento to set
|
||||||
|
*/
|
||||||
|
public void setIndOutrosIsento(Boolean indOutrosIsento) {
|
||||||
|
this.indOutrosIsento = indOutrosIsento;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the activo
|
||||||
|
*/
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param activo
|
||||||
|
* the activo to set
|
||||||
|
*/
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the fecmodif
|
||||||
|
*/
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param fecmodif
|
||||||
|
* the fecmodif to set
|
||||||
|
*/
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the usuarioId
|
||||||
|
*/
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param usuarioId
|
||||||
|
* the usuarioId to set
|
||||||
|
*/
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the empresa
|
||||||
|
*/
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param empresa
|
||||||
|
* the empresa to set
|
||||||
|
*/
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Estado getEstado() {
|
||||||
|
return estado;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setEstado(Estado estado) {
|
||||||
|
this.estado = estado;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (empresaImpostoId != null ? empresaImpostoId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof EmpresaImposto)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
EmpresaImposto other = (EmpresaImposto) object;
|
||||||
|
if ((this.empresaImpostoId == null && other.empresaImpostoId != null) || (this.empresaImpostoId != null && !this.empresaImpostoId.equals(other.empresaImpostoId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "com.rjconsultores.ventaboletos.entidad.EmpresaImposto[empresaImpostoId=" + empresaImpostoId + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -58,6 +58,8 @@ public class Estado implements Serializable {
|
||||||
private List<Ciudad> ciudadList;
|
private List<Ciudad> ciudadList;
|
||||||
@Column(name = "ICMS")
|
@Column(name = "ICMS")
|
||||||
private BigDecimal icms;
|
private BigDecimal icms;
|
||||||
|
@OneToMany(mappedBy = "estado")
|
||||||
|
private List<EmpresaImposto> empresaImpostoList;
|
||||||
|
|
||||||
public Estado() {
|
public Estado() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Administrador
|
||||||
|
*/
|
||||||
|
public interface EmpresaImpostoService extends GenericService<EmpresaImposto, Integer> {
|
||||||
|
|
||||||
|
public List<EmpresaImposto> buscarByEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
@ -27,4 +28,6 @@ public interface EstadoService {
|
||||||
public void borrar(Estado entidad) throws RegistroConDependenciaException;
|
public void borrar(Estado entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<Estado> buscar(String nombestado, Pais pais);
|
public List<Estado> buscar(String nombestado, Pais pais);
|
||||||
|
|
||||||
|
public List<Estado> buscarNotInEmpresaImposto(Empresa empresa);
|
||||||
}
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaImpostoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaImpostoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Administrador
|
||||||
|
*/
|
||||||
|
@Service("empresaImpostoService")
|
||||||
|
public class EmpresaImpostoServiceImpl implements EmpresaImpostoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaImpostoDAO empresaImpostoDAO;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public EmpresaImposto suscribir(EmpresaImposto entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaImpostoDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.rjconsultores.ventaboletos.service.GenericService#obtenerTodos()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmpresaImposto> obtenerTodos() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.rjconsultores.ventaboletos.service.GenericService#obtenerID(java.lang.Object)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmpresaImposto obtenerID(Integer id) {
|
||||||
|
return empresaImpostoDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public EmpresaImposto actualizacion(EmpresaImposto entidad) {
|
||||||
|
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
return empresaImpostoDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(EmpresaImposto entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
empresaImpostoDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaImposto> buscarByEmpresa(Empresa empresa) {
|
||||||
|
return empresaImpostoDAO.buscarByEmpresa(empresa);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.CiudadDAO;
|
import com.rjconsultores.ventaboletos.dao.CiudadDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.EstadoDAO;
|
import com.rjconsultores.ventaboletos.dao.EstadoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||||
|
@ -26,52 +27,57 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
@Service("estadoService")
|
@Service("estadoService")
|
||||||
public class EstadoServiceImpl implements EstadoService {
|
public class EstadoServiceImpl implements EstadoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EstadoDAO estadoDAO;
|
private EstadoDAO estadoDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CiudadDAO ciudadDAO;
|
private CiudadDAO ciudadDAO;
|
||||||
|
|
||||||
public List<Estado> obtenerTodos() {
|
public List<Estado> obtenerTodos() {
|
||||||
return estadoDAO.obtenerTodos();
|
return estadoDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Estado obtenerID(Integer id) {
|
public Estado obtenerID(Integer id) {
|
||||||
return estadoDAO.obtenerID(id);
|
return estadoDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Estado suscribir(Estado entidad) {
|
public Estado suscribir(Estado entidad) {
|
||||||
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 estadoDAO.suscribir(entidad);
|
return estadoDAO.suscribir(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Estado actualizacion(Estado entidad) {
|
public Estado actualizacion(Estado entidad) {
|
||||||
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 estadoDAO.actualizacion(entidad);
|
return estadoDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void borrar(Estado entidad) throws RegistroConDependenciaException {
|
public void borrar(Estado entidad) throws RegistroConDependenciaException {
|
||||||
|
|
||||||
if (ciudadDAO.count("estado", entidad) > 0l){
|
if (ciudadDAO.count("estado", entidad) > 0l) {
|
||||||
throw new RegistroConDependenciaException();
|
throw new RegistroConDependenciaException();
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
estadoDAO.actualizacion(entidad);
|
estadoDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Estado> buscar(String nombestado, Pais pais) {
|
public List<Estado> buscar(String nombestado, Pais pais) {
|
||||||
return estadoDAO.buscar(nombestado, pais);
|
return estadoDAO.buscar(nombestado, pais);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Estado> buscarNotInEmpresaImposto(Empresa empresa) {
|
||||||
|
return estadoDAO.buscarNotInEmpresaImposto(empresa);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue