#fixed bug #7292 - desenvolvimento nota tela: Cadastro Aliquota ECF
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@54423 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5de46620aa
commit
d9df7fc573
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.FiscalAliquotaEmpresa;
|
||||||
|
|
||||||
|
public interface FiscalAliquotaEmpresaDAO extends GenericDAO<FiscalAliquotaEmpresa, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.FiscalAliquotaEmpresaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.FiscalAliquotaEmpresa;
|
||||||
|
|
||||||
|
@Repository("fiscalAliquotaEmpresaDAO")
|
||||||
|
public class FiscalAliquotaEmpresaHibernateDAO extends GenericHibernateDAO<FiscalAliquotaEmpresa, Integer>
|
||||||
|
implements FiscalAliquotaEmpresaDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public FiscalAliquotaEmpresaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
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 = "FISCAL_ALIQUOTA_EMP_SEQ", sequenceName = "FISCAL_ALIQUOTA_EMP_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "FISCAL_ALIQUOTA_EMPRESA")
|
||||||
|
public class FiscalAliquotaEmpresa implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FISCAL_ALIQUOTA_EMP_SEQ")
|
||||||
|
@Column(name = "FISCALALIQUOTAEMPRESA_ID")
|
||||||
|
private Integer fiscalAliquotaEmpresaId;
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "TOTALIZADOR")
|
||||||
|
private Integer totalizador;
|
||||||
|
@Column(name = "ICMS")
|
||||||
|
private BigDecimal icms;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Integer getFiscalAliquotaEmpresaId() {
|
||||||
|
return fiscalAliquotaEmpresaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFiscalAliquotaEmpresaId(Integer fiscalAliquotaEmpresaId) {
|
||||||
|
this.fiscalAliquotaEmpresaId = fiscalAliquotaEmpresaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotalizador() {
|
||||||
|
return totalizador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalizador(Integer totalizador) {
|
||||||
|
this.totalizador = totalizador;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getIcms() {
|
||||||
|
return icms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcms(BigDecimal icms) {
|
||||||
|
this.icms = icms;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return fiscalAliquotaEmpresaId.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (fiscalAliquotaEmpresaId != null ? fiscalAliquotaEmpresaId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof FiscalAliquotaEmpresa)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FiscalAliquotaEmpresa other = (FiscalAliquotaEmpresa) object;
|
||||||
|
if ((this.fiscalAliquotaEmpresaId == null && other.fiscalAliquotaEmpresaId != null) || (this.fiscalAliquotaEmpresaId != null && !this.fiscalAliquotaEmpresaId.equals(other.fiscalAliquotaEmpresaId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.FiscalAliquotaEmpresa;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
|
public interface FiscalAliquotaEmpresaService {
|
||||||
|
|
||||||
|
public List<FiscalAliquotaEmpresa> obtenerTodos();
|
||||||
|
|
||||||
|
public FiscalAliquotaEmpresa obtenerID(Integer id);
|
||||||
|
|
||||||
|
public FiscalAliquotaEmpresa suscribirActualizar(FiscalAliquotaEmpresa entidad) throws BusinessException;
|
||||||
|
|
||||||
|
public void borrar(FiscalAliquotaEmpresa entidad);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
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.FiscalAliquotaEmpresaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.FiscalAliquotaEmpresa;
|
||||||
|
import com.rjconsultores.ventaboletos.service.FiscalAliquotaEmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("fiscalAliquotaEmpresa")
|
||||||
|
public class FiscalAliquotaEmpresaServiceImpl implements FiscalAliquotaEmpresaService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FiscalAliquotaEmpresaDAO fiscalAliquotaEmpresaDAO;
|
||||||
|
|
||||||
|
public List<FiscalAliquotaEmpresa> obtenerTodos() {
|
||||||
|
return fiscalAliquotaEmpresaDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FiscalAliquotaEmpresa obtenerID(Integer id) {
|
||||||
|
return fiscalAliquotaEmpresaDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public FiscalAliquotaEmpresa suscribirActualizar(FiscalAliquotaEmpresa entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
if (entidad.getFiscalAliquotaEmpresaId() == null) {
|
||||||
|
return fiscalAliquotaEmpresaDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
return fiscalAliquotaEmpresaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(FiscalAliquotaEmpresa entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
fiscalAliquotaEmpresaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue