atualização de fonte
parent
3b481a4042
commit
3666279c81
|
@ -0,0 +1,15 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfTotemVentaRapida;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
|
||||||
|
public interface ConfTotemVentaRapidaDAO extends GenericDAO<ConfTotemVentaRapida, Integer> {
|
||||||
|
|
||||||
|
ConfTotemVentaRapida buscarOrigemDestino(Parada origem, Parada destino);
|
||||||
|
|
||||||
|
List<ConfTotemVentaRapida> buscarOrigem(Parada origem);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RegionMetropolitana;
|
import com.rjconsultores.ventaboletos.entidad.RegionMetropolitana;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.parada.ParadaVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -60,4 +61,6 @@ public interface ParadaDAO {
|
||||||
|
|
||||||
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada);
|
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada);
|
||||||
|
|
||||||
|
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
public interface PtovtaExcecaoMultaCancDAO extends GenericDAO<PtovtaExcecaoMultaCanc, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
|
||||||
|
|
||||||
|
@ -34,5 +35,6 @@ public interface RemessaCNABBancosDAO extends GenericDAO<FechamentoBoleto, Long>
|
||||||
|
|
||||||
public FechamentoBoleto obtenerFechamentoBoletoPorNossoNumero(String nossoNumero, Integer empresaId);
|
public FechamentoBoleto obtenerFechamentoBoletoPorNossoNumero(String nossoNumero, Integer empresaId);
|
||||||
|
|
||||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException;
|
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,15 @@ import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
||||||
|
|
||||||
public interface SapDAO extends GenericDAO<FechamentoCntcorrente, Long> {
|
public interface SapDAO extends GenericDAO<FechamentoCntcorrente, Long> {
|
||||||
|
|
||||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
||||||
|
|
||||||
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta);
|
||||||
|
|
||||||
public boolean atualizaFechamento(Long fechamentocntcorrenteId, int status) throws Exception;
|
public boolean atualizaFechamento(Long fechamentocntcorrenteId, int status) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
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.ConfTotemVentaRapidaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfTotemVentaRapida;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Wallace
|
||||||
|
*/
|
||||||
|
@Repository("ConfTotemVentaRapidaDAO")
|
||||||
|
public class ConfTotemVentaRapidaHibernateDAO extends GenericHibernateDAO<ConfTotemVentaRapida, Integer> implements ConfTotemVentaRapidaDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConfTotemVentaRapidaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfTotemVentaRapida buscarOrigemDestino(Parada origem, Parada destino) {
|
||||||
|
|
||||||
|
Criteria c = this.makeCriteria();
|
||||||
|
c.add(Restrictions.eq("origen", origem));
|
||||||
|
c.add(Restrictions.eq("destino", destino));
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return (ConfTotemVentaRapida) c.uniqueResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfTotemVentaRapida> buscarOrigem(Parada origem) {
|
||||||
|
|
||||||
|
Criteria c = this.makeCriteria();
|
||||||
|
c.add(Restrictions.eq("origen", origem));
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,6 +52,7 @@ import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.DiaConferenciaComissaoVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.DiaConferenciaComissaoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.comissao.FormaPagoEventosFinanceirosVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.FormapagoVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.FormapagoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||||
|
@ -709,8 +710,18 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
||||||
eventosFinanceiros.setTurnoId(rSet.getInt("turnoId"));
|
eventosFinanceiros.setTurnoId(rSet.getInt("turnoId"));
|
||||||
|
|
||||||
eventosFinanceiros.setConferencia(conferencia);
|
eventosFinanceiros.setConferencia(conferencia);
|
||||||
if (!result.contains(eventosFinanceiros)) {
|
|
||||||
result.add(eventosFinanceiros);
|
|
||||||
|
if (result.contains(eventosFinanceiros)) {
|
||||||
|
int indice = result.indexOf(eventosFinanceiros);
|
||||||
|
EventosFinanceirosVO aux = result.get(indice);
|
||||||
|
FormaPagoEventosFinanceirosVO formapagoVO = new FormaPagoEventosFinanceirosVO(eventosFinanceiros.getFormapagoId(),eventosFinanceiros.getDescpago(),eventosFinanceiros.getImpingreso());
|
||||||
|
aux.getFormapagos().add(formapagoVO);
|
||||||
|
result.set(indice, aux);
|
||||||
|
}else {
|
||||||
|
eventosFinanceiros.setFormapagos(new ArrayList<FormaPagoEventosFinanceirosVO>());
|
||||||
|
eventosFinanceiros.getFormapagos().add(new FormaPagoEventosFinanceirosVO(eventosFinanceiros.getFormapagoId(),eventosFinanceiros.getDescpago(),eventosFinanceiros.getImpingreso()));
|
||||||
|
result.add(eventosFinanceiros);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,15 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
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.MatchMode;
|
import org.hibernate.criterion.MatchMode;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Projections;
|
import org.hibernate.criterion.Projections;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||||
|
import org.hibernate.type.IntegerType;
|
||||||
|
import org.hibernate.type.StringType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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;
|
||||||
|
@ -24,6 +28,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RegionMetropolitana;
|
import com.rjconsultores.ventaboletos.entidad.RegionMetropolitana;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.parada.ParadaVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -140,6 +145,36 @@ public class ParadaHibernateDAO extends GenericHibernateDAO<Parada, Integer> imp
|
||||||
return getSession().createQuery(sql).setEntity("origem", origem).list();
|
return getSession().createQuery(sql).setEntity("origem", origem).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Parada> buscarDestinosPorOrigem(Integer origenId){
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.append("select distinct p.PARADA_ID as paradaId, p.CVEPARADA as cveparada, p.DESCPARADA as descparada from RUTA_COMBINACION rc ")
|
||||||
|
.append("inner join ruta r on rc.RUTA_ID=r.RUTA_ID ")
|
||||||
|
.append("inner join ESQUEMA_CORRIDA ec on r.RUTA_ID=ec.RUTA_ID ")
|
||||||
|
.append("inner join corrida c on ec.NUMCORRIDA=c.CORRIDA_ID ")
|
||||||
|
.append("inner join parada p on p.parada_id=c.DESTINO_ID ")
|
||||||
|
.append("where rc.ACTIVO = 1 and r.activo=1 and ec.activo=1 and c.activo=1 and p.activo = 1 and c.ORIGEN_ID=:origenId");
|
||||||
|
|
||||||
|
Query qry = getSession().createSQLQuery(sb.toString())
|
||||||
|
.addScalar("paradaId", IntegerType.INSTANCE)
|
||||||
|
.addScalar("cveparada", StringType.INSTANCE)
|
||||||
|
.addScalar("descparada", StringType.INSTANCE)
|
||||||
|
.setResultTransformer(new AliasToBeanResultTransformer(Parada.class));
|
||||||
|
|
||||||
|
qry.setInteger("origenId", origenId);
|
||||||
|
|
||||||
|
List<Parada> list = qry.list();
|
||||||
|
|
||||||
|
if (list.size() > 0) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public List<Parada> buscaParadaRegionMetropolitana(RegionMetropolitana regionMetropolitana) {
|
public List<Parada> buscaParadaRegionMetropolitana(RegionMetropolitana regionMetropolitana) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
|
@ -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.PtovtaExcecaoMultaCancDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
@Repository("ptovtaExcecaoMultaCancHibernateDAO")
|
||||||
|
public class PtovtaExcecaoMultaCancHibernateDAO extends GenericHibernateDAO<PtovtaExcecaoMultaCanc, Integer> implements PtovtaExcecaoMultaCancDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PtovtaExcecaoMultaCancHibernateDAO(
|
||||||
|
@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -28,6 +28,7 @@ import com.rjconsultores.ventaboletos.ArquivoRemessa;
|
||||||
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
import com.rjconsultores.ventaboletos.ArquivoRemessaItem;
|
||||||
import com.rjconsultores.ventaboletos.ArquivoRemessaItemInteface;
|
import com.rjconsultores.ventaboletos.ArquivoRemessaItemInteface;
|
||||||
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
import com.rjconsultores.ventaboletos.blocos.DetalheObrigatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.blocos.DetalheRetorno;
|
||||||
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
import com.rjconsultores.ventaboletos.blocos.RodapeRemessaPadrao;
|
||||||
import com.rjconsultores.ventaboletos.blocos.bancobrasil.ArquivoRemessaBancoBrasil;
|
import com.rjconsultores.ventaboletos.blocos.bancobrasil.ArquivoRemessaBancoBrasil;
|
||||||
import com.rjconsultores.ventaboletos.blocos.bancobrasil.CabecalhoLoteRemessaBancoBrasil;
|
import com.rjconsultores.ventaboletos.blocos.bancobrasil.CabecalhoLoteRemessaBancoBrasil;
|
||||||
|
@ -829,7 +830,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
detalhe.setCepSacado(Integer.valueOf(tupla[24].toString()));
|
detalhe.setCepSacado(tupla[24].toString());
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
throw new RuntimeException("O CEP do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
throw new RuntimeException("O CEP do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||||
}
|
}
|
||||||
|
@ -1719,7 +1720,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId) throws SQLException {
|
public boolean quitarFechamentoBoleto(Long fechamentoboletoId, Integer usuarioId, DetalheRetorno detalhe) throws SQLException {
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
Connection con = getSession().connection();
|
Connection con = getSession().connection();
|
||||||
|
@ -1730,6 +1731,16 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
qry.append(" update FECHAMENTO_BOLETO set INDBOLETOQUITADO = 1, ");
|
qry.append(" update FECHAMENTO_BOLETO set INDBOLETOQUITADO = 1, ");
|
||||||
qry.append(" FECMODIF = SYSDATE, ");
|
qry.append(" FECMODIF = SYSDATE, ");
|
||||||
qry.append(" USUARIO_ID_QUITA = ").append(usuarioId);
|
qry.append(" USUARIO_ID_QUITA = ").append(usuarioId);
|
||||||
|
qry.append(" , FECBAIXA = TO_DATE('");
|
||||||
|
qry.append( detalhe.getDataBaixa());
|
||||||
|
qry.append("', 'DDMMYY')");
|
||||||
|
|
||||||
|
if( detalhe.getValorJuros() != null) {
|
||||||
|
qry.append(" , VALOR_JUROS = ").append(detalhe.getValorJuros());
|
||||||
|
}else {
|
||||||
|
qry.append(" , VALOR_JUROS = 0 ");
|
||||||
|
}
|
||||||
|
|
||||||
qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId);
|
qry.append(" where FECHAMENTOBOLETO_ID = ").append(fechamentoboletoId);
|
||||||
qry.append(" AND ACTIVO = 1 ");
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository;
|
||||||
import com.rjconsultores.ventaboletos.dao.SapDAO;
|
import com.rjconsultores.ventaboletos.dao.SapDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
||||||
|
|
||||||
|
@ -27,9 +28,14 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
||||||
|
return obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta) {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(" SELECT ");
|
sb.append(" SELECT ");
|
||||||
|
@ -51,11 +57,13 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
||||||
sb.append(" ELSE to_char(fc.fecfechamento+1, 'yyyy-mm-DD') END as feclancamento ");
|
sb.append(" ELSE to_char(fc.fecfechamento+1, 'yyyy-mm-DD') END as feclancamento ");
|
||||||
sb.append(" FROM ");
|
sb.append(" FROM ");
|
||||||
sb.append(" fechamento_cntcorrente fc ");
|
sb.append(" fechamento_cntcorrente fc ");
|
||||||
sb.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = fc.puntoventa_id AND pv.activo = 1 ");
|
sb.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = fc.puntoventa_id AND pv.activo = 1 ");
|
||||||
sb.append(" INNER JOIN empresa emp ON emp.empresa_id = fc.empresa_id AND emp.activo = 1 ");
|
sb.append(" INNER JOIN empresa emp ON emp.empresa_id = fc.empresa_id AND emp.activo = 1 ");
|
||||||
sb.append(" LEFT JOIN ciudad ci ON ci.ciudad_id = emp.ciudad_id AND ci.activo = 1 ");
|
sb.append(" INNER JOIN FECHAMENTO_PARAMPTOVTA fp ON fp.PUNTOVENTA_ID = fc.puntoventa_id AND fp.activo =1 ");
|
||||||
sb.append(" LEFT JOIN plaza pl ON pl.plaza_id = ci.plaza_id AND pl.activo = 1 ");
|
sb.append(" AND fp.empresa_id = fc.empresa_id AND fp.TIPOPAGAMENTO = 'B'" );
|
||||||
sb.append(" LEFT JOIN estado es ON es.estado_id = ci.estado_id AND es.activo = 1 ");
|
sb.append(" LEFT JOIN ciudad ci ON ci.ciudad_id = emp.ciudad_id AND ci.activo = 1 ");
|
||||||
|
sb.append(" LEFT JOIN plaza pl ON pl.plaza_id = ci.plaza_id AND pl.activo = 1 ");
|
||||||
|
sb.append(" LEFT JOIN estado es ON es.estado_id = ci.estado_id AND es.activo = 1 ");
|
||||||
sb.append(" WHERE ");
|
sb.append(" WHERE ");
|
||||||
sb.append(" fc.activo = 1 ");
|
sb.append(" fc.activo = 1 ");
|
||||||
sb.append(" AND fc.fecfechamento BETWEEN :dataDe AND :dataAte ");
|
sb.append(" AND fc.fecfechamento BETWEEN :dataDe AND :dataAte ");
|
||||||
|
@ -64,8 +72,12 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
||||||
sb.append(" AND fc.EMPRESA_ID = :empresaId ");
|
sb.append(" AND fc.EMPRESA_ID = :empresaId ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( puntoVenta != null ) {
|
||||||
|
sb.append(" AND pv.puntoventa_id = :puntoVentaId ");
|
||||||
|
}
|
||||||
|
|
||||||
if(!reenviar){
|
if(!reenviar){
|
||||||
sb.append(" AND fc.indintegradosap IS NULL ");
|
sb.append(" AND fc.indintegradosap = 2 ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append(" ORDER BY ");
|
sb.append(" ORDER BY ");
|
||||||
|
@ -77,6 +89,10 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
||||||
query.setInteger("empresaId", empresa.getEmpresaId());
|
query.setInteger("empresaId", empresa.getEmpresaId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( puntoVenta != null ) {
|
||||||
|
query.setInteger("puntoVentaId", puntoVenta.getPuntoventaId());
|
||||||
|
}
|
||||||
|
|
||||||
if(dataDe != null && dataAte != null){
|
if(dataDe != null && dataAte != null){
|
||||||
query.setDate("dataDe", DateUtil.normalizarToFecha(dataDe));
|
query.setDate("dataDe", DateUtil.normalizarToFecha(dataDe));
|
||||||
query.setDate("dataAte", DateUtil.normalizarToFecha(dataAte));
|
query.setDate("dataAte", DateUtil.normalizarToFecha(dataAte));
|
||||||
|
|
|
@ -311,13 +311,15 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
sql.append(" using ");
|
sql.append(" using ");
|
||||||
sql.append(" ( ");
|
sql.append(" ( ");
|
||||||
sql.append(" WITH tarifas_ofic as ( ");
|
sql.append(" WITH tarifas_ofic as ( ");
|
||||||
sql.append(" select tarifaoficial_id, ORGAOCONCEDENTE_ID, ruta_id , origen_id , DESTINO_ID from tarifa_oficial where activo = 1");
|
sql.append(" select tarifaoficial_id, ORGAOCONCEDENTE_ID, ruta_id , origen_id , DESTINO_ID, MARCA_ID from tarifa_oficial where activo = 1");
|
||||||
sql.append(" ), ");
|
sql.append(" ), ");
|
||||||
|
|
||||||
sql.append(" noArtesp as (select p.destino_id dest, p.origen_id as orig , p.ruta_id as idruta ,p.orgaoconcedente_id as idorgao, ");
|
sql.append(" noArtesp as (select p.destino_id dest, p.origen_id as orig , p.ruta_id as idruta ,p.orgaoconcedente_id as idorgao, ");
|
||||||
sql.append(" p.importepeaje as importe , p.activo as actv from peaje p inner join tarifas_ofic tof on ");
|
sql.append(" p.importepeaje as importe , p.activo as actv, m.marca_id as marca from peaje p inner join tarifas_ofic tof on ");
|
||||||
sql.append(" p.ORGAOCONCEDENTE_ID = tof.ORGAOCONCEDENTE_ID and p.ruta_id = tof.ruta_id ");
|
sql.append(" p.ORGAOCONCEDENTE_ID = tof.ORGAOCONCEDENTE_ID and p.ruta_id = tof.ruta_id ");
|
||||||
sql.append(" and p.ORIGEN_ID = tof.ORIGEN_ID and p.DESTINO_ID = tof.DESTINO_ID and p.activo = 1), ");
|
sql.append(" and p.ORIGEN_ID = tof.ORIGEN_ID and p.DESTINO_ID = tof.DESTINO_ID and p.activo = 1 ");
|
||||||
|
sql.append(" inner join ruta_empresa re on p.ruta_id=re.ruta_id ");
|
||||||
|
sql.append(" inner join marca m on m.marca_id=tof.marca_id where re.empresa_id=m.empresa_id), ");
|
||||||
|
|
||||||
sql.append(" linha as ( select * from ruta where ruta_id in (select ruta_id from tarifas_ofic ) ) , ");
|
sql.append(" linha as ( select * from ruta where ruta_id in (select ruta_id from tarifas_ofic ) ) , ");
|
||||||
sql.append(" linha_voltaId as (select ru.ruta_id rutavolta_id, t_1.ruta_id as ida from ruta ru ");
|
sql.append(" linha_voltaId as (select ru.ruta_id rutavolta_id, t_1.ruta_id as ida from ruta ru ");
|
||||||
|
@ -377,7 +379,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
sql.append(" peaje_tarifas as ( ");
|
sql.append(" peaje_tarifas as ( ");
|
||||||
sql.append(" select * from peaje p inner join tarifas_ofic tof on ");
|
sql.append(" select * from peaje p inner join tarifas_ofic tof on ");
|
||||||
sql.append(" p.ORGAOCONCEDENTE_ID = tof.ORGAOCONCEDENTE_ID and p.ruta_id = tof.ruta_id ");
|
sql.append(" p.ORGAOCONCEDENTE_ID = tof.ORGAOCONCEDENTE_ID and p.ruta_id = tof.ruta_id ");
|
||||||
sql.append(" and p.ORIGEN_ID = tof.ORIGEN_ID and p.DESTINO_ID = tof.DESTINO_ID and p.activo = 1 ");
|
sql.append(" and p.ORIGEN_ID = tof.ORIGEN_ID and p.DESTINO_ID = tof.DESTINO_ID and noar.MARCA = tof.MARCA_ID and p.activo = 1 ");
|
||||||
sql.append(" ) ");
|
sql.append(" ) ");
|
||||||
sql.append(" select pf.tarifaoficial_id , sum(round(importepeaje,2)) as soma from peaje_tarifas pf Group by pf.tarifaoficial_id ");
|
sql.append(" select pf.tarifaoficial_id , sum(round(importepeaje,2)) as soma from peaje_tarifas pf Group by pf.tarifaoficial_id ");
|
||||||
sql.append(" ");
|
sql.append(" ");
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.TipoOcupacionDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
@ -14,43 +13,51 @@ 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;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.TipoOcupacionDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Repository("tipoOcupacionDAO")
|
@Repository("tipoOcupacionDAO")
|
||||||
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Integer>
|
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Integer>
|
||||||
implements TipoOcupacionDAO {
|
implements TipoOcupacionDAO {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public TipoOcupacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public TipoOcupacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TipoOcupacion> obtenerTodos() {
|
public List<TipoOcupacion> obtenerTodos() {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion) {
|
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
c.add(Restrictions.eq("desctipo", desctipo));
|
if (desctipo != null) {
|
||||||
c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion));
|
c.add(Restrictions.eq("desctipo", desctipo));
|
||||||
|
}
|
||||||
|
|
||||||
return c.list();
|
if (cvetipoocupacion != null) {
|
||||||
}
|
c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion));
|
||||||
|
}
|
||||||
|
|
||||||
public List<TipoOcupacion> buscarClave(String cvetipoocupacion) {
|
return c.list();
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
}
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
|
||||||
|
|
||||||
c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion));
|
public List<TipoOcupacion> buscarClave(String cvetipoocupacion) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
return c.list();
|
c.add(Restrictions.eq("cvetipoocupacion", cvetipoocupacion));
|
||||||
}
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,6 +230,13 @@ public class CategoriaDescuento implements Serializable {
|
||||||
@ManyToOne(cascade = CascadeType.ALL)
|
@ManyToOne(cascade = CascadeType.ALL)
|
||||||
private Categoria categoriaInterage;
|
private Categoria categoriaInterage;
|
||||||
|
|
||||||
|
@Column(name = "INDEXIGENUMFIDELIDADE")
|
||||||
|
private Boolean indExigeNumFidelidade;
|
||||||
|
|
||||||
|
@JoinColumn(name = "TIPOOCUPACION_ID")
|
||||||
|
@ManyToOne(cascade = CascadeType.ALL)
|
||||||
|
private TipoOcupacion tipoOcupacion;
|
||||||
|
|
||||||
public enum DisponibilidadeFeriado {
|
public enum DisponibilidadeFeriado {
|
||||||
// Declaraçăo dos enum
|
// Declaraçăo dos enum
|
||||||
GERARSEMPRE("SEMPRE", "S"),
|
GERARSEMPRE("SEMPRE", "S"),
|
||||||
|
@ -969,4 +976,19 @@ public class CategoriaDescuento implements Serializable {
|
||||||
this.categoriaInterage = categoriaInterage;
|
this.categoriaInterage = categoriaInterage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getIndExigeNumFidelidade() {
|
||||||
|
return indExigeNumFidelidade == null ? false : indExigeNumFidelidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndExigeNumFidelidade(Boolean indExigeNumFidelidade) {
|
||||||
|
this.indExigeNumFidelidade = indExigeNumFidelidade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoOcupacion getTipoOcupacion() {
|
||||||
|
return tipoOcupacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoOcupacion(TipoOcupacion tipoOcupacion) {
|
||||||
|
this.tipoOcupacion = tipoOcupacion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,29 +51,6 @@ public class ConfTotem implements Serializable {
|
||||||
public ConfTotem() {
|
public ConfTotem() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((confTotemId == null) ? 0 : confTotemId.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
ConfTotem other = (ConfTotem) obj;
|
|
||||||
if (confTotemId == null) {
|
|
||||||
if (other.confTotemId != null)
|
|
||||||
return false;
|
|
||||||
} else if (!confTotemId.equals(other.confTotemId))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValor() {
|
public String getValor() {
|
||||||
return valor;
|
return valor;
|
||||||
|
@ -107,4 +84,28 @@ public class ConfTotem implements Serializable {
|
||||||
this.chave = chave;
|
this.chave = chave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((confTotemId == null) ? 0 : confTotemId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
ConfTotem other = (ConfTotem) obj;
|
||||||
|
if (confTotemId == null) {
|
||||||
|
if (other.confTotemId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!confTotemId.equals(other.confTotemId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,139 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.FetchType;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author wallace
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "CONFTOTEM_VENTARAPIDA_SEQ", sequenceName = "CONFTOTEM_VENTARAPIDA_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CONF_TOTEM_VENTARAPIDA")
|
||||||
|
public class ConfTotemVentaRapida implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFTOTEM_VENTARAPIDA_SEQ")
|
||||||
|
@Column(name = "CONFTOTEMVENTARAPIDA_ID")
|
||||||
|
private Integer confTotemVentaRapidaId;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ORIGEN_ID")
|
||||||
|
private Parada origen;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "DESTINO_ID")
|
||||||
|
private Parada destino;
|
||||||
|
|
||||||
|
public ConfTotemVentaRapida() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfTotemVentaRapida(Parada origem, Parada destino) {
|
||||||
|
this.origen = origem;
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConfTotemVentaRapidaOri() {
|
||||||
|
return confTotemVentaRapidaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfTotemVentaRapidaId(Integer confTotemVentaRapidaId) {
|
||||||
|
this.confTotemVentaRapidaId = confTotemVentaRapidaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getOrigen() {
|
||||||
|
return origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigen(Parada origen) {
|
||||||
|
this.origen = origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(Parada destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((destino == null) ? 0 : destino.hashCode());
|
||||||
|
result = prime * result + ((origen == null) ? 0 : origen.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
ConfTotemVentaRapida other = (ConfTotemVentaRapida) obj;
|
||||||
|
if (destino == null) {
|
||||||
|
if (other.destino != null)
|
||||||
|
return false;
|
||||||
|
} else if (!destino.equals(other.destino))
|
||||||
|
return false;
|
||||||
|
if (origen == null) {
|
||||||
|
if (other.origen != null)
|
||||||
|
return false;
|
||||||
|
} else if (!origen.equals(other.origen))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -396,14 +396,15 @@ public class Empresa implements Serializable, Auditavel<Empresa> {
|
||||||
@Column(name = "INDCHECKINBLOQUEADOREMARCACAO")
|
@Column(name = "INDCHECKINBLOQUEADOREMARCACAO")
|
||||||
private Boolean indCheckinBloqueadoRemarcacao;
|
private Boolean indCheckinBloqueadoRemarcacao;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "INDAGRUPLOCCONEXAO")
|
@Column(name = "INDAGRUPLOCCONEXAO")
|
||||||
private Boolean indAgrupLocConexao;
|
private Boolean indAgrupLocConexao;
|
||||||
|
|
||||||
|
|
||||||
@Column(name = "INDLIMITACATEGORIAPORCORRIDA")
|
@Column(name = "INDLIMITACATEGORIAPORCORRIDA")
|
||||||
private Boolean IndLimitaCategoriaPorCorrida;
|
private Boolean IndLimitaCategoriaPorCorrida;
|
||||||
|
|
||||||
|
@Column(name = "INDSEGUNDAVIASEGOPCIONAL")
|
||||||
|
private Boolean indSegundaViaSegOpcional;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@NaoAuditar
|
@NaoAuditar
|
||||||
private Empresa empresaClone;
|
private Empresa empresaClone;
|
||||||
|
@ -1495,4 +1496,12 @@ public class Empresa implements Serializable, Auditavel<Empresa> {
|
||||||
public void setIndLimitaCategoriaPorCorrida(Boolean indLimitaCategoriaPorCorrida) {
|
public void setIndLimitaCategoriaPorCorrida(Boolean indLimitaCategoriaPorCorrida) {
|
||||||
IndLimitaCategoriaPorCorrida = indLimitaCategoriaPorCorrida;
|
IndLimitaCategoriaPorCorrida = indLimitaCategoriaPorCorrida;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getIndSegundaViaSegOpcional() {
|
||||||
|
return indSegundaViaSegOpcional == null ? false : indSegundaViaSegOpcional;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndSegundaViaSegOpcional(Boolean indSegundaViaSegOpcional) {
|
||||||
|
this.indSegundaViaSegOpcional = indSegundaViaSegOpcional;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,9 @@ public class Estado implements Serializable {
|
||||||
@Column(name = "CODIBGE")
|
@Column(name = "CODIBGE")
|
||||||
private Integer codibge;
|
private Integer codibge;
|
||||||
|
|
||||||
|
@Column(name = "TIMEOUT_BPE")
|
||||||
|
private Integer timeoutBpe;
|
||||||
|
|
||||||
public Estado() {
|
public Estado() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,8 +228,6 @@ public class Estado implements Serializable {
|
||||||
this.centroResultadosAG = centroResultadosAG;
|
this.centroResultadosAG = centroResultadosAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getMensagemPromocional1() {
|
public String getMensagemPromocional1() {
|
||||||
return mensagemPromocional1;
|
return mensagemPromocional1;
|
||||||
}
|
}
|
||||||
|
@ -290,4 +291,12 @@ public class Estado implements Serializable {
|
||||||
public void setCodibge(Integer codibge) {
|
public void setCodibge(Integer codibge) {
|
||||||
this.codibge = codibge;
|
this.codibge = codibge;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getTimeoutBpe() {
|
||||||
|
return timeoutBpe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeoutBpe(Integer timeoutBpe) {
|
||||||
|
this.timeoutBpe = timeoutBpe;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,9 +42,16 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fecvencimento;
|
private Date fecvencimento;
|
||||||
|
|
||||||
|
@Column(name = "FECBAIXA", length = 7)
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecbaixa;
|
||||||
|
|
||||||
@Column(name = "VALORDOCUMENTO")
|
@Column(name = "VALORDOCUMENTO")
|
||||||
private BigDecimal valordocumento;
|
private BigDecimal valordocumento;
|
||||||
|
|
||||||
|
@Column(name = "VALOR_JUROS")
|
||||||
|
private BigDecimal valorjuros;
|
||||||
|
|
||||||
@Column(name = "DESCONTOS")
|
@Column(name = "DESCONTOS")
|
||||||
private BigDecimal descontos;
|
private BigDecimal descontos;
|
||||||
|
|
||||||
|
@ -91,6 +98,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Long getFechamentoboletoId() {
|
public Long getFechamentoboletoId() {
|
||||||
return fechamentoboletoId;
|
return fechamentoboletoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFechamentoboletoId(Long fechamentoboletoId) {
|
public void setFechamentoboletoId(Long fechamentoboletoId) {
|
||||||
this.fechamentoboletoId = fechamentoboletoId;
|
this.fechamentoboletoId = fechamentoboletoId;
|
||||||
}
|
}
|
||||||
|
@ -98,6 +106,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public FechamentoCntcorrente getFechamentoCntcorrente() {
|
public FechamentoCntcorrente getFechamentoCntcorrente() {
|
||||||
return fechamentoCntcorrente;
|
return fechamentoCntcorrente;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFechamentoCntcorrente(FechamentoCntcorrente fechamentoCntcorrente) {
|
public void setFechamentoCntcorrente(FechamentoCntcorrente fechamentoCntcorrente) {
|
||||||
this.fechamentoCntcorrente = fechamentoCntcorrente;
|
this.fechamentoCntcorrente = fechamentoCntcorrente;
|
||||||
}
|
}
|
||||||
|
@ -105,6 +114,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public String getNossonumero() {
|
public String getNossonumero() {
|
||||||
return nossonumero;
|
return nossonumero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNossonumero(String nossonumero) {
|
public void setNossonumero(String nossonumero) {
|
||||||
this.nossonumero = nossonumero;
|
this.nossonumero = nossonumero;
|
||||||
}
|
}
|
||||||
|
@ -112,6 +122,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Date getFecdocumento() {
|
public Date getFecdocumento() {
|
||||||
return fecdocumento;
|
return fecdocumento;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecdocumento(Date fecdocumento) {
|
public void setFecdocumento(Date fecdocumento) {
|
||||||
this.fecdocumento = fecdocumento;
|
this.fecdocumento = fecdocumento;
|
||||||
}
|
}
|
||||||
|
@ -119,6 +130,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Date getFecvencimento() {
|
public Date getFecvencimento() {
|
||||||
return fecvencimento;
|
return fecvencimento;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecvencimento(Date fecvencimento) {
|
public void setFecvencimento(Date fecvencimento) {
|
||||||
this.fecvencimento = fecvencimento;
|
this.fecvencimento = fecvencimento;
|
||||||
}
|
}
|
||||||
|
@ -126,6 +138,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getValordocumento() {
|
public BigDecimal getValordocumento() {
|
||||||
return valordocumento;
|
return valordocumento;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValordocumento(BigDecimal valordocumento) {
|
public void setValordocumento(BigDecimal valordocumento) {
|
||||||
this.valordocumento = valordocumento;
|
this.valordocumento = valordocumento;
|
||||||
}
|
}
|
||||||
|
@ -133,6 +146,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getDescontos() {
|
public BigDecimal getDescontos() {
|
||||||
return descontos;
|
return descontos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescontos(BigDecimal descontos) {
|
public void setDescontos(BigDecimal descontos) {
|
||||||
this.descontos = descontos;
|
this.descontos = descontos;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +154,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getDeducoes() {
|
public BigDecimal getDeducoes() {
|
||||||
return deducoes;
|
return deducoes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDeducoes(BigDecimal deducoes) {
|
public void setDeducoes(BigDecimal deducoes) {
|
||||||
this.deducoes = deducoes;
|
this.deducoes = deducoes;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +162,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getMora() {
|
public BigDecimal getMora() {
|
||||||
return mora;
|
return mora;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMora(BigDecimal mora) {
|
public void setMora(BigDecimal mora) {
|
||||||
this.mora = mora;
|
this.mora = mora;
|
||||||
}
|
}
|
||||||
|
@ -154,6 +170,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getAcrescimos() {
|
public BigDecimal getAcrescimos() {
|
||||||
return acrescimos;
|
return acrescimos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAcrescimos(BigDecimal acrescimos) {
|
public void setAcrescimos(BigDecimal acrescimos) {
|
||||||
this.acrescimos = acrescimos;
|
this.acrescimos = acrescimos;
|
||||||
}
|
}
|
||||||
|
@ -161,6 +178,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public BigDecimal getValorCobrado() {
|
public BigDecimal getValorCobrado() {
|
||||||
return valorCobrado;
|
return valorCobrado;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValorCobrado(BigDecimal valorCobrado) {
|
public void setValorCobrado(BigDecimal valorCobrado) {
|
||||||
this.valorCobrado = valorCobrado;
|
this.valorCobrado = valorCobrado;
|
||||||
}
|
}
|
||||||
|
@ -168,6 +186,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Date getFecmodif() {
|
public Date getFecmodif() {
|
||||||
return fecmodif;
|
return fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecmodif(Date fecmodif) {
|
public void setFecmodif(Date fecmodif) {
|
||||||
this.fecmodif = fecmodif;
|
this.fecmodif = fecmodif;
|
||||||
}
|
}
|
||||||
|
@ -175,6 +194,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Integer getUsuarioId() {
|
public Integer getUsuarioId() {
|
||||||
return usuarioId;
|
return usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsuarioId(Integer usuarioId) {
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
@ -182,6 +202,7 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public Boolean getActivo() {
|
public Boolean getActivo() {
|
||||||
return activo;
|
return activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivo(Boolean activo) {
|
public void setActivo(Boolean activo) {
|
||||||
this.activo = activo;
|
this.activo = activo;
|
||||||
}
|
}
|
||||||
|
@ -189,36 +210,47 @@ public class FechamentoBoleto implements java.io.Serializable{
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(String status) {
|
public void setStatus(String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getRemessaId() {
|
public Long getRemessaId() {
|
||||||
return remessaId;
|
return remessaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemessaId(Long remessaId) {
|
public void setRemessaId(Long remessaId) {
|
||||||
this.remessaId = remessaId;
|
this.remessaId = remessaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getPorcentagemMulta() {
|
public BigDecimal getPorcentagemMulta() {
|
||||||
return porcentagemMulta;
|
return porcentagemMulta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPorcentagemMulta(BigDecimal porcentagemMulta) {
|
public void setPorcentagemMulta(BigDecimal porcentagemMulta) {
|
||||||
this.porcentagemMulta = porcentagemMulta;
|
this.porcentagemMulta = porcentagemMulta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getPorcentagemMora() {
|
public BigDecimal getPorcentagemMora() {
|
||||||
return porcentagemMora;
|
return porcentagemMora;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPorcentagemMora(BigDecimal porcentagemMora) {
|
public void setPorcentagemMora(BigDecimal porcentagemMora) {
|
||||||
this.porcentagemMora = porcentagemMora;
|
this.porcentagemMora = porcentagemMora;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getIndBoletoQuitado() {
|
public Boolean getIndBoletoQuitado() {
|
||||||
return indBoletoQuitado;
|
return indBoletoQuitado;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIndBoletoQuitado(Boolean indBoletoQuitado) {
|
public void setIndBoletoQuitado(Boolean indBoletoQuitado) {
|
||||||
this.indBoletoQuitado = indBoletoQuitado;
|
this.indBoletoQuitado = indBoletoQuitado;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUsuarioQuitacao() {
|
public Integer getUsuarioQuitacao() {
|
||||||
return usuarioQuitacao;
|
return usuarioQuitacao;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsuarioQuitacao(Integer usuarioQuitacao) {
|
public void setUsuarioQuitacao(Integer usuarioQuitacao) {
|
||||||
this.usuarioQuitacao = usuarioQuitacao;
|
this.usuarioQuitacao = usuarioQuitacao;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,14 @@ public class OrgaoCancelacion implements Serializable, Auditavel<OrgaoCancelaci
|
||||||
@Column(name = "INDBLOQUEIOREMARCADO")
|
@Column(name = "INDBLOQUEIOREMARCADO")
|
||||||
private Boolean indBloqueioRemarcado;
|
private Boolean indBloqueioRemarcado;
|
||||||
|
|
||||||
|
@Column(name = "INDPERMPAGMULTAPREESTORNO")
|
||||||
|
private Boolean indPermPagMultaPreEstorno;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "INDIMPRIMECOMPROVANTETRANS")
|
||||||
|
private Boolean indImprimeComprovanteTransferencia;
|
||||||
|
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@NaoAuditar
|
@NaoAuditar
|
||||||
private OrgaoCancelacion orgaoCancelacionClone;
|
private OrgaoCancelacion orgaoCancelacionClone;
|
||||||
|
@ -377,6 +385,25 @@ public class OrgaoCancelacion implements Serializable, Auditavel<OrgaoCancelaci
|
||||||
public void setIndBloqueioRemarcado(Boolean indBloqueioRemarcado) {
|
public void setIndBloqueioRemarcado(Boolean indBloqueioRemarcado) {
|
||||||
this.indBloqueioRemarcado = indBloqueioRemarcado;
|
this.indBloqueioRemarcado = indBloqueioRemarcado;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean getIndPermPagMultaPreEstorno() {
|
||||||
|
return indPermPagMultaPreEstorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndPermPagMultaPreEstorno(Boolean indPermPagMultaPreEstorno) {
|
||||||
|
this.indPermPagMultaPreEstorno = indPermPagMultaPreEstorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean getIndImprimeComprovanteTransferencia() {
|
||||||
|
return indImprimeComprovanteTransferencia;
|
||||||
|
}
|
||||||
|
public void setIndImprimeComprovanteTransferencia(Boolean indImprimeComprovanteTransferencia) {
|
||||||
|
this.indImprimeComprovanteTransferencia = indImprimeComprovanteTransferencia;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clonar() throws CloneNotSupportedException {
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,7 @@ public class OrgaoConcedente implements Serializable, Auditavel<OrgaoConcedente>
|
||||||
@Column(name = "TAXA_CONVENIENCIA_SVI")
|
@Column(name = "TAXA_CONVENIENCIA_SVI")
|
||||||
private BigDecimal taxaConvenienciaSVI;
|
private BigDecimal taxaConvenienciaSVI;
|
||||||
|
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@NaoAuditar
|
@NaoAuditar
|
||||||
private OrgaoConcedente orgaoConcedenteClone;
|
private OrgaoConcedente orgaoConcedenteClone;
|
||||||
|
@ -351,6 +352,8 @@ public class OrgaoConcedente implements Serializable, Auditavel<OrgaoConcedente>
|
||||||
this.taxaConvenienciaSVI = taxaConvenienciaSVI;
|
this.taxaConvenienciaSVI = taxaConvenienciaSVI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clonar() throws CloneNotSupportedException {
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ public class Parada implements Serializable, Auditavel<Parada> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Parada other = (Parada) object;
|
Parada other = (Parada) object;
|
||||||
if ((this.getParadaId() == null && other.getParadaId() != null) || (this.getParadaId() != null && !this.getParadaId().equals(other.getParadaId()))) {
|
if ((this.getParadaId() == null && other.getParadaId() != null) || (this.getParadaId() != null && this.getParadaId().intValue() != other.getParadaId().intValue())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -0,0 +1,184 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
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;
|
||||||
|
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 Valdevir
|
||||||
|
*/
|
||||||
|
@AuditarClasse(nome = "PtovtaExcecaoMultaCanc", tela = "Alteração Ponto de Venda/Excecao Multa Canc")
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "PTOVTA_EXCECAO_MULTA_CANC_SEQ", sequenceName = "PTOVTA_EXCECAO_MULTA_CANC_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "PTOVTA_EXCECAO_MULTA_CANC")
|
||||||
|
public class PtovtaExcecaoMultaCanc implements Serializable , Auditavel<PtovtaExcecaoMultaCanc> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTA_EXCECAO_MULTA_CANC_SEQ")
|
||||||
|
@Column(name = "PTOVTAEXCECAOMULTACANC_ID")
|
||||||
|
private Integer ptovtaExcecaoMultaCancId;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "PUNTOVENTA_ID")
|
||||||
|
private PuntoVenta puntoventa;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ORGAOCONCEDENTE_ID")
|
||||||
|
private OrgaoConcedente orgaoConcedente;
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private int usuarioId;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private PtovtaExcecaoMultaCanc ptovtaExcecaoMultaCancClone;
|
||||||
|
|
||||||
|
public PtovtaExcecaoMultaCanc() {
|
||||||
|
super();
|
||||||
|
this.activo = true;
|
||||||
|
this.fecmodif = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPtovtaExcecaoMultaCancId() {
|
||||||
|
return ptovtaExcecaoMultaCancId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancId(Integer ptovtaExcecaoMultaCancId) {
|
||||||
|
this.ptovtaExcecaoMultaCancId = ptovtaExcecaoMultaCancId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrgaoConcedente getOrgaoConcedente() {
|
||||||
|
return orgaoConcedente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
|
||||||
|
this.orgaoConcedente = orgaoConcedente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtovtaExcecaoMultaCanc getPtovtaExcecaoMultaCancClone() {
|
||||||
|
return ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancClone(PtovtaExcecaoMultaCanc ptovtaExcecaoMultaCancClone) {
|
||||||
|
this.ptovtaExcecaoMultaCancClone = ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PuntoVenta getPuntoventa() {
|
||||||
|
return puntoventa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoventa(PuntoVenta puntoventa) {
|
||||||
|
this.puntoventa = puntoventa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 int getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(int usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((ptovtaExcecaoMultaCancId == null) ? 0 : ptovtaExcecaoMultaCancId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (!(obj instanceof PtovtaExcecaoMultaCanc))
|
||||||
|
return false;
|
||||||
|
PtovtaExcecaoMultaCanc other = (PtovtaExcecaoMultaCanc) obj;
|
||||||
|
if (ptovtaExcecaoMultaCancId == null) {
|
||||||
|
if (other.ptovtaExcecaoMultaCancId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!ptovtaExcecaoMultaCancId.equals(other.ptovtaExcecaoMultaCancId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
ptovtaExcecaoMultaCancClone = new PtovtaExcecaoMultaCanc();
|
||||||
|
ptovtaExcecaoMultaCancClone = (PtovtaExcecaoMultaCanc) this.clone();
|
||||||
|
Hibernate.initialize(ptovtaExcecaoMultaCancClone.getPuntoventa());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PtovtaExcecaoMultaCanc getCloneObject() throws CloneNotSupportedException {
|
||||||
|
return ptovtaExcecaoMultaCancClone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTextoInclusaoExclusao() {
|
||||||
|
return String.format("ID [%s]", getPtovtaExcecaoMultaCancId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -32,7 +32,6 @@ import javax.persistence.TemporalType;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
import org.apache.commons.lang.BooleanUtils;
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
import org.hibernate.Hibernate;
|
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
|
@ -286,6 +285,12 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
@Where(clause = "activo = 1")
|
@Where(clause = "activo = 1")
|
||||||
private List<PtovtaAntifraude> ptovtaAntifraudes;
|
private List<PtovtaAntifraude> ptovtaAntifraudes;
|
||||||
|
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "PtovtaExcecaoMultaCanc")
|
||||||
|
@OneToMany(mappedBy = "puntoventa", cascade = CascadeType.ALL)
|
||||||
|
@LazyCollection(LazyCollectionOption.FALSE)
|
||||||
|
@Where(clause = "activo = 1")
|
||||||
|
private List<PtovtaExcecaoMultaCanc> ptovtaExcecaoMultaCancList;
|
||||||
|
|
||||||
@Column(name = "INDBLOQUEIATIPOPASSAGEM")
|
@Column(name = "INDBLOQUEIATIPOPASSAGEM")
|
||||||
private Boolean indBloqueiaTipoPassagem;
|
private Boolean indBloqueiaTipoPassagem;
|
||||||
|
|
||||||
|
@ -1194,6 +1199,12 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removePtovtaExcecaoMultaCanc(PtovtaExcecaoMultaCanc excecaoMulta){
|
||||||
|
if(this.ptovtaExcecaoMultaCancList != null) {
|
||||||
|
this.ptovtaExcecaoMultaCancList.remove(excecaoMulta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean getIndBloqueiaTipoPassagem() {
|
public Boolean getIndBloqueiaTipoPassagem() {
|
||||||
return BooleanUtils.toBoolean(indBloqueiaTipoPassagem);
|
return BooleanUtils.toBoolean(indBloqueiaTipoPassagem);
|
||||||
}
|
}
|
||||||
|
@ -1249,6 +1260,26 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||||
public void setIndQrcodeTaxaEmbarqueRodTTL(Boolean indQrcodeTaxaEmbarqueRodTTL) {
|
public void setIndQrcodeTaxaEmbarqueRodTTL(Boolean indQrcodeTaxaEmbarqueRodTTL) {
|
||||||
this.indQrcodeTaxaEmbarqueRodTTL = indQrcodeTaxaEmbarqueRodTTL;
|
this.indQrcodeTaxaEmbarqueRodTTL = indQrcodeTaxaEmbarqueRodTTL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean getIndBloqueiaCancelamentoBilheteImpresso() {
|
||||||
|
return indBloqueiaCancelamentoBilheteImpresso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndBloqueiaCancelamentoBilheteImpresso(Boolean indBloqueiaCancelamentoBilheteImpresso) {
|
||||||
|
this.indBloqueiaCancelamentoBilheteImpresso = indBloqueiaCancelamentoBilheteImpresso;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<PtovtaExcecaoMultaCanc> getPtovtaExcecaoMultaCancList() {
|
||||||
|
return ptovtaExcecaoMultaCancList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaExcecaoMultaCancList(List<PtovtaExcecaoMultaCanc> ptovtaExcecaoMultaCanc) {
|
||||||
|
this.ptovtaExcecaoMultaCancList = ptovtaExcecaoMultaCanc;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clonar() throws CloneNotSupportedException {
|
public void clonar() throws CloneNotSupportedException {
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ public enum TipoImpressora {
|
||||||
DARUMA(4, Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscal"), true),
|
DARUMA(4, Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscal"), true),
|
||||||
DARUMA_BLINDADA(5, Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscalBlindada"), true),
|
DARUMA_BLINDADA(5, Labels.getLabel("editarEstacionController.tipoImpressora.darumaFiscalBlindada"), true),
|
||||||
STOCK_CENTRAL(6, Labels.getLabel("editarEstacionController.tipoImpressora.stockCentral"), true),
|
STOCK_CENTRAL(6, Labels.getLabel("editarEstacionController.tipoImpressora.stockCentral"), true),
|
||||||
BPE(7, Labels.getLabel("editarEstacionController.tipoImpressora.bpe"), true);
|
BPE(7, Labels.getLabel("editarEstacionController.tipoImpressora.bpe"), true),
|
||||||
|
MACON(8, Labels.getLabel("editarEstacionController.tipoImpressora.macon"), true);
|
||||||
|
|
||||||
private final int codigo;
|
private final int codigo;
|
||||||
private final String nome;
|
private final String nome;
|
||||||
|
|
|
@ -10,10 +10,14 @@ import com.rjconsultores.ventaboletos.vo.parada.ParadaVOConexionRuta;
|
||||||
|
|
||||||
public interface ConexionRutaCombinacionService {
|
public interface ConexionRutaCombinacionService {
|
||||||
|
|
||||||
public void gerarCombinacionEntre2Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl);
|
public void gerarCombinacionEntre2Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl, Boolean isConexaoPorAgrupamento);
|
||||||
|
|
||||||
public void gerarCombinacionEntre3Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Parada> listParadasC, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl);
|
public void gerarCombinacionEntre3Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Parada> listParadasC, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl);
|
||||||
|
|
||||||
public List<ConexionRutaCtrlVO> extrairConexionRutaCtrl(List<ParadaVOConexionRuta> localidadesGeradas);
|
public List<ConexionRutaCtrlVO> extrairConexionRutaCtrl(List<ParadaVOConexionRuta> localidadesGeradas);
|
||||||
|
|
||||||
|
public List<Parada> getParadasByAgrupamentoId(Parada parada);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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.ConfTotemVentaRapida;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author wallace
|
||||||
|
*/
|
||||||
|
public interface ConfTotemVentaRapidaService extends GenericService<ConfTotemVentaRapida, Integer>{
|
||||||
|
|
||||||
|
ConfTotemVentaRapida buscarOrigemDestino(Parada origem, Parada destino);
|
||||||
|
|
||||||
|
List<ConfTotemVentaRapida> buscarOrigem(Parada origen);
|
||||||
|
|
||||||
|
void apagarPorOrigem(Parada selectedObject);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -14,4 +14,7 @@ public interface ImportacaoClientesService {
|
||||||
public String[] lerArquivoExcel(Media media, List<Empresa> empresas);
|
public String[] lerArquivoExcel(Media media, List<Empresa> empresas);
|
||||||
|
|
||||||
public Integer[] salvarClientes(String[] cliente, List<Empresa> empresas) throws Exception;
|
public Integer[] salvarClientes(String[] cliente, List<Empresa> empresas) throws Exception;
|
||||||
|
|
||||||
|
public String[] lerArquivoPolicialExcel(Media media, List<Empresa> empresas);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.parada.ParadaVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -46,4 +47,7 @@ public interface ParadaService {
|
||||||
public List<Parada> buscaParadaRegionMetropolitana(RegionMetropolitana regionMetropolitana);
|
public List<Parada> buscaParadaRegionMetropolitana(RegionMetropolitana regionMetropolitana);
|
||||||
|
|
||||||
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada);
|
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada);
|
||||||
|
|
||||||
|
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
|
||||||
|
public interface PtovtaExcecaoMultaCancService extends GenericService<PtovtaExcecaoMultaCanc, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
||||||
|
|
||||||
public interface SapService extends GenericService<FechamentoCntcorrente, Long> {
|
public interface SapService extends GenericService<FechamentoCntcorrente, Long> {
|
||||||
|
@ -13,6 +14,8 @@ public interface SapService extends GenericService<FechamentoCntcorrente, Long>
|
||||||
|
|
||||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
||||||
|
|
||||||
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta);
|
||||||
|
|
||||||
public void integracaoSapAutomatica() throws Exception;
|
public void integracaoSapAutomatica() throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Integer> {
|
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Integer> {
|
||||||
|
|
||||||
|
public List<TipoOcupacion> buscar(String desctipo);
|
||||||
|
|
||||||
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion);
|
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion);
|
||||||
|
|
||||||
public List<TipoOcupacion> buscarClave(String cvetipoocupacion);
|
public List<TipoOcupacion> buscarClave(String cvetipoocupacion);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
return cacheLocalidades;
|
return cacheLocalidades;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gerarCombinacao(LinkedList<List<Parada>> lists, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl, Map<Integer, Parada> cacheLocalidades) {
|
private void gerarCombinacao(LinkedList<List<Parada>> lists, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl, Map<Integer, Parada> cacheLocalidades, Boolean isConexaoPorAgrupamento) {
|
||||||
|
|
||||||
|
|
||||||
Set<String> combinacoes = new TreeSet<String>();
|
Set<String> combinacoes = new TreeSet<String>();
|
||||||
|
@ -66,7 +66,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
Set<String> rutasVendaB = rutaCombinacionService.rutasCombinacionVenda(rutasEixoB);
|
Set<String> rutasVendaB = rutaCombinacionService.rutasCombinacionVenda(rutasEixoB);
|
||||||
|
|
||||||
if(rutasEixoC == null) {
|
if(rutasEixoC == null) {
|
||||||
gerarLocalidadesEixoAB(rutasEixoA, rutasEixoB, localidadesGeradas, combinacoes, conexoesCtrl, cacheLocalidades, rutasVendaA, rutasVendaB);
|
gerarLocalidadesEixoAB(rutasEixoA, rutasEixoB, localidadesGeradas, combinacoes, conexoesCtrl, cacheLocalidades, rutasVendaA, rutasVendaB, isConexaoPorAgrupamento);
|
||||||
}else {
|
}else {
|
||||||
Set<String> rutasVendaC = rutaCombinacionService.rutasCombinacionVenda(rutasEixoC);
|
Set<String> rutasVendaC = rutaCombinacionService.rutasCombinacionVenda(rutasEixoC);
|
||||||
gerarLocalidadesEixoABC(rutasEixoA, rutasEixoB,rutasEixoC, localidadesGeradas, combinacoes, conexoesCtrl, cacheLocalidades, rutasVendaA, rutasVendaB, rutasVendaC );
|
gerarLocalidadesEixoABC(rutasEixoA, rutasEixoB,rutasEixoC, localidadesGeradas, combinacoes, conexoesCtrl, cacheLocalidades, rutasVendaA, rutasVendaB, rutasVendaC );
|
||||||
|
@ -76,7 +76,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void gerarLocalidadesEixoAB(List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<ParadaVOConexionRuta> localidadesGeradas, Set<String> combinacoes, List<ConexionCtrlVO> conexoesCtrl, Map<Integer, Parada> cacheLocalidades, Set<String> rutasVendaA, Set<String> rutasVendaB) {
|
private void gerarLocalidadesEixoAB(List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<ParadaVOConexionRuta> localidadesGeradas, Set<String> combinacoes, List<ConexionCtrlVO> conexoesCtrl, Map<Integer, Parada> cacheLocalidades, Set<String> rutasVendaA, Set<String> rutasVendaB, Boolean isConexaoPorAgrupamento) {
|
||||||
short i = 1;
|
short i = 1;
|
||||||
String[] valoresCalculados;
|
String[] valoresCalculados;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
conexionCtrl, conexionRutaCtrl, rutaEixoB.getDescSentido());
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, null, rutasVendaA, rutasVendaB, new HashSet<String>());
|
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, null, rutasVendaA, rutasVendaB, new HashSet<String>(), isConexaoPorAgrupamento);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void adicionarLocalidadeGerada(ConexionCtrlVO conexionCtrl, List<ParadaVOConexionRuta> localidadesGeradas, ParadaVOConexionRuta trechoA, ParadaVOConexionRuta trechoB, ParadaVOConexionRuta trechoC, Set<String> rutasVendaA, Set<String> rutasVendaB, Set<String> rutasVendaC) {
|
private void adicionarLocalidadeGerada(ConexionCtrlVO conexionCtrl, List<ParadaVOConexionRuta> localidadesGeradas, ParadaVOConexionRuta trechoA, ParadaVOConexionRuta trechoB, ParadaVOConexionRuta trechoC, Set<String> rutasVendaA, Set<String> rutasVendaB, Set<String> rutasVendaC, Boolean isConexaoPorAgrupamento) {
|
||||||
boolean isTrechoAVende = false;
|
boolean isTrechoAVende = false;
|
||||||
boolean isTrechoBVende = false;
|
boolean isTrechoBVende = false;
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isTrechoAVende && isTrechoBVende && isTrechoCVende) {
|
if((isTrechoAVende && isTrechoBVende && isTrechoCVende) || Boolean.TRUE.equals(isConexaoPorAgrupamento)) {
|
||||||
localidadesGeradas.add(trechoA);
|
localidadesGeradas.add(trechoA);
|
||||||
localidadesGeradas.add(trechoB);
|
localidadesGeradas.add(trechoB);
|
||||||
if(trechoC != null) {
|
if(trechoC != null) {
|
||||||
|
@ -220,7 +220,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
conexionCtrl, conexionRutaCtrl, rutaEixoC.getDescSentido());
|
conexionCtrl, conexionRutaCtrl, rutaEixoC.getDescSentido());
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, trechoC, rutasVendaA, rutasVendaB, rutasVendaC);
|
adicionarLocalidadeGerada(conexionCtrl, localidadesGeradas, trechoA, trechoB, trechoC, rutasVendaA, rutasVendaB, rutasVendaC, null);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
conexoesCtrl.addAll(temp);
|
conexoesCtrl.addAll(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void gerarCombinacionEntre2Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl) {
|
public void gerarCombinacionEntre2Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl, Boolean isConexaoPorAgrupamento) {
|
||||||
|
|
||||||
for (int i = 0; i < lsLocalidadesComuns.size(); i++) {
|
for (int i = 0; i < lsLocalidadesComuns.size(); i++) {
|
||||||
|
|
||||||
|
@ -279,12 +279,25 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<Integer, Parada> cacheLocalidades = criandoCacheLocalidades(localidades);
|
Map<Integer, Parada> cacheLocalidades = criandoCacheLocalidades(localidades);
|
||||||
gerarCombinacao(lists, rutasEixoA, rutasEixoB, null, localidadesGeradas, conexoesCtrl, cacheLocalidades);
|
gerarCombinacao(lists, rutasEixoA, rutasEixoB, null, localidadesGeradas, conexoesCtrl, cacheLocalidades, isConexaoPorAgrupamento);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Parada> getParadasByAgrupamentoId(Parada parada) {
|
||||||
|
List<Parada> localidades = new ArrayList<Parada>();
|
||||||
|
List<Parada> paradaAgrupamentoList = paradaService.buscarPorAgrupamentoParadaId(parada.getAgrupamentoParada());
|
||||||
|
if(paradaAgrupamentoList!=null && !paradaAgrupamentoList.isEmpty()) {
|
||||||
|
for (Parada paradaAgrupamento : paradaAgrupamentoList) {
|
||||||
|
if(!localidades.contains(paradaAgrupamento)) {
|
||||||
|
localidades.add(paradaAgrupamento);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return localidades;
|
||||||
|
}
|
||||||
|
|
||||||
public void gerarCombinacionEntre3Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Parada> listParadasC, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl) {
|
public void gerarCombinacionEntre3Eixos(List<Parada> listParada1, List<Ruta> rutasEixoA, List<Ruta> rutasEixoB, List<Parada> lsLocalidadesComuns, List<Parada> listParada4, List<Parada> listParadasC, List<Ruta> rutasEixoA2, List<Ruta> rutasEixoB2, List<Ruta> rutasEixoC, List<ParadaVOConexionRuta> localidadesGeradas, List<ConexionCtrlVO> conexoesCtrl) {
|
||||||
|
|
||||||
for (int i = 0; i < lsLocalidadesComuns.size(); i++) {
|
for (int i = 0; i < lsLocalidadesComuns.size(); i++) {
|
||||||
|
@ -308,7 +321,7 @@ public class ConexionRutaCombinacionServiceImpl implements ConexionRutaCombinaci
|
||||||
localidades.addAll(listParadasC);
|
localidades.addAll(listParadasC);
|
||||||
|
|
||||||
Map<Integer, Parada> cacheLocalidades = criandoCacheLocalidades(localidades);
|
Map<Integer, Parada> cacheLocalidades = criandoCacheLocalidades(localidades);
|
||||||
gerarCombinacao(lists, rutasEixoA, rutasEixoB, rutasEixoC, localidadesGeradas, conexoesCtrl, cacheLocalidades);
|
gerarCombinacao(lists, rutasEixoA, rutasEixoB, rutasEixoC, localidadesGeradas, conexoesCtrl, cacheLocalidades, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@ public class ConexionRutaLocalidadeRemovidaServiceImpl implements ConexionRutaLo
|
||||||
/**
|
/**
|
||||||
*Obtem a lista de paradas removidas pela lista de paradas
|
*Obtem a lista de paradas removidas pela lista de paradas
|
||||||
*/
|
*/
|
||||||
@Transactional
|
|
||||||
public List<ConexionRutaLocalidadeRemovida> obtenerPorParadaList(List<Parada> paradaList) {
|
public List<ConexionRutaLocalidadeRemovida> obtenerPorParadaList(List<Parada> paradaList) {
|
||||||
List<Long> paradaIdList = new ArrayList<Long>();
|
List<Long> paradaIdList = new ArrayList<Long>();
|
||||||
for (Parada parada : paradaList) {
|
for (Parada parada : paradaList) {
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
/*
|
||||||
|
* 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.ConfTotemVentaRapidaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfTotemVentaRapida;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConfTotemVentaRapidaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author wallace
|
||||||
|
*/
|
||||||
|
@Service("confTotemVentaRapidaService")
|
||||||
|
public class ConfTotemVentaRapidaServiceImpl implements ConfTotemVentaRapidaService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfTotemVentaRapidaDAO confTotemVentaRapidaDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfTotemVentaRapida> obtenerTodos() {
|
||||||
|
return confTotemVentaRapidaDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfTotemVentaRapida obtenerID(Integer id) {
|
||||||
|
return confTotemVentaRapidaDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public ConfTotemVentaRapida suscribir(ConfTotemVentaRapida entidad) {
|
||||||
|
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
|
||||||
|
return confTotemVentaRapidaDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public ConfTotemVentaRapida actualizacion(ConfTotemVentaRapida entidad) {
|
||||||
|
|
||||||
|
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
return confTotemVentaRapidaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public void borrar(ConfTotemVentaRapida entidad) {
|
||||||
|
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
|
||||||
|
confTotemVentaRapidaDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfTotemVentaRapida buscarOrigemDestino(Parada origem, Parada destino) {
|
||||||
|
return confTotemVentaRapidaDAO.buscarOrigemDestino(origem, destino);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfTotemVentaRapida> buscarOrigem(Parada origem) {
|
||||||
|
return confTotemVentaRapidaDAO.buscarOrigem(origem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void apagarPorOrigem(Parada paradaOrigem) {
|
||||||
|
|
||||||
|
for (ConfTotemVentaRapida confTotemVentaRapida : confTotemVentaRapidaDAO.buscarOrigem(paradaOrigem)) {
|
||||||
|
confTotemVentaRapida.setActivo(Boolean.FALSE);
|
||||||
|
confTotemVentaRapida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
confTotemVentaRapida.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
confTotemVentaRapidaDAO.actualizacion(confTotemVentaRapida);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -47,6 +47,7 @@ import com.rjconsultores.ventaboletos.vo.comissao.ConferenciaComissaoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.DiaConferenciaComissaoVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.DiaConferenciaComissaoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.EtiquetaMalote;
|
import com.rjconsultores.ventaboletos.vo.comissao.EtiquetaMalote;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.EventosFinanceirosVO;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.comissao.FormaPagoEventosFinanceirosVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.FormapagoVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.FormapagoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||||
|
@ -575,11 +576,13 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
||||||
|
|
||||||
// calculando os movimentos financeiros
|
// calculando os movimentos financeiros
|
||||||
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
||||||
if (formaspagosDeposito.contains(eventosFinanceiros.getFormapagoId())) {
|
for (FormaPagoEventosFinanceirosVO formaPagamento : eventosFinanceiros.getFormapagos()) {
|
||||||
if (eventosFinanceiros.isCredito()) {
|
if (formaspagosDeposito.contains(formaPagamento.getFormapagoId())) {
|
||||||
totalDeposito = MoneyHelper.somar(totalDeposito, eventosFinanceiros.getImpingreso());
|
if (eventosFinanceiros.isCredito()) {
|
||||||
} else if (eventosFinanceiros.isDebito()) {
|
totalDeposito = MoneyHelper.somar(totalDeposito, formaPagamento.getImporte());
|
||||||
totalDeposito = MoneyHelper.subtrair(totalDeposito, eventosFinanceiros.getImpingreso().abs());
|
} else if (eventosFinanceiros.isDebito()) {
|
||||||
|
totalDeposito = MoneyHelper.subtrair(totalDeposito, formaPagamento.getImporte().abs());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -630,7 +633,8 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
||||||
}
|
}
|
||||||
|
|
||||||
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
||||||
FormapagoVO formapagoEventoFinanceiro = new FormapagoVO(eventosFinanceiros.getFormapagoId(), eventosFinanceiros.getDescpago(), null, BigDecimal.ZERO);
|
for(FormaPagoEventosFinanceirosVO formaPagoEventosFinanceirosVO: eventosFinanceiros.getFormapagos()) {
|
||||||
|
FormapagoVO formapagoEventoFinanceiro = new FormapagoVO(formaPagoEventosFinanceirosVO.getFormapagoId(), formaPagoEventosFinanceirosVO.getDescpago(), null, BigDecimal.ZERO);
|
||||||
if (totalFormapagos.contains(formapagoEventoFinanceiro)) {
|
if (totalFormapagos.contains(formapagoEventoFinanceiro)) {
|
||||||
formapagoEventoFinanceiro = totalFormapagos.get(totalFormapagos.indexOf(formapagoEventoFinanceiro));
|
formapagoEventoFinanceiro = totalFormapagos.get(totalFormapagos.indexOf(formapagoEventoFinanceiro));
|
||||||
} else {
|
} else {
|
||||||
|
@ -638,9 +642,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventosFinanceiros.isCredito()) {
|
if (eventosFinanceiros.isCredito()) {
|
||||||
formapagoEventoFinanceiro.add(eventosFinanceiros.getImpingreso());
|
formapagoEventoFinanceiro.add(formaPagoEventosFinanceirosVO.getImporte());
|
||||||
} else if (eventosFinanceiros.isDebito()) {
|
} else if (eventosFinanceiros.isDebito()) {
|
||||||
formapagoEventoFinanceiro.subtract(eventosFinanceiros.getImpingreso().abs());
|
formapagoEventoFinanceiro.subtract(formaPagoEventosFinanceirosVO.getImporte().abs());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,12 @@ import com.rjconsultores.ventaboletos.entidad.ClienteFidelidad;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad;
|
import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion;
|
import com.rjconsultores.ventaboletos.entidad.TipoIdentificacion;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||||
import com.rjconsultores.ventaboletos.passageirofrequente.vo.ClienteExcelVo;
|
import com.rjconsultores.ventaboletos.passageirofrequente.vo.ClienteExcelVo;
|
||||||
import com.rjconsultores.ventaboletos.service.ClienteService;
|
import com.rjconsultores.ventaboletos.service.ClienteService;
|
||||||
import com.rjconsultores.ventaboletos.service.ImportacaoClientesService;
|
import com.rjconsultores.ventaboletos.service.ImportacaoClientesService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoIdentificacionService;
|
import com.rjconsultores.ventaboletos.service.TipoIdentificacionService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.TipoOcupacionService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -43,10 +45,15 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
@Service("importacaoClientesService")
|
@Service("importacaoClientesService")
|
||||||
public class ImportacaoClientesServiceImpl implements ImportacaoClientesService {
|
public class ImportacaoClientesServiceImpl implements ImportacaoClientesService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TipoOcupacionService tipoOcupacionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TipoIdentificacionService tipoIdentificacionService;
|
TipoIdentificacionService tipoIdentificacionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ClienteService clienteService;
|
private ClienteService clienteService;
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger(ImportacaoClientesServiceImpl.class);
|
private static Logger log = Logger.getLogger(ImportacaoClientesServiceImpl.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -165,7 +172,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
StringBuilder erros = new StringBuilder();
|
StringBuilder erros = new StringBuilder();
|
||||||
Integer inseridos = 0;
|
Integer inseridos = 0;
|
||||||
Integer atualizados = 0;
|
Integer atualizados = 0;
|
||||||
Integer desconsiderados =0;
|
Integer desconsiderados = 0;
|
||||||
InputStream isMExcel = media.getStreamData();
|
InputStream isMExcel = media.getStreamData();
|
||||||
Sheet sheet = null;
|
Sheet sheet = null;
|
||||||
|
|
||||||
|
@ -184,23 +191,23 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
wb = new XSSFWorkbook(isMExcel);
|
wb = new XSSFWorkbook(isMExcel);
|
||||||
sheet = wb.getSheetAt(0);
|
sheet = wb.getSheetAt(0);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("",e);
|
log.error("", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int rows = sheet.getPhysicalNumberOfRows();
|
int rows = sheet.getPhysicalNumberOfRows();
|
||||||
|
|
||||||
log.info(String.format("Quantidade cliente:%s",rows));
|
log.info(String.format("Quantidade cliente:%s", rows));
|
||||||
|
|
||||||
if (validaSheet(sheet)) {
|
if (validaSheet(sheet)) {
|
||||||
usaCPFComoFidelidade = ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.USA_CPF_COMO_FIDELIDADE.getDescricao());
|
usaCPFComoFidelidade = ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.USA_CPF_COMO_FIDELIDADE.getDescricao());
|
||||||
log.info(String.format("usaCPFComoFidelidade:%s",usaCPFComoFidelidade));
|
log.info(String.format("usaCPFComoFidelidade:%s", usaCPFComoFidelidade));
|
||||||
try {
|
try {
|
||||||
for (index = 1; index < rows; index++) {
|
for (index = 1; index < rows; index++) {
|
||||||
log.info(String.format("index cliente:%s",index));
|
log.info(String.format("index cliente:%s", index));
|
||||||
|
|
||||||
Row row = sheet.getRow(index);
|
Row row = sheet.getRow(index);
|
||||||
if (row == null){
|
if (row == null) {
|
||||||
log.info("index/row empty");
|
log.info("index/row empty");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -275,17 +282,17 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info(String.format("cliente:%s cpf:%s",cliente.getNome(),cliente.getCpf()));
|
log.info(String.format("cliente:%s cpf:%s", cliente.getNome(), cliente.getCpf()));
|
||||||
|
|
||||||
if (validaDadosPlanilha(cliente, erros)) {
|
if (validaDadosPlanilha(cliente, erros)) {
|
||||||
log.info("enviado para gravação...");
|
log.info("enviado para gravação...");
|
||||||
try{
|
try {
|
||||||
Integer[] gravados = salvarClienteExcel(empresas, usaCPFComoFidelidade, cliente, tipoIdentificacionUno, tipoIdentificacionDoos);
|
Integer[] gravados = salvarClienteExcel(empresas, usaCPFComoFidelidade, cliente, tipoIdentificacionUno, tipoIdentificacionDoos, false);
|
||||||
inseridos = gravados[0] + inseridos;
|
inseridos = gravados[0] + inseridos;
|
||||||
atualizados = gravados[1] + atualizados;
|
atualizados = gravados[1] + atualizados;
|
||||||
desconsiderados = gravados[2] + desconsiderados;
|
desconsiderados = gravados[2] + desconsiderados;
|
||||||
}catch(Throwable e){
|
} catch (Throwable e) {
|
||||||
log.error("Erro na gravação do registro. Favor revisar",e);
|
log.error("Erro na gravação do registro. Favor revisar", e);
|
||||||
log.info("continuando importação");
|
log.info("continuando importação");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +302,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
erros.append(index + 1).append(" do arquivo.");
|
erros.append(index + 1).append(" do arquivo.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qtdeGravados.append("Gravados ").append(inseridos + atualizados).append(" clientes de ").append(index-1).append(" importados.\n");
|
qtdeGravados.append("Gravados ").append(inseridos + atualizados).append(" clientes de ").append(index - 1).append(" importados.\n");
|
||||||
qtdeGravados.append("Desconsiderados ").append(desconsiderados).append(" clientes.\n");
|
qtdeGravados.append("Desconsiderados ").append(desconsiderados).append(" clientes.\n");
|
||||||
qtdeGravados.append("Atualizados ").append(atualizados).append(" clientes.\n");
|
qtdeGravados.append("Atualizados ").append(atualizados).append(" clientes.\n");
|
||||||
qtdeGravados.append("Inseridos ").append(inseridos).append(" novos clientes.");
|
qtdeGravados.append("Inseridos ").append(inseridos).append(" novos clientes.");
|
||||||
|
@ -326,13 +333,20 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer[] salvarClienteExcel(List<Empresa> empresas, Boolean usaCPFComoFidelidade, ClienteExcelVo cliente, TipoIdentificacion tipoIdentificacionUno, TipoIdentificacion tipoIdentificacionDoos) throws ParseException {
|
private Integer[] salvarClienteExcel(List<Empresa> empresas, Boolean usaCPFComoFidelidade, ClienteExcelVo cliente,
|
||||||
|
TipoIdentificacion tipoIdentificacionUno, TipoIdentificacion tipoIdentificacionDoos, boolean isImportacaoPolicial) throws ParseException {
|
||||||
Integer inseridos = new Integer(0);
|
Integer inseridos = new Integer(0);
|
||||||
Integer atualizados = new Integer(0);
|
Integer atualizados = new Integer(0);
|
||||||
Integer desconsiderados = new Integer(0);
|
Integer desconsiderados = new Integer(0);
|
||||||
Integer[] gravados = { 0, 0, 0 };
|
Integer[] gravados = { 0, 0, 0 };
|
||||||
Cliente clienteGravar = new Cliente();
|
Cliente clienteGravar = new Cliente();
|
||||||
List<Cliente> lsCliente = clienteService.buscarPorDocumento(cliente.getCpf());
|
|
||||||
|
String docBusca = cliente.getCpf();
|
||||||
|
if (isImportacaoPolicial) {
|
||||||
|
docBusca = cliente.getRg();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Cliente> lsCliente = clienteService.buscarPorDocumento(docBusca);
|
||||||
|
|
||||||
if (lsCliente != null && !lsCliente.isEmpty()) {
|
if (lsCliente != null && !lsCliente.isEmpty()) {
|
||||||
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.IS_DESCONSIDERA_CLIENTE_NA_BASE.getDescricao())) {
|
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.IS_DESCONSIDERA_CLIENTE_NA_BASE.getDescricao())) {
|
||||||
|
@ -344,23 +358,45 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (true) {
|
if (usaCPFComoFidelidade == null)
|
||||||
criarFidelidadesTodasEmpresas(clienteGravar, empresas, cliente);
|
usaCPFComoFidelidade = false;
|
||||||
// }
|
|
||||||
clienteGravar.setFecnacimiento(StringUtils.isEmpty(cliente.getNascimento()) ? null : retornaDate(cliente.getNascimento()));
|
criarFidelidadesTodasEmpresas(clienteGravar, empresas, cliente, usaCPFComoFidelidade);
|
||||||
clienteGravar.setDesccorreo(cliente.getEmail());
|
|
||||||
clienteGravar.setNombcliente(cliente.getNome());
|
clienteGravar.setNombcliente(cliente.getNome());
|
||||||
clienteGravar.setNumfax(cliente.getFax());
|
|
||||||
clienteGravar.setNumtelefono(cliente.getTelefone());
|
if (isImportacaoPolicial) {
|
||||||
clienteGravar.setNumtelefonodos(cliente.getCelular());
|
if (!StringUtils.isEmpty(cliente.getRg())) {
|
||||||
clienteGravar.setIndsexo(cliente.getSexo());
|
clienteGravar.setNumIdentificaUno(cliente.getRg());
|
||||||
clienteGravar.setNumIdentificaUno(cliente.getCpf());
|
clienteGravar.setTipoIdentificacionUno(tipoIdentificacionUno);
|
||||||
clienteGravar.setTipoIdentificacionUno(tipoIdentificacionUno);
|
}
|
||||||
if (!StringUtils.isEmpty(cliente.getRg())) {
|
|
||||||
clienteGravar.setNumIdentificaDos(cliente.getRg());
|
List<TipoOcupacion> ls = tipoOcupacionService.buscar("POLICIAL MILITAR", null);
|
||||||
clienteGravar.setTipoIdentificacionDos(tipoIdentificacionDoos);
|
if (ls == null || ls.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
clienteGravar.setTipoocupacionId(ls != null && !ls.isEmpty() ? ls.get(0) : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
clienteGravar.setFecnacimiento(StringUtils.isEmpty(cliente.getNascimento()) ? null : retornaDate(cliente.getNascimento()));
|
||||||
|
clienteGravar.setDesccorreo(cliente.getEmail());
|
||||||
|
|
||||||
|
clienteGravar.setNumfax(cliente.getFax());
|
||||||
|
clienteGravar.setNumtelefono(cliente.getTelefone());
|
||||||
|
clienteGravar.setNumtelefonodos(cliente.getCelular());
|
||||||
|
clienteGravar.setIndsexo(cliente.getSexo());
|
||||||
|
clienteGravar.setNumIdentificaUno(cliente.getCpf());
|
||||||
|
clienteGravar.setTipoIdentificacionUno(tipoIdentificacionUno);
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(cliente.getRg())) {
|
||||||
|
clienteGravar.setNumIdentificaDos(cliente.getRg());
|
||||||
|
clienteGravar.setTipoIdentificacionDos(tipoIdentificacionDoos);
|
||||||
|
}
|
||||||
|
|
||||||
|
setDirecion(clienteGravar, cliente);
|
||||||
}
|
}
|
||||||
setDirecion(clienteGravar, cliente);
|
|
||||||
if (clienteGravar.getClienteId() == null) {
|
if (clienteGravar.getClienteId() == null) {
|
||||||
clienteGravar.setFecCadastro(new Date());
|
clienteGravar.setFecCadastro(new Date());
|
||||||
clienteService.suscribir(clienteGravar);
|
clienteService.suscribir(clienteGravar);
|
||||||
|
@ -397,7 +433,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void criarFidelidadesTodasEmpresas(Cliente cliente, List<Empresa> empresas, ClienteExcelVo cExce) {
|
private void criarFidelidadesTodasEmpresas(Cliente cliente, List<Empresa> empresas, ClienteExcelVo cExce, Boolean usaCPFComoFidelidade) {
|
||||||
|
|
||||||
Boolean achou = false;
|
Boolean achou = false;
|
||||||
List<ClienteFidelidad> fidelidades = null;
|
List<ClienteFidelidad> fidelidades = null;
|
||||||
|
@ -405,7 +441,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
if (cliente.getClienteId() == null) {
|
if (cliente.getClienteId() == null) {
|
||||||
fidelidades = new ArrayList<ClienteFidelidad>();
|
fidelidades = new ArrayList<ClienteFidelidad>();
|
||||||
for (Empresa e : empresas) {
|
for (Empresa e : empresas) {
|
||||||
fidelidades.add(criarFidelidade(e, cExce));
|
fidelidades.add(criarFidelidade(e, cExce, usaCPFComoFidelidade));
|
||||||
}
|
}
|
||||||
cliente.setListClienteFidelidad(fidelidades);
|
cliente.setListClienteFidelidad(fidelidades);
|
||||||
|
|
||||||
|
@ -413,7 +449,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
fidelidades = cliente.getListClienteFidelidad();
|
fidelidades = cliente.getListClienteFidelidad();
|
||||||
if (fidelidades == null || fidelidades.isEmpty()) {
|
if (fidelidades == null || fidelidades.isEmpty()) {
|
||||||
for (Empresa e : empresas) {
|
for (Empresa e : empresas) {
|
||||||
fidelidades.add(criarFidelidade(e, cExce));
|
fidelidades.add(criarFidelidade(e, cExce, usaCPFComoFidelidade));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (Empresa e : empresas) {
|
for (Empresa e : empresas) {
|
||||||
|
@ -432,7 +468,7 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!achou) {
|
if (!achou) {
|
||||||
fidelidades.add(criarFidelidade(e, cExce));
|
fidelidades.add(criarFidelidade(e, cExce, usaCPFComoFidelidade));
|
||||||
}
|
}
|
||||||
achou = false;
|
achou = false;
|
||||||
}
|
}
|
||||||
|
@ -441,43 +477,10 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private List<ClienteFidelidad> criarFidelidadesTodasEmpresas(List<ClienteFidelidad> fidelidades, List<Empresa> empresas, ClienteExcelVo cExce) {
|
private ClienteFidelidad criarFidelidade(Empresa e, ClienteExcelVo cExcel, Boolean usaCPFComoFidelidade) {
|
||||||
//
|
|
||||||
// List<ClienteFidelidad> result = new ArrayList<ClienteFidelidad>();
|
|
||||||
// Boolean achou = false;
|
|
||||||
// if (fidelidades==null || fidelidades.isEmpty()) {
|
|
||||||
// for (Empresa e : empresas) {
|
|
||||||
// result.add(criarFidelidade(e, cExce));
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// for (Empresa e : empresas) {
|
|
||||||
// for (ClienteFidelidad f : fidelidades) {
|
|
||||||
// if (f.getEmpresa().equals(e)) {
|
|
||||||
// f.setActivo(true);
|
|
||||||
// f.setFecmodif(new Date());
|
|
||||||
// TarjetaFidelidad tarjetaFidelidad = f.getTarjetaFidelidad();
|
|
||||||
// if(tarjetaFidelidad!=null){
|
|
||||||
// tarjetaFidelidad.setActivo(true);
|
|
||||||
// tarjetaFidelidad.setFecmodif(new Date());
|
|
||||||
// }
|
|
||||||
// result.add(f);
|
|
||||||
// achou = true;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (!achou) {
|
|
||||||
// result.add(criarFidelidade(e, cExce));
|
|
||||||
// }
|
|
||||||
// achou = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private ClienteFidelidad criarFidelidade(Empresa e, ClienteExcelVo cExcel) {
|
|
||||||
ClienteFidelidad clienteFidelidad = new ClienteFidelidad();
|
ClienteFidelidad clienteFidelidad = new ClienteFidelidad();
|
||||||
TarjetaFidelidad tarjetaFidelidad = new TarjetaFidelidad();
|
TarjetaFidelidad tarjetaFidelidad = new TarjetaFidelidad();
|
||||||
tarjetaFidelidad.setNumTarjeta(cExcel.getCpf());
|
tarjetaFidelidad.setNumTarjeta(usaCPFComoFidelidade ? cExcel.getCpf() : cExcel.getRg());
|
||||||
tarjetaFidelidad.setActivo(true);
|
tarjetaFidelidad.setActivo(true);
|
||||||
tarjetaFidelidad.setFecmodif(Calendar.getInstance().getTime());
|
tarjetaFidelidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
tarjetaFidelidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
tarjetaFidelidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
@ -624,6 +627,29 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Boolean validaSheetImportacaoPolicial(Sheet sheet) {
|
||||||
|
|
||||||
|
Row row = sheet.getRow(0);
|
||||||
|
Iterator<Cell> cellIterator = row.cellIterator();
|
||||||
|
|
||||||
|
while (cellIterator.hasNext()) {
|
||||||
|
Cell cell = cellIterator.next();
|
||||||
|
switch (cell.getColumnIndex()) {
|
||||||
|
case 0:
|
||||||
|
if (cell.getStringCellValue().equalsIgnoreCase(Labels.getLabel("importarClientesPolicialController.HEADERCOLUMN.nome"))) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case 1:
|
||||||
|
if (cell.getStringCellValue().equalsIgnoreCase(Labels.getLabel("importarClientesPolicialController.HEADERCOLUMN.rg"))) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private Date retornaDate(String date) throws ParseException {
|
private Date retornaDate(String date) throws ParseException {
|
||||||
|
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
||||||
|
@ -655,4 +681,124 @@ public class ImportacaoClientesServiceImpl implements ImportacaoClientesService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] lerArquivoPolicialExcel(Media media, List<Empresa> empresas) {
|
||||||
|
|
||||||
|
List<TipoIdentificacion> lsTipoIdentificacion = tipoIdentificacionService.obtenerTodos();
|
||||||
|
TipoIdentificacion tipoIdentificacionUno = null;
|
||||||
|
|
||||||
|
for (TipoIdentificacion t : lsTipoIdentificacion) {
|
||||||
|
|
||||||
|
if (t.getDesctipo().equalsIgnoreCase("rg")) {
|
||||||
|
tipoIdentificacionUno = t;
|
||||||
|
}
|
||||||
|
if (tipoIdentificacionUno != null)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer index = 1;
|
||||||
|
StringBuilder qtdeGravados = new StringBuilder();
|
||||||
|
StringBuilder erros = new StringBuilder();
|
||||||
|
Integer inseridos = 0;
|
||||||
|
Integer atualizados = 0;
|
||||||
|
Integer desconsiderados = 0;
|
||||||
|
InputStream isMExcel = media.getStreamData();
|
||||||
|
Sheet sheet = null;
|
||||||
|
|
||||||
|
if (media.getFormat().equals("xls")) {
|
||||||
|
HSSFWorkbook wb;
|
||||||
|
try {
|
||||||
|
wb = new HSSFWorkbook(isMExcel);
|
||||||
|
sheet = wb.getSheetAt(0);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (media.getFormat().equals("xlsx")) {
|
||||||
|
XSSFWorkbook wb;
|
||||||
|
try {
|
||||||
|
wb = new XSSFWorkbook(isMExcel);
|
||||||
|
sheet = wb.getSheetAt(0);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int rows = sheet.getPhysicalNumberOfRows();
|
||||||
|
|
||||||
|
log.info(String.format("Quantidade cliente:%s", rows));
|
||||||
|
|
||||||
|
if (validaSheetImportacaoPolicial(sheet)) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (index = 1; index < rows; index++) {
|
||||||
|
log.info(String.format("index cliente:%s", index));
|
||||||
|
|
||||||
|
Row row = sheet.getRow(index);
|
||||||
|
if (row == null) {
|
||||||
|
log.info("index/row empty");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<Cell> cellIterator = row.cellIterator();
|
||||||
|
ClienteExcelVo cliente = new ClienteExcelVo();
|
||||||
|
|
||||||
|
while (cellIterator.hasNext()) {
|
||||||
|
Cell cell = cellIterator.next();
|
||||||
|
switch (cell.getColumnIndex()) {
|
||||||
|
case 0:
|
||||||
|
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||||
|
cliente.setNome(cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||||
|
cliente.setRg(cell.getStringCellValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info(String.format("cliente:%s rg:%s", cliente.getNome(), cliente.getRg()));
|
||||||
|
|
||||||
|
log.info("enviado para gravação...");
|
||||||
|
try {
|
||||||
|
Integer[] gravados = salvarClienteExcel(empresas, false, cliente, tipoIdentificacionUno, null, true);
|
||||||
|
inseridos = gravados[0] + inseridos;
|
||||||
|
atualizados = gravados[1] + atualizados;
|
||||||
|
desconsiderados = gravados[2] + desconsiderados;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
log.error("Erro na gravação do registro. Favor revisar", e);
|
||||||
|
log.info("continuando importação");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
qtdeGravados.append("Gravados ").append(inseridos + atualizados).append(" clientes de ").append(index - 1).append(" importados.\n");
|
||||||
|
qtdeGravados.append("Desconsiderados ").append(desconsiderados).append(" clientes.\n");
|
||||||
|
qtdeGravados.append("Atualizados ").append(atualizados).append(" clientes.\n");
|
||||||
|
qtdeGravados.append("Inseridos ").append(inseridos).append(" novos clientes.");
|
||||||
|
String[] resultado = { qtdeGravados.toString(), erros.toString() };
|
||||||
|
|
||||||
|
log.info("importação finalizada");
|
||||||
|
|
||||||
|
return resultado;
|
||||||
|
|
||||||
|
} catch (ArrayIndexOutOfBoundsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
String msg = "Erro ao gravar cliente na linha " + (index + 1) + " do arquivo.";
|
||||||
|
erros.append(msg);
|
||||||
|
String[] resultado = { "Houve erro ao gravar os clientes, consulte o arquivo de erros.", erros.toString() };
|
||||||
|
return resultado;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
erros.append("Linha ").append(index).append(" do arquivo de clientes, erro: ").append(e.getCause().getCause()).append("\n");
|
||||||
|
String[] resultado = { "Houve erro ao gravar os clientes, consulte o arquivo de erros.", erros.toString() };
|
||||||
|
return resultado;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
erros.append("A estrutura do arquivo esta com erro ").append("\n");
|
||||||
|
String[] resultado = { "Houve erro ao gravar os clientes, consulte o arquivo de erros.", erros.toString() };
|
||||||
|
return resultado;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -24,6 +25,9 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
@Service("importacaoRetornoBancarioService")
|
@Service("importacaoRetornoBancarioService")
|
||||||
public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBancarioService {
|
public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBancarioService {
|
||||||
|
|
||||||
|
private static final String LIQUIDACAO_NORMAL = "06";
|
||||||
|
private static final String LIQUIDACAO_EM_CARTORIO = "08";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemessaCNABBancosDAO remessaCNABBancosDAO;
|
private RemessaCNABBancosDAO remessaCNABBancosDAO;
|
||||||
|
|
||||||
|
@ -55,7 +59,11 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
||||||
|
|
||||||
for (DetalheRetorno detalhe : retornoBancario.getTitulos()) {
|
for (DetalheRetorno detalhe : retornoBancario.getTitulos()) {
|
||||||
try {
|
try {
|
||||||
if( salvarRetornoBancario( detalhe, empresa.getEmpresaId(), usuarioId )) {
|
if( !detalhe.getCodigoOcorrencia().equals(LIQUIDACAO_NORMAL)
|
||||||
|
&& !detalhe.getCodigoOcorrencia().equals(LIQUIDACAO_EM_CARTORIO) ) {
|
||||||
|
erros++;
|
||||||
|
detalhado.append("Registro sem ocorrencia de quitação: ").append(detalhe.getNossoNumero()).append(".\n");
|
||||||
|
}else if( salvarRetornoBancario( detalhe, empresa.getEmpresaId(), usuarioId )) {
|
||||||
atualizados++;
|
atualizados++;
|
||||||
detalhado.append("Quitado:").append(detalhe.getNossoNumero()).append(".\n");
|
detalhado.append("Quitado:").append(detalhe.getNossoNumero()).append(".\n");
|
||||||
}else {
|
}else {
|
||||||
|
@ -126,7 +134,10 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
||||||
|
|
||||||
if(linha.startsWith("1")) { //detalhe
|
if(linha.startsWith("1")) { //detalhe
|
||||||
DetalheRetornoItau detalhe = new DetalheRetornoItau();
|
DetalheRetornoItau detalhe = new DetalheRetornoItau();
|
||||||
|
detalhe.setCodigoOcorrencia(linha.substring(108, 110));
|
||||||
|
detalhe.setValorJuros( new BigDecimal(linha.substring(266, 279)).divide(new BigDecimal(100)) );
|
||||||
detalhe.setNossoNumero(linha.substring(85, 93)+"-"+linha.substring(93, 94));
|
detalhe.setNossoNumero(linha.substring(85, 93)+"-"+linha.substring(93, 94));
|
||||||
|
detalhe.setDataBaixa(linha.substring(110, 116));
|
||||||
arquivo.addTitulo(detalhe);
|
arquivo.addTitulo(detalhe);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +166,7 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
||||||
throw new RuntimeException("Boleto já quitado para a empresa com o nosso numero: "+detalhe.getNossoNumero());
|
throw new RuntimeException("Boleto já quitado para a empresa com o nosso numero: "+detalhe.getNossoNumero());
|
||||||
}
|
}
|
||||||
|
|
||||||
return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId );
|
return remessaCNABBancosDAO.quitarFechamentoBoleto( boleto.getFechamentoboletoId(), usuarioId, detalhe );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.parada.ParadaVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -179,4 +180,9 @@ public class ParadaServiceImpl implements ParadaService {
|
||||||
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada){
|
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada){
|
||||||
return paradaDAO.buscarPorAgrupamentoParadaId(agrupamentoParada);
|
return paradaDAO.buscarPorAgrupamentoParadaId(agrupamentoParada);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Parada> buscarDestinosPorOrigem(Integer origemId) {
|
||||||
|
return paradaDAO.buscarDestinosPorOrigem(origemId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
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.PtovtaExcecaoMultaCancDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaExcecaoMultaCanc;
|
||||||
|
import com.rjconsultores.ventaboletos.service.PtovtaExcecaoMultaCancService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("ptovtaExcecaoMultaCancService")
|
||||||
|
public class PtovtaExcecaoMultaCancServiceImpl implements PtovtaExcecaoMultaCancService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PtovtaExcecaoMultaCancDAO ptovtaExcecaoMultaCancDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PtovtaExcecaoMultaCanc> obtenerTodos() {
|
||||||
|
return ptovtaExcecaoMultaCancDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PtovtaExcecaoMultaCanc obtenerID(Integer id) {
|
||||||
|
return ptovtaExcecaoMultaCancDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaExcecaoMultaCanc suscribir(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setActivo(true);
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return ptovtaExcecaoMultaCancDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaExcecaoMultaCanc actualizacion(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return ptovtaExcecaoMultaCancDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(PtovtaExcecaoMultaCanc entidad) {
|
||||||
|
entidad.setActivo(false);
|
||||||
|
entidad.setFecmodif(new Date());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
ptovtaExcecaoMultaCancDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -435,9 +435,11 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
PuntoVenta originalClone = null;
|
PuntoVenta originalClone = null;
|
||||||
try {
|
try {
|
||||||
originalClone = entidad.getCloneObject();
|
originalClone = entidad.getCloneObject();
|
||||||
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
|
if(entidad.getTitularId()!=null) {
|
||||||
|
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("",e);
|
log.error("Erro ao clonar TitularId",e);
|
||||||
}
|
}
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.rjconsultores.ventaboletos.dao.SapDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.rest.IntegracaoSapRest;
|
import com.rjconsultores.ventaboletos.rest.IntegracaoSapRest;
|
||||||
import com.rjconsultores.ventaboletos.service.SapService;
|
import com.rjconsultores.ventaboletos.service.SapService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
@ -65,7 +66,12 @@ public class SapServiceImpl implements SapService{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
||||||
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar);
|
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta) {
|
||||||
|
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, puntoVenta);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,49 +21,53 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@Service("tipoOcupacionService")
|
@Service("tipoOcupacionService")
|
||||||
public class TipoOcupacionServiceImpl implements TipoOcupacionService {
|
public class TipoOcupacionServiceImpl implements TipoOcupacionService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TipoOcupacionDAO tipoOcupacionDAO;
|
private TipoOcupacionDAO tipoOcupacionDAO;
|
||||||
|
|
||||||
public List<TipoOcupacion> obtenerTodos() {
|
public List<TipoOcupacion> obtenerTodos() {
|
||||||
return tipoOcupacionDAO.obtenerTodos();
|
return tipoOcupacionDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TipoOcupacion obtenerID(Integer id) {
|
public TipoOcupacion obtenerID(Integer id) {
|
||||||
return tipoOcupacionDAO.obtenerID(id);
|
return tipoOcupacionDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public TipoOcupacion suscribir(TipoOcupacion entidad) {
|
public TipoOcupacion suscribir(TipoOcupacion 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 tipoOcupacionDAO.suscribir(entidad);
|
return tipoOcupacionDAO.suscribir(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public TipoOcupacion actualizacion(TipoOcupacion entidad) {
|
public TipoOcupacion actualizacion(TipoOcupacion 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 tipoOcupacionDAO.actualizacion(entidad);
|
return tipoOcupacionDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void borrar(TipoOcupacion entidad) {
|
public void borrar(TipoOcupacion entidad) {
|
||||||
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);
|
||||||
|
|
||||||
tipoOcupacionDAO.actualizacion(entidad);
|
tipoOcupacionDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion) {
|
public List<TipoOcupacion> buscar(String desctipo) {
|
||||||
return tipoOcupacionDAO.buscar(desctipo, cvetipoocupacion);
|
return buscar(desctipo, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TipoOcupacion> buscarClave(String cvetipoocupacion) {
|
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion) {
|
||||||
return tipoOcupacionDAO.buscarClave(cvetipoocupacion);
|
return tipoOcupacionDAO.buscar(desctipo, cvetipoocupacion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<TipoOcupacion> buscarClave(String cvetipoocupacion) {
|
||||||
|
return tipoOcupacionDAO.buscarClave(cvetipoocupacion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,12 @@ public class ApplicationProperties {
|
||||||
*/
|
*/
|
||||||
public boolean isCustomHabilitado(String key, String defaultValue) {
|
public boolean isCustomHabilitado(String key, String defaultValue) {
|
||||||
String property = getValuefromCustom(key, defaultValue);
|
String property = getValuefromCustom(key, defaultValue);
|
||||||
return property.equals("1");
|
return property.equals("1") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCustomHabilitado(String key, Boolean defaultValue) {
|
||||||
|
String property = getValuefromCustom(key, defaultValue.toString());
|
||||||
|
return property.equals("true") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputStream readImagefromCustom(String imagene) throws FileNotFoundException, IOException {
|
private InputStream readImagefromCustom(String imagene) throws FileNotFoundException, IOException {
|
||||||
|
|
|
@ -153,7 +153,9 @@ public enum CustomEnum {
|
||||||
|
|
||||||
IS_DESABILITA_USUARIO_ADMINISTRADORES_PERFIL("dasabilitaUsuarioAdministradoresPerfil"),
|
IS_DESABILITA_USUARIO_ADMINISTRADORES_PERFIL("dasabilitaUsuarioAdministradoresPerfil"),
|
||||||
|
|
||||||
INTEGRACION_SAFER("integracion.safer");
|
INTEGRACION_SAFER("integracion.safer"),
|
||||||
|
|
||||||
|
IS_VENDA_MACON("IsVendaMacon");
|
||||||
|
|
||||||
private String descricao;
|
private String descricao;
|
||||||
|
|
||||||
|
|
|
@ -207,6 +207,16 @@ public final class DateUtil {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static java.sql.Timestamp getTimestampFromString(String data, String formato) throws java.text.ParseException {
|
||||||
|
Date d = new Date();
|
||||||
|
DateFormat df = new SimpleDateFormat(formato);
|
||||||
|
|
||||||
|
d = df.parse(data);
|
||||||
|
return new java.sql.Timestamp(d.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static int compareDate(java.util.Date d1) {
|
public static int compareDate(java.util.Date d1) {
|
||||||
return compareDate(d1, new java.util.Date());
|
return compareDate(d1, new java.util.Date());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.vo.comissao;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
|
@ -49,6 +50,9 @@ public class EventosFinanceirosVO {
|
||||||
private Long cajaDiversosId;
|
private Long cajaDiversosId;
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
private Integer turnoId;
|
private Integer turnoId;
|
||||||
|
private List<FormaPagoEventosFinanceirosVO> formapagos;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public EventosFinanceirosVO(Long eventoextraId, Long logconferenciaId) {
|
public EventosFinanceirosVO(Long eventoextraId, Long logconferenciaId) {
|
||||||
this.eventoextraId = eventoextraId;
|
this.eventoextraId = eventoextraId;
|
||||||
|
@ -335,6 +339,36 @@ public class EventosFinanceirosVO {
|
||||||
this.turnoId = turnoId;
|
this.turnoId = turnoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<FormaPagoEventosFinanceirosVO> getFormapagos() {
|
||||||
|
return formapagos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormapagos(List<FormaPagoEventosFinanceirosVO> formapagos) {
|
||||||
|
this.formapagos = formapagos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescFormapagos() {
|
||||||
|
StringBuilder sFormapagos = new StringBuilder();
|
||||||
|
for (FormaPagoEventosFinanceirosVO formapago : formapagos) {
|
||||||
|
if (sFormapagos.length() > 0) {
|
||||||
|
sFormapagos.append(", ");
|
||||||
|
}
|
||||||
|
sFormapagos.append(formapago.getDescpago());
|
||||||
|
}
|
||||||
|
return sFormapagos.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotal() {
|
||||||
|
BigDecimal total = BigDecimal.ZERO;
|
||||||
|
for (FormaPagoEventosFinanceirosVO formapagoVO : formapagos) {
|
||||||
|
total = total.add(formapagoVO.getImporte());
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
@ -366,4 +400,7 @@ public class EventosFinanceirosVO {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
|
||||||
|
|
||||||
|
public class FormaPagoEventosFinanceirosVO {
|
||||||
|
|
||||||
|
private Integer formapagoId;
|
||||||
|
private String descpago;
|
||||||
|
private BigDecimal importe;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public FormaPagoEventosFinanceirosVO(Integer formapagoId, String descpago, BigDecimal importe) {
|
||||||
|
super();
|
||||||
|
this.formapagoId = formapagoId;
|
||||||
|
this.descpago = descpago;
|
||||||
|
this.importe = importe;
|
||||||
|
}
|
||||||
|
public Integer getFormapagoId() {
|
||||||
|
return formapagoId;
|
||||||
|
}
|
||||||
|
public void setFormapagoId(Integer formapagoId) {
|
||||||
|
this.formapagoId = formapagoId;
|
||||||
|
}
|
||||||
|
public String getDescpago() {
|
||||||
|
return descpago;
|
||||||
|
}
|
||||||
|
public void setDescpago(String descpago) {
|
||||||
|
this.descpago = descpago;
|
||||||
|
}
|
||||||
|
public BigDecimal getImporte() {
|
||||||
|
return importe;
|
||||||
|
}
|
||||||
|
public void setImporte(BigDecimal importe) {
|
||||||
|
this.importe = importe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getImporteFormatado() {
|
||||||
|
return BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(getImporte(), LocaleUtil.getLocale());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(BigDecimal importe) {
|
||||||
|
this.importe = MoneyHelper.somar(this.importe, (importe != null ? importe : BigDecimal.ZERO));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void subtract(BigDecimal importe) {
|
||||||
|
this.importe = MoneyHelper.subtrair(this.importe,(importe != null ? importe : BigDecimal.ZERO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.rjconsultores.ventaboletos.vo.conftotem;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
|
||||||
|
public class ConfTotemVentaRapidaVO {
|
||||||
|
|
||||||
|
private Parada origem;
|
||||||
|
private Parada destino;
|
||||||
|
|
||||||
|
public Parada getOrigem() {
|
||||||
|
return origem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigem(Parada origem) {
|
||||||
|
this.origem = origem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(Parada destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
public ConfTotemVentaRapidaVO() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfTotemVentaRapidaVO(Parada origem ,Parada destino) {
|
||||||
|
super();
|
||||||
|
this.origem = origem;
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((destino == null) ? 0 : destino.hashCode());
|
||||||
|
result = prime * result + ((origem == null) ? 0 : origem.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
ConfTotemVentaRapidaVO other = (ConfTotemVentaRapidaVO) obj;
|
||||||
|
if (destino == null) {
|
||||||
|
if (other.destino != null)
|
||||||
|
return false;
|
||||||
|
} else if (!destino.equals(other.destino))
|
||||||
|
return false;
|
||||||
|
if (origem == null) {
|
||||||
|
if (other.origem != null)
|
||||||
|
return false;
|
||||||
|
} else if (!origem.equals(other.origem))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue