sincronismo com fonte atual
parent
12027cf461
commit
f175a8ccb6
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>modelWeb</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.3</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.HistoricoFormaPagoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public interface HistoricoFormaPagoPuntoVentaDAO extends GenericDAO<HistoricoFormaPagoPuntoVenta, Integer> {
|
||||
|
||||
List<HistoricoFormaPagoPuntoVenta> obtenerTodosPorPuntoVenta(PuntoVenta puntoVenta);
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Peaje;
|
||||
|
||||
public interface PeajeDao extends GenericDAO<Peaje, Integer> {
|
||||
|
||||
|
||||
}
|
|
@ -76,5 +76,5 @@ public interface RutaDAO extends GenericDAO<Ruta, Integer> {
|
|||
|
||||
public List<Ruta> buscarPorIds(Integer[] rutaIds);
|
||||
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje);
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje, Empresa empresa);
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
|||
|
||||
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, String status);
|
||||
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status, PuntoVenta puntoVenta);
|
||||
|
||||
public boolean atualizaFechamento(Long fechamentocntcorrenteId, int status) throws Exception;
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
|
@ -13,6 +15,7 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
|
|||
import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialComComposicaoDoPedagioVo;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialVO;
|
||||
|
||||
public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
||||
|
@ -23,7 +26,7 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
|||
* @param orgaoConcedenteId TODO
|
||||
* @return TODO
|
||||
*/
|
||||
public Integer gerarTarifaPorCoeficiente(Integer ruta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
public Integer gerarTarifaPorCoeficiente(Integer ruta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas,Integer[] lsCasetaPeaje);
|
||||
|
||||
public Integer gerarTarifaArtesp(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
|
@ -98,4 +101,8 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
|||
public long obtenerCount(List<Empresa> lsEmpresaSelected);
|
||||
|
||||
public List<TarifaOficialVO> obterTarifaOficialPorFiltroVO(Moneda moneda, Marca marca,List<Marca> lsMarcas,Parada origem, Parada destino, ClaseServicio claseServicio, Ruta ruta, String numRuta, Boolean vende);
|
||||
|
||||
public List<TarifaOficialComComposicaoDoPedagioVo> oberTarifaOficialComComposicaoDoPedagioVo(Integer empresaId);
|
||||
|
||||
public void atualizarPedagioComFiltroDePracaDePedagio(Integer tarifaOficialId, BigDecimal importePedagio, String composicaoPedagio );
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.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.HistoricoFormaPagoPuntoVentaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.HistoricoFormaPagoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
@Repository("historicoFormaPagoPuntoVentaDAO")
|
||||
public class HistoricoFormaPagoPuntoVentaHibernateDAO extends GenericHibernateDAO<HistoricoFormaPagoPuntoVenta, Integer> implements HistoricoFormaPagoPuntoVentaDAO {
|
||||
|
||||
@Autowired
|
||||
public HistoricoFormaPagoPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HistoricoFormaPagoPuntoVenta> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HistoricoFormaPagoPuntoVenta> obtenerTodosPorPuntoVenta(PuntoVenta puntoVenta) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("puntoVenta", puntoVenta));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -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.PeajeDao;
|
||||
import com.rjconsultores.ventaboletos.entidad.Peaje;
|
||||
|
||||
|
||||
@Repository("peajeDao")
|
||||
public class PeajeHibernateDao extends GenericHibernateDAO<Peaje, Integer> implements PeajeDao {
|
||||
|
||||
@Autowired
|
||||
public PeajeHibernateDao(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
}
|
|
@ -470,7 +470,7 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje){
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje,Empresa empresa){
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("indRutaCancelada", Boolean.FALSE));
|
||||
|
@ -485,6 +485,9 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
|||
crietriaOrgaoConcendente.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
crietriaOrgaoConcendente.add(Restrictions.eq("orgaoConcedenteId", orgao.getOrgaoConcedenteId()));
|
||||
}
|
||||
if (empresa != null && empresa.getEmpresaId() != -1) {
|
||||
c.createCriteria("lsRutaEmpresa").add(Restrictions.eq("empresa", empresa));
|
||||
}
|
||||
c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||
return c.list();
|
||||
|
||||
|
|
|
@ -7,19 +7,20 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.SapDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.StatusIntegracaoSap;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
||||
|
||||
import org.hibernate.Query;
|
||||
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.SapDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
||||
|
||||
@Repository("sapDAO")
|
||||
public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente, Long> implements SapDAO {
|
||||
|
||||
|
@ -29,13 +30,13 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
||||
return obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, null);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status) {
|
||||
return obtenerTodosParaRemessa(empresa, dataDe, dataAte, status, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta) {
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status, PuntoVenta puntoVenta) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" SELECT ");
|
||||
|
@ -76,8 +77,8 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
|||
sb.append(" AND pv.puntoventa_id = :puntoVentaId ");
|
||||
}
|
||||
|
||||
if(!reenviar){
|
||||
sb.append(" AND fc.indintegradosap = 2 ");
|
||||
if(status != null && !status.isEmpty()){
|
||||
sb.append(" AND fc.indintegradosap in ("+status+")");
|
||||
}
|
||||
|
||||
sb.append(" ORDER BY ");
|
||||
|
@ -123,7 +124,7 @@ public class SapHibernateDAO extends GenericHibernateDAO<FechamentoCntcorrente,
|
|||
fcc.setEmpresaId( Integer.valueOf( tupla[7].toString() ));
|
||||
fcc.setNombEmpresa( tupla[8].toString());
|
||||
|
||||
fcc.setIntegradoSap( tupla[9]==null?false:tupla[9].toString().equals("1")?true:false );
|
||||
fcc.setIntegradoSap( StatusIntegracaoSap.getStatusIntegracaoSap( tupla[9]==null?0:Integer.valueOf(tupla[9].toString()) ));
|
||||
|
||||
fcc.setAnofechamento(tupla[10].toString());
|
||||
fcc.setMesfechamento(tupla[11].toString());
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -31,6 +33,8 @@ import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
|||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialComComposicaoDoPedagioVo;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialVO;
|
||||
|
||||
@Repository("tarifaOficialDAO")
|
||||
|
@ -47,9 +51,9 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas) {
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas, Integer[] lsCasetaPeaje) {
|
||||
|
||||
String sql = sqlBuilder.getSQLGerarTarifaOficial(rutaId, usuarioId, orgaoConcedente, idsEmpresas);
|
||||
String sql = sqlBuilder.getSQLGerarTarifaOficial(rutaId, usuarioId, orgaoConcedente, idsEmpresas,lsCasetaPeaje);
|
||||
|
||||
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||
|
||||
|
@ -381,13 +385,17 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
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(" ) ");
|
||||
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,");
|
||||
sql.append(" LISTAGG(casetapeaje_id||';'||peaje_id,',') WITHIN GROUP (ORDER BY casetapeaje_id) as composicaoDoPeaje ");
|
||||
sql.append(" from peaje_tarifas pf Group by pf.tarifaoficial_id ");
|
||||
sql.append(" ");
|
||||
sql.append(" ) tarifa_importe ");
|
||||
sql.append(" on (tarifa_oficial.tarifaoficial_id = tarifa_importe.tarifaoficial_id) ");
|
||||
sql.append(" when matched then ");
|
||||
sql.append(" update set ");
|
||||
sql.append(" composicao_do_peaje = tarifa_importe.composicaoDoPeaje,");
|
||||
sql.append(" importepedagio = tarifa_importe.soma ");
|
||||
|
||||
}
|
||||
|
||||
Connection conn = getSession().connection();
|
||||
|
@ -521,4 +529,64 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
int qtd = query.executeUpdate();
|
||||
log.info("qtd Tarifa Embarcada apagada = " + qtd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TarifaOficialComComposicaoDoPedagioVo> oberTarifaOficialComComposicaoDoPedagioVo(Integer empresaId) {
|
||||
StringBuilder sql = new StringBuilder(" SELECT ");
|
||||
sql.append(" tof.tarifaoficial_id as tarifaOficialId, ");
|
||||
sql.append(" ta.COMPOSICAO_DO_PEAJE as composicaoDoPedagioNaTarifa, ");
|
||||
sql.append(" LISTAGG(p.casetapeaje_id||';'||p.peaje_id,',')\r\n"
|
||||
+ "WITHIN GROUP (ORDER BY p.casetapeaje_id) as composicaoDoPedagioNaTarifaOficialComPeaje");
|
||||
sql.append(" FROM tarifa_oficial tof ");
|
||||
sql.append(" INNER JOIN marca m ON m.marca_id=tof.marca_id ");
|
||||
sql.append(" LEFT join tarifa ta on");
|
||||
sql.append(" ta.origen_id=tof.origen_id and");
|
||||
sql.append(" ta.destino_id=tof.destino_id and ");
|
||||
sql.append( "ta.RUTA_ID=tof.RUTA_ID and ");
|
||||
sql.append(" ta.ORGAOCONCEDENTE_ID=tof.ORGAOCONCEDENTE_ID and");
|
||||
sql.append(" ta.CLASESERVICIO_ID=tof.CLASESERVICIO_ID and");
|
||||
sql.append(" ta.MARCA_ID=tof.MARCA_ID and ");
|
||||
sql.append(" ta.tramo_id=tof.tramo_id ");
|
||||
sql.append(" LEFT JOIN VIGENCIA_TARIFA vg on ta.VIGENCIATARIFA_ID=vg.VIGENCIATARIFA_ID");
|
||||
sql.append(" and vg.FECINICIOVIGENCIA<= TO_DATE(:dataInicial,'DD/MM/YYYY hh24:mi') ");
|
||||
sql.append(" and vg.FECFINVIGENCIA>= TO_DATE(:dataFinal,'DD/MM/YYYY hh24:mi')");
|
||||
sql.append(" INNER JOIN PEAJE p");
|
||||
sql.append(" ON p.ORGAOCONCEDENTE_ID = tof.ORGAOCONCEDENTE_ID");
|
||||
sql.append(" AND p.ruta_id= tof.ruta_id");
|
||||
sql.append(" AND p.ORIGEN_ID = tof.ORIGEN_ID");
|
||||
sql.append(" AND p.DESTINO_ID = tof.DESTINO_ID");
|
||||
sql.append(" AND p.activo = 1");
|
||||
sql.append(" AND m.empresa_id=:empresaId ");
|
||||
sql.append(" group by ta.tarifa_id,tof.tarifaoficial_id,ta.tarifa_id,ta.COMPOSICAO_DO_PEAJE");
|
||||
|
||||
Query query = getSession().createSQLQuery(sql.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sql.toString()).addScalar("tarifaOficialId", Hibernate.INTEGER).addScalar("composicaoDoPedagioNaTarifa", Hibernate.STRING).addScalar("composicaoDoPedagioNaTarifaOficialComPeaje", Hibernate.STRING).setResultTransformer(Transformers.aliasToBean(TarifaOficialComComposicaoDoPedagioVo.class));
|
||||
qr.setParameter("empresaId", empresaId);
|
||||
qr.setParameter("dataInicial", DateUtil.getStringDate(DateUtil.inicioFecha(new Date()), "dd/MM/yyyy HH:mm"));
|
||||
qr.setParameter("dataFinal", DateUtil.getStringDate(DateUtil.fimFecha(new Date()), "dd/MM/yyyy HH:mm"));
|
||||
|
||||
return (List<TarifaOficialComComposicaoDoPedagioVo>) qr.list();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void atualizarPedagioComFiltroDePracaDePedagio(Integer tarifaOficialId, BigDecimal importePedagio, String composicaoPedagio) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("update tarifa_oficial set IMPORTEPEDAGIO =:importePedagio, ");
|
||||
sb.append("COMPOSICAO_DO_PEAJE =:composicaoDoPedagio ");
|
||||
sb.append("WHERE tarifaoficial_id=:tarifaOficialId");
|
||||
|
||||
Query query = getSession().createSQLQuery(sb.toString());
|
||||
query.setBigDecimal("importePedagio", importePedagio);
|
||||
query.setString("composicaoDoPedagio", composicaoPedagio);
|
||||
query.setInteger("tarifaOficialId", tarifaOficialId);
|
||||
|
||||
query.executeUpdate();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -21,7 +21,7 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
|||
*/
|
||||
public interface SQLBuilder {
|
||||
|
||||
public String getSQLGerarTarifaOficial(Integer codRuta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
public String getSQLGerarTarifaOficial(Integer codRuta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas, Integer[] listCasetaPeaje);
|
||||
|
||||
public String getSQLGerarTabelaZerada(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas, List<Integer> lsParadaId);
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||
|
@ -245,7 +247,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
@Override
|
||||
public String getSQLGerarTarifaOficial(final Integer codRuta, final Integer usuarioId,
|
||||
final OrgaoConcedente orgaoConcedente, final List<Integer> idsEmpresas) {
|
||||
final OrgaoConcedente orgaoConcedente, final List<Integer> idsEmpresas,Integer[] listCasetaPeaje) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" INSERT ");
|
||||
|
@ -374,8 +376,12 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" inner join estado e on e.estado_id = c.estado_id ");
|
||||
sb.append(" inner join MARCA_CLASESERVICIO mc on ");
|
||||
sb.append(" mc.CLASESERVICIO_ID = r.CLASESERVICIO_ID and ma.marca_id = mc.marca_id ");
|
||||
if(null !=listCasetaPeaje) {
|
||||
sb.append(" inner join peaje p on p.ruta_id=r.ruta_id and p.origen_id=po.parada_id and p.destino_id=pd.parada_id and p.orgaoconcedente_id =oc.orgaoconcedente_id ");
|
||||
}
|
||||
sb.append(" inner join CLASE_SERVICIO cl on cl.claseservicio_id = r.CLASESERVICIO_ID, ");
|
||||
sb.append(" moneda m ");
|
||||
|
||||
sb.append(" ");
|
||||
sb.append("where ");
|
||||
sb.append(" rc.activo = 1 ");
|
||||
|
@ -407,6 +413,10 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" not in (select tao.tramo_id,tao.marca_id,tao.CLASESERVICIO_ID, ");
|
||||
sb.append(" tao.moneda_id,tao.orgaoconcedente_id, tao.ruta_id ");
|
||||
sb.append(" from tarifa_oficial tao where tao.activo = 1) ");
|
||||
if(null !=listCasetaPeaje) {
|
||||
sb.append(" and p.activo=1 ");
|
||||
sb.append(" and p.casetapeaje_id in ( " + StringUtils.join(listCasetaPeaje,",") + ") ");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
@ -768,6 +778,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
StringBuilder sb = new StringBuilder("");
|
||||
|
||||
sb.append("SELECT tao.IMPORTEPEDAGIO AS \"taoimportepedagio\", ");
|
||||
sb.append(" tao.COMPOSICAO_DO_PEAJE AS \"taocomposicaodopeaje\", ");
|
||||
sb.append(" tao.PRECIO AS \"taoprecio\", ");
|
||||
sb.append(" tao.PRECIOORIGINAL AS \"taopreciooriginal\", ");
|
||||
sb.append(" tao.IMPORTETAXAEMBARQUE AS \"taoimportetaxaembarque\", ");
|
||||
|
@ -809,6 +820,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
if (calculaPegagio) {
|
||||
sb.append("IMPORTEPEDAGIO=").append(dados.get("taoimportepedagio")).append(",");
|
||||
sb.append(" COMPOSICAO_DO_PEAJE='").append(dados.get("taocomposicaodopeaje")).append("',");
|
||||
}
|
||||
if (calculaTarifa) {
|
||||
sb.append("PRECIO=").append(dados.get("taoprecio")).append(",PRECIOORIGINAL=").append(dados.get("taopreciooriginal")).append(",");
|
||||
|
@ -839,7 +851,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" MARCA_ID, CLASESERVICIO_ID, PRECIOORIGINAL, MONEDA_ID, ");
|
||||
sb.append(" VIGENCIATARIFA_ID, STATUSTARIFA, ACTIVO, FECMODIF, ");
|
||||
sb.append(" USUARIO_ID, IMPORTETAXAEMBARQUE, IMPORTEPEDAGIO, IMPORTEOUTROS, ");
|
||||
sb.append(" IMPORTESEGURO, IMPORTETPP, ORGAOCONCEDENTE_ID, RUTA_ID, ORIGEN_ID, DESTINO_ID ) ");
|
||||
sb.append(" IMPORTESEGURO, IMPORTETPP, ORGAOCONCEDENTE_ID, RUTA_ID, ORIGEN_ID, DESTINO_ID, COMPOSICAO_DO_PEAJE ) ");
|
||||
sb.append(" select ");
|
||||
sb.append(" TARIFA_SEQ.nextval, ");
|
||||
sb.append(" tao.PRECIO , ");
|
||||
|
@ -862,7 +874,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tao.ORGAOCONCEDENTE_ID , ");
|
||||
sb.append(" tao.RUTA_ID , ");
|
||||
sb.append(" tao.ORIGEN_ID , ");
|
||||
sb.append(" tao.DESTINO_ID ");
|
||||
sb.append(" tao.DESTINO_ID, ");
|
||||
sb.append(" tao.COMPOSICAO_DO_PEAJE ");
|
||||
sb.append(" from ");
|
||||
sb.append(" TARIFA_OFICIAL tao, ");
|
||||
sb.append(" VIGENCIA_TARIFA v, ");
|
||||
|
|
|
@ -102,6 +102,9 @@ public class Categoria implements Serializable {
|
|||
@Column(name = "INDVENDEAPI")
|
||||
private Boolean indvendeapi;
|
||||
|
||||
@Column(name = "INDEXIGEIDENTIDADE")
|
||||
private Boolean indExigeIdentidade;
|
||||
|
||||
public Categoria() {
|
||||
}
|
||||
|
||||
|
@ -292,4 +295,14 @@ public class Categoria implements Serializable {
|
|||
public void setIndvendeapi(Boolean indvendeapi) {
|
||||
this.indvendeapi = indvendeapi;
|
||||
}
|
||||
|
||||
public Boolean getIndExigeIdentidade() {
|
||||
return indExigeIdentidade;
|
||||
|
||||
}
|
||||
|
||||
public void setIndExigeIdentidade(Boolean indExigeIdentidade) {
|
||||
this.indExigeIdentidade = indExigeIdentidade;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
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;
|
||||
|
||||
@AuditarClasse(nome = "HistoricoFormaPagoPuntoVenta", tela = "Alteracao Forma Pago Ponto de Venda/Historico")
|
||||
@Entity
|
||||
@SequenceGenerator(name = "HIST_FORMAPAGOPUNTOVENTA_SEQ", sequenceName = "HIST_FORMAPAGOPUNTOVENTA_SEQ", allocationSize = 1)
|
||||
@Table(name = "HIST_FORMAPAGO_PUNTOVENTA")
|
||||
public class HistoricoFormaPagoPuntoVenta implements Serializable, Auditavel<HistoricoFormaPagoPuntoVenta> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "HIST_FORMAPAGOPUNTOVENTA_SEQ")
|
||||
@Column(name = "HIST_FORMAPAGO_PUNTOVENTA_ID")
|
||||
private Integer historicoFormaPagoPuntoVentaId;
|
||||
|
||||
@Column(name = "IND_INCLUSAO")
|
||||
private Boolean indInclusao;
|
||||
|
||||
@Column(name = "MOTIVO")
|
||||
private String motivo;
|
||||
|
||||
@Column(name = "FEC_ALTERACAO")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecAlteracao;
|
||||
|
||||
@NaoAuditar
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PUNTOVENTA_ID")
|
||||
private PuntoVenta puntoVenta;
|
||||
|
||||
@Column(name = "FORMAPAGO_ID")
|
||||
private Integer formaPagoId;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@Column(name = "EMPRESA_ID")
|
||||
private Integer empresaId;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private HistoricoFormaPagoPuntoVenta historicoPuntoVentaClone;
|
||||
|
||||
|
||||
public Integer getHistoricoFormaPagoPuntoVentaId() {
|
||||
return historicoFormaPagoPuntoVentaId;
|
||||
}
|
||||
|
||||
public void setHistoricoFormaPagoPuntoVentaId(Integer historicoFormaPagoPuntoVentaId) {
|
||||
this.historicoFormaPagoPuntoVentaId = historicoFormaPagoPuntoVentaId;
|
||||
}
|
||||
|
||||
public Boolean getIndInclusao() {
|
||||
return indInclusao;
|
||||
}
|
||||
|
||||
public void setIndInclusao(Boolean indInclusao) {
|
||||
this.indInclusao = indInclusao;
|
||||
}
|
||||
|
||||
public Date getFecAlteracao() {
|
||||
return fecAlteracao;
|
||||
}
|
||||
|
||||
public void setFecAlteracao(Date fecAlteracao) {
|
||||
this.fecAlteracao = fecAlteracao;
|
||||
}
|
||||
|
||||
public HistoricoFormaPagoPuntoVenta getHistoricoPuntoVentaClone() {
|
||||
return historicoPuntoVentaClone;
|
||||
}
|
||||
|
||||
public void setHistoricoPuntoVentaClone(HistoricoFormaPagoPuntoVenta historicoPuntoVentaClone) {
|
||||
this.historicoPuntoVentaClone = historicoPuntoVentaClone;
|
||||
}
|
||||
|
||||
public PuntoVenta getPuntoVenta() {
|
||||
return puntoVenta;
|
||||
}
|
||||
|
||||
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||
this.puntoVenta = puntoVenta;
|
||||
}
|
||||
|
||||
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 Integer getEmpresaId() {
|
||||
return empresaId;
|
||||
}
|
||||
|
||||
public void setEmpresaId(Integer empresaId) {
|
||||
this.empresaId = empresaId;
|
||||
}
|
||||
|
||||
public String getMotivo() {
|
||||
return motivo;
|
||||
}
|
||||
|
||||
public void setMotivo(String motivo) {
|
||||
this.motivo = motivo;
|
||||
}
|
||||
|
||||
public Integer getFormaPagoId() {
|
||||
return formaPagoId;
|
||||
}
|
||||
|
||||
public void setFormaPagoId(Integer formaPagoId) {
|
||||
this.formaPagoId = formaPagoId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
historicoPuntoVentaClone = new HistoricoFormaPagoPuntoVenta();
|
||||
historicoPuntoVentaClone = (HistoricoFormaPagoPuntoVenta) this.clone();
|
||||
Hibernate.initialize(historicoPuntoVentaClone.getPuntoVenta());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HistoricoFormaPagoPuntoVenta getCloneObject() throws CloneNotSupportedException {
|
||||
return historicoPuntoVentaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getHistoricoFormaPagoPuntoVentaId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -52,7 +52,7 @@ import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(name = "PUNTO_VENTA_SEQ", sequenceName = "PUNTO_VENTA_SEQ", allocationSize = 1)
|
||||
@AuditarClasse(nome = "PuntoVenta", tela = "Alteração de Ponto de Venda")
|
||||
@AuditarClasse(nome = "PuntoVenta", tela = "Altera<EFBFBD><EFBFBD>o de Ponto de Venda")
|
||||
@Table(name = "PUNTO_VENTA")
|
||||
public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
||||
|
||||
|
@ -259,6 +259,11 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
|||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
private List<HistoricoPuntoVenta> historicoPuntoVentaList;
|
||||
|
||||
@NaoAuditar
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoVenta")
|
||||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
private List<HistoricoFormaPagoPuntoVenta> historicoFormaPagoPuntoVentaList;
|
||||
|
||||
@AuditarLista(auditarEntidades = true, nome = "CategoriaBloqueioImpPosterior")
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoventa")
|
||||
@LazyCollection(LazyCollectionOption.FALSE)
|
||||
|
@ -326,6 +331,12 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
|||
@Column(name = "INDBLOQCANCBILHETEIMPRESSO ")
|
||||
private Boolean indBloqueiaCancelamentoBilheteImpresso;
|
||||
|
||||
@Column(name = "LATITUDE ")
|
||||
private Double latitude;
|
||||
|
||||
@Column(name = "LONGITUDE ")
|
||||
private Double longitude;
|
||||
|
||||
public List<CobrancaAdcPuntoVenta> getCobrancaAdicionalList() {
|
||||
return cobrancaAdicionalList;
|
||||
}
|
||||
|
@ -424,6 +435,7 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
|||
this.ptovtaCatIndList = new ArrayList<PtovtaCatInd>();
|
||||
this.ptovtaEmpresaBloqueadaList = new ArrayList<PtovtaEmpresaBloqueada>();
|
||||
this.historicoPuntoVentaList = new ArrayList<HistoricoPuntoVenta>();
|
||||
this.historicoFormaPagoPuntoVentaList = new ArrayList<HistoricoFormaPagoPuntoVenta>();
|
||||
}
|
||||
|
||||
public PuntoVenta(Integer puntoventaId) {
|
||||
|
@ -1093,6 +1105,14 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
|||
this.historicoPuntoVentaList = historicoPuntoVentaList;
|
||||
}
|
||||
|
||||
public List<HistoricoFormaPagoPuntoVenta> getHistoricoFormaPagoPuntoVentaList() {
|
||||
return historicoFormaPagoPuntoVentaList;
|
||||
}
|
||||
|
||||
public void setHistoricoFormaPagoPuntoVentaList(List<HistoricoFormaPagoPuntoVenta> historicoFormaPagoPuntoVentaList) {
|
||||
this.historicoFormaPagoPuntoVentaList = historicoFormaPagoPuntoVentaList;
|
||||
}
|
||||
|
||||
public List<CategoriaBloqueioImpPosterior> getCategoriaBloqImpPosteriorList() {
|
||||
return categoriaBloqImpPosteriorList;
|
||||
}
|
||||
|
@ -1280,6 +1300,22 @@ public class PuntoVenta implements Serializable, Auditavel<PuntoVenta> {
|
|||
this.ptovtaExcecaoMultaCancList = ptovtaExcecaoMultaCanc;
|
||||
}
|
||||
|
||||
public Double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(Double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public Double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(Double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
|
||||
|
|
|
@ -162,6 +162,11 @@ public class Tarifa implements Serializable, Auditavel<Tarifa>, AuditavelTelaAlt
|
|||
@Transient
|
||||
private String telaAlternativa;
|
||||
|
||||
|
||||
@Column(name = "COMPOSICAO_DO_PEAJE")
|
||||
@NaoAuditar
|
||||
private String composicaoDoPeaje;
|
||||
|
||||
public Tarifa() {
|
||||
}
|
||||
|
||||
|
@ -408,6 +413,16 @@ public class Tarifa implements Serializable, Auditavel<Tarifa>, AuditavelTelaAlt
|
|||
this.importeseguro = importeseguro;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getComposicaoDoPeaje() {
|
||||
return composicaoDoPeaje;
|
||||
}
|
||||
|
||||
public void setComposicaoDoPeaje(String composicaoDoPeaje) {
|
||||
this.composicaoDoPeaje = composicaoDoPeaje;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
tarifaClone = new Tarifa();
|
||||
|
|
|
@ -139,6 +139,10 @@ public class TarifaOficial implements Serializable, Auditavel<TarifaOficial> {
|
|||
@Transient
|
||||
private Integer empresaId;
|
||||
|
||||
@Column(name = "COMPOSICAO_DO_PEAJE")
|
||||
@NaoAuditar
|
||||
private String composicaoDoPeaje;
|
||||
|
||||
public TarifaOficial() {
|
||||
}
|
||||
|
||||
|
@ -286,6 +290,16 @@ public class TarifaOficial implements Serializable, Auditavel<TarifaOficial> {
|
|||
this.destino = destino;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getComposicaoDoPeaje() {
|
||||
return composicaoDoPeaje;
|
||||
}
|
||||
|
||||
public void setComposicaoDoPeaje(String composicaoDoPeaje) {
|
||||
this.composicaoDoPeaje = composicaoDoPeaje;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
|
|
|
@ -1,7 +1,35 @@
|
|||
package com.rjconsultores.ventaboletos.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum StatusIntegracaoSap {
|
||||
INTEGRADO,
|
||||
NAO_INTEGRADO,
|
||||
PENDENTE;
|
||||
INTEGRADO("Integrado"),
|
||||
NAO_ENVIADO("Nao Enviado"),
|
||||
PENDENTE("Pendente"),
|
||||
RECUSADO("Recusado SAP");
|
||||
|
||||
private String descricao;
|
||||
|
||||
private StatusIntegracaoSap(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public static List<StatusIntegracaoSap> list() {
|
||||
return Arrays.asList(values());
|
||||
}
|
||||
|
||||
public static StatusIntegracaoSap getStatusIntegracaoSap(Integer tValor) {
|
||||
for (StatusIntegracaoSap valor : StatusIntegracaoSap.values()) {
|
||||
if (tValor.equals(valor.ordinal())) {
|
||||
return valor;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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.HistoricoFormaPagoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public interface HistoricoFormaPagoPuntoVentaService extends GenericService<HistoricoFormaPagoPuntoVenta, Integer> {
|
||||
|
||||
List<HistoricoFormaPagoPuntoVenta> obtenerTodosPorPuntoVenta(PuntoVenta puntoVenta);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Peaje;
|
||||
|
||||
public interface PeajeService {
|
||||
|
||||
public Peaje buscarPeajePorId(Integer peajeId);
|
||||
|
||||
}
|
|
@ -124,4 +124,6 @@ public interface RutaService {
|
|||
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedenteParadaIds(Empresa empresa, OrgaoConcedente orgao, Integer[] lsParadaIds) ;
|
||||
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje, Empresa empresa);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ import com.rjconsultores.ventaboletos.vo.integracao.FechamentoCntCorrenteVO;
|
|||
|
||||
public interface SapService extends GenericService<FechamentoCntcorrente, Long> {
|
||||
|
||||
public int remessa(List<FechamentoCntCorrenteVO> fechamentos) throws Exception ;
|
||||
public int remessa(List<FechamentoCntCorrenteVO> fechamentos, boolean processoManual) throws Exception ;
|
||||
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status);
|
||||
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status, PuntoVenta puntoVenta);
|
||||
|
||||
public void integracaoSapAutomatica() throws Exception;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
|
@ -35,7 +36,7 @@ public interface TarifaOficialService {
|
|||
* @param orgaoConcedenteId
|
||||
* @return A quantidade de registros afetadas
|
||||
*/
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas,Integer[] lsCasetaPeaje);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -66,7 +67,7 @@ public interface TarifaOficialService {
|
|||
* @param empresaId
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException;
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedenteId, List<Empresa> lsEmpresaSelected, Integer[] lsCasetaPeaje) throws BusinessException;
|
||||
|
||||
/**
|
||||
* Copia a tarifa oficial para a tabela de tarifa de acordo com a vigencia especificada.<br/>
|
||||
|
@ -148,5 +149,7 @@ public interface TarifaOficialService {
|
|||
|
||||
public List<TarifaOficial> obterTarifaOficialPorFiltro(Moneda moneda, Marca marca,List<Marca> lsMarcas,Parada origem, Parada destino, ClaseServicio claseServicio, Ruta ruta, String numRuta, Boolean vende);
|
||||
|
||||
public void atualizarPedagioPorListaDePracaDePagio(List<CasetaPeaje> lsCasetaPeaje,Integer empresaId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -617,14 +617,14 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
if (boletoComissao.isMotivocancelacionQuitacaoOcd()) {
|
||||
formapago.subtract(formapagoBoleto.getImporte());
|
||||
// somando as vendas
|
||||
} else if (boletoComissao.isAbaBilheteVendido() || boletoComissao.isAbaGapVendido() || boletoComissao.isAbaBilheteManual()) {
|
||||
} else if (boletoComissao.isAbaBilheteVendido() || boletoComissao.isAbaGapVendido() || boletoComissao.isAbaBilheteManual() || (boletoComissao.isVendaBilheteTransferencia(boletoComissao.getTipoVenta()) && formapago.getFormapagoId() == 1)) {
|
||||
formapago.add(formapagoBoleto.getImporte());
|
||||
// subtraindo os cancelamentos
|
||||
} else if (boletoComissao.isAbaBilheteCancelado() || boletoComissao.isAbaGapCancelado()) {
|
||||
formapago.subtract(formapagoBoleto.getImporte());
|
||||
// subtraindo as trocas e devolucoes
|
||||
} else if (boletoComissao.isAbaBilheteDevolvido() || boletoComissao.isAbaGapDevolvido()) {
|
||||
if (boletoComissao.isMotivocancelacionTrocado() || boletoComissao.isMotivocancelacionDevolvido() || boletoComissao.isMotivocancelacionQuitacaoOcd()) {
|
||||
} else if (boletoComissao.isAbaBilheteDevolvido() || boletoComissao.isAbaGapDevolvido() || boletoComissao.isMotivocancelacionTransferido()) {
|
||||
if (boletoComissao.isMotivocancelacionTrocado() || boletoComissao.isMotivocancelacionDevolvido() || boletoComissao.isMotivocancelacionQuitacaoOcd() || (boletoComissao.isVendaBilheteTransferencia(boletoComissao.getTipoVenta()) && formapago.getFormapagoId() == 1)) {
|
||||
formapago.subtract(formapagoBoleto.getImporte());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,15 +67,15 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
historicoCont.setDataHora(Calendar.getInstance().getTime());
|
||||
|
||||
if (historicoCont.getEmpresa() == null) {
|
||||
throw new BusinessException("Não é possível salvar sem a empresa");
|
||||
throw new BusinessException("N<EFBFBD>o <20> poss<73>vel salvar sem a empresa");
|
||||
}
|
||||
|
||||
if (historicoCont.getEstado() == null) {
|
||||
throw new BusinessException("Não é possível salvar sem o estado referente");
|
||||
throw new BusinessException("N<EFBFBD>o <20> poss<73>vel salvar sem o estado referente");
|
||||
}
|
||||
|
||||
if (historicoCont.getMotivo() == null) {
|
||||
throw new BusinessException("Não é possível salvar sem o motivo referente");
|
||||
throw new BusinessException("N<EFBFBD>o <20> poss<73>vel salvar sem o motivo referente");
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -102,10 +102,10 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
}
|
||||
|
||||
private void setMotivoNaoTrocaStatus(LogHistoricoContingencia historicoCont, Exception e) {
|
||||
log.error(String.format("Erro no envio de e-mail de contingência da empresa %s para o estado %s.", historicoCont.getEmpresa().getEmpresaId(),historicoCont.getEstado()), e);
|
||||
log.error(String.format("Erro no envio de e-mail de conting<EFBFBD>ncia da empresa %s para o estado %s.", historicoCont.getEmpresa().getEmpresaId(),historicoCont.getEstado()), e);
|
||||
|
||||
String motivo = historicoCont.getMotivo();
|
||||
motivo = motivo.concat("**Problema no envio de E-mail de notificação. Favor checar.");
|
||||
motivo = motivo.concat("**Problema no envio de E-mail de notifica<EFBFBD><EFBFBD>o. Favor checar.");
|
||||
|
||||
historicoCont.setMotivo(motivo);
|
||||
}
|
||||
|
@ -165,9 +165,17 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
}
|
||||
|
||||
private void enviaEmail(LogHistoricoContingencia historicoCont) throws SendFailedException, AuthenticationFailedException {
|
||||
SendMail mail = new SendMail();
|
||||
|
||||
EmpresaEmail empresaEmail = empresaEmailService.buscarPorEmpresa(historicoCont.getEmpresa());
|
||||
EmpresaEmailConfig empresaEmailConfig = empresaEmailConfigService.buscarPorEmpresa(historicoCont.getEmpresa());
|
||||
|
||||
if (empresaEmail != null && empresaEmailConfig != null &&
|
||||
empresaEmailConfig.getIndAutenticacao() != null && empresaEmail.getEmailDe() != null &&
|
||||
empresaEmailConfig.getTipoAutorizacao() != null && empresaEmailConfig.getSmtp() != null &&
|
||||
empresaEmailConfig.getSenha() != null && empresaEmailConfig.getSmtpPorta() != null &&
|
||||
empresaEmailConfig.getSmtpEmail() != null && empresaEmail.getDestinatario() != null) {
|
||||
|
||||
SendMail mail = new SendMail();
|
||||
mail.setAuth(empresaEmailConfig.getIndAutenticacao());
|
||||
if (StringUtils.isNotEmpty(empresaEmailConfig.getTipoAutorizacao())) {
|
||||
mail.setAuthType(AuthType.valueOf(empresaEmailConfig.getTipoAutorizacao()));
|
||||
|
@ -177,22 +185,23 @@ public class ContingenciaServiceImpl implements ContingenciaService {
|
|||
mail.setSmtpPassword(empresaEmailConfig.getSenha());
|
||||
mail.setSmtpPort(empresaEmailConfig.getSmtpPorta());
|
||||
mail.setSmtpUser(empresaEmailConfig.getSmtpEmail());
|
||||
mail.setSubject("Contingência Off-line BP-e");
|
||||
mail.setSubject("Conting<EFBFBD>ncia Off-line BP-e");
|
||||
mail.setText(getMensagem(historicoCont));
|
||||
mail.setEmailTo(empresaEmail.getDestinatario());
|
||||
mail.setEmailToCO(EMAIL_COPIA_OCULTA);
|
||||
mail.send();
|
||||
}
|
||||
}
|
||||
|
||||
private String getMensagem(LogHistoricoContingencia historicoContingencia) {
|
||||
StringBuilder mensagem = new StringBuilder();
|
||||
mensagem.append(String.format("A empresa %s está com a emissão do BP-e em contingência off-line para a UF %s no ambiente de %s. ",
|
||||
mensagem.append(String.format("A empresa %s est<EFBFBD> com a emiss<73>o do BP-e em conting<6E>ncia off-line para a UF %s no ambiente de %s. ",
|
||||
historicoContingencia.getEmpresa().getNombempresa(), historicoContingencia.getEstado().getCveestado(),
|
||||
EAmbienteContingencia.getAmbienteContingencia(historicoContingencia.getAmbiente()).getDescricao()));
|
||||
mensagem.append("A emissão em contingência deve ser tratada como exceção, sendo que a regra deve ser a emissão com autorização em tempo real.");
|
||||
mensagem.append("O Fisco poderá solicitar esclarecimentos, e até mesmo restringir ao contribuinte a utilização da modalidade de contingência off-line, caso seja identificado que o emissor do BP-e utiliza a contingência em demasia e sem justificativa aceitável, quando comparado a outros contribuintes em situação similar.");
|
||||
mensagem.append("Na utilização de contingência off-line, o contribuinte assume o risco de perda da informação dos ");
|
||||
mensagem.append("BP-e emitidos em contingência, até que os mesmos constem da base de dados do Fisco.");
|
||||
mensagem.append("A emiss<EFBFBD>o em conting<6E>ncia deve ser tratada como exce<63><65>o, sendo que a regra deve ser a emiss<73>o com autoriza<7A><61>o em tempo real.");
|
||||
mensagem.append("O Fisco poder<EFBFBD> solicitar esclarecimentos, e at<61> mesmo restringir ao contribuinte a utiliza<7A><61>o da modalidade de conting<6E>ncia off-line, caso seja identificado que o emissor do BP-e utiliza a conting<6E>ncia em demasia e sem justificativa aceit<69>vel, quando comparado a outros contribuintes em situa<75><61>o similar.");
|
||||
mensagem.append("Na utiliza<EFBFBD><EFBFBD>o de conting<6E>ncia off-line, o contribuinte assume o risco de perda da informa<6D><61>o dos ");
|
||||
mensagem.append("BP-e emitidos em conting<EFBFBD>ncia, at<61> que os mesmos constem da base de dados do Fisco.");
|
||||
return mensagem.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -1443,17 +1443,28 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
try {
|
||||
while (DateUtil.compareOnlyDate(dataAte, dataInicial) >= 0) {
|
||||
|
||||
boolean corridaGerada = this.generarCorrida(dataAte, Arrays.asList(esquemaCorrida), false);
|
||||
if (corridaGerada) {
|
||||
calendarData.setTime(dataAte);
|
||||
calendarData.add(Calendar.DATE, -1);
|
||||
dataAte = calendarData.getTime();
|
||||
boolean corridaExiste = corridaDAO.existe(new Corrida.Id(esquemaCorrida.getNumCorrida(), dataAte));
|
||||
String strDataGeracao = DateUtil.getStringDate(dataAte);
|
||||
|
||||
log.info(String.format("Corrida existe = %s [%s - %s]",corridaExiste,esquemaCorrida.getNumCorrida() ,strDataGeracao));
|
||||
|
||||
//A corrida já existir é a única condição para parar de gerar.
|
||||
//Se a corrida não for gerada (rotina mais abaixo), podem haver várias condições: o dia da semana, feriado, etc
|
||||
if (corridaExiste){
|
||||
log.info(String.format("Corrida % do dia % já gerada",esquemaCorrida.getNumCorrida(), strDataGeracao));
|
||||
|
||||
} else {
|
||||
log.info("Corrida do dia: " + sdfData.format(dataAte) + " já gerada");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
boolean corridaGerada = this.generarCorrida(dataAte, Arrays.asList(esquemaCorrida), false);
|
||||
|
||||
log.info(String.format("Corrida gerada = %s [%s - %s]",corridaGerada,esquemaCorrida.getNumCorrida() ,strDataGeracao));
|
||||
|
||||
|
||||
calendarData.setTime(dataAte);
|
||||
calendarData.add(Calendar.DATE, -1);
|
||||
dataAte = calendarData.getTime();
|
||||
}
|
||||
|
||||
log.info("commit bloco corridas");
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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.HistoricoFormaPagoPuntoVentaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.HistoricoFormaPagoPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.HistoricoFormaPagoPuntoVentaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
@Service("historicoFormaPagoPuntoVentaService")
|
||||
public class HistoricoFormaPagoPuntoVentaServiceImpl implements HistoricoFormaPagoPuntoVentaService {
|
||||
|
||||
@Autowired
|
||||
private HistoricoFormaPagoPuntoVentaDAO historicoFormaPagoPuntoVentaDAO;
|
||||
|
||||
public List<HistoricoFormaPagoPuntoVenta> obtenerTodos() {
|
||||
return historicoFormaPagoPuntoVentaDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public HistoricoFormaPagoPuntoVenta obtenerID(Integer id) {
|
||||
return historicoFormaPagoPuntoVentaDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public HistoricoFormaPagoPuntoVenta suscribir(HistoricoFormaPagoPuntoVenta entidad) {
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
entidad.setIndInclusao(Boolean.TRUE);
|
||||
entidad.setFecAlteracao(Calendar.getInstance().getTime());
|
||||
|
||||
return historicoFormaPagoPuntoVentaDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public HistoricoFormaPagoPuntoVenta actualizacion(HistoricoFormaPagoPuntoVenta entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return historicoFormaPagoPuntoVentaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(HistoricoFormaPagoPuntoVenta entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
entidad.setIndInclusao(Boolean.FALSE);
|
||||
entidad.setFecAlteracao(Calendar.getInstance().getTime());
|
||||
|
||||
historicoFormaPagoPuntoVentaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HistoricoFormaPagoPuntoVenta> obtenerTodosPorPuntoVenta(PuntoVenta puntoVenta) {
|
||||
return historicoFormaPagoPuntoVentaDAO.obtenerTodosPorPuntoVenta(puntoVenta);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.PeajeDao;
|
||||
import com.rjconsultores.ventaboletos.entidad.Peaje;
|
||||
import com.rjconsultores.ventaboletos.service.PeajeService;
|
||||
|
||||
@Service("peajeService")
|
||||
public class PeajeServiceImpl implements PeajeService{
|
||||
|
||||
@Autowired
|
||||
private PeajeDao peajeDao;
|
||||
|
||||
|
||||
public Peaje buscarPeajePorId(Integer peajeId) {
|
||||
return peajeDao.obtenerID(peajeId);
|
||||
}
|
||||
}
|
|
@ -86,7 +86,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
// FIXME : Remover esse método de quem está usando. Esse método carrega muitos dados
|
||||
// FIXME : Remover esse m<EFBFBD>todo de quem est<73> usando. Esse m<>todo carrega muitos dados
|
||||
@Deprecated
|
||||
public List<PuntoVenta> obtenerTodos() {
|
||||
return puntoVentaDAO.obtenerTodos();
|
||||
|
@ -114,13 +114,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
Constante constDesativaTotvs = constanteService.buscarPorNomeConstante("WS_TOTVS_DESATIVA_INTEGRACAO");
|
||||
Boolean desativaTotvs = constDesativaTotvs != null && constDesativaTotvs.getValorconstante().equals("1");
|
||||
|
||||
// Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso.
|
||||
// Integração AG
|
||||
// Mantis 15739 - A integra<EFBFBD><EFBFBD>o AG deve ser acionada ap<61>s a persist<73>ncia dos dados com sucesso.
|
||||
// Integra<EFBFBD><EFBFBD>o AG
|
||||
/*
|
||||
* Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG"); if (entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) { log.debug("iniciando integração com AG"); integraAG(entidad); log.debug("fim da integração com AG"); }
|
||||
* Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG"); if (entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) { log.debug("iniciando integra<EFBFBD><EFBFBD>o com AG"); integraAG(entidad); log.debug("fim da integra<EFBFBD><EFBFBD>o com AG"); }
|
||||
*/
|
||||
|
||||
// Integração Totvs
|
||||
// Integra<EFBFBD><EFBFBD>o Totvs
|
||||
if (!desativaTotvs){
|
||||
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.INTEGRACION_TOTVS.getDescricao())) {
|
||||
try {
|
||||
|
@ -176,13 +176,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
logAuditoriaService.auditar(null, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||
|
||||
|
||||
// Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso.
|
||||
// Integração AG
|
||||
// Mantis 15739 - A integra<EFBFBD><EFBFBD>o AG deve ser acionada ap<61>s a persist<73>ncia dos dados com sucesso.
|
||||
// Integra<EFBFBD><EFBFBD>o AG
|
||||
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
||||
if (entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
||||
log.debug("iniciando integração com AG");
|
||||
log.debug("iniciando integra<EFBFBD><EFBFBD>o com AG");
|
||||
integraAG(entidad);
|
||||
log.debug("fim da integração com AG");
|
||||
log.debug("fim da integra<EFBFBD><EFBFBD>o com AG");
|
||||
}
|
||||
|
||||
return entidad;
|
||||
|
@ -214,7 +214,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
connection.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error("error fechar conexão", e);
|
||||
log.error("error fechar conex<EFBFBD>o", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@ -236,9 +236,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
return;
|
||||
}
|
||||
if (!strFornecedor.contains("ERRO")){
|
||||
// retornar msg a informação de registro já cadastrado
|
||||
// retornar msg a informa<EFBFBD><EFBFBD>o de registro j<> cadastrado
|
||||
entidad.setIndIntegradoAG(false);
|
||||
entidad.setMotivoNaoIntegradoAG("Fornecedor já cadastrado");
|
||||
entidad.setMotivoNaoIntegradoAG("Fornecedor j<EFBFBD> cadastrado");
|
||||
} else {
|
||||
fornecedor = new TFornecedor();
|
||||
fornecedor.setNome(entidad.getRazonSocial());
|
||||
|
@ -307,9 +307,9 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
return;
|
||||
}
|
||||
if (!cliStr.contains("ERRO")) {
|
||||
// retornar msg a informação de registro já cadastrado
|
||||
// retornar msg a informa<EFBFBD><EFBFBD>o de registro j<> cadastrado
|
||||
entidad.setIndIntegradoAG(false);
|
||||
entidad.setMotivoNaoIntegradoAG("Cliente já cadastrado");
|
||||
entidad.setMotivoNaoIntegradoAG("Cliente j<EFBFBD> cadastrado");
|
||||
} else {
|
||||
cli = new TCliente();
|
||||
cli.setCodigo("");
|
||||
|
@ -435,7 +435,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
PuntoVenta originalClone = null;
|
||||
try {
|
||||
originalClone = entidad.getCloneObject();
|
||||
if(entidad.getTitularId()!=null) {
|
||||
if(entidad.getTitularId()!=null && originalClone != null) {
|
||||
originalClone.setTitularId(entidad.getTitularId().getCloneObject());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -449,13 +449,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
Constante constDesativaTotvs = constanteService.buscarPorNomeConstante("WS_TOTVS_DESATIVA_INTEGRACAO");
|
||||
Boolean desativaTotvs = constDesativaTotvs != null && constDesativaTotvs.getValorconstante().equals("1");
|
||||
|
||||
// Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso.
|
||||
// Integração AG
|
||||
// Mantis 15739 - A integra<EFBFBD><EFBFBD>o AG deve ser acionada ap<61>s a persist<73>ncia dos dados com sucesso.
|
||||
// Integra<EFBFBD><EFBFBD>o AG
|
||||
/*
|
||||
* Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG"); if ( entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) { log.debug("iniciando integração com AG"); integraAG(entidad); log.debug("fim da integração com AG"); }
|
||||
* Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG"); if ( entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) { log.debug("iniciando integra<EFBFBD><EFBFBD>o com AG"); integraAG(entidad); log.debug("fim da integra<EFBFBD><EFBFBD>o com AG"); }
|
||||
*/
|
||||
|
||||
// Integração Totvs
|
||||
// Integra<EFBFBD><EFBFBD>o Totvs
|
||||
if (!desativaTotvs){
|
||||
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.INTEGRACION_TOTVS.getDescricao())) {
|
||||
|
||||
|
@ -510,13 +510,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
}
|
||||
}
|
||||
|
||||
// Mantis 15739 - A integração AG deve ser acionada após a persistência dos dados com sucesso.
|
||||
// Integração AG
|
||||
// Mantis 15739 - A integra<EFBFBD><EFBFBD>o AG deve ser acionada ap<61>s a persist<73>ncia dos dados com sucesso.
|
||||
// Integra<EFBFBD><EFBFBD>o AG
|
||||
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
||||
if (entidad.getStatusaprobacion().equals("A") && empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
||||
log.debug("iniciando integração com AG");
|
||||
log.debug("iniciando integra<EFBFBD><EFBFBD>o com AG");
|
||||
integraAG(entidad);
|
||||
log.debug("fim da integração com AG");
|
||||
log.debug("fim da integra<EFBFBD><EFBFBD>o com AG");
|
||||
}
|
||||
|
||||
return entidad;
|
||||
|
@ -765,7 +765,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
|
||||
String contrib = ContribuinteICMS.NAO.getValor();
|
||||
String entid = TipoEntidade.TRANSPORTE_PASSAGEIRO.getValor();
|
||||
String pais = "";// segundo orientação da TOTVS, passar em branco
|
||||
String pais = "";// segundo orienta<EFBFBD><EFBFBD>o da TOTVS, passar em branco
|
||||
|
||||
try {
|
||||
resp = TotvsService.cadastrarCliente(endpointCliente, bairro, cep, cgc, codmun, codpais, complemen, contaCliente, contrib, ddd, email, cnpjEmpresaProtheus,
|
||||
|
|
|
@ -675,7 +675,7 @@ public class RutaServiceImpl implements RutaService {
|
|||
|
||||
@Override
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje){
|
||||
return rutaDAO.buscarPorOrgaoEcasetaPeaje(orgao,listCasetaPeaje);
|
||||
return buscarPorOrgaoEcasetaPeaje(orgao,listCasetaPeaje,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -683,4 +683,9 @@ public class RutaServiceImpl implements RutaService {
|
|||
return rutaDAO.buscarRutasPorEmpresaOrgaoConcedenteParadaIds(empresa,orgao,lsParadaIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje, Empresa empresa){
|
||||
return rutaDAO.buscarPorOrgaoEcasetaPeaje(orgao,listCasetaPeaje,empresa);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.rjconsultores.ventaboletos.entidad.Constante;
|
|||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.StatusIntegracaoSap;
|
||||
import com.rjconsultores.ventaboletos.rest.IntegracaoSapRest;
|
||||
import com.rjconsultores.ventaboletos.service.SapService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
|
@ -25,8 +26,6 @@ public class SapServiceImpl implements SapService{
|
|||
|
||||
private static final String INTEGRACAO_SAP_URL = "INTEGRACAO_SAP_URL";
|
||||
private static final String INTEGRACAO_SAP_CREDENCIAL = "INTEGRACAO_SAP_CREDENCIAL";
|
||||
private static final int INTEGRACAO_SAP_OK = 1;
|
||||
private static final int INTEGRACAO_SAP_ERRO = 2;
|
||||
private static Logger log = Logger.getLogger(SapServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
|
@ -65,17 +64,17 @@ public class SapServiceImpl implements SapService{
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar) {
|
||||
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, null);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status) {
|
||||
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, status, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, Boolean reenviar, PuntoVenta puntoVenta) {
|
||||
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, reenviar, puntoVenta);
|
||||
public List<FechamentoCntCorrenteVO> obtenerTodosParaRemessa(Empresa empresa, Date dataDe, Date dataAte, String status, PuntoVenta puntoVenta) {
|
||||
return sapDAO.obtenerTodosParaRemessa(empresa, dataDe, dataAte, status, puntoVenta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remessa(List<FechamentoCntCorrenteVO> fechamentos) throws Exception {
|
||||
public int remessa(List<FechamentoCntCorrenteVO> fechamentos, boolean processoManual) throws Exception {
|
||||
try {
|
||||
int contador = 0;
|
||||
IntegracaoSapRest integracaoSapRest = IntegracaoSapRest.getInstance();
|
||||
|
@ -87,19 +86,23 @@ public class SapServiceImpl implements SapService{
|
|||
JSONObject integrado = integracaoSapRest.enviarIntegracaoSap(fechamentoCntcorrente, url, credenciais);
|
||||
|
||||
if(integrado == null) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_ERRO);
|
||||
log.error("Erro no envio/retorno da requisicao para integra<72><61>o SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||
throw new RuntimeException("Erro no envio/retorno da requisicao para integração SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.NAO_ENVIADO.ordinal());
|
||||
log.error("Erro no envio/retorno da requisicao para integracao SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||
if(processoManual) {
|
||||
throw new RuntimeException("Erro no envio/retorno da requisicao para integracao SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||
}
|
||||
}else if(integrado.getString("Integration").equals("S")) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_OK);
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.INTEGRADO.ordinal());
|
||||
contador++;
|
||||
}else if(integrado.getString("Integration").equals("E")) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_ERRO);
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), StatusIntegracaoSap.RECUSADO.ordinal());
|
||||
log.warn("Retorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
||||
if(processoManual) {
|
||||
throw new RuntimeException("Fechamento: "+fechamentoCntcorrente.getFechamentocntcorrenteId()+"\r\nRetorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return contador;
|
||||
}catch(RuntimeException re){
|
||||
|
@ -125,18 +128,18 @@ public class SapServiceImpl implements SapService{
|
|||
|
||||
@Override
|
||||
public void integracaoSapAutomatica() throws Exception {
|
||||
List<FechamentoCntCorrenteVO> listaPendente = obtenerTodosParaRemessa(null, DateUtil.getYesterdayDate(), new Date(), false);
|
||||
List<FechamentoCntCorrenteVO> listaPendente = obtenerTodosParaRemessa(null, DateUtil.getYesterdayDate(), new Date(), "2");
|
||||
|
||||
while(!listaPendente.isEmpty()) {
|
||||
log.info("IntegracaoSap: Registro a enviar:"+listaPendente.size());
|
||||
|
||||
try {
|
||||
remessa(listaPendente);
|
||||
remessa(listaPendente, false);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
listaPendente = obtenerTodosParaRemessa(null, DateUtil.getYesterdayDate(), new Date(), false);
|
||||
listaPendente = obtenerTodosParaRemessa(null, DateUtil.getYesterdayDate(), new Date(), "2");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -14,12 +19,14 @@ import com.rjconsultores.ventaboletos.dao.OrgaoConcedenteDAO;
|
|||
import com.rjconsultores.ventaboletos.dao.SeguroKmDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.SeguroTarifaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Peaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||
|
@ -27,8 +34,10 @@ import com.rjconsultores.ventaboletos.entidad.Via;
|
|||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.PeajeService;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialComComposicaoDoPedagioVo;
|
||||
import com.rjconsultores.ventaboletos.vo.comissao.TarifaOficialVO;
|
||||
|
||||
@Service("tarifaOficialService")
|
||||
|
@ -48,10 +57,14 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private PeajeService peajeService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas) {
|
||||
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente, idsEmpresas);
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas,Integer[] lsCasetaPeaje) {
|
||||
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente, idsEmpresas,lsCasetaPeaje );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,7 +82,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedente, List<Empresa> lsEmpresaSelected) throws BusinessException {
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedente, List<Empresa> lsEmpresaSelected, Integer[] lsCasetaPeaje) throws BusinessException {
|
||||
|
||||
// Limpando a tabela de TARIFA_OFICIAL
|
||||
tarifaOficialDAO.limparTarifasOficiais(lsEmpresaSelected);
|
||||
|
@ -96,7 +109,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
// Gerando as tarifas pelo coeficiente
|
||||
if (orgaoConcedente == null ||
|
||||
(orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() != OrgaoConcedente.CODIGO_ARTESP)) {
|
||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas);
|
||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas,lsCasetaPeaje);
|
||||
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
||||
}
|
||||
|
||||
|
@ -341,4 +354,114 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
return lsTarifa;
|
||||
}
|
||||
|
||||
|
||||
public void atualizarPedagioPorListaDePracaDePagio(List<CasetaPeaje> lsCasetaPeaje,Integer empresaId) {
|
||||
try {
|
||||
List<TarifaOficialComComposicaoDoPedagioVo> lsTarifaOficialComComposicaoDoPedagioVo = tarifaOficialDAO.oberTarifaOficialComComposicaoDoPedagioVo(empresaId);
|
||||
|
||||
if (!lsTarifaOficialComComposicaoDoPedagioVo.isEmpty()) {
|
||||
|
||||
|
||||
for (TarifaOficialComComposicaoDoPedagioVo tarifaOficialComComposicaoDoPedagioVo : lsTarifaOficialComComposicaoDoPedagioVo) {
|
||||
log.info("tarifaOficiald:" + tarifaOficialComComposicaoDoPedagioVo.getTarifaOficialId() + " | composicao do pedágio no cálculo:" + tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifaOficialComPeaje() + " | composicao do pedágio na tarifa:" + tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifa());
|
||||
|
||||
if (tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifa() == null) {
|
||||
HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifaOficialComPeaje = new HashMap();
|
||||
String[] parDeChavePeajeMaisCasetaPeaje1 = tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifaOficialComPeaje().replace(" ", "").split(",");
|
||||
montaMapComposicao(mapComposicaoDoPedagioNaTarifaOficialComPeaje, parDeChavePeajeMaisCasetaPeaje1);
|
||||
BigDecimal valorPedagio = montarObterValorImportePedagio(mapComposicaoDoPedagioNaTarifaOficialComPeaje);
|
||||
String stringComposicaoDoPedagio = tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifaOficialComPeaje();
|
||||
|
||||
atualizarPedagioComFiltroDePracaDePedagio(tarifaOficialComComposicaoDoPedagioVo, valorPedagio, stringComposicaoDoPedagio);
|
||||
|
||||
} else {
|
||||
HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifa = new HashMap();
|
||||
String[] parDeChavePeajeMaisCasetaPeaje = tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifa().replace(" ", "").split(",");
|
||||
montaMapComposicao(mapComposicaoDoPedagioNaTarifa, parDeChavePeajeMaisCasetaPeaje);
|
||||
|
||||
HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifaOficialComPeaje = new HashMap();
|
||||
String[] parDeChavePeajeMaisCasetaPeaje1 = tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifaOficialComPeaje().replace(" ", "").split(",");
|
||||
montaMapComposicao(mapComposicaoDoPedagioNaTarifaOficialComPeaje, parDeChavePeajeMaisCasetaPeaje1);
|
||||
|
||||
atualizarComposicaoDoPedagioNaTarifa(lsCasetaPeaje, mapComposicaoDoPedagioNaTarifa, mapComposicaoDoPedagioNaTarifaOficialComPeaje);
|
||||
|
||||
BigDecimal valorPedagio = montarObterValorImportePedagio(mapComposicaoDoPedagioNaTarifa);
|
||||
|
||||
String stringComposicaoDoPedagio = "";
|
||||
stringComposicaoDoPedagio = remontarAStringDeComposicaoDoPedagio(mapComposicaoDoPedagioNaTarifa, stringComposicaoDoPedagio);
|
||||
|
||||
atualizarPedagioComFiltroDePracaDePedagio(tarifaOficialComComposicaoDoPedagioVo, valorPedagio, stringComposicaoDoPedagio);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
log.info("Não retornou nenhum registro da consulta oberTarifaOficialComComposicaoDoPedagioVo ");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void atualizarPedagioComFiltroDePracaDePedagio(TarifaOficialComComposicaoDoPedagioVo tarifaOficialComComposicaoDoPedagioVo, BigDecimal valorPedagio, String stringComposicaoDoPedagio) {
|
||||
log.info("tarifaOficiald:"+tarifaOficialComComposicaoDoPedagioVo.getTarifaOficialId()+" | composicao do pedágio na tarifa oficial:" + tarifaOficialComComposicaoDoPedagioVo.getComposicaoDoPedagioNaTarifaOficialComPeaje() +" | importePedagio:"+valorPedagio);
|
||||
|
||||
tarifaOficialDAO.atualizarPedagioComFiltroDePracaDePedagio(tarifaOficialComComposicaoDoPedagioVo.getTarifaOficialId(), valorPedagio, stringComposicaoDoPedagio);
|
||||
}
|
||||
|
||||
private String remontarAStringDeComposicaoDoPedagio(HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifa, String stringComposicaoDoPedagio) {
|
||||
Boolean inicio =true;
|
||||
|
||||
for(Entry<Integer, Integer> map : mapComposicaoDoPedagioNaTarifa.entrySet()) {
|
||||
if(!inicio) {
|
||||
stringComposicaoDoPedagio += ",";
|
||||
}
|
||||
stringComposicaoDoPedagio += map.getKey()+";"+map.getValue();
|
||||
inicio=false;
|
||||
}
|
||||
return stringComposicaoDoPedagio;
|
||||
}
|
||||
|
||||
private BigDecimal montarObterValorImportePedagio(HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifa) {
|
||||
BigDecimal valorPedagio = new BigDecimal("0.0");
|
||||
for(Entry<Integer, Integer> map : mapComposicaoDoPedagioNaTarifa.entrySet()) {
|
||||
Peaje peaje = peajeService.buscarPeajePorId(map.getValue());
|
||||
valorPedagio=valorPedagio.add(peaje.getImportePeaje().setScale(2,RoundingMode.HALF_UP));
|
||||
|
||||
}
|
||||
return valorPedagio.setScale(2,RoundingMode.HALF_UP);
|
||||
|
||||
}
|
||||
|
||||
private void atualizarComposicaoDoPedagioNaTarifa(List<CasetaPeaje> lsCasetaPeaje, HashMap<Integer, Integer> mapComposicaoDoPedagioNaTarifa, Map<Integer, Integer> mapComposicaoDoPedagioNaTarifaOficialComPeaje) {
|
||||
for(CasetaPeaje casetaPeaje : lsCasetaPeaje) {
|
||||
if(mapComposicaoDoPedagioNaTarifa.containsKey(casetaPeaje.getCasetaPeajeId())) {
|
||||
mapComposicaoDoPedagioNaTarifa.remove(casetaPeaje.getCasetaPeajeId());
|
||||
}
|
||||
|
||||
if(mapComposicaoDoPedagioNaTarifaOficialComPeaje.containsKey(casetaPeaje.getCasetaPeajeId())) {
|
||||
mapComposicaoDoPedagioNaTarifa.put(casetaPeaje.getCasetaPeajeId(),mapComposicaoDoPedagioNaTarifaOficialComPeaje.get(casetaPeaje.getCasetaPeajeId()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void montaMapComposicao(Map<Integer, Integer> mapComposicaoDoPedagioNaTarifa, String[] parDeChavePeajeMaisCasetaPeaje) {
|
||||
for(String chavePeajeMaisCasetaPeaje:parDeChavePeajeMaisCasetaPeaje) {
|
||||
String[] composicao = chavePeajeMaisCasetaPeaje.split(";");
|
||||
Integer casetaPeaje = Integer.parseInt(composicao[0].trim());
|
||||
Integer peaje = Integer.parseInt(composicao[1].trim());
|
||||
mapComposicaoDoPedagioNaTarifa.put(casetaPeaje,peaje);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
BigDecimal valorPedagio = new BigDecimal("0.0");
|
||||
|
||||
valorPedagio=valorPedagio.add(new BigDecimal("100.005"));
|
||||
System.out.println(valorPedagio.setScale(2,RoundingMode.HALF_UP));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -846,11 +846,7 @@ public class BoletoComissao {
|
|||
return false;
|
||||
}
|
||||
|
||||
if(isVendaBilheteTransferencia(getTipoVenta())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isStatusVendido() || isStatusTroca() || isStatusEntregue();
|
||||
return isStatusVendido() || isStatusTroca() || isStatusEntregue() || isVendaBilheteTransferencia(getTipoVenta());
|
||||
}
|
||||
public boolean isQuitacaoOCD() {
|
||||
if(getMotivoCancelacionId() != null){
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
public class TarifaOficialComComposicaoDoPedagioVo {
|
||||
private Integer tarifaOficialId;
|
||||
private String composicaoDoPedagioNaTarifa;
|
||||
private String composicaoDoPedagioNaTarifaOficialComPeaje;
|
||||
|
||||
public Integer getTarifaOficialId() {
|
||||
return tarifaOficialId;
|
||||
}
|
||||
public void setTarifaOficialId(Integer tarifaOficialId) {
|
||||
this.tarifaOficialId = tarifaOficialId;
|
||||
}
|
||||
public String getComposicaoDoPedagioNaTarifa() {
|
||||
return composicaoDoPedagioNaTarifa;
|
||||
}
|
||||
public void setComposicaoDoPedagioNaTarifa(String composicaoDoPedagioNaTarifa) {
|
||||
this.composicaoDoPedagioNaTarifa = composicaoDoPedagioNaTarifa;
|
||||
}
|
||||
public String getComposicaoDoPedagioNaTarifaOficialComPeaje() {
|
||||
return composicaoDoPedagioNaTarifaOficialComPeaje;
|
||||
}
|
||||
public void setComposicaoDoPedagioNaTarifaOficialComPeaje(String composicaoDoPedagioNaTarifaOficialComPeaje) {
|
||||
this.composicaoDoPedagioNaTarifaOficialComPeaje = composicaoDoPedagioNaTarifaOficialComPeaje;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -2,6 +2,8 @@ package com.rjconsultores.ventaboletos.vo.integracao;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.StatusIntegracaoSap;
|
||||
|
||||
public class FechamentoCntCorrenteVO {
|
||||
|
||||
public FechamentoCntCorrenteVO() {
|
||||
|
@ -21,10 +23,10 @@ public class FechamentoCntCorrenteVO {
|
|||
private Integer empresaId;
|
||||
private String nombEmpresa;
|
||||
private String ufEmpresa;
|
||||
private Boolean integradoSap;
|
||||
private StatusIntegracaoSap integradoSap;
|
||||
private boolean enviar;
|
||||
|
||||
public FechamentoCntCorrenteVO(Long fechamentocntcorrenteId, String fecfechamento, String feclancamento, String anofechamento, String mesfechamento, BigDecimal total, String nombpuntoventa, String cnpjPuntoVenta, Integer empresaId, String nombEmpresa, String ufEmpresa, Boolean integradoSap) {
|
||||
public FechamentoCntCorrenteVO(Long fechamentocntcorrenteId, String fecfechamento, String feclancamento, String anofechamento, String mesfechamento, BigDecimal total, String nombpuntoventa, String cnpjPuntoVenta, Integer empresaId, String nombEmpresa, String ufEmpresa, StatusIntegracaoSap integradoSap) {
|
||||
super();
|
||||
this.fechamentocntcorrenteId = fechamentocntcorrenteId;
|
||||
this.fecfechamento = fecfechamento;
|
||||
|
@ -104,11 +106,11 @@ public class FechamentoCntCorrenteVO {
|
|||
this.ufEmpresa = ufEmpresa;
|
||||
}
|
||||
|
||||
public boolean isIntegradoSap() {
|
||||
return Boolean.TRUE.equals(integradoSap);
|
||||
public StatusIntegracaoSap getIntegradoSap() {
|
||||
return integradoSap;
|
||||
}
|
||||
|
||||
public void setIntegradoSap(boolean integradoSap) {
|
||||
public void setIntegradoSap(StatusIntegracaoSap integradoSap) {
|
||||
this.integradoSap = integradoSap;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue