- MERGE precoLinha
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@25799 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
acd3d37a2d
commit
dd97edc961
|
@ -2,6 +2,27 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
||||||
|
|
||||||
public interface OrgaoTramoDAO extends GenericDAO<OrgaoTramo, Integer> {
|
public interface OrgaoTramoDAO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hace la busqueda de la configuracion del coeficiente por tramo <br/>
|
||||||
|
*
|
||||||
|
* @param origenId
|
||||||
|
* @param destinoId
|
||||||
|
* @param viaId
|
||||||
|
* @param orgaoConcedenteId
|
||||||
|
* @param claseServicioId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public OrgaoTramo buscar(Integer origenId, Integer destinoId, Integer viaId, Integer orgaoConcedenteId, Short claseServicioId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Graba el registro en la base de datos
|
||||||
|
* @param orgaoTramo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public OrgaoTramo suscribir(OrgaoTramo orgaoTramo);
|
||||||
|
|
||||||
|
public Long count(String campo, Object o);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,11 @@ import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -13,20 +14,39 @@ import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
||||||
|
|
||||||
@Repository("orgaoTramoDAO")
|
@Repository("orgaoTramoDAO")
|
||||||
public class OrgaoTramoHibernateDAO extends GenericHibernateDAO<OrgaoTramo, Integer>
|
public class OrgaoTramoHibernateDAO extends GenericHibernateDAO<OrgaoTramo, Integer> implements OrgaoTramoDAO {
|
||||||
implements OrgaoTramoDAO {
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public OrgaoTramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public OrgaoTramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrgaoTramo> obtenerTodos() {
|
public OrgaoTramo buscar(Integer origenId, Integer destinoId, Integer viaId, Integer orgaoConcedenteId, Short claseServicioId) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = makeCriteria();
|
||||||
|
Criteria cTramo = c.createCriteria("tramo");
|
||||||
|
cTramo.add(Restrictions.eq("origem.paradaId", origenId));
|
||||||
|
cTramo.add(Restrictions.eq("destino.paradaId", destinoId));
|
||||||
|
cTramo.add(Restrictions.eq("via.viaId", viaId));
|
||||||
|
|
||||||
|
c.add(Restrictions.eq("orgaoConcedente.orgaoConcedenteId", orgaoConcedenteId));
|
||||||
|
c.add(Restrictions.eq("claseServicio.claseservicioId", claseServicioId));
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
return c.list();
|
c.setFetchMode("tramo", FetchMode.SELECT);
|
||||||
|
|
||||||
|
List<OrgaoTramo> list = c.list();
|
||||||
|
|
||||||
|
if (list.size() > 1) {
|
||||||
|
throw new RuntimeException("Erro ao consultar os dados do coeficiente por trecho. Retornou mais de um resultado");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,11 @@ import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaVO;
|
||||||
|
|
||||||
import org.hibernate.transform.AliasToBeanResultTransformer;
|
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,22 +4,23 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.TramoServicioDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.TramoServicio;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.TramoTiempo;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.TramoServicioDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TramoServicio;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
|
|
|
@ -1,7 +1,20 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
import java.util.List;
|
||||||
|
|
||||||
public interface CoeficienteTarifaService extends GenericService<CoeficienteTarifa, Integer>{
|
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
|
public interface CoeficienteTarifaService {
|
||||||
|
|
||||||
|
public List<CoeficienteTarifa> obtenerTodos();
|
||||||
|
|
||||||
|
public CoeficienteTarifa obtenerID(Integer id);
|
||||||
|
|
||||||
|
public CoeficienteTarifa suscribir(CoeficienteTarifa entidad);
|
||||||
|
|
||||||
|
public CoeficienteTarifa actualizacion(CoeficienteTarifa entidad);
|
||||||
|
|
||||||
|
public void borrar(CoeficienteTarifa entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,27 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pais;
|
import com.rjconsultores.ventaboletos.entidad.Pais;
|
||||||
import java.util.List;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author MCosso
|
* @author MCosso
|
||||||
*/
|
*/
|
||||||
public interface EstadoService extends GenericService<Estado, Integer> {
|
public interface EstadoService {
|
||||||
|
|
||||||
|
public List<Estado> obtenerTodos();
|
||||||
|
|
||||||
|
public Estado obtenerID(Integer id);
|
||||||
|
|
||||||
|
public Estado suscribir(Estado entidad);
|
||||||
|
|
||||||
|
public Estado actualizacion(Estado entidad);
|
||||||
|
|
||||||
|
public void borrar(Estado entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<Estado> buscar(String nombestado, Pais pais);
|
public List<Estado> buscar(String nombestado, Pais pais);
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
|
||||||
|
|
||||||
public interface OrgaoTramoService extends GenericService<OrgaoTramo, Integer> {
|
public interface OrgaoTramoService{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.rjconsultores.ventaboletos.entidad.Nodo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ public interface ParadaService {
|
||||||
|
|
||||||
public Parada suscribirActualizar(Parada entidad) throws BusinessException;
|
public Parada suscribirActualizar(Parada entidad) throws BusinessException;
|
||||||
|
|
||||||
public void borrar(Parada entidad);
|
public void borrar(Parada entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<Parada> buscar(String descparada, String cveparada, Ciudad ciudad,
|
public List<Parada> buscar(String descparada, String cveparada, Ciudad ciudad,
|
||||||
TipoParada tipoParada, Nodo nodo);
|
TipoParada tipoParada, Nodo nodo);
|
||||||
|
|
|
@ -4,15 +4,27 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RolOperativo;
|
import com.rjconsultores.ventaboletos.entidad.RolOperativo;
|
||||||
import java.util.List;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
*/
|
*/
|
||||||
public interface RolOperativoService extends GenericService<RolOperativo, Integer> {
|
public interface RolOperativoService {
|
||||||
|
|
||||||
|
public List<RolOperativo> obtenerTodos();
|
||||||
|
|
||||||
|
public RolOperativo obtenerID(Integer id);
|
||||||
|
|
||||||
|
public RolOperativo suscribir(RolOperativo entidad);
|
||||||
|
|
||||||
|
public RolOperativo actualizacion(RolOperativo entidad);
|
||||||
|
|
||||||
|
public void borrar(RolOperativo entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<RolOperativo> pesquisar(DiagramaAutobus diagrama, String rol);
|
public List<RolOperativo> pesquisar(DiagramaAutobus diagrama, String rol);
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,26 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface TipoParadaService extends GenericService<TipoParada, Integer> {
|
public interface TipoParadaService {
|
||||||
|
|
||||||
|
public List<TipoParada> obtenerTodos();
|
||||||
|
|
||||||
|
public TipoParada obtenerID(Integer id);
|
||||||
|
|
||||||
|
public TipoParada suscribir(TipoParada entidad);
|
||||||
|
|
||||||
|
public TipoParada actualizacion(TipoParada entidad);
|
||||||
|
|
||||||
|
public void borrar(TipoParada entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<TipoParada> buscar(String desctipo);
|
public List<TipoParada> buscar(String desctipo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO;
|
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO;
|
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoCoeficienteVO;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ public interface TramoRutaService {
|
||||||
* @param rutaTramoVO
|
* @param rutaTramoVO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SecuenciaRutaTramoVO> generarCombinacion(RutaTramoVO rutaTramoVO);
|
public List<SecuenciaRutaTramoCoeficienteVO> generarCombinacion(RutaTramoVO rutaTramoVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renera los datos de regreso para la ruta informada
|
* Renera los datos de regreso para la ruta informada
|
||||||
|
|
|
@ -38,7 +38,7 @@ public interface TramoServicioService extends GenericService<TramoServicio, Inte
|
||||||
/**
|
/**
|
||||||
* Genera un nuevo registro de tramo y tramo servicio sino ya existen.
|
* Genera un nuevo registro de tramo y tramo servicio sino ya existen.
|
||||||
*
|
*
|
||||||
* Si el tramo y tramo tiempo existen, el es retornado.
|
* Si el tramo y tramo tiempo existen, es retornado false.
|
||||||
*
|
*
|
||||||
* @param origen
|
* @param origen
|
||||||
* @param destino
|
* @param destino
|
||||||
|
|
|
@ -4,14 +4,26 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface ViaService extends GenericService<Via, Integer> {
|
public interface ViaService {
|
||||||
|
|
||||||
|
public List<Via> obtenerTodos();
|
||||||
|
|
||||||
|
public Via obtenerID(Integer id);
|
||||||
|
|
||||||
|
public Via suscribir(Via entidad);
|
||||||
|
|
||||||
|
public Via actualizacion(Via entidad);
|
||||||
|
|
||||||
|
public void borrar(Via entidad) throws RegistroConDependenciaException;
|
||||||
|
|
||||||
public List<Via> buscar(String nombvia);
|
public List<Via> buscar(String nombvia);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,10 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.CoeficienteTarifaDAO;
|
import com.rjconsultores.ventaboletos.dao.CoeficienteTarifaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.CoeficienteTarifaService;
|
import com.rjconsultores.ventaboletos.service.CoeficienteTarifaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
@Service("coeficienteTarifaService")
|
@Service("coeficienteTarifaService")
|
||||||
|
@ -17,6 +19,8 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CoeficienteTarifaDAO coeficienteTarifaDAO;
|
private CoeficienteTarifaDAO coeficienteTarifaDAO;
|
||||||
|
@Autowired
|
||||||
|
private OrgaoTramoDAO orgaoTramoDAO;
|
||||||
|
|
||||||
public List<CoeficienteTarifa> obtenerTodos() {
|
public List<CoeficienteTarifa> obtenerTodos() {
|
||||||
return coeficienteTarifaDAO.obtenerTodos();
|
return coeficienteTarifaDAO.obtenerTodos();
|
||||||
|
@ -45,7 +49,16 @@ public class CoeficienteTarifaServiceImpl implements CoeficienteTarifaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void borrar(CoeficienteTarifa entidad) {
|
public void borrar(CoeficienteTarifa entidad) throws RegistroConDependenciaException {
|
||||||
|
long count =0;
|
||||||
|
count +=orgaoTramoDAO.count("coeficienteTarifa1", entidad);
|
||||||
|
count +=orgaoTramoDAO.count("coeficienteTarifa2", entidad);
|
||||||
|
count +=orgaoTramoDAO.count("coeficienteTarifa3", entidad);
|
||||||
|
|
||||||
|
if (count >0 ){
|
||||||
|
throw new RegistroConDependenciaException();
|
||||||
|
}
|
||||||
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class EstadoServiceImpl implements EstadoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void borrar(Estado entidad) {
|
public void borrar(Estado entidad) throws RegistroConDependenciaException {
|
||||||
|
|
||||||
if (ciudadDAO.count("estado", entidad) > 0l){
|
if (ciudadDAO.count("estado", entidad) > 0l){
|
||||||
throw new RegistroConDependenciaException();
|
throw new RegistroConDependenciaException();
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
|
import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoTramoService;
|
import com.rjconsultores.ventaboletos.service.OrgaoTramoService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
||||||
|
|
||||||
@Service("orgaoTramoService")
|
@Service("orgaoTramoService")
|
||||||
public class OrgaoTramoServiceImpl implements OrgaoTramoService {
|
public class OrgaoTramoServiceImpl implements OrgaoTramoService {
|
||||||
|
@ -18,38 +12,4 @@ public class OrgaoTramoServiceImpl implements OrgaoTramoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrgaoTramoDAO orgaoTramoDAO;
|
private OrgaoTramoDAO orgaoTramoDAO;
|
||||||
|
|
||||||
public List<OrgaoTramo> obtenerTodos() {
|
|
||||||
return orgaoTramoDAO.obtenerTodos();
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrgaoTramo obtenerID(Integer id) {
|
|
||||||
return orgaoTramoDAO.obtenerID(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public OrgaoTramo suscribir(OrgaoTramo entidad) {
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.TRUE);
|
|
||||||
|
|
||||||
return orgaoTramoDAO.suscribir(entidad);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public OrgaoTramo actualizacion(OrgaoTramo entidad) {
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.TRUE);
|
|
||||||
|
|
||||||
return orgaoTramoDAO.actualizacion(entidad);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void borrar(OrgaoTramo entidad) {
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(Boolean.FALSE);
|
|
||||||
|
|
||||||
orgaoTramoDAO.actualizacion(entidad);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
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.EsquemaCorridaDAO;
|
import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.RolOperativoDAO;
|
import com.rjconsultores.ventaboletos.dao.RolOperativoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
||||||
|
@ -11,11 +18,6 @@ import com.rjconsultores.ventaboletos.entidad.RolOperativo;
|
||||||
import com.rjconsultores.ventaboletos.service.RolOperativoService;
|
import com.rjconsultores.ventaboletos.service.RolOperativoService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import 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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -75,4 +77,5 @@ public class RolOperativoServiceImpl implements RolOperativoService {
|
||||||
public List<RolOperativo> buscar(String descroloperativo) {
|
public List<RolOperativo> buscar(String descroloperativo) {
|
||||||
return rolOperativoDAO.buscar(descroloperativo);
|
return rolOperativoDAO.buscar(descroloperativo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,11 @@ import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaEscalaVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaGroupVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaGroupVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.TarifaOficialEscalaVO;
|
import com.rjconsultores.ventaboletos.vo.tarifa.TarifaOficialEscalaVO;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -12,13 +12,20 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.OrgaoTramoDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.RutaDAO;
|
import com.rjconsultores.ventaboletos.dao.RutaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.TramoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.dao.TramoServicioDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.OrgaoTramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
|
import com.rjconsultores.ventaboletos.entidad.RutaCombinacion;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaSecuencia;
|
import com.rjconsultores.ventaboletos.entidad.RutaSecuencia;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TramoServicio;
|
import com.rjconsultores.ventaboletos.entidad.TramoServicio;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
@ -31,6 +38,7 @@ import com.rjconsultores.ventaboletos.service.TramoServicioService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.HoraSistema;
|
import com.rjconsultores.ventaboletos.utilerias.HoraSistema;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO;
|
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoCoeficienteVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO;
|
import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO;
|
||||||
|
|
||||||
@Service("tramoRutaService")
|
@Service("tramoRutaService")
|
||||||
|
@ -49,9 +57,16 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
private TramoServicioService tramoServicioService;
|
private TramoServicioService tramoServicioService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RutaDAO rutaDAO;
|
private RutaDAO rutaDAO;
|
||||||
|
@Autowired
|
||||||
|
private OrgaoTramoDAO orgaoTramoDAO;
|
||||||
|
@Autowired
|
||||||
|
private TramoServicioDAO tramoServicioDAO;
|
||||||
|
@Autowired
|
||||||
|
private TramoDAO tramoDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hace la validación de los datos del rutaTramoVO
|
* Hace la validación de los datos del rutaTramoVO
|
||||||
|
*
|
||||||
* @param rutaTramoVO
|
* @param rutaTramoVO
|
||||||
* @throws BusinessException
|
* @throws BusinessException
|
||||||
*/
|
*/
|
||||||
|
@ -69,14 +84,15 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
if (rutaTramoVO.getLsCombinacionRutaTramoVO().isEmpty()) {
|
if (rutaTramoVO.getLsCombinacionRutaTramoVO().isEmpty()) {
|
||||||
throw new BusinessException("tramoRutaServiceImpl.msg.combinacionObligatorio");
|
throw new BusinessException("tramoRutaServiceImpl.msg.combinacionObligatorio");
|
||||||
}
|
}
|
||||||
for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
for (SecuenciaRutaTramoCoeficienteVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
||||||
if (s.getTramoId() != null) {
|
if (s.getTramoId() != null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((s.getOrigen() == null) || (s.getDestino() == null) || (s.getVia() == null)
|
if ((s.getOrigen() == null) || (s.getDestino() == null) || (s.getVia() == null)
|
||||||
|| (s.getKmReal() == null) || (s.getSecuencia() == null) || (s.getTiempoRecorrido() == null)) {
|
|| (s.getKmReal() == null) || (s.getSecuencia() == null) || (s.getTiempoRecorrido() == null)
|
||||||
throw new BusinessException("tramoRutaServiceImpl.msg.cambosObligatoriosCombinacion", new Object[]{s.getOrigen(),
|
|| (s.getCoeficienteTarifa1() == null) || (s.getKmCoeficiente1() == null) || (s.getKmCoeficiente1() == 0)) {
|
||||||
s.getDestino()});
|
|
||||||
|
throw new BusinessException("tramoRutaServiceImpl.msg.cambosObligatoriosCombinacion", new Object[] { s.getOrigen(),s.getDestino() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsSecuenciaRutaTramoVO()) {
|
for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsSecuenciaRutaTramoVO()) {
|
||||||
|
@ -99,10 +115,9 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
|
|
||||||
// Genero los tramos y tramos servicios de la combinacion que no existen
|
// Genero los tramos y tramos servicios de la combinacion que no existen
|
||||||
// Aqui si genera tambien los tramos de la secuencia
|
// Aqui si genera tambien los tramos de la secuencia
|
||||||
for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
for (SecuenciaRutaTramoCoeficienteVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
||||||
log.debug("Origen:" + s.getOrigen() + ";Destino:" + s.getDestino() + ";Via:" + s.getVia());
|
log.debug("Origen:" + s.getOrigen() + ";Destino:" + s.getDestino() + ";Via:" + s.getVia());
|
||||||
boolean fueGenerado = tramoServicioService.generarTramoTiempo(s.getOrigen(), s.getDestino(), s.getVia(), s.getKmReal(),
|
boolean fueGenerado = generarDatos(s, rutaTramoVO.getClaseServicio(), rutaTramoVO.getOrgaoConcedente());
|
||||||
s.getTiempoRecorrido().getFecha(), rutaTramoVO.getClaseServicio());
|
|
||||||
log.debug("Fue Generado:" + fueGenerado);
|
log.debug("Fue Generado:" + fueGenerado);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +164,7 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
rutaSecuencia = rutaSecuenciaService.suscribir(rutaSecuencia);
|
rutaSecuencia = rutaSecuenciaService.suscribir(rutaSecuencia);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (SecuenciaRutaTramoVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
for (SecuenciaRutaTramoCoeficienteVO s : rutaTramoVO.getLsCombinacionRutaTramoVO()) {
|
||||||
RutaCombinacion rutaCombinacion = new RutaCombinacion();
|
RutaCombinacion rutaCombinacion = new RutaCombinacion();
|
||||||
rutaCombinacion.setIndventa(Boolean.TRUE);
|
rutaCombinacion.setIndventa(Boolean.TRUE);
|
||||||
rutaCombinacion.setRuta(ruta);
|
rutaCombinacion.setRuta(ruta);
|
||||||
|
@ -185,6 +200,7 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
|
|
||||||
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoRegresoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoRegresoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
||||||
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoIdaVO = new ArrayList<SecuenciaRutaTramoVO>(rutaTramoVO.getLsSecuenciaRutaTramoVO());
|
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoIdaVO = new ArrayList<SecuenciaRutaTramoVO>(rutaTramoVO.getLsSecuenciaRutaTramoVO());
|
||||||
|
//Reordena a lista
|
||||||
Collections.sort(lsSecuenciaRutaTramoIdaVO, new Comparator<SecuenciaRutaTramoVO>() {
|
Collections.sort(lsSecuenciaRutaTramoIdaVO, new Comparator<SecuenciaRutaTramoVO>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -196,7 +212,7 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
int secuencia = 0;
|
int secuencia = 0;
|
||||||
|
|
||||||
for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoIdaVO) {
|
for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoIdaVO) {
|
||||||
TramoServicio tramoServicio = tramoServicioService.buscar(s.getOrigen(), s.getDestino(), s.getVia(), rutaTramoVO.getClaseServicio());
|
TramoServicio tramoServicio = tramoServicioService.buscar( s.getDestino(),s.getOrigen(), s.getVia(), rutaTramoVO.getClaseServicio());
|
||||||
if (tramoServicio != null) {
|
if (tramoServicio != null) {
|
||||||
s.setTramoId(tramoServicio.getTramo().getTramoId());
|
s.setTramoId(tramoServicio.getTramo().getTramoId());
|
||||||
s.setTramoServicioId(tramoServicio.getTramoservicioId());
|
s.setTramoServicioId(tramoServicio.getTramoservicioId());
|
||||||
|
@ -209,27 +225,51 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
}
|
}
|
||||||
rutaTramoRegresoVO.setLsSecuenciaRutaTramoVO(lsSecuenciaRutaTramoRegresoVO);
|
rutaTramoRegresoVO.setLsSecuenciaRutaTramoVO(lsSecuenciaRutaTramoRegresoVO);
|
||||||
|
|
||||||
List<SecuenciaRutaTramoVO> lsCombinacionRutaTramoRegresoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
List<SecuenciaRutaTramoCoeficienteVO> lsCombinacionRutaTramoRegresoVO = new ArrayList<SecuenciaRutaTramoCoeficienteVO>();
|
||||||
List<SecuenciaRutaTramoVO> lsCombinacionTramoIdaVO = new ArrayList<SecuenciaRutaTramoVO>(rutaTramoVO.getLsCombinacionRutaTramoVO());
|
List<SecuenciaRutaTramoCoeficienteVO> lsCombinacionTramoIdaVO = new ArrayList<SecuenciaRutaTramoCoeficienteVO>(rutaTramoVO.getLsCombinacionRutaTramoVO());
|
||||||
Collections.sort(lsCombinacionTramoIdaVO, new Comparator<SecuenciaRutaTramoVO>() {
|
Collections.sort(lsCombinacionTramoIdaVO, new Comparator<SecuenciaRutaTramoCoeficienteVO>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2) {
|
public int compare(SecuenciaRutaTramoCoeficienteVO o1, SecuenciaRutaTramoCoeficienteVO o2) {
|
||||||
return o2.getSecuencia().compareTo(o1.getSecuencia());
|
return o2.getSecuencia().compareTo(o1.getSecuencia());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
secuencia = 0;
|
secuencia = 0;
|
||||||
for (SecuenciaRutaTramoVO s : lsCombinacionTramoIdaVO) {
|
for (SecuenciaRutaTramoCoeficienteVO s : lsCombinacionTramoIdaVO) {
|
||||||
TramoServicio tramoServicio = tramoServicioService.buscar(s.getOrigen(), s.getDestino(), s.getVia(), rutaTramoVO.getClaseServicio());
|
TramoServicio tramoServicio = tramoServicioService.buscar(s.getDestino(), s.getOrigen(), s.getVia(), rutaTramoVO.getClaseServicio());
|
||||||
if (tramoServicio != null) {
|
if (tramoServicio != null) {
|
||||||
s.setTramoId(tramoServicio.getTramo().getTramoId());
|
s.setTramoId(tramoServicio.getTramo().getTramoId());
|
||||||
s.setTramoServicioId(tramoServicio.getTramoservicioId());
|
s.setTramoServicioId(tramoServicio.getTramoservicioId());
|
||||||
|
|
||||||
lsCombinacionRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmReal(), s.getTiempoRecorrido(),
|
SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO = new SecuenciaRutaTramoCoeficienteVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmReal(), s.getTiempoRecorrido(),
|
||||||
s.getTramoId(), s.getTramoServicioId(), rutaTramoRegresoVO.getNumRuta(), rutaTramoRegresoVO.getIndSentidoIda()));
|
s.getTramoId(), s.getTramoServicioId(), rutaTramoRegresoVO.getNumRuta());
|
||||||
|
|
||||||
|
OrgaoTramo orgaoTramo = orgaoTramoDAO.buscar(s.getDestino().getParadaId(), s.getOrigen().getParadaId(), s.getVia().getViaId(), rutaTramoVO.getOrgaoConcedente().getOrgaoConcedenteId(), rutaTramoVO.getClaseServicio().getClaseservicioId());
|
||||||
|
|
||||||
|
if (orgaoTramo != null){
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setOrgaoTramoId(orgaoTramo.getOrgaoTramoId());
|
||||||
|
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1(orgaoTramo.getCoeficienteTarifa1());
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setKmCoeficiente1(orgaoTramo.getKmCoeficiente1());
|
||||||
|
|
||||||
|
if (orgaoTramo.getCoeficienteTarifa2()!=null){
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2(orgaoTramo.getCoeficienteTarifa2());
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setKmCoeficiente2(orgaoTramo.getKmCoeficiente2());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lsCombinacionRutaTramoRegresoVO.add(secuenciaRutaTramoCoeficienteVO);
|
||||||
} else {
|
} else {
|
||||||
lsCombinacionRutaTramoRegresoVO.add(new SecuenciaRutaTramoVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmReal(), s.getTiempoRecorrido(),rutaTramoRegresoVO.getNumRuta(), rutaTramoRegresoVO.getIndSentidoIda()));
|
SecuenciaRutaTramoCoeficienteVO secuenciaRutaTramoCoeficienteVO = new SecuenciaRutaTramoCoeficienteVO(s.getDestino(), s.getOrigen(), s.getVia(), ++secuencia, s.getKmReal(), s.getTiempoRecorrido(), rutaTramoRegresoVO.getNumRuta());
|
||||||
|
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa1(s.getCoeficienteTarifa1());
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setKmCoeficiente1(s.getKmCoeficiente1());
|
||||||
|
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setCoeficienteTarifa2(s.getCoeficienteTarifa2());
|
||||||
|
secuenciaRutaTramoCoeficienteVO.setKmCoeficiente2(s.getKmCoeficiente2());
|
||||||
|
|
||||||
|
lsCombinacionRutaTramoRegresoVO.add(secuenciaRutaTramoCoeficienteVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -239,9 +279,10 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SecuenciaRutaTramoVO> generarCombinacion(RutaTramoVO rutaTramoVO) {
|
public List<SecuenciaRutaTramoCoeficienteVO> generarCombinacion(RutaTramoVO rutaTramoVO) {
|
||||||
|
// una nueva lista que va a ser ordenada. Con eso, no afecta la lista original
|
||||||
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>(rutaTramoVO.getLsSecuenciaRutaTramoVO());
|
List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>(rutaTramoVO.getLsSecuenciaRutaTramoVO());
|
||||||
List<SecuenciaRutaTramoVO> lsSecuenciaCombinacionRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
List<SecuenciaRutaTramoCoeficienteVO> lsSecuenciaCombinacionRutaTramoVO = new ArrayList<SecuenciaRutaTramoCoeficienteVO>();
|
||||||
|
|
||||||
Collections.sort(lsSecuenciaRutaTramoVO, new Comparator<SecuenciaRutaTramoVO>() {
|
Collections.sort(lsSecuenciaRutaTramoVO, new Comparator<SecuenciaRutaTramoVO>() {
|
||||||
|
|
||||||
|
@ -250,15 +291,6 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
return o1.getSecuencia().compareTo(o2.getSecuencia());
|
return o1.getSecuencia().compareTo(o2.getSecuencia());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Collections.sort(lsSecuenciaCombinacionRutaTramoVO, new
|
|
||||||
// Comparator<SecuenciaRutaTramoVO>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public int compare(SecuenciaRutaTramoVO o1, SecuenciaRutaTramoVO o2)
|
|
||||||
// {
|
|
||||||
// return o1.getSecuencia().compareTo(o2.getSecuencia());
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
int qtdTramos = lsSecuenciaRutaTramoVO.size();
|
int qtdTramos = lsSecuenciaRutaTramoVO.size();
|
||||||
int secuencia = 0;
|
int secuencia = 0;
|
||||||
|
@ -267,18 +299,15 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
Parada origen = secuenciaInicial.getOrigen();
|
Parada origen = secuenciaInicial.getOrigen();
|
||||||
BigDecimal totalKmsReal = secuenciaInicial.getKmReal();
|
BigDecimal totalKmsReal = secuenciaInicial.getKmReal();
|
||||||
HoraSistema totalTiempoRecorrido = secuenciaInicial.getTiempoRecorrido();
|
HoraSistema totalTiempoRecorrido = secuenciaInicial.getTiempoRecorrido();
|
||||||
boolean primeraCombinacion = true;
|
|
||||||
int j = i + 1;
|
int j = i + 1;
|
||||||
for (; j < (qtdTramos); j++) {
|
for (; j < (qtdTramos); j++) {
|
||||||
Parada destino = lsSecuenciaRutaTramoVO.get(j).getOrigen();
|
Parada destino = lsSecuenciaRutaTramoVO.get(j).getOrigen();
|
||||||
|
|
||||||
Via via = secuenciaInicial.getVia();
|
Via via = secuenciaInicial.getVia();
|
||||||
// if (primeraCombinacion) {
|
|
||||||
// via = secuenciaInicial.getVia();
|
|
||||||
// }
|
|
||||||
|
|
||||||
SecuenciaRutaTramoVO nuevaSecuencia = new SecuenciaRutaTramoVO(origen, destino, via, ++secuencia,
|
SecuenciaRutaTramoCoeficienteVO nuevaSecuencia = new SecuenciaRutaTramoCoeficienteVO(origen, destino, via, ++secuencia,
|
||||||
totalKmsReal, totalTiempoRecorrido, rutaTramoVO.getNumRuta(), rutaTramoVO.getIndSentidoIda());
|
totalKmsReal, totalTiempoRecorrido, rutaTramoVO.getNumRuta());
|
||||||
|
|
||||||
if (via != null) {
|
if (via != null) {
|
||||||
TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio());
|
TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio());
|
||||||
|
@ -291,7 +320,20 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId());
|
nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
OrgaoTramo orgaoTramo = orgaoTramoDAO.buscar(origen.getParadaId(), destino.getParadaId(), via.getViaId(), rutaTramoVO.getOrgaoConcedente().getOrgaoConcedenteId(), rutaTramoVO.getClaseServicio().getClaseservicioId());
|
||||||
|
if (orgaoTramo != null) {
|
||||||
|
nuevaSecuencia.setCoeficienteTarifa1(orgaoTramo.getCoeficienteTarifa1());
|
||||||
|
nuevaSecuencia.setKmCoeficiente1(orgaoTramo.getKmCoeficiente1());
|
||||||
|
nuevaSecuencia.setCoeficienteTarifa2(orgaoTramo.getCoeficienteTarifa2());
|
||||||
|
nuevaSecuencia.setKmCoeficiente2(orgaoTramo.getKmCoeficiente2());
|
||||||
|
nuevaSecuencia.setOrgaoTramoId(orgaoTramo.getOrgaoTramoId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nuevaSecuencia.getKmCoeficiente1() == null) {
|
||||||
|
nuevaSecuencia.setKmCoeficiente1(nuevaSecuencia.getKmReal().intValue());
|
||||||
|
}
|
||||||
|
|
||||||
lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia);
|
lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia);
|
||||||
|
|
||||||
totalKmsReal = totalKmsReal.add(lsSecuenciaRutaTramoVO.get(j).getKmReal());
|
totalKmsReal = totalKmsReal.add(lsSecuenciaRutaTramoVO.get(j).getKmReal());
|
||||||
|
@ -300,17 +342,14 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:"
|
log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:"
|
||||||
+ nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";hora:" + nuevaSecuencia.getTiempoRecorrido());
|
+ nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";hora:" + nuevaSecuencia.getTiempoRecorrido());
|
||||||
|
|
||||||
primeraCombinacion = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Parada destino = lsSecuenciaRutaTramoVO.get(qtdTramos - 1).getDestino();
|
Parada destino = lsSecuenciaRutaTramoVO.get(qtdTramos - 1).getDestino();
|
||||||
|
|
||||||
Via via = secuenciaInicial.getVia();
|
Via via = secuenciaInicial.getVia();
|
||||||
// if (primeraCombinacion) {
|
|
||||||
// via = secuenciaInicial.getVia();
|
|
||||||
// }
|
|
||||||
|
|
||||||
SecuenciaRutaTramoVO nuevaSecuencia = new SecuenciaRutaTramoVO(origen, destino, via, ++secuencia,
|
SecuenciaRutaTramoCoeficienteVO nuevaSecuencia = new SecuenciaRutaTramoCoeficienteVO(origen, destino, via, ++secuencia,
|
||||||
totalKmsReal, totalTiempoRecorrido, rutaTramoVO.getNumRuta(), rutaTramoVO.getIndSentidoIda());
|
totalKmsReal, totalTiempoRecorrido, rutaTramoVO.getNumRuta());
|
||||||
if (via != null) {
|
if (via != null) {
|
||||||
TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio());
|
TramoServicio tramoServicio = tramoServicioService.buscar(origen, destino, via, rutaTramoVO.getClaseServicio());
|
||||||
if (tramoServicio != null) {
|
if (tramoServicio != null) {
|
||||||
|
@ -321,9 +360,19 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
nuevaSecuencia.setTramoId(tramoServicio.getTramo().getTramoId());
|
nuevaSecuencia.setTramoId(tramoServicio.getTramo().getTramoId());
|
||||||
nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId());
|
nuevaSecuencia.setTramoServicioId(tramoServicio.getTramoservicioId());
|
||||||
}
|
}
|
||||||
|
OrgaoTramo orgaoTramo = orgaoTramoDAO.buscar(origen.getParadaId(), destino.getParadaId(), via.getViaId(), rutaTramoVO.getOrgaoConcedente().getOrgaoConcedenteId(), rutaTramoVO.getClaseServicio().getClaseservicioId());
|
||||||
|
if (orgaoTramo != null) {
|
||||||
|
nuevaSecuencia.setCoeficienteTarifa1(orgaoTramo.getCoeficienteTarifa1());
|
||||||
|
nuevaSecuencia.setKmCoeficiente1(orgaoTramo.getKmCoeficiente1());
|
||||||
|
nuevaSecuencia.setCoeficienteTarifa2(orgaoTramo.getCoeficienteTarifa2());
|
||||||
|
nuevaSecuencia.setKmCoeficiente2(orgaoTramo.getKmCoeficiente2());
|
||||||
|
nuevaSecuencia.setOrgaoTramoId(orgaoTramo.getOrgaoTramoId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nuevaSecuencia.getKmCoeficiente1() == null) {
|
||||||
|
nuevaSecuencia.setKmCoeficiente1(nuevaSecuencia.getKmReal().intValue());
|
||||||
}
|
}
|
||||||
nuevaSecuencia.setNumRuta(rutaTramoVO.getNumRuta());
|
nuevaSecuencia.setNumRuta(rutaTramoVO.getNumRuta());
|
||||||
nuevaSecuencia.setIndSentidoIda(rutaTramoVO.getIndSentidoIda());
|
|
||||||
lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia);
|
lsSecuenciaCombinacionRutaTramoVO.add(nuevaSecuencia);
|
||||||
log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:"
|
log.debug("Origen:" + nuevaSecuencia.getOrigen() + ";Destino:" + nuevaSecuencia.getDestino() + ";Via:"
|
||||||
+ nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";hora:" + nuevaSecuencia.getTiempoRecorrido());
|
+ nuevaSecuencia.getVia() + ";KmsReal:" + nuevaSecuencia.getKmReal() + ";hora:" + nuevaSecuencia.getTiempoRecorrido());
|
||||||
|
@ -332,4 +381,64 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
||||||
|
|
||||||
return lsSecuenciaCombinacionRutaTramoVO;
|
return lsSecuenciaCombinacionRutaTramoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Genera los datos de tramo, tramo tiempo e coeficiente tarifa sino existen los datos
|
||||||
|
*
|
||||||
|
* @param secuencia
|
||||||
|
* @param claseServicio
|
||||||
|
* @param orgaoConcedente
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean generarDatos(SecuenciaRutaTramoCoeficienteVO secuencia, ClaseServicio claseServicio, OrgaoConcedente orgaoConcedente) {
|
||||||
|
TramoServicio tramoServicio = tramoServicioDAO.buscar(secuencia.getOrigen(), secuencia.getDestino(), secuencia.getVia(), claseServicio);
|
||||||
|
|
||||||
|
Tramo tramo = null;
|
||||||
|
if (tramoServicio == null) {
|
||||||
|
tramo = tramoService.buscar(secuencia.getOrigen(), secuencia.getDestino(), secuencia.getVia());
|
||||||
|
if (tramo == null) {
|
||||||
|
tramo = new Tramo();
|
||||||
|
tramo.setDesctramo(tramoService.gerarDescripcionTramo(secuencia.getOrigen(), secuencia.getDestino(), secuencia.getVia()));
|
||||||
|
tramo.setOrigem(secuencia.getOrigen());
|
||||||
|
tramo.setDestino(secuencia.getDestino());
|
||||||
|
tramo.setKmReal(secuencia.getKmReal());
|
||||||
|
tramo.setVia(secuencia.getVia());
|
||||||
|
tramo.setActivo(Boolean.TRUE);
|
||||||
|
tramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
tramo.setFecmodif(new java.util.Date());
|
||||||
|
|
||||||
|
tramo = tramoDAO.suscribir(tramo);
|
||||||
|
}
|
||||||
|
tramoServicio = new TramoServicio();
|
||||||
|
tramoServicio.setClaseServicio(claseServicio);
|
||||||
|
tramoServicio.setTramo(tramo);
|
||||||
|
tramoServicio.setTiemporecorrido(secuencia.getTiempoRecorrido().getFecha());
|
||||||
|
|
||||||
|
tramoServicio = tramoServicioService.suscribir(tramoServicio);
|
||||||
|
|
||||||
|
if (secuencia.getOrgaoTramoId() == null) {
|
||||||
|
OrgaoTramo orgaoTramo = new OrgaoTramo();
|
||||||
|
orgaoTramo.setClaseServicio(claseServicio);
|
||||||
|
orgaoTramo.setOrgaoConcedente(orgaoConcedente);
|
||||||
|
orgaoTramo.setTramo(tramo);
|
||||||
|
|
||||||
|
orgaoTramo.setActivo(Boolean.TRUE);
|
||||||
|
orgaoTramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
orgaoTramo.setFecmodif(new java.util.Date());
|
||||||
|
orgaoTramo.setCoeficienteTarifa1(secuencia.getCoeficienteTarifa1());
|
||||||
|
orgaoTramo.setKmCoeficiente1(secuencia.getKmCoeficiente1());
|
||||||
|
|
||||||
|
if (secuencia.getCoeficienteTarifa2() != null) {
|
||||||
|
orgaoTramo.setCoeficienteTarifa2(secuencia.getCoeficienteTarifa2());
|
||||||
|
orgaoTramo.setKmCoeficiente2(secuencia.getKmCoeficiente2());
|
||||||
|
}
|
||||||
|
|
||||||
|
orgaoTramo = orgaoTramoDAO.suscribir(orgaoTramo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,12 @@ import org.zkoss.util.resource.Labels;
|
||||||
*
|
*
|
||||||
* @author gleimar
|
* @author gleimar
|
||||||
*/
|
*/
|
||||||
public class RegistroConDependenciaException extends RuntimeException {
|
public class RegistroConDependenciaException extends Exception {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public RegistroConDependenciaException() {
|
public RegistroConDependenciaException() {
|
||||||
super(Labels.getLabel("MSG.exception.RegistroConDependenciaException"));
|
super(Labels.getLabel("MSG.exception.RegistroConDependenciaException"));
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class RutaTramoVO {
|
||||||
private ClaseServicio claseServicio;
|
private ClaseServicio claseServicio;
|
||||||
private OrgaoConcedente orgaoConcedente;
|
private OrgaoConcedente orgaoConcedente;
|
||||||
private List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoVO;
|
private List<SecuenciaRutaTramoVO> lsSecuenciaRutaTramoVO;
|
||||||
private List<SecuenciaRutaTramoVO> lsCombinacionRutaTramoVO;
|
private List<SecuenciaRutaTramoCoeficienteVO> lsCombinacionRutaTramoVO;
|
||||||
private List<Empresa> lsEmpresa;
|
private List<Empresa> lsEmpresa;
|
||||||
private String prefixo;
|
private String prefixo;
|
||||||
private String descRuta;
|
private String descRuta;
|
||||||
|
@ -25,7 +25,7 @@ public class RutaTramoVO {
|
||||||
public RutaTramoVO() {
|
public RutaTramoVO() {
|
||||||
lsSecuenciaRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
lsSecuenciaRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
||||||
lsEmpresa = new ArrayList<Empresa>();
|
lsEmpresa = new ArrayList<Empresa>();
|
||||||
lsCombinacionRutaTramoVO = new ArrayList<SecuenciaRutaTramoVO>();
|
lsCombinacionRutaTramoVO = new ArrayList<SecuenciaRutaTramoCoeficienteVO>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getVentaHandHeld() {
|
public Boolean getVentaHandHeld() {
|
||||||
|
@ -87,11 +87,11 @@ public class RutaTramoVO {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SecuenciaRutaTramoVO> getLsCombinacionRutaTramoVO() {
|
public List<SecuenciaRutaTramoCoeficienteVO> getLsCombinacionRutaTramoVO() {
|
||||||
return Collections.unmodifiableList(lsCombinacionRutaTramoVO);
|
return Collections.unmodifiableList(lsCombinacionRutaTramoVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLsCombinacionRutaTramoVO(List<SecuenciaRutaTramoVO> lsCombinacionRutaTramoVO) {
|
public void setLsCombinacionRutaTramoVO(List<SecuenciaRutaTramoCoeficienteVO> lsCombinacionRutaTramoVO) {
|
||||||
this.lsCombinacionRutaTramoVO = lsCombinacionRutaTramoVO;
|
this.lsCombinacionRutaTramoVO = lsCombinacionRutaTramoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,198 @@
|
||||||
|
package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.HoraSistema;
|
||||||
|
|
||||||
|
public class SecuenciaRutaTramoCoeficienteVO {
|
||||||
|
|
||||||
|
private Parada origen;
|
||||||
|
private Parada destino;
|
||||||
|
private Via via;
|
||||||
|
private Integer secuencia;
|
||||||
|
private BigDecimal kmReal;
|
||||||
|
private HoraSistema tiempoRecorrido;
|
||||||
|
private Integer tramoId;
|
||||||
|
private Integer tramoServicioId;
|
||||||
|
private Integer numRuta;
|
||||||
|
private Integer orgaoTramoId;
|
||||||
|
private CoeficienteTarifa coeficienteTarifa1;
|
||||||
|
private Integer kmCoeficiente1;
|
||||||
|
private CoeficienteTarifa coeficienteTarifa2;
|
||||||
|
private Integer kmCoeficiente2;
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal, HoraSistema tiempoRecorrido) {
|
||||||
|
super();
|
||||||
|
this.origen = origen;
|
||||||
|
this.destino = destino;
|
||||||
|
this.via = via;
|
||||||
|
this.secuencia = secuencia;
|
||||||
|
this.kmReal = kmReal;
|
||||||
|
this.setTiempoRecorrido(tiempoRecorrido);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal, HoraSistema tiempoRecorrido, Integer numruta) {
|
||||||
|
this(origen, destino, via, secuencia, kmReal, tiempoRecorrido);
|
||||||
|
this.numRuta = numruta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Integer secuencia, Via via) {
|
||||||
|
super();
|
||||||
|
this.origen = origen;
|
||||||
|
this.destino = destino;
|
||||||
|
this.secuencia = secuencia;
|
||||||
|
this.via = via;
|
||||||
|
this.setTiempoRecorrido(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Integer secuencia, Via via, Integer numruta) {
|
||||||
|
this(origen, destino, secuencia, via);
|
||||||
|
this.numRuta = numruta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal,
|
||||||
|
HoraSistema tiempoRecorrido, Integer tramoId, Integer tramoServicioId) {
|
||||||
|
super();
|
||||||
|
this.origen = origen;
|
||||||
|
this.destino = destino;
|
||||||
|
this.via = via;
|
||||||
|
this.secuencia = secuencia;
|
||||||
|
this.kmReal = kmReal;
|
||||||
|
this.setTiempoRecorrido(tiempoRecorrido);
|
||||||
|
this.tramoId = tramoId;
|
||||||
|
this.tramoServicioId = tramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecuenciaRutaTramoCoeficienteVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal,
|
||||||
|
HoraSistema tiempoRecorrido, Integer tramoId, Integer tramoServicioId, Integer numruta) {
|
||||||
|
this(origen, destino, via, secuencia, kmReal, tiempoRecorrido, tramoId, tramoServicioId);
|
||||||
|
this.numRuta = numruta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getOrigen() {
|
||||||
|
return origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigen(Parada origen) {
|
||||||
|
this.origen = origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HoraSistema getTiempoRecorrido() {
|
||||||
|
return tiempoRecorrido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTiempoRecorrido(HoraSistema tiempoRecorrido) {
|
||||||
|
if (tiempoRecorrido == null) {
|
||||||
|
tiempoRecorrido = new HoraSistema();
|
||||||
|
}
|
||||||
|
this.tiempoRecorrido = tiempoRecorrido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(Parada destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Via getVia() {
|
||||||
|
return via;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVia(Via via) {
|
||||||
|
this.via = via;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSecuencia() {
|
||||||
|
return secuencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecuencia(Integer secuencia) {
|
||||||
|
this.secuencia = secuencia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getKmReal() {
|
||||||
|
return kmReal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKmReal(BigDecimal kmReal) {
|
||||||
|
this.kmReal = kmReal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTramoId() {
|
||||||
|
return tramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTramoId(Integer tramoId) {
|
||||||
|
this.tramoId = tramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTramoServicioId() {
|
||||||
|
return tramoServicioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTramoServicioId(Integer tramoServicioId) {
|
||||||
|
this.tramoServicioId = tramoServicioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumRuta() {
|
||||||
|
return numRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumRuta(Integer numRuta) {
|
||||||
|
this.numRuta = numRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
HoraSistema hora = getTiempoRecorrido();
|
||||||
|
|
||||||
|
return secuencia + ";" + origen + ";" + destino + ";" + via + ";" + kmReal + ";"
|
||||||
|
+ ((hora != null) ? hora.getHora() : "-") + ";" + ((hora != null) ? hora.getMinuto() : "-");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrgaoTramoId() {
|
||||||
|
return orgaoTramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgaoTramoId(Integer orgaoTramoId) {
|
||||||
|
this.orgaoTramoId = orgaoTramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CoeficienteTarifa getCoeficienteTarifa1() {
|
||||||
|
return coeficienteTarifa1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoeficienteTarifa1(CoeficienteTarifa coeficienteTarifa1) {
|
||||||
|
this.coeficienteTarifa1 = coeficienteTarifa1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getKmCoeficiente1() {
|
||||||
|
return kmCoeficiente1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKmCoeficiente1(Integer kmCoeficiente1) {
|
||||||
|
this.kmCoeficiente1 = kmCoeficiente1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CoeficienteTarifa getCoeficienteTarifa2() {
|
||||||
|
return coeficienteTarifa2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoeficienteTarifa2(CoeficienteTarifa coeficienteTarifa2) {
|
||||||
|
this.coeficienteTarifa2 = coeficienteTarifa2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getKmCoeficiente2() {
|
||||||
|
return kmCoeficiente2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKmCoeficiente2(Integer kmCoeficiente2) {
|
||||||
|
this.kmCoeficiente2 = kmCoeficiente2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CoeficienteTarifa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.HoraSistema;
|
import com.rjconsultores.ventaboletos.utilerias.HoraSistema;
|
||||||
|
@ -19,8 +20,7 @@ public class SecuenciaRutaTramoVO {
|
||||||
private Boolean indSentidoIda;
|
private Boolean indSentidoIda;
|
||||||
private Integer numRuta;
|
private Integer numRuta;
|
||||||
|
|
||||||
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal,
|
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal, HoraSistema tiempoRecorrido) {
|
||||||
HoraSistema tiempoRecorrido) {
|
|
||||||
super();
|
super();
|
||||||
this.origen = origen;
|
this.origen = origen;
|
||||||
this.destino = destino;
|
this.destino = destino;
|
||||||
|
@ -30,8 +30,7 @@ public class SecuenciaRutaTramoVO {
|
||||||
this.setTiempoRecorrido(tiempoRecorrido);
|
this.setTiempoRecorrido(tiempoRecorrido);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal,
|
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Via via, Integer secuencia, BigDecimal kmReal, HoraSistema tiempoRecorrido, Integer numruta, Boolean indSentidoIda) {
|
||||||
HoraSistema tiempoRecorrido, Integer numruta, Boolean indSentidoIda) {
|
|
||||||
this(origen, destino, via, secuencia, kmReal, tiempoRecorrido);
|
this(origen, destino, via, secuencia, kmReal, tiempoRecorrido);
|
||||||
this.numRuta = numruta;
|
this.numRuta = numruta;
|
||||||
this.indSentidoIda = indSentidoIda;
|
this.indSentidoIda = indSentidoIda;
|
||||||
|
@ -45,9 +44,10 @@ public class SecuenciaRutaTramoVO {
|
||||||
this.via = via;
|
this.via = via;
|
||||||
this.setTiempoRecorrido(null);
|
this.setTiempoRecorrido(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Integer secuencia, Via via, Integer numruta, Boolean indSentidoIda) {
|
public SecuenciaRutaTramoVO(Parada origen, Parada destino, Integer secuencia, Via via, Integer numruta, Boolean indSentidoIda) {
|
||||||
this(origen, destino, secuencia, via);
|
this(origen, destino, secuencia, via);
|
||||||
this.numRuta = numRuta;
|
this.numRuta = numruta;
|
||||||
this.indSentidoIda = indSentidoIda;
|
this.indSentidoIda = indSentidoIda;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,8 +138,6 @@ public class SecuenciaRutaTramoVO {
|
||||||
this.tramoServicioId = tramoServicioId;
|
this.tramoServicioId = tramoServicioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Boolean getIndSentidoIda() {
|
public Boolean getIndSentidoIda() {
|
||||||
return indSentidoIda;
|
return indSentidoIda;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
package com.rjconsultores.ventaboletos.vo.tarifa;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
|
@ -2,7 +2,7 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
package com.rjconsultores.ventaboletos.vo.tarifa;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
package com.rjconsultores.ventaboletos.vo.tarifa;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.vo.esquemaoperacional;
|
package com.rjconsultores.ventaboletos.vo.tarifa;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
Loading…
Reference in New Issue