sincronismo de fonte
parent
3666279c81
commit
12027cf461
|
@ -6,9 +6,9 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
|||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
|
||||
public interface CalcularPeajeDAO {
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta);
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta,Integer[] listCasetaPeaje);
|
||||
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) throws Exception;
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS,Integer[] listCasetaPeaje) throws Exception;
|
||||
|
||||
public List<Ruta> buscarRutaWithCasetaPeajeFromOrgao(OrgaoConcedente oc);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
||||
|
||||
public interface ConfRestricaoCanalVentaDAO{
|
||||
|
@ -13,4 +15,6 @@ public interface ConfRestricaoCanalVentaDAO{
|
|||
public void borrar(ConfRestricaoCanalVenta entidad);
|
||||
|
||||
public Long count(String campo, Object o);
|
||||
|
||||
public Boolean inativarListConfRestricaoCanalVenta(List<Integer> idsConfRestricaoCanalVenta, Integer usuarioId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce;
|
||||
|
||||
public interface EmpresaEmailEComerceDAO extends GenericDAO<EmpresaEmailEComerce, Integer> {
|
||||
|
||||
public List<EmpresaEmailEComerce> obtenerTodos();
|
||||
|
||||
public EmpresaEmailEComerce buscarPorEmpresa(Empresa empresa, String tipoOperacao);
|
||||
|
||||
}
|
|
@ -63,4 +63,6 @@ public interface ParadaDAO {
|
|||
|
||||
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId,Integer[] listRuta);
|
||||
|
||||
}
|
||||
|
|
|
@ -66,10 +66,15 @@ public interface RutaDAO extends GenericDAO<Ruta, Integer> {
|
|||
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
||||
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedenteParadaIds(Empresa empresa, OrgaoConcedente orgao, Integer[] lsParadaIds) ;
|
||||
|
||||
public void updateAsientosVendibles(Ruta ruta, Tramo viejoTramo, Tramo nuevoTramo);
|
||||
|
||||
public List<Ruta> buscarRutasVendaEmbarcada(List<Integer> empresasIds, Integer rutaId, String numeroLinha, String descRuta, ClaseServicio classe);
|
||||
|
||||
public List<Ruta> buscaLikeComboBox(String stringConsulta);
|
||||
|
||||
public List<Ruta> buscarPorIds(Integer[] rutaIds);
|
||||
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
|||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinimaCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -25,7 +26,7 @@ public interface TarifaMinimaDAO extends GenericDAO<TarifaMinima, Integer> {
|
|||
ClaseServicio claseServicio, Plaza plaza);
|
||||
|
||||
public List<TarifaMinima> pesquisar(Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio, Moneda moneda);
|
||||
ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<TarifaMinima> pesquisar( TarifaMinima tarifaMinima);
|
||||
|
||||
|
@ -37,7 +38,7 @@ public interface TarifaMinimaDAO extends GenericDAO<TarifaMinima, Integer> {
|
|||
Plaza plaza, Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio);
|
||||
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda);
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<TarifaMinima> buscarPorMarcaMoneda(Marca marca, Moneda moneda);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
|||
|
||||
public Integer gerarTarifaArtesp(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public Integer gerarTabelaZerada(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public Integer gerarTabelaZerada(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer>lsParadaId);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarTarifaPorCoeficiente(Integer, Integer)}
|
||||
|
@ -57,7 +57,7 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
|||
* @param orgaoConcedenteId TODO
|
||||
* @param empresaId TODO
|
||||
*/
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer> lsParadaIds);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarSeguroPorKm(Integer, Integer, Integer)}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
|
@ -85,7 +86,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta) {
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta, Integer[] listCasetaPeaje) {
|
||||
StringBuilder sql = new StringBuilder()
|
||||
.append("with tramo_tmp as ( ")
|
||||
.append(" select t.origen_id as orig, t.destino_id as dest, t.tramo_id as tra, ")
|
||||
|
@ -132,8 +133,12 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
.append(" inner join ruta_secuencia rseq2 on rseq2.tramo_id = rseq1.tramo_id ")
|
||||
.append(" inner join tramo tra on tra.tramo_id = rseq1.tramo_id and rseq1.ruta_id = :rutaId ")
|
||||
.append(" inner join caseta_peaje casp on casp.casetapeaje_id = rcas.casetapeaje_id ")
|
||||
.append(" where rcas.activo =1 and rseq1.activo =1 and rseq2.activo =1 and tra.activo =1 and casp.activo =1 ")
|
||||
.append(") ")
|
||||
.append(" where rcas.activo =1 and rseq1.activo =1 and rseq2.activo =1 and tra.activo =1 and casp.activo =1 ");
|
||||
if(null!=listCasetaPeaje) {
|
||||
sql.append( "and casp.casetapeaje_id in (" + StringUtils.join(listCasetaPeaje,",") + ") ");
|
||||
|
||||
}
|
||||
sql.append(") ")
|
||||
.append("select distinct origen_tramo_inicial_seq, destino_tramo_final_seq, tramo_orig, tramo_dest, tracomb, ttorig, ttdest, ")
|
||||
.append(" tracombdesc, tracomborig, tracombdest, tracombvia, tracombcantkm, tracombcantkmpago, tracombactivo, ")
|
||||
.append(" tracombfecmodif, tracombusuario, rutacasetaid, rutasecuenciaid, casetapeaje_id, tramoid, casetapeajeid, ")
|
||||
|
@ -148,11 +153,12 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
query.setInteger("rutaId", ruta.getRutaId());
|
||||
query.setInteger("rutaId", ruta.getRutaId());
|
||||
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
// pra cada ruta obter as combinacoes de tramos, cada tramo com sua lista de casetaPeaje
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) throws Exception {
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS,Integer[] listCasetaPeaje) throws Exception {
|
||||
boolean isOrgaoNull = orgao == null;
|
||||
List<String> updates = new ArrayList<String>();
|
||||
Set<PeajeVO> peajes = new HashSet<CalcularPeajeHibernateDAO.PeajeVO>();
|
||||
|
@ -171,13 +177,16 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
log.info("****** Linha "+(++z)+" de "+lsRuta.size()+" ******");
|
||||
log.info("****** LINHA : "+ruta.toString()+" ******");
|
||||
|
||||
List<Object> lsObj = buscarCasetasPeajeWithinTramo(ruta);
|
||||
List<Object> lsObj = buscarCasetasPeajeWithinTramo(ruta,listCasetaPeaje);
|
||||
log.info("****** QTD COMBINAÇÕES DE TRECHOS x QTD PEDAGIOS POR TRECHO: "+lsObj.size()+" ******");
|
||||
|
||||
if(isOrgaoNull){
|
||||
orgao = orgaoConcedenteService.obtenerID(ruta.getOrgaoConcedente().getOrgaoConcedenteId());
|
||||
classeIndicePeajes = orgao.getClassesIndicePeaje();
|
||||
String update = " update peaje set activo = 0 where ruta_id ="+ruta.getRutaId();
|
||||
if(null!=listCasetaPeaje) {
|
||||
update = update + " and casetapeaje_id in (" + StringUtils.join(listCasetaPeaje,",") + ") ";
|
||||
}
|
||||
updates.add(update);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
@ -15,4 +19,24 @@ public class ConfRestricaoCanalVentaHibernateDAO extends GenericHibernateDAO<Con
|
|||
public ConfRestricaoCanalVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean inativarListConfRestricaoCanalVenta(List<Integer> idsConfRestricaoCanalVenta, Integer usuarioId) {
|
||||
if(idsConfRestricaoCanalVenta.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" UPDATE ConfRestricaoCanalVenta SET activo=0, ");
|
||||
sb.append(" usuarioId=:usuarioId, ");
|
||||
sb.append(" fecmodif=:data" );
|
||||
sb.append(" where confRestricaoCanalVentaId in (");
|
||||
sb.append(idsConfRestricaoCanalVenta.toString().substring(1, idsConfRestricaoCanalVenta.toString().length() - 1)).append(" ) ");
|
||||
Query queryConfRestricaoCanalVenta = getSession().createQuery(sb.toString());
|
||||
queryConfRestricaoCanalVenta.setInteger("usuarioId", usuarioId);
|
||||
queryConfRestricaoCanalVenta.setDate("data", new Date());
|
||||
|
||||
return queryConfRestricaoCanalVenta.executeUpdate()>1?true:false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
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.EmpresaEmailEComerceDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce;
|
||||
|
||||
@Repository("empresaEmailEComerceDAO")
|
||||
public class EmpresaEmailEComerceHibernateDAO extends GenericHibernateDAO<EmpresaEmailEComerce, Integer>
|
||||
implements EmpresaEmailEComerceDAO {
|
||||
|
||||
@Autowired
|
||||
public EmpresaEmailEComerceHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmpresaEmailEComerce> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaEmailEComerce buscarPorEmpresa(Empresa empresa, String tipoOperacao) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("empresa", empresa));
|
||||
c.add(Restrictions.eq("tipoOperacao", tipoOperacao));
|
||||
|
||||
return (EmpresaEmailEComerce) c.uniqueResult();
|
||||
}
|
||||
}
|
|
@ -129,6 +129,41 @@ public class ParadaHibernateDAO extends GenericHibernateDAO<Parada, Integer> imp
|
|||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId,Integer[] listRuta) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
Criteria criteriaTramo =c.createCriteria("tramoOrigemList");
|
||||
criteriaTramo.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
Criteria criteriaRutaCombinacionList =criteriaTramo.createCriteria("rutaCombinacionList");
|
||||
criteriaRutaCombinacionList.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
Criteria criteriaRuta = criteriaRutaCombinacionList.createCriteria("ruta");
|
||||
criteriaRuta.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
if(null!=orgaoConcendenteId) {
|
||||
Criteria criteriaOrgaoConcendente = criteriaRuta.createCriteria("orgaoConcedente");
|
||||
criteriaOrgaoConcendente.add(Restrictions.eq("orgaoConcendenteID", orgaoConcendenteId));
|
||||
criteriaOrgaoConcendente.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
}
|
||||
if(null!=empresaId) {
|
||||
Criteria criteriaRutaEmpresa = criteriaRuta.createCriteria("lsRutaEmpresa");
|
||||
criteriaRutaEmpresa.add(Restrictions.eq("empresaId", empresaId));
|
||||
criteriaRutaEmpresa.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
}
|
||||
|
||||
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
if(null!=listRuta) {
|
||||
criteriaRuta.add(Restrictions.in("rutaId", listRuta));
|
||||
}
|
||||
|
||||
c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<Parada> obterPossiveisDestinos(Parada origem) {
|
||||
if (origem == null) {
|
||||
|
|
|
@ -288,6 +288,33 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
|||
return c.list();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedenteParadaIds(Empresa empresa, OrgaoConcedente orgao, Integer[] lsParadaIds) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.ne("rutaId", -1));
|
||||
|
||||
if (empresa != null && empresa.getEmpresaId() != -1) {
|
||||
c.createCriteria("lsRutaEmpresa").add(Restrictions.eq("empresa", empresa));
|
||||
}
|
||||
|
||||
if (orgao != null && orgao.getOrgaoConcedenteId() != -1) {
|
||||
c.add(Restrictions.eq("orgaoConcedente", orgao));
|
||||
}
|
||||
Criteria rutaCombinacionList = c.createCriteria("rutaCombinacionList");
|
||||
rutaCombinacionList.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
Criteria tramo = rutaCombinacionList.createCriteria("tramo");
|
||||
tramo.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
Criteria parada = tramo.createCriteria("origem");
|
||||
parada.add(Restrictions.in("paradaId", lsParadaIds));
|
||||
|
||||
c.addOrder(Order.asc("descruta"));
|
||||
c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAsientosVendibles(Ruta ruta, Tramo viejoTramo, Tramo nuevoTramo) {
|
||||
|
||||
|
@ -434,4 +461,34 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
|||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorIds(Integer[] rutaIds) {
|
||||
Criteria c = this.makeCriteria();
|
||||
c.add(Restrictions.in("rutaId", rutaIds));
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje){
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("indRutaCancelada", Boolean.FALSE));
|
||||
Criteria criteriaRutaSecuencia = c.createCriteria("rutaSecuenciaList","secuencia");
|
||||
criteriaRutaSecuencia.add(Restrictions.eq("secuencia.activo", Boolean.TRUE));
|
||||
Criteria criteriaRutaCaseta = criteriaRutaSecuencia.createCriteria("lsRutaCase");
|
||||
criteriaRutaCaseta.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
Criteria criteriaCasetaPeaje=criteriaRutaCaseta.createCriteria("casetaPeaje");
|
||||
criteriaCasetaPeaje.add(Restrictions.in("casetaPeajeId", listCasetaPeaje));
|
||||
if(orgao!=null) {
|
||||
Criteria crietriaOrgaoConcendente = c.createCriteria("orgaoConcedente");
|
||||
crietriaOrgaoConcendente.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
crietriaOrgaoConcendente.add(Restrictions.eq("orgaoConcedenteId", orgao.getOrgaoConcedenteId()));
|
||||
}
|
||||
c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||
return c.list();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
|||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinimaCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -50,7 +51,7 @@ public class TarifaMinimaHibernateDAO extends GenericHibernateDAO<TarifaMinima,
|
|||
}
|
||||
|
||||
public List<TarifaMinima> pesquisar(Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio, Moneda moneda) {
|
||||
ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
|
@ -70,8 +71,8 @@ public class TarifaMinimaHibernateDAO extends GenericHibernateDAO<TarifaMinima,
|
|||
c.add(Restrictions.eq("claseServicio", claseServicio));
|
||||
}
|
||||
|
||||
if (moneda != null) {
|
||||
c.add(Restrictions.eq("moneda", moneda));
|
||||
if (vigenciaTarifa != null) {
|
||||
c.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa));
|
||||
}
|
||||
|
||||
return c.list();
|
||||
|
@ -159,7 +160,7 @@ public class TarifaMinimaHibernateDAO extends GenericHibernateDAO<TarifaMinima,
|
|||
return c.list();
|
||||
}
|
||||
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem, Parada destino, ClaseServicio claseServicio, Moneda moneda) {
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem, Parada destino, ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa) {
|
||||
|
||||
Criteria criterioBusca = getSession().createCriteria(getPersistentClass());
|
||||
|
||||
|
@ -179,6 +180,8 @@ public class TarifaMinimaHibernateDAO extends GenericHibernateDAO<TarifaMinima,
|
|||
|
||||
criterioBusca.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
criterioBusca.add(Restrictions.eq("moneda", moneda));
|
||||
criterioBusca.add(Restrictions.eq("vigenciaTarifa", vigenciaTarifa));
|
||||
|
||||
|
||||
criterioBusca.add(Restrictions.or(Restrictions.eq("marca", marca), Restrictions.eq("marca.marcaId", (short) -1)));
|
||||
criterioBusca.add(Restrictions.or(Restrictions.eq("claseServicio", claseServicio), Restrictions.eq("claseServicio.claseservicioId", -1)));
|
||||
|
|
|
@ -67,9 +67,9 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer gerarTabelaZerada(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public Integer gerarTabelaZerada(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer>lsParadaId) {
|
||||
|
||||
String sql = sqlBuilder.getSQLGerarTabelaZerada(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas);
|
||||
String sql = sqlBuilder.getSQLGerarTabelaZerada(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas,lsParadaId);
|
||||
|
||||
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||
|
||||
|
@ -210,7 +210,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
@Override
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer> lsParadaIds) {
|
||||
|
||||
int x = 0;
|
||||
|
||||
|
@ -226,15 +226,15 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
// Atualizo a taxa de embarque de acordo a parada e km
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getAtualizarTaxaEmbarquePorKmParada(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas));
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getAtualizarTaxaEmbarquePorKmParada(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas,lsParadaIds));
|
||||
query.executeUpdate();
|
||||
|
||||
// Atualizo a taxa de embarque de acordo a km do orgao
|
||||
query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTaxaEmbarquePorKmOrgao(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas));
|
||||
query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTaxaEmbarquePorKmOrgao(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas,lsParadaIds));
|
||||
query.executeUpdate();
|
||||
|
||||
// Atualizo a taxa de embarque de acordo a parada e valor fixo
|
||||
query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTaxaEmbarquePorParadaFixo(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas));
|
||||
query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTaxaEmbarquePorParadaFixo(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas,lsParadaIds));
|
||||
query.executeUpdate();
|
||||
x--;
|
||||
} while (x > 0);
|
||||
|
@ -379,7 +379,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
sql.append(" peaje_tarifas as ( ");
|
||||
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(" 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(" 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(" ");
|
||||
|
|
|
@ -23,18 +23,18 @@ public interface SQLBuilder {
|
|||
|
||||
public String getSQLGerarTarifaOficial(Integer codRuta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
|
||||
public String getSQLGerarTabelaZerada(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public String getSQLGerarTabelaZerada(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas, List<Integer> lsParadaId);
|
||||
|
||||
public String getSQLAtualizarTarifaOficial(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente);
|
||||
|
||||
public String getSQLGerarTarifaOficialArtesp(Integer codRuta, Integer usuarioId,
|
||||
Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public String getAtualizarTaxaEmbarquePorKmParada(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public String getAtualizarTaxaEmbarquePorKmParada(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer>lsParadaIds);
|
||||
|
||||
public String getSQLAtualizarTaxaEmbarquePorKmOrgao(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public String getSQLAtualizarTaxaEmbarquePorKmOrgao(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas, List<Integer> lsParadaIds);
|
||||
|
||||
public String getSQLAtualizarTaxaEmbarquePorParadaFixo(Integer rutaId, Integer usuarioId,Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public String getSQLAtualizarTaxaEmbarquePorParadaFixo(Integer rutaId, Integer usuarioId,Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer> lsParadaIds);
|
||||
|
||||
public String getSQLAtualizarSeguroPorKm(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, TipoSeguro tipoSeguro);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
private static final Integer DER_PR = 2;
|
||||
|
||||
@Override
|
||||
public String getSQLGerarTabelaZerada(final Integer codRuta, final Integer usuarioId,final Integer orgaoConcedenteId, final List<Integer> idsEmpresas){
|
||||
public String getSQLGerarTabelaZerada(final Integer codRuta, final Integer usuarioId, final Integer orgaoConcedenteId, final List<Integer> idsEmpresas, List<Integer> lsParadaId) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("INSERT ");
|
||||
|
@ -102,7 +102,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and mc.activo = 1 ");
|
||||
sb.append(" and re.activo = 1 ");
|
||||
if (idsEmpresas != null) {
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
sb.append(" and m.moneda_id = 1 ");
|
||||
if (orgaoConcedenteId != null) {
|
||||
|
@ -117,14 +117,16 @@ 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 != lsParadaId) {
|
||||
sb.append(" and t.origen_id in (").append(lsParadaId.toString().substring(1, lsParadaId.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLGerarTarifaOficialArtesp(final Integer codRuta, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId, final List<Integer> idsEmpresas)
|
||||
{
|
||||
final Integer orgaoConcedenteId, final List<Integer> idsEmpresas) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" INSERT ");
|
||||
sb.append(" INTO ");
|
||||
|
@ -201,7 +203,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" inner join ruta_empresa re on r.ruta_id = re.ruta_id ");
|
||||
sb.append(" inner join marca ma on ma.empresa_id = re.empresa_id ");
|
||||
sb.append(" inner join orgao_concedente oc on oc.orgaoconcedente_id =r.orgaoconcedente_id ");
|
||||
sb.append(" inner join tramo t on t.tramo_id = rc.tramo_id and t.activo =1");//adicionei isso t.activo =1");
|
||||
sb.append(" inner join tramo t on t.tramo_id = rc.tramo_id and t.activo =1");// adicionei isso t.activo =1");
|
||||
sb.append(" inner join parada po on po.parada_id = t.origen_id ");
|
||||
sb.append(" inner join parada pd on pd.parada_id = t.destino_id ");
|
||||
sb.append(" inner join ciudad c on c.ciudad_id = po.ciudad_id ");
|
||||
|
@ -222,7 +224,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and re.activo = 1 ");
|
||||
sb.append(" and r.orgaoconcedente_id = 21 ");
|
||||
if (idsEmpresas != null) {
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
sb.append(" and m.moneda_id = 1 ");
|
||||
if (orgaoConcedenteId != null) {
|
||||
|
@ -275,12 +277,12 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" select ");
|
||||
sb.append(" ");
|
||||
sb.append(" TARIFA_OFICIAL_SEQ.NEXTVAL, ");
|
||||
//>> SE ORGAO FOR DER-PR E SE O COEFICIENTE DA CLASSE NAO ESTA NULL
|
||||
sb.append(" CASE R.ORGAOCONCEDENTE_ID WHEN "+DER_PR+" THEN CASE WHEN cl.COEFICIENTETARIFA IS NOT NULL THEN " );
|
||||
sb.append(" trunc(((coalesce(ct1.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente1,0) + 350,0.27)*16160 )) ) * COALESCE(tc.kmcoeficiente1,0)) * cl.COEFICIENTETARIFA " );
|
||||
sb.append(" + ((coalesce(ct2.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente2,0) + 350,0.27)*13470 )) ) * COALESCE(tc.kmcoeficiente2,0)) * cl.COEFICIENTETARIFA,2) " );
|
||||
sb.append(" ELSE " );
|
||||
//< COEFICIENTE DA CLASSE ESTA NULL
|
||||
// >> SE ORGAO FOR DER-PR E SE O COEFICIENTE DA CLASSE NAO ESTA NULL
|
||||
sb.append(" CASE R.ORGAOCONCEDENTE_ID WHEN " + DER_PR + " THEN CASE WHEN cl.COEFICIENTETARIFA IS NOT NULL THEN ");
|
||||
sb.append(" trunc(((coalesce(ct1.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente1,0) + 350,0.27)*16160 )) ) * COALESCE(tc.kmcoeficiente1,0)) * cl.COEFICIENTETARIFA ");
|
||||
sb.append(" + ((coalesce(ct2.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente2,0) + 350,0.27)*13470 )) ) * COALESCE(tc.kmcoeficiente2,0)) * cl.COEFICIENTETARIFA,2) ");
|
||||
sb.append(" ELSE ");
|
||||
// < COEFICIENTE DA CLASSE ESTA NULL
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
|
@ -291,8 +293,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" 1, 2 ) ");
|
||||
}
|
||||
//
|
||||
sb.append(" end else " );
|
||||
//< ORGAO NAO EH DER-PR
|
||||
sb.append(" end else ");
|
||||
// < ORGAO NAO EH DER-PR
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
|
@ -302,14 +304,14 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
} else {
|
||||
sb.append(" 1, 2 ) ");
|
||||
}
|
||||
sb.append(" end , " );
|
||||
sb.append(" end , ");
|
||||
//
|
||||
//>> SE ORGAO FOR DER-PR E SE O COEFICIENTE DA CLASSE NAO ESTA NULL
|
||||
sb.append(" CASE R.ORGAOCONCEDENTE_ID WHEN "+DER_PR+" THEN CASE WHEN cl.COEFICIENTETARIFA IS NOT NULL THEN " );
|
||||
sb.append(" trunc(((coalesce(ct1.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente1,0) + 350,0.27)*16160 )) ) * COALESCE(tc.kmcoeficiente1,0)) * cl.COEFICIENTETARIFA " );
|
||||
sb.append(" + ((coalesce(ct2.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente2,0) + 350,0.27)*13470 )) ) * COALESCE(tc.kmcoeficiente2,0)) * cl.COEFICIENTETARIFA,2) " );
|
||||
sb.append(" ELSE " );
|
||||
//< COEFICIENTE DA CLASSE ESTA NULL
|
||||
// >> SE ORGAO FOR DER-PR E SE O COEFICIENTE DA CLASSE NAO ESTA NULL
|
||||
sb.append(" CASE R.ORGAOCONCEDENTE_ID WHEN " + DER_PR + " THEN CASE WHEN cl.COEFICIENTETARIFA IS NOT NULL THEN ");
|
||||
sb.append(" trunc(((coalesce(ct1.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente1,0) + 350,0.27)*16160 )) ) * COALESCE(tc.kmcoeficiente1,0)) * cl.COEFICIENTETARIFA ");
|
||||
sb.append(" + ((coalesce(ct2.coeficiente,0) + oc.coeficientetarifa / ((POWER(COALESCE(tc.kmcoeficiente2,0) + 350,0.27)*13470 )) ) * COALESCE(tc.kmcoeficiente2,0)) * cl.COEFICIENTETARIFA,2) ");
|
||||
sb.append(" ELSE ");
|
||||
// < COEFICIENTE DA CLASSE ESTA NULL
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
|
@ -320,8 +322,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" 1, 2 ) ");
|
||||
}
|
||||
//
|
||||
sb.append(" end else " );
|
||||
//< ORGAO NAO EH DER-PR
|
||||
sb.append(" end else ");
|
||||
// < ORGAO NAO EH DER-PR
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
|
@ -331,7 +333,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
} else {
|
||||
sb.append(" 1, 2 ) ");
|
||||
}
|
||||
sb.append(" end , " );
|
||||
sb.append(" end , ");
|
||||
//
|
||||
sb.append(" t.tramo_id, ");
|
||||
sb.append(" mc.marca_id, ");
|
||||
|
@ -386,11 +388,11 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and mc.activo = 1 ");
|
||||
sb.append(" and re.activo = 1 ");
|
||||
sb.append(" and r.orgaoconcedente_id <> 21 ");
|
||||
if(ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.CRIAR_TARIFA_APENAS_TRECHO_VENDIDO.getDescricao())){
|
||||
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.CRIAR_TARIFA_APENAS_TRECHO_VENDIDO.getDescricao())) {
|
||||
sb.append(" and rc.indventa = 1 ");
|
||||
}
|
||||
if (idsEmpresas != null) {
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
sb.append(" and m.moneda_id = 1 ");
|
||||
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null && orgaoConcedente.getOrgaoConcedenteId() != SELECAO_TODOS) {
|
||||
|
@ -475,7 +477,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getAtualizarTaxaEmbarquePorKmParada(final Integer rutaId, final Integer usuarioId,final Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public String getAtualizarTaxaEmbarquePorKmParada(final Integer rutaId, final Integer usuarioId, final Integer orgaoConcedenteId, List<Integer> idsEmpresas, List<Integer> lsParadaIds) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("update tarifa_oficial set IMPORTETAXAEMBARQUE = ");
|
||||
sb.append("( ");
|
||||
|
@ -488,7 +490,11 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" inner join tramo t on t.tramo_id = tao.tramo_id ");
|
||||
sb.append(" inner join TAXA_EMBARQUE_PARADA tepKm on ");
|
||||
sb.append(" tepKm.parada_id = t.origen_id and tepKm.KMATE >= ");
|
||||
sb.append(" t.CANTKMREAL and tepKm.activo = 1 and tepKm.indtipo = 'K' and tepKm.empresa_id in (-1, ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" t.CANTKMREAL and tepKm.activo = 1 and tepKm.indtipo = 'K' and tepKm.empresa_id in (-1, ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and t.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
|
||||
sb.append(" inner join marca m on m.marca_id = tao.marca_id ");
|
||||
sb.append("where ");
|
||||
sb.append(" tepKm.kmate= ");
|
||||
|
@ -507,7 +513,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and tao.tramo_id = tarifa_oficial.tramo_id ");
|
||||
sb.append(" and tepKm.orgaoconcedente_id = tarifa_oficial.orgaoconcedente_id ");
|
||||
if (idsEmpresas != null) {
|
||||
sb.append(" and m.empresa_id in (-1,").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" and m.empresa_id in (-1,").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
sb.append(") ");
|
||||
sb.append(", usuario_id = ").append(usuarioId).append(",fecmodif = ").append(DBUtil.getInstance().dbSysdate()).append(" ");
|
||||
|
@ -520,13 +526,14 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and tarifa_oficial.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
}
|
||||
|
||||
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and tarifa_oficial.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarTaxaEmbarquePorKmOrgao(final Integer rutaId, final Integer usuarioId,final Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public String getSQLAtualizarTaxaEmbarquePorKmOrgao(final Integer rutaId, final Integer usuarioId, final Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer> lsParadaIds) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("update tarifa_oficial set IMPORTETAXAEMBARQUE = ");
|
||||
sb.append("coalesce( ");
|
||||
|
@ -560,9 +567,15 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and tao.tramo_id = tarifa_oficial.tramo_id ");
|
||||
|
||||
if (idsEmpresas != null) {
|
||||
sb.append(" and m.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
sb.append(" and m.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and t.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
|
||||
|
||||
|
||||
sb.append("),IMPORTETAXAEMBARQUE) ");
|
||||
sb.append(", usuario_id = ").append(usuarioId).append(",fecmodif = ").append(DBUtil.getInstance().dbSysdate()).append(" ");
|
||||
sb.append(" ");
|
||||
|
@ -576,11 +589,15 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and tarifa_oficial.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
}
|
||||
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and tarifa_oficial.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarTaxaEmbarquePorParadaFixo(final Integer rutaId, final Integer usuarioId,final Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public String getSQLAtualizarTaxaEmbarquePorParadaFixo(final Integer rutaId, final Integer usuarioId, final Integer orgaoConcedenteId, List<Integer> idsEmpresas,List<Integer> lsParadaIds) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
|
||||
sb.append("update tarifa_oficial set IMPORTETAXAEMBARQUE = ");
|
||||
|
@ -593,7 +610,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tarifa_oficial tao ");
|
||||
sb.append(" inner join tramo t on t.tramo_id = tao.tramo_id ");
|
||||
sb.append(" inner join TAXA_EMBARQUE_PARADA tepFixo on ");
|
||||
sb.append(" tepFixo.parada_id = t.origen_id and tepFixo.empresa_id in ("+obtemEmpresas(idsEmpresas)+" ) ");
|
||||
sb.append(" tepFixo.parada_id = t.origen_id and tepFixo.empresa_id in (" + obtemEmpresas(idsEmpresas) + " ) ");
|
||||
sb.append(" and tepFixo.indtipo = 'F' and tepFixo.activo = 1 ");
|
||||
sb.append(" inner join marca m on m.marca_id = tao.marca_id ");
|
||||
sb.append("where ");
|
||||
|
@ -604,7 +621,11 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and tao.moneda_id = tarifa_oficial.moneda_id ");
|
||||
sb.append(" and tao.ruta_id = tarifa_oficial.ruta_id ");
|
||||
sb.append(" and tao.tramo_id = tarifa_oficial.tramo_id ");
|
||||
sb.append(" and m.empresa_id in ("+obtemEmpresas(idsEmpresas)+" ) and tao.activo = 1 ");
|
||||
sb.append(" and m.empresa_id in (" + obtemEmpresas(idsEmpresas) + " ) and tao.activo = 1 ");
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and t.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
|
||||
sb.append("),IMPORTETAXAEMBARQUE) ");
|
||||
sb.append(", usuario_id = ").append(usuarioId).append(",fecmodif = ").append(DBUtil.getInstance().dbSysdate()).append(" ");
|
||||
sb.append(" ");
|
||||
|
@ -616,7 +637,11 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and tarifa_oficial.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
}
|
||||
sb.append(" and tarifa_oficial.MARCA_ID in (select m2.marca_id from marca m2 where m2.activo = 1 and m2.empresa_id in (" +obtemEmpresas(idsEmpresas)+ " ) ) ");
|
||||
sb.append(" and tarifa_oficial.MARCA_ID in (select m2.marca_id from marca m2 where m2.activo = 1 and m2.empresa_id in (" + obtemEmpresas(idsEmpresas) + " ) ) ");
|
||||
|
||||
if (null != lsParadaIds) {
|
||||
sb.append(" and tarifa_oficial.origen_id in (").append(lsParadaIds.toString().substring(1, lsParadaIds.toString().length() - 1)).append(" ) ");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
@ -624,7 +649,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if (idsEmpresas == null || idsEmpresas.contains(SELECAO_TODOS)) {
|
||||
return Integer.toString(SELECAO_TODOS);
|
||||
}
|
||||
return idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1);
|
||||
return idsEmpresas.toString().substring(1, idsEmpresas.toString().length() - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -751,7 +776,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tao.IMPORTEOUTROS AS \"taoimporteoutros\", ");
|
||||
sb.append(" ta.TARIFA_ID AS \"tarifaId\" ");
|
||||
|
||||
sb.append("FROM TARIFA_OFICIAL tao " );
|
||||
sb.append("FROM TARIFA_OFICIAL tao ");
|
||||
sb.append("INNER JOIN TARIFA ta ON (tao.MARCA_ID = ta.MARCA_ID ");
|
||||
sb.append(" AND tao.CLASESERVICIO_ID = ta.CLASESERVICIO_ID ");
|
||||
sb.append(" AND tao.TRAMO_ID = ta.TRAMO_ID ");
|
||||
|
@ -764,10 +789,10 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
sb.append("WHERE ta.VIGENCIATARIFA_ID = ").append(vigenciaTarifaId);
|
||||
|
||||
if(orgao != null){
|
||||
if (orgao != null) {
|
||||
sb.append(" AND tao.ORGAOCONCEDENTE_ID = ").append(orgao.getOrgaoConcedenteId());
|
||||
}
|
||||
if(empresa != null){
|
||||
if (empresa != null) {
|
||||
sb.append(" AND mTa.EMPRESA_ID = ").append(empresa.getEmpresaId());
|
||||
sb.append(" AND mTao.EMPRESA_ID = ").append(empresa.getEmpresaId());
|
||||
}
|
||||
|
@ -776,25 +801,25 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarTarifaPorTarifaOfical(Map<String,Object> dados, Integer usuarioId, Boolean calculaPegagio,
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP){
|
||||
public String getSQLAtualizarTarifaPorTarifaOfical(Map<String, Object> dados, Integer usuarioId, Boolean calculaPegagio,
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP) {
|
||||
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("UPDATE TARIFA SET ");
|
||||
|
||||
if(calculaPegagio){
|
||||
if (calculaPegagio) {
|
||||
sb.append("IMPORTEPEDAGIO=").append(dados.get("taoimportepedagio")).append(",");
|
||||
}
|
||||
if(calculaTarifa){
|
||||
if (calculaTarifa) {
|
||||
sb.append("PRECIO=").append(dados.get("taoprecio")).append(",PRECIOORIGINAL=").append(dados.get("taopreciooriginal")).append(",");
|
||||
}
|
||||
if(calculaTaxaEmbarque){
|
||||
if (calculaTaxaEmbarque) {
|
||||
sb.append("IMPORTETAXAEMBARQUE=").append(dados.get("taoimportetaxaembarque")).append(",");
|
||||
}
|
||||
if(calculaSeguro){
|
||||
if (calculaSeguro) {
|
||||
sb.append("IMPORTESEGURO=").append(dados.get("taoimporteseguro")).append(",");
|
||||
}
|
||||
if(calculaTPP){
|
||||
if (calculaTPP) {
|
||||
sb.append("IMPORTETPP=").append(dados.get("taoimportetpp")).append(",");
|
||||
}
|
||||
sb.append("IMPORTEOUTROS=").append(dados.get("taoimporteoutros")).append(",");
|
||||
|
@ -1368,7 +1393,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" tao.IMPORTEOUTROS AS \"taoimporteoutros\", ");
|
||||
sb.append(" ta.TARIFAEMBARCADA_ID AS \"tarifaId\" ");
|
||||
|
||||
sb.append("FROM TARIFA_OFICIAL tao " );
|
||||
sb.append("FROM TARIFA_OFICIAL tao ");
|
||||
sb.append("INNER JOIN TARIFA_EMBARCADA ta ON (tao.MARCA_ID = ta.MARCA_ID ");
|
||||
sb.append(" AND tao.CLASESERVICIO_ID = ta.CLASESERVICIO_ID ");
|
||||
sb.append(" AND tao.TRAMO_ID = ta.TRAMO_ID ");
|
||||
|
@ -1381,10 +1406,10 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
sb.append("WHERE ta.VIGENCIATARIFA_ID = ").append(vigenciaTarifaId);
|
||||
|
||||
if(orgao != null){
|
||||
if (orgao != null) {
|
||||
sb.append(" AND tao.ORGAOCONCEDENTE_ID = ").append(orgao.getOrgaoConcedenteId());
|
||||
}
|
||||
if(empresa != null){
|
||||
if (empresa != null) {
|
||||
sb.append(" AND mTa.EMPRESA_ID = ").append(empresa.getEmpresaId());
|
||||
sb.append(" AND mTao.EMPRESA_ID = ").append(empresa.getEmpresaId());
|
||||
}
|
||||
|
@ -1393,25 +1418,25 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getSQLAtualizarTarifaEmbarcadaPorTarifaOfical(Map<String,Object> dados, Integer usuarioId, Boolean calculaPegagio,
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP){
|
||||
public String getSQLAtualizarTarifaEmbarcadaPorTarifaOfical(Map<String, Object> dados, Integer usuarioId, Boolean calculaPegagio,
|
||||
Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP) {
|
||||
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
sb.append("UPDATE TARIFA_EMBARCADA SET ");
|
||||
|
||||
if(calculaPegagio){
|
||||
if (calculaPegagio) {
|
||||
sb.append("IMPORTEPEDAGIO=").append(dados.get("taoimportepedagio")).append(",");
|
||||
}
|
||||
if(calculaTarifa){
|
||||
if (calculaTarifa) {
|
||||
sb.append("PRECIO=").append(dados.get("taoprecio")).append(",PRECIOORIGINAL=").append(dados.get("taopreciooriginal")).append(",");
|
||||
}
|
||||
if(calculaTaxaEmbarque){
|
||||
if (calculaTaxaEmbarque) {
|
||||
sb.append("IMPORTETAXAEMBARQUE=").append(dados.get("taoimportetaxaembarque")).append(",");
|
||||
}
|
||||
if(calculaSeguro){
|
||||
if (calculaSeguro) {
|
||||
sb.append("IMPORTESEGURO=").append(dados.get("taoimporteseguro")).append(",");
|
||||
}
|
||||
if(calculaTPP){
|
||||
if (calculaTPP) {
|
||||
sb.append("IMPORTETPP=").append(dados.get("taoimportetpp")).append(",");
|
||||
}
|
||||
sb.append("IMPORTEOUTROS=").append(dados.get("taoimporteoutros")).append(",");
|
||||
|
|
|
@ -0,0 +1,248 @@
|
|||
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.OneToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "EMPRESA_EMAIL_ECOMERCE_SEQ", sequenceName = "EMPRESA_EMAIL_ECOMERCE_SEQ", allocationSize = 1)
|
||||
@Table(name = "EMPRESA_EMAIL_ECOMERCE")
|
||||
public class EmpresaEmailEComerce implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_EMAIL_ECOMERCE_SEQ")
|
||||
@Column(name = "EMPRESAEMAILECOMERCE_ID")
|
||||
private Integer empresaEmailEComerceId;
|
||||
@OneToOne
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
@Column(name = "SMTP")
|
||||
private String smtp;
|
||||
@Column(name = "SENHA")
|
||||
private String senha;
|
||||
@Column(name = "SMTPPORTA")
|
||||
private String smtpPorta;
|
||||
@Column(name = "SMTPEMAIL")
|
||||
private String smtpEmail;
|
||||
@Column(name = "TEXTOEMAIL")
|
||||
private String textoEmail;
|
||||
@Column(name = "TEXTOCUPOMEMBARQUE")
|
||||
private String textoCupomEmbarque;
|
||||
@Column(name = "ASSUNTO")
|
||||
private String assunto;
|
||||
@Column(name = "EMAILDE")
|
||||
private String emailDe;
|
||||
@Column(name = "EMAILCOPIAOCULTA")
|
||||
private String emailCopiaOculta;
|
||||
@Column(name = "TIPOOPERACAO")
|
||||
private String tipoOperacao;
|
||||
@Column(name = "TIPOAUTORIZACAO")
|
||||
private String tipoAutorizacao;
|
||||
@Column(name = "INDAUTENTICACAO")
|
||||
private Boolean indAutenticacao;
|
||||
|
||||
@Column(name = "ANEXO1")
|
||||
private String anexo1;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public EmpresaEmailEComerce() {
|
||||
|
||||
}
|
||||
|
||||
public Integer getEmpresaEmailEComerceId() {
|
||||
return empresaEmailEComerceId;
|
||||
}
|
||||
|
||||
public void setEmpresaEmailEComerceId(Integer empresaEmailEComerceId) {
|
||||
this.empresaEmailEComerceId = empresaEmailEComerceId;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public String getSmtp() {
|
||||
return smtp;
|
||||
}
|
||||
|
||||
public void setSmtp(String smtp) {
|
||||
this.smtp = smtp;
|
||||
}
|
||||
|
||||
public String getSenha() {
|
||||
return senha;
|
||||
}
|
||||
|
||||
public void setSenha(String senha) {
|
||||
this.senha = senha;
|
||||
}
|
||||
|
||||
public String getSmtpPorta() {
|
||||
return smtpPorta;
|
||||
}
|
||||
|
||||
public void setSmtpPorta(String smtpPorta) {
|
||||
this.smtpPorta = smtpPorta;
|
||||
}
|
||||
|
||||
public String getSmtpEmail() {
|
||||
return smtpEmail;
|
||||
}
|
||||
|
||||
public void setSmtpEmail(String smtpEmail) {
|
||||
this.smtpEmail = smtpEmail;
|
||||
}
|
||||
|
||||
public String getTextoEmail() {
|
||||
return textoEmail;
|
||||
}
|
||||
|
||||
public void setTextoEmail(String textoEmail) {
|
||||
this.textoEmail = textoEmail;
|
||||
}
|
||||
|
||||
public String getTextoCupomEmbarque() {
|
||||
return textoCupomEmbarque;
|
||||
}
|
||||
|
||||
public void setTextoCupomEmbarque(String textoCupomEmbarque) {
|
||||
this.textoCupomEmbarque = textoCupomEmbarque;
|
||||
}
|
||||
|
||||
public String getAssunto() {
|
||||
return assunto;
|
||||
}
|
||||
|
||||
public void setAssunto(String assunto) {
|
||||
this.assunto = assunto;
|
||||
}
|
||||
|
||||
public String getEmailDe() {
|
||||
return emailDe;
|
||||
}
|
||||
|
||||
public void setEmailDe(String emailDe) {
|
||||
this.emailDe = emailDe;
|
||||
}
|
||||
|
||||
public String getEmailCopiaOculta() {
|
||||
return emailCopiaOculta;
|
||||
}
|
||||
|
||||
public void setEmailCopiaOculta(String emailCopiaOculta) {
|
||||
this.emailCopiaOculta = emailCopiaOculta;
|
||||
}
|
||||
|
||||
public String getTipoOperacao() {
|
||||
return tipoOperacao;
|
||||
}
|
||||
|
||||
public void setTipoOperacao(String tipoOperacao) {
|
||||
this.tipoOperacao = tipoOperacao;
|
||||
}
|
||||
|
||||
public String getTipoAutorizacao() {
|
||||
return tipoAutorizacao;
|
||||
}
|
||||
|
||||
public void setTipoAutorizacao(String tipoAutorizacao) {
|
||||
this.tipoAutorizacao = tipoAutorizacao;
|
||||
}
|
||||
|
||||
public Boolean getIndAutenticacao() {
|
||||
return indAutenticacao;
|
||||
}
|
||||
|
||||
public void setIndAutenticacao(Boolean indAutenticacao) {
|
||||
this.indAutenticacao = indAutenticacao;
|
||||
}
|
||||
|
||||
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 String getAnexo1() {
|
||||
return anexo1;
|
||||
}
|
||||
|
||||
public void setAnexo1(String anexo1) {
|
||||
this.anexo1 = anexo1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((empresaEmailEComerceId == null) ? 0 : empresaEmailEComerceId.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;
|
||||
EmpresaEmailEComerce other = (EmpresaEmailEComerce) obj;
|
||||
if (empresaEmailEComerceId == null) {
|
||||
if (other.empresaEmailEComerceId != null)
|
||||
return false;
|
||||
} else if (!empresaEmailEComerceId.equals(other.empresaEmailEComerceId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(this.getEmpresaEmailEComerceId());
|
||||
}
|
||||
|
||||
}
|
|
@ -54,6 +54,9 @@ public class RedondeoCtrl implements Serializable {
|
|||
@OneToMany(mappedBy = "redondeoCtrl", cascade = CascadeType.ALL)
|
||||
private List<Redondeo> redondeoList;
|
||||
|
||||
@OneToMany(mappedBy = "redondeoCtrl", cascade = CascadeType.ALL)
|
||||
private List<RedondeoOrgaoConcedente> redondeoOrgaoList;
|
||||
|
||||
public RedondeoCtrl() {
|
||||
}
|
||||
|
||||
|
@ -169,4 +172,19 @@ public class RedondeoCtrl implements Serializable {
|
|||
public void setIndaplicaArtesp(Boolean indaplicaArtesp) {
|
||||
this.indaplicaArtesp = indaplicaArtesp;
|
||||
}
|
||||
|
||||
public List<RedondeoOrgaoConcedente> getRedondeoOrgaoList() {
|
||||
List<RedondeoOrgaoConcedente> rmList = new ArrayList<RedondeoOrgaoConcedente>();
|
||||
for (RedondeoOrgaoConcedente roc : this.redondeoOrgaoList) {
|
||||
if (roc.getActivo() == Boolean.TRUE) {
|
||||
rmList.add(roc);
|
||||
}
|
||||
}
|
||||
|
||||
return rmList;
|
||||
}
|
||||
|
||||
public void setRedondeoOrgaoList(List<RedondeoOrgaoConcedente> redondeoOrgaoList) {
|
||||
this.redondeoOrgaoList = redondeoOrgaoList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
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.OneToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author valdir.cordeiro
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(name = "REDONDEO_ORGAOCONCEDENTE_SEQ", sequenceName = "REDONDEO_ORGAOCONCEDENTE_SEQ", allocationSize = 1)
|
||||
@Table(name = "REDONDEO_ORGAOCONCEDENTE")
|
||||
public class RedondeoOrgaoConcedente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_ORGAOCONCEDENTE_SEQ")
|
||||
@Basic(optional = false)
|
||||
@Column(name = "REDONDEOORGAOCONCEDENTE_ID")
|
||||
private Long redondeoOrgaoConcedenteId;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@JoinColumn(name = "REDONDEOCTRL_ID", referencedColumnName = "REDONDEOCTRL_ID")
|
||||
@ManyToOne
|
||||
private RedondeoCtrl redondeoCtrl;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "ORGAOCONCEDENTE_ID")
|
||||
private OrgaoConcedente orgaoConcedente;
|
||||
|
||||
public RedondeoOrgaoConcedente() {
|
||||
}
|
||||
|
||||
public RedondeoOrgaoConcedente(Long redondeoOrgaoConcedenteId) {
|
||||
this.redondeoOrgaoConcedenteId = redondeoOrgaoConcedenteId;
|
||||
}
|
||||
|
||||
public Long getRedondeoOrgaoConcedenteId() {
|
||||
return redondeoOrgaoConcedenteId;
|
||||
}
|
||||
|
||||
public void setRedondeoOrgaoConcedenteId(Long redondeoOrgaoConcedenteId) {
|
||||
this.redondeoOrgaoConcedenteId = redondeoOrgaoConcedenteId;
|
||||
}
|
||||
|
||||
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 RedondeoCtrl getRedondeoCtrl() {
|
||||
return redondeoCtrl;
|
||||
}
|
||||
|
||||
public void setRedondeoCtrl(RedondeoCtrl redondeoCtrl) {
|
||||
this.redondeoCtrl = redondeoCtrl;
|
||||
}
|
||||
|
||||
public OrgaoConcedente getOrgaoConcedente() {
|
||||
return orgaoConcedente;
|
||||
}
|
||||
|
||||
public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
|
||||
this.orgaoConcedente = orgaoConcedente;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final RedondeoOrgaoConcedente other = (RedondeoOrgaoConcedente) obj;
|
||||
if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
|
||||
return false;
|
||||
}
|
||||
if (this.redondeoCtrl != other.redondeoCtrl && (this.redondeoCtrl == null || !this.redondeoCtrl.equals(other.redondeoCtrl))) {
|
||||
return false;
|
||||
}
|
||||
if (this.orgaoConcedente != other.orgaoConcedente && (this.orgaoConcedente == null || !this.orgaoConcedente.equals(other.orgaoConcedente))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 47 * hash + (this.activo != null ? this.activo.hashCode() : 0);
|
||||
hash = 47 * hash + (this.redondeoCtrl != null ? this.redondeoCtrl.hashCode() : 0);
|
||||
hash = 47 * hash + (this.orgaoConcedente != null ? this.orgaoConcedente.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.RedondeoOrgaoConcedente[redondeoOrgaoConcedente=" + redondeoOrgaoConcedenteId + "]";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.rjconsultores.ventaboletos.enums;
|
||||
|
||||
public enum TipoEmail {
|
||||
|
||||
CALL_CENTER(1, "Call Center"),
|
||||
ECOMMERCE(2, "E-Commerce"),
|
||||
;
|
||||
|
||||
private Integer id;
|
||||
private String descricao;
|
||||
|
||||
private TipoEmail(Integer id, String descricao) {
|
||||
this.descricao = descricao;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescricao() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public void setDescricao(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static TipoEmail buscarPorId(Integer id) {
|
||||
for (TipoEmail ids : TipoEmail.values()) {
|
||||
if (ids.getId() == id) {
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.rjconsultores.ventaboletos.enums;
|
||||
|
||||
public enum TipoOperacaoECommerce {
|
||||
|
||||
CADASTRO_CLIENTE(1, "Cadastro Cliente"),
|
||||
ESQUECER_SENHA(2, "Esquecer Senha"),
|
||||
COMPRA_PASSAGEM(3, "Compra de passagem"),
|
||||
COMPRA_CANCELAMENTO(4, "Cancelamento de compra"),
|
||||
;
|
||||
|
||||
private Integer id;
|
||||
private String descricao;
|
||||
|
||||
private TipoOperacaoECommerce(Integer id, String descricao) {
|
||||
this.descricao = descricao;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDescricao() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public void setDescricao(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public static TipoOperacaoECommerce buscarPorId(Integer id) {
|
||||
for (TipoOperacaoECommerce ids : TipoOperacaoECommerce.values()) {
|
||||
if (ids.getId() == id) {
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,7 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
|||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
|
||||
public interface CalcularPeajeService {
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta);
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta,Integer[] listCasetaPeaje);
|
||||
public List<Ruta> buscarRutaWithCasetaPeajeFromOrgao(OrgaoConcedente oc);
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) throws Exception;
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS,Integer[] listCasetaPeaje) throws Exception;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
|
@ -11,4 +13,7 @@ public interface ConfRestricaoCanalVentaService{
|
|||
|
||||
public ConfRestricaoCanalVenta suscribirActualizar(ConfRestricaoCanalVenta entidad) throws BusinessException;
|
||||
|
||||
public void borrarList(Set<ConfRestricaoCanalVenta> confRestricaoCanalVentaSelecionadas);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce;
|
||||
|
||||
public interface EmpresaEmailEComerceService extends GenericService<EmpresaEmailEComerce, Integer> {
|
||||
|
||||
public EmpresaEmailEComerce buscarPorEmpresa(Empresa empresa, String tipoOperacao);
|
||||
|
||||
}
|
|
@ -50,4 +50,6 @@ public interface ParadaService {
|
|||
|
||||
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId,Integer[] listRuta);
|
||||
|
||||
}
|
||||
|
|
|
@ -118,4 +118,10 @@ public interface RutaService {
|
|||
|
||||
public List<Ruta> buscaLikeComboBox(String stringConsulta);
|
||||
|
||||
public List<Ruta> buscarPorIds(Integer[] rutaIds);
|
||||
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje);
|
||||
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedenteParadaIds(Empresa empresa, OrgaoConcedente orgao, Integer[] lsParadaIds) ;
|
||||
|
||||
}
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
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.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinimaCategoria;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -23,10 +23,10 @@ import java.util.List;
|
|||
public interface TarifaMinimaService extends GenericService<TarifaMinima, Integer> {
|
||||
|
||||
public List<TarifaMinima> pesquisarEspecifico(Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio, Moneda moneda);
|
||||
ClaseServicio claseServicio, Moneda moneda, VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<TarifaMinima> pesquisar(Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio, Moneda moneda);
|
||||
ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<TarifaMinima> buscarPorPlaza(Plaza plaza);
|
||||
|
||||
|
@ -37,7 +37,7 @@ public interface TarifaMinimaService extends GenericService<TarifaMinima, Intege
|
|||
|
||||
public List<TarifaMinima> pesquisar(TarifaMinima tarifaMinima);
|
||||
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca,Parada origem, Parada destino,ClaseServicio claseServicio, Moneda moneda);
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca,Parada origem, Parada destino,ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<TarifaMinima> buscarPorMarca(Marca marca, Moneda moneda);
|
||||
|
||||
|
|
|
@ -95,8 +95,7 @@ public interface TarifaOficialService {
|
|||
* @param empresaId - Empresa para ser filtrada
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer orgaoConcedenteId,boolean gerarTabelaZerada, List<Empresa> lsEmpresaSelected) throws BusinessException;
|
||||
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer orgaoConcedenteId,boolean gerarTabelaZerada, List<Empresa> lsEmpresaSelected, List<Integer> lsParadaIds) throws BusinessException;
|
||||
|
||||
/**
|
||||
* Atualiza o seguro de acordo a kilometragem do trecho
|
||||
|
@ -137,7 +136,7 @@ public interface TarifaOficialService {
|
|||
|
||||
public void borrar(TarifaOficial tarifaOficial);
|
||||
|
||||
public void gerarAtualizarTabelaZerada(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException ;
|
||||
public void gerarAtualizarTabelaZerada(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected,List<Integer> lsParadaId) throws BusinessException ;
|
||||
|
||||
public void atualizarPedagio();
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public interface TarifaService extends GenericService<Tarifa, Integer> {
|
|||
|
||||
public List<Tarifa> buscarPorVigencia(VigenciaTarifa vigencia,Empresa empresa);
|
||||
|
||||
public Boolean podeAlterarTarifaMinima(Tarifa tarifa, Marca marca, Parada origem,Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda);
|
||||
public Boolean podeAlterarTarifaMinima(Tarifa tarifa, Marca marca, Parada origem,Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda, VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
public List<Tarifa> buscarExisteVigencia(VigenciaTarifa vigenciaTarifa);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CalcularPeajeDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CasetaPeaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
@ -19,8 +20,8 @@ public class CalcularPeajeServiceImpl implements CalcularPeajeService{
|
|||
private CalcularPeajeDAO calcularPeajeDAO;
|
||||
|
||||
@Override
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta){
|
||||
return calcularPeajeDAO.buscarCasetasPeajeWithinTramo(ruta);
|
||||
public List<Object> buscarCasetasPeajeWithinTramo(Ruta ruta,Integer[] listCasetaPeaje){
|
||||
return calcularPeajeDAO.buscarCasetasPeajeWithinTramo(ruta,listCasetaPeaje);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +31,7 @@ public class CalcularPeajeServiceImpl implements CalcularPeajeService{
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) throws Exception {
|
||||
return calcularPeajeDAO.gerarSQLInserirPeajes(lsRuta, orgao, usaICMS);
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS,Integer[] listCasetaPeaje) throws Exception {
|
||||
return calcularPeajeDAO.gerarSQLInserirPeajes(lsRuta, orgao, usaICMS,listCasetaPeaje);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rjconsultores.ventaboletos.service.impl;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -47,6 +48,22 @@ public class ConfRestricaoCanalVentaServiceImpl implements ConfRestricaoCanalVen
|
|||
confRestricaoCanalVentaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void borrarList(Set<ConfRestricaoCanalVenta> confRestricaoCanalVentaSelecionadas) {
|
||||
List<Integer> listConfRestricaoCanalVentaIds =retornarListConfRestricaoCanalVentaIds(confRestricaoCanalVentaSelecionadas);
|
||||
confRestricaoCanalVentaDAO.inativarListConfRestricaoCanalVenta(listConfRestricaoCanalVentaIds, UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
}
|
||||
|
||||
|
||||
private List<Integer> retornarListConfRestricaoCanalVentaIds(Set<ConfRestricaoCanalVenta> ConfRestricaoCanalVentaSelecionadas) {
|
||||
List<Integer> listConfRestricaoCanalVentaIds = new ArrayList<Integer>();
|
||||
for (ConfRestricaoCanalVenta c : ConfRestricaoCanalVentaSelecionadas) {
|
||||
listConfRestricaoCanalVentaIds.add(c.getConfRestricaoCanalVentaId().intValue());
|
||||
}
|
||||
return listConfRestricaoCanalVentaIds;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isBloqueoExistente(ConfRestricaoCanalVenta c , List<ConfRestricaoCanalVenta> confRestricaoCanalVentaList){
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.service.impl;
|
|||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
@ -855,7 +856,7 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
return b - a;
|
||||
}
|
||||
|
||||
private void generarCorrida(Date dataGeracao, List<EsquemaCorrida> lsEsquemaCorrida, boolean isGeracaoAutomaticaCorrida) {
|
||||
private Boolean generarCorrida(Date dataGeracao, List<EsquemaCorrida> lsEsquemaCorrida, boolean isGeracaoAutomaticaCorrida) {
|
||||
|
||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
||||
|
||||
|
@ -869,6 +870,8 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
Integer unPuntoVenta= constanteService.buscarValorConstantePorNomeConstante("PUNTOVENTA_RESERVA_CLIENTES");
|
||||
Integer estacionId = constanteService.buscarValorConstantePorNomeConstante("ESTACION_RESERVA_CLIENTES");
|
||||
|
||||
boolean corridaGerada = true;
|
||||
|
||||
Corrida corrida = null;
|
||||
try {
|
||||
|
||||
|
@ -884,6 +887,7 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
//Nessas duas condições, o "filho" só é gerado a partir do esquema corrida "pai"
|
||||
if (esHijoRebote || esSegundoPiso) {
|
||||
log.info(String.format("Esquema nao gerado. esHijoRebote:%s ; esSegundoPiso: %s",esHijoRebote,esSegundoPiso));
|
||||
corridaGerada = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -895,6 +899,7 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
if (corrida == null) {// Si no genera la corrida, no va a
|
||||
// generar el rebote
|
||||
log.info("No fue generado corrida. Esquema " + esquemaCorrida.getEsquemacorridaId() + " Data" + dataGeracao);
|
||||
corridaGerada = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1030,6 +1035,8 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
validaCriaReservaCliente(corrida, unUsuarioId, unPuntoVenta, estacionId);
|
||||
}
|
||||
}
|
||||
|
||||
return corridaGerada;
|
||||
}
|
||||
|
||||
private void validaCriaReservaCliente(Corrida corrida, Integer unUsuarioId, Integer unPuntoVenta, Integer estacionId) {
|
||||
|
@ -1229,8 +1236,28 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
return dataAte;
|
||||
}
|
||||
|
||||
private boolean generaCorridaAprimorada() {
|
||||
try {
|
||||
Constante constante = constanteService.buscarPorNomeConstante("GENERACION_CORRIDA_APRIMORADA");
|
||||
return (constante != null && StringUtils.isNotBlank(constante.getValorconstante())
|
||||
&& Boolean.valueOf(constante.getValorconstante())) ? Boolean.TRUE : Boolean.FALSE;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
|
||||
public boolean generarCorridaAutomatica() {
|
||||
|
||||
if (generaCorridaAprimorada()) {
|
||||
return generarCorridaAutomaticaAprimorada();
|
||||
} else {
|
||||
return generarCorridaAutomaticaPadrao();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean generarCorridaAutomaticaPadrao() {
|
||||
feriadoCache.limpar();
|
||||
|
||||
Date dataDe = Calendar.getInstance().getTime();
|
||||
|
@ -1247,6 +1274,19 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
return hayErroConstante && hayErroQtdeDias;
|
||||
}
|
||||
|
||||
private boolean generarCorridaAutomaticaAprimorada() {
|
||||
feriadoCache.limpar();
|
||||
|
||||
Date dataDe = Calendar.getInstance().getTime();
|
||||
|
||||
Date dataAteConstante = calcularDataFinalGeneracionCorrida();
|
||||
Boolean hayErroConstante = !generarCorridaAutomaticaAprimorada(dataDe, dataAteConstante);
|
||||
|
||||
log.debug("corrida generadas aprimorada por la cant de dias.hayError=" + hayErroConstante);
|
||||
|
||||
return hayErroConstante;
|
||||
}
|
||||
|
||||
private boolean generarCorridaAutomaticaQtdeDias(Date dataDeOriginal) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
|
||||
|
@ -1354,6 +1394,92 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
return generacionExitosa;
|
||||
}
|
||||
|
||||
private boolean generarCorridaAutomaticaAprimorada(final Date dataInicial, final Date dataConstanteFim) {
|
||||
boolean generacionExitosa = true;
|
||||
SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy");
|
||||
|
||||
log.debug("** AUTO - Data De: " + sdfData.format(dataInicial) + " **Data Ateh: " + sdfData.format(dataConstanteFim));
|
||||
|
||||
// TODO: Melhorar o tratamento às transações manuais em caso de erro,etc
|
||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
||||
TransactionStatus status = transactionManager.getTransaction(def);
|
||||
|
||||
Calendar calendarData = Calendar.getInstance();
|
||||
calendarData.setTime(dataConstanteFim);
|
||||
|
||||
Date dataAte = calendarData.getTime();
|
||||
|
||||
try {
|
||||
log.debug("*** Data: " + sdfData.format(dataAte));
|
||||
List<EsquemaCorrida> lsEsquemaCorrida = esquemaCorridaService.buscaDentroVigencia(dataInicial);
|
||||
|
||||
Boolean dentroVigenciaEsquemaOperacional = !lsEsquemaCorrida.isEmpty();
|
||||
if (dentroVigenciaEsquemaOperacional) {
|
||||
|
||||
for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) {
|
||||
log.debug("esquemaCorrida=" + esquemaCorrida.getEsquemacorridaId());
|
||||
|
||||
Integer qtdeDiasGerar = esquemaCorrida.getCantDiasGeneracion();
|
||||
|
||||
if (qtdeDiasGerar != null && qtdeDiasGerar >= 0) {
|
||||
log.debug("cantDiasGenerar=" + qtdeDiasGerar);
|
||||
|
||||
Calendar calendarDiasGenerar = Calendar.getInstance();
|
||||
calendarDiasGenerar.setTime(dataInicial);
|
||||
calendarDiasGenerar.add(Calendar.DATE, qtdeDiasGerar);
|
||||
dataAte = calendarDiasGenerar.getTime();
|
||||
} else {
|
||||
calendarData.setTime(dataConstanteFim);
|
||||
dataAte = calendarData.getTime();
|
||||
}
|
||||
|
||||
log.debug("Periodo generacion = " + sdf.format(dataInicial) + " hasta " + sdf.format(dataAte));
|
||||
|
||||
if (DateUtil.compareOnlyDate(dataAte, esquemaCorrida.getEsquemaOperacional().getFecfinvigencia()) > 0) {
|
||||
log.info("Cant dias excede final de la vigencia");
|
||||
dataAte = esquemaCorrida.getEsquemaOperacional().getFecfinvigencia();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
} else {
|
||||
log.info("Corrida do dia: " + sdfData.format(dataAte) + " já gerada");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.info("commit bloco corridas");
|
||||
|
||||
transactionManager.commit(status);
|
||||
status = transactionManager.getTransaction(def);
|
||||
} catch (Exception ex) {
|
||||
log.error("", ex);
|
||||
log.error(" Erro ao gerar corrida = " + esquemaCorrida.getNumCorrida() + " esquemaCorrida = " + esquemaCorrida.getEsquemacorridaId());
|
||||
transactionManager.rollback(status);
|
||||
status = transactionManager.getTransaction(def);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info("No hay esquema vigente para la fecha " + sdfData.format(dataInicial));
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("Erro ao gerar corridas: " + ex, ex);
|
||||
generacionExitosa = false;
|
||||
}
|
||||
|
||||
return generacionExitosa;
|
||||
}
|
||||
|
||||
private int cantDiasMaxGerarCorridasManual() {
|
||||
|
||||
Constante constante = constanteService.buscarPorNomeConstante("CANT_MAX_CORRIDA_GERA_MANUAL");
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
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.EmpresaEmailEComerceDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaEmailEComerceService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("empresaEmailEComerceService")
|
||||
public class EmpresaEmailEComerceServiceImpl implements EmpresaEmailEComerceService {
|
||||
|
||||
@Autowired
|
||||
private EmpresaEmailEComerceDAO empresaEmailEComerceDAO;
|
||||
|
||||
@Override
|
||||
public List<EmpresaEmailEComerce> obtenerTodos() {
|
||||
return empresaEmailEComerceDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaEmailEComerce obtenerID(Integer id) {
|
||||
return empresaEmailEComerceDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EmpresaEmailEComerce suscribir(EmpresaEmailEComerce entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return empresaEmailEComerceDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EmpresaEmailEComerce actualizacion(EmpresaEmailEComerce entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return empresaEmailEComerceDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void borrar(EmpresaEmailEComerce entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
empresaEmailEComerceDAO.actualizacion(entidad);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaEmailEComerce buscarPorEmpresa(Empresa empresa, String tipoOperacao) {
|
||||
return empresaEmailEComerceDAO.buscarPorEmpresa(empresa, tipoOperacao);
|
||||
}
|
||||
|
||||
}
|
|
@ -243,14 +243,9 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
|
|||
case 3:
|
||||
cell.setCellType(Cell.CELL_TYPE_STRING);
|
||||
String numDocString = null;
|
||||
try {
|
||||
numDocString = new Long(Math.round(cell.getNumericCellValue())).toString();
|
||||
}catch(Exception e) {
|
||||
log.error("Erro na gravação do registro. Favor revisar",e);
|
||||
erros.append(cliente.getNumfidelidade() + " - Numero doc nao numerico: " + new Long(Math.round(cell.getNumericCellValue())).toString());
|
||||
erros.append("\n");
|
||||
|
||||
}
|
||||
numDocString = cell.getStringCellValue();
|
||||
|
||||
cliente.setNumerodoc(numDocString);
|
||||
cliente.setCpf(numDocString);
|
||||
cliente.setRg(numDocString);
|
||||
|
@ -337,7 +332,7 @@ public class ImportacaoClientesSrvpServiceImpl implements ImportacaoClientesSrvp
|
|||
break;
|
||||
case 14:
|
||||
try {
|
||||
cliente.setCep(new Long(Math.round(cell.getNumericCellValue())).toString());
|
||||
cliente.setCep(cell.getStringCellValue());
|
||||
}catch(Exception e) {
|
||||
log.error("Erro na gravação do registro. Favor revisar",e);
|
||||
}
|
||||
|
|
|
@ -185,4 +185,9 @@ public class ParadaServiceImpl implements ParadaService {
|
|||
public List<Parada> buscarDestinosPorOrigem(Integer origemId) {
|
||||
return paradaDAO.buscarDestinosPorOrigem(origemId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId, Integer[] listRuta){
|
||||
return paradaDAO.obtenerOrigenPorListRutaIds(orgaoConcendenteId,empresaId,listRuta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -666,4 +666,21 @@ public class RutaServiceImpl implements RutaService {
|
|||
public List<Ruta> buscaLikeComboBox(String stringConsulta) {
|
||||
return rutaDAO.buscaLikeComboBox(stringConsulta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorIds(Integer[] rutaIds){
|
||||
return rutaDAO.buscarPorIds(rutaIds);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarPorOrgaoEcasetaPeaje(OrgaoConcedente orgao, Integer[] listCasetaPeaje){
|
||||
return rutaDAO.buscarPorOrgaoEcasetaPeaje(orgao,listCasetaPeaje);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedenteParadaIds(Empresa empresa, OrgaoConcedente orgao, Integer[] lsParadaIds) {
|
||||
return rutaDAO.buscarRutasPorEmpresaOrgaoConcedenteParadaIds(empresa,orgao,lsParadaIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,13 +88,15 @@ public class SapServiceImpl implements SapService{
|
|||
|
||||
if(integrado == null) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_ERRO);
|
||||
log.error("Erro no envio/retorno da requisicao para integração SAP do fechamentoID: "+fechamentoCntcorrente.getFechamentocntcorrenteId());
|
||||
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());
|
||||
}else if(integrado.getString("Integration").equals("S")) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_OK);
|
||||
contador++;
|
||||
}else if(integrado.getString("Integration").equals("E")) {
|
||||
atualizaFechamento(fechamentoCntcorrente.getFechamentocntcorrenteId(), INTEGRACAO_SAP_ERRO);
|
||||
log.warn("Retorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
||||
throw new RuntimeException("Fechamento: "+fechamentoCntcorrente.getFechamentocntcorrenteId()+"\r\nRetorno enviado pelo SAP: \r\n"+integrado.getString("Message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +117,7 @@ public class SapServiceImpl implements SapService{
|
|||
Constante constante = constanteDAO.buscarPorNomeConstante(constanteString);
|
||||
|
||||
if( constante == null || constante.getValorconstante() == null || constante.getValorconstante().isEmpty() ) {
|
||||
throw new RuntimeException("Constante "+constanteString+" não cadastrada");
|
||||
throw new RuntimeException("Constante "+constanteString+" n<EFBFBD>o cadastrada");
|
||||
}
|
||||
|
||||
return constante.getValorconstante();
|
||||
|
|
|
@ -136,10 +136,10 @@ public class TarifaEmbarcadaServiceImpl implements TarifaEmbarcadaService {
|
|||
|
||||
Boolean podeAlterarTarifaMinima = Boolean.TRUE;
|
||||
|
||||
List<TarifaMinima> lsTarifaMinima = tarifaMinimaService.pesquisarEspecifico(marca, origem, destino, claseServicio, moneda);
|
||||
List<TarifaMinima> lsTarifaMinima = tarifaMinimaService.pesquisarEspecifico(marca, origem, destino, claseServicio, moneda,null);
|
||||
|
||||
if (lsTarifaMinima.isEmpty()) {
|
||||
lsTarifaMinima = tarifaMinimaService.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda);
|
||||
lsTarifaMinima = tarifaMinimaService.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda,null);
|
||||
}
|
||||
|
||||
log.debug("Moneda : " + moneda.getDescmoneda());
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
|||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinimaCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
|
@ -75,8 +76,8 @@ public class TarifaMinimaServiceImpl implements TarifaMinimaService {
|
|||
}
|
||||
|
||||
public List<TarifaMinima> pesquisar(Marca marca, Parada origem, Parada destino,
|
||||
ClaseServicio claseServicio, Moneda moneda) {
|
||||
return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda);
|
||||
ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa) {
|
||||
return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda,vigenciaTarifa);
|
||||
}
|
||||
|
||||
public List<TarifaMinima> pesquisar(BigDecimal valor, Moneda moneda,
|
||||
|
@ -91,12 +92,12 @@ public class TarifaMinimaServiceImpl implements TarifaMinimaService {
|
|||
}
|
||||
|
||||
public List<TarifaMinima> pesquisarEspecifico(Marca marca, Parada origem,
|
||||
Parada destino, ClaseServicio claseServicio, Moneda moneda) {
|
||||
return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda);
|
||||
Parada destino, ClaseServicio claseServicio, Moneda moneda, VigenciaTarifa vigenciaTarifa) {
|
||||
return tarifaMinimaDAO.pesquisar(marca, origem, destino, claseServicio, moneda,vigenciaTarifa);
|
||||
}
|
||||
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda) {
|
||||
return tarifaMinimaDAO.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda);
|
||||
public List<TarifaMinima> pesquisarOrigemDestinoTodos(Marca marca, Parada origem,Parada destino,ClaseServicio claseServicio, Moneda moneda,VigenciaTarifa vigenciaTarifa) {
|
||||
return tarifaMinimaDAO.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda,vigenciaTarifa);
|
||||
}
|
||||
|
||||
public List<TarifaMinima> buscarPorMarca(Marca marca, Moneda moneda) {
|
||||
|
|
|
@ -113,7 +113,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public void gerarAtualizarTabelaZerada(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException {
|
||||
public void gerarAtualizarTabelaZerada(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected,List<Integer> lsParadaIds) throws BusinessException {
|
||||
// Limpando a tabela de TARIFA_OFICIAL
|
||||
tarifaOficialDAO.limparTarifasOficiais(lsEmpresaSelected);
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
}
|
||||
|
||||
//Gerando as tarifas
|
||||
tarifaOficialDAO.gerarTabelaZerada(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
||||
tarifaOficialDAO.gerarTabelaZerada(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas,lsParadaIds);
|
||||
|
||||
x--;
|
||||
}while(x > 0);
|
||||
|
@ -142,10 +142,10 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer orgaoConcedenteId,boolean gerarTabelaZerada, List<Empresa> lsEmpresaSelected) throws BusinessException{
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer orgaoConcedenteId,boolean gerarTabelaZerada, List<Empresa> lsEmpresaSelected, List<Integer> lsParadaIds) throws BusinessException{
|
||||
|
||||
if (gerarTabelaZerada){
|
||||
gerarAtualizarTabelaZerada(lsRuta, orgaoConcedenteId, lsEmpresaSelected);
|
||||
gerarAtualizarTabelaZerada(lsRuta, orgaoConcedenteId, lsEmpresaSelected,lsParadaIds);
|
||||
}
|
||||
|
||||
List<Integer> idsEmpresas = new ArrayList<Integer>();
|
||||
|
@ -153,7 +153,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
idsEmpresas.add(e.getEmpresaId());
|
||||
}
|
||||
|
||||
tarifaOficialDAO.atualizarTaxaEmbarque(lsRuta, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
||||
tarifaOficialDAO.atualizarTaxaEmbarque(lsRuta, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas,lsParadaIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -209,14 +209,14 @@ public class TarifaServiceImpl implements TarifaService {
|
|||
}
|
||||
|
||||
public Boolean podeAlterarTarifaMinima(Tarifa tarifa, Marca marca, Parada origem,
|
||||
Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda) {
|
||||
Parada destino, ClaseServicio claseServicio, Plaza plaza, Moneda moneda, VigenciaTarifa vigenciaTarifa) {
|
||||
|
||||
Boolean podeAlterarTarifaMinima = Boolean.TRUE;
|
||||
|
||||
List<TarifaMinima> lsTarifaMinima = tarifaMinimaService.pesquisarEspecifico(marca, origem, destino, claseServicio, moneda);
|
||||
List<TarifaMinima> lsTarifaMinima = tarifaMinimaService.pesquisarEspecifico(marca, origem, destino, claseServicio, moneda,vigenciaTarifa);
|
||||
|
||||
if (lsTarifaMinima.isEmpty()) {
|
||||
lsTarifaMinima = tarifaMinimaService.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda);
|
||||
lsTarifaMinima = tarifaMinimaService.pesquisarOrigemDestinoTodos(marca, origem, destino, claseServicio, moneda,vigenciaTarifa);
|
||||
}
|
||||
|
||||
log.debug("Moneda : " + moneda.getDescmoneda());
|
||||
|
@ -242,6 +242,7 @@ public class TarifaServiceImpl implements TarifaService {
|
|||
return tarifaDAO.buscarTarifasAtivasPorVigencia(vigenciaTarifa);
|
||||
}
|
||||
|
||||
|
||||
// Metodo para gerar todas as tarifas possiveis
|
||||
@Transactional
|
||||
public Boolean generarTarifas(VigenciaTarifa vigencia, Marca marca) {
|
||||
|
@ -375,6 +376,7 @@ public class TarifaServiceImpl implements TarifaService {
|
|||
|
||||
|
||||
}
|
||||
return lsTarifa;
|
||||
return lsTarifa ;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue