fixes bug #7930
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@66010 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c4072eb0f6
commit
2610b25071
|
@ -60,4 +60,6 @@ public interface RutaDAO extends GenericDAO<Ruta, Integer> {
|
||||||
|
|
||||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
||||||
|
|
||||||
|
public void updateAsientosVendibles(Ruta ruta, Tramo viejoTramo, Tramo nuevoTramo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
@ -68,8 +69,8 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
||||||
|
|
||||||
c.addOrder(Order.asc("descruta"));
|
c.addOrder(Order.asc("descruta"));
|
||||||
|
|
||||||
List<Ruta> l =c.list();
|
List<Ruta> l = c.list();
|
||||||
for(Ruta r : l){
|
for (Ruta r : l) {
|
||||||
r.getLsRutaEmpresa();
|
r.getLsRutaEmpresa();
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
|
@ -229,4 +230,80 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAsientosVendibles(Ruta ruta, Tramo viejoTramo, Tramo nuevoTramo) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
getSession().flush();
|
||||||
|
|
||||||
|
List<String> qryList = new ArrayList<String>();
|
||||||
|
StringBuilder qry = new StringBuilder(" update RUTA_COMBINACION set TRAMO_ID = :nuevoTramo, ");
|
||||||
|
qry.append(" FECMODIF = SYSDATE, USUARIO_ID = :usuario where TRAMO_ID = :viejoTramo and RUTA_ID = :ruta ");
|
||||||
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
qryList.add(qry.toString());
|
||||||
|
|
||||||
|
qry = new StringBuilder(" update RUTA_SECUENCIA set TRAMO_ID = :nuevoTramo, ");
|
||||||
|
qry.append(" FECMODIF = SYSDATE, USUARIO_ID = :usuario where TRAMO_ID = :viejoTramo and RUTA_ID = :ruta ");
|
||||||
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
qryList.add(qry.toString());
|
||||||
|
|
||||||
|
for (String strQuery : qryList) {
|
||||||
|
Query query = getSession().createSQLQuery(strQuery);
|
||||||
|
query.setInteger("viejoTramo", viejoTramo.getTramoId());
|
||||||
|
query.setInteger("nuevoTramo", nuevoTramo.getTramoId());
|
||||||
|
query.setInteger("usuario", nuevoTramo.getUsuarioId());
|
||||||
|
query.setInteger("ruta", ruta.getRutaId());
|
||||||
|
query.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
qryList = new ArrayList<String>();
|
||||||
|
qry = new StringBuilder(" update TARIFA set TRAMO_ID = :nuevoTramo, ");
|
||||||
|
qry.append(" FECMODIF = SYSDATE, USUARIO_ID = :usuario, ORIGEN_ID =:origen, DESTINO_ID = :destino ");
|
||||||
|
qry.append(" where TRAMO_ID = :viejoTramo and RUTA_ID = :ruta ");
|
||||||
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
qryList.add(qry.toString());
|
||||||
|
|
||||||
|
qry = new StringBuilder(" update TARIFA_OFICIAL set TRAMO_ID = :nuevoTramo, ");
|
||||||
|
qry.append(" FECMODIF = SYSDATE, USUARIO_ID = :usuario, ORIGEN_ID =:origen, DESTINO_ID = :destino ");
|
||||||
|
qry.append(" where TRAMO_ID = :viejoTramo and RUTA_ID = :ruta ");
|
||||||
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
qryList.add(qry.toString());
|
||||||
|
|
||||||
|
qry = new StringBuilder(" update CORRIDA_TRAMO set TRAMO_ID = :nuevoTramo, ");
|
||||||
|
qry.append(" FECMODIF = SYSDATE, USUARIO_ID = :usuario, ORIGEN_ID =:origen, DESTINO_ID = :destino ");
|
||||||
|
qry.append(" where TRAMO_ID = :viejoTramo and ");
|
||||||
|
qry.append(" CORRIDA_ID in (select CORRIDA_ID from CORRIDA_CTRL where RUTA_ID = :ruta ) ");
|
||||||
|
qry.append(" AND ACTIVO = 1 ");
|
||||||
|
qryList.add(qry.toString());
|
||||||
|
|
||||||
|
for (String strQuery : qryList) {
|
||||||
|
Query query = getSession().createSQLQuery(strQuery);
|
||||||
|
query.setInteger("viejoTramo", viejoTramo.getTramoId());
|
||||||
|
query.setInteger("nuevoTramo", nuevoTramo.getTramoId());
|
||||||
|
query.setInteger("origen", nuevoTramo.getOrigem().getParadaId());
|
||||||
|
query.setInteger("destino", nuevoTramo.getDestino().getParadaId());
|
||||||
|
query.setInteger("usuario", nuevoTramo.getUsuarioId());
|
||||||
|
query.setInteger("ruta", ruta.getRutaId());
|
||||||
|
query.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
qry = new StringBuilder(" update CORRIDA set FECMODIF = SYSDATE, USUARIO_ID = :usuario, ");
|
||||||
|
qry.append(" ORIGEN_ID = (case when ORIGEN_ID = :viejaOrigen then :nuevaOrigen else ORIGEN_ID end ), ");
|
||||||
|
qry.append(" DESTINO_ID = (case when DESTINO_ID = :viejoDestino then :nuevoDestino else DESTINO_ID end ) ");
|
||||||
|
qry.append(" where RUTA_ID = :ruta ");
|
||||||
|
|
||||||
|
Query query = getSession().createSQLQuery(qry.toString());
|
||||||
|
query.setInteger("viejaOrigen", viejoTramo.getOrigem().getParadaId());
|
||||||
|
query.setInteger("nuevaOrigen", nuevoTramo.getOrigem().getParadaId());
|
||||||
|
query.setInteger("viejoDestino", viejoTramo.getOrigem().getParadaId());
|
||||||
|
query.setInteger("nuevoDestino", nuevoTramo.getDestino().getParadaId());
|
||||||
|
query.setInteger("usuario", nuevoTramo.getUsuarioId());
|
||||||
|
query.setInteger("ruta", ruta.getRutaId());
|
||||||
|
query.executeUpdate();
|
||||||
|
|
||||||
|
} catch (final Exception ex) {
|
||||||
|
throw new RuntimeException("", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,4 +106,6 @@ public interface RutaService {
|
||||||
|
|
||||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
||||||
|
|
||||||
|
public boolean cambiarParadaRuta(Ruta ruta, Parada parada, String descripcionParada) throws BusinessException ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,8 @@ package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -22,7 +19,6 @@ import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.RutaDAO;
|
import com.rjconsultores.ventaboletos.dao.RutaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia;
|
import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia;
|
||||||
|
@ -34,7 +30,7 @@ import com.rjconsultores.ventaboletos.entidad.RutaSecuencia;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
import com.rjconsultores.ventaboletos.entidad.Tramo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Via;
|
import com.rjconsultores.ventaboletos.entidad.Via;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
import com.rjconsultores.ventaboletos.service.RutaCombinacionService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
|
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
|
@ -62,7 +58,7 @@ public class RutaServiceImpl implements RutaService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EsquemaCorridaDAO esquemaCorridaDAO;
|
private EsquemaCorridaDAO esquemaCorridaDAO;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EsquemaCorridaService esquemaCorridaService;
|
private ParadaService paradaService;
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger(RutaServiceImpl.class);
|
private static Logger log = Logger.getLogger(RutaServiceImpl.class);
|
||||||
|
|
||||||
|
@ -74,6 +70,135 @@ public class RutaServiceImpl implements RutaService {
|
||||||
return rutaDAO.obtenerID(id);
|
return rutaDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
|
public boolean cambiarParadaRuta(Ruta ruta, Parada parada, String descripcionParada) throws BusinessException {
|
||||||
|
|
||||||
|
try {
|
||||||
|
String cve = null;
|
||||||
|
String descparada = null;
|
||||||
|
try {
|
||||||
|
String arraySplit[] = new String[2];
|
||||||
|
arraySplit = descripcionParada.split(" - ");
|
||||||
|
cve = arraySplit[0];
|
||||||
|
descparada = arraySplit[1];
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cve == null || descparada == null)
|
||||||
|
throw new BusinessException("editarCatalogoDeRutaController.actionCanbiarParada.businessException");
|
||||||
|
|
||||||
|
Parada nuevaParada = null;
|
||||||
|
List<Parada> paradas = paradaService.buscarCVE(cve);
|
||||||
|
paradas.addAll(paradaService.buscar(descparada));
|
||||||
|
if (!paradas.isEmpty()) {
|
||||||
|
nuevaParada = paradas.iterator().next();
|
||||||
|
} else {
|
||||||
|
nuevaParada = crearNuevaParada(parada, cve, descparada);
|
||||||
|
paradaService.suscribirActualizar(nuevaParada);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Tramo> tramos = validaTramosRuta(ruta);
|
||||||
|
List<CambioRutaTramo> cambios = new ArrayList<CambioRutaTramo>();
|
||||||
|
for (Tramo tramo : tramos) {
|
||||||
|
Tramo nTramo = crearNuevoTramo(tramo, parada, nuevaParada);
|
||||||
|
if (nTramo != null) {
|
||||||
|
cambios.add(new CambioRutaTramo(tramo, nTramo, parada, nuevaParada));
|
||||||
|
tramoService.suscribirActualizar(nTramo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CambioRutaTramo crt : cambios) {
|
||||||
|
rutaDAO.updateAsientosVendibles(ruta, crt.getViejoTramo(), crt.getNuevoTramo());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("", e);
|
||||||
|
throw new BusinessException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Tramo> validaTramosRuta(Ruta ruta) {
|
||||||
|
|
||||||
|
List<Tramo> tramosRuta = new ArrayList<Tramo>();
|
||||||
|
|
||||||
|
for (RutaCombinacion rc : ruta.getRutaCombinacionList()) {
|
||||||
|
if (!tramosRuta.contains(rc.getTramo()))
|
||||||
|
tramosRuta.add(rc.getTramo());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (RutaSecuencia rs : ruta.getRutaSecuenciaList()) {
|
||||||
|
if (!tramosRuta.contains(rs.getTramo()))
|
||||||
|
tramosRuta.add(rs.getTramo());
|
||||||
|
}
|
||||||
|
|
||||||
|
return tramosRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Tramo crearNuevoTramo(Tramo tramo, Parada viejaParada, Parada nuevaParada) {
|
||||||
|
|
||||||
|
Tramo viejoTramo = tramoService.obtenerID(tramo.getTramoId());
|
||||||
|
if (viejoTramo.getOrigem().equals(viejaParada) || viejoTramo.getDestino().equals(viejaParada)) {
|
||||||
|
|
||||||
|
Tramo ptramo = null;
|
||||||
|
if (viejoTramo.getOrigem().equals(viejaParada)) {
|
||||||
|
ptramo = tramoService.obtenerTramotPorOrigemDestinoVia(nuevaParada, viejoTramo.getDestino(), viejoTramo.getVia());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viejoTramo.getDestino().equals(viejaParada)) {
|
||||||
|
ptramo = tramoService.obtenerTramotPorOrigemDestinoVia(viejoTramo.getOrigem(), nuevaParada, viejoTramo.getVia());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ptramo == null) {
|
||||||
|
|
||||||
|
Tramo nuevoTramo = new Tramo();
|
||||||
|
nuevoTramo.setDesctramo(viejoTramo.getDesctramo() + " II");
|
||||||
|
nuevoTramo.setVia(viejoTramo.getVia());
|
||||||
|
nuevoTramo.setKmPagoConductor(viejoTramo.getKmPagoConductor());
|
||||||
|
nuevoTramo.setKmReal(viejoTramo.getKmReal());
|
||||||
|
|
||||||
|
nuevoTramo.setLsTramoTiempo(viejoTramo.getLsTramoTiempo());
|
||||||
|
nuevoTramo.setLsOrgaoTramo(viejoTramo.getLsOrgaoTramo());
|
||||||
|
|
||||||
|
nuevoTramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
nuevoTramo.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
nuevoTramo.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
if (viejoTramo.getOrigem().equals(viejaParada)) {
|
||||||
|
nuevoTramo.setOrigem(nuevaParada);
|
||||||
|
nuevoTramo.setDestino(viejoTramo.getDestino());
|
||||||
|
}
|
||||||
|
if (viejoTramo.getDestino().equals(viejaParada)) {
|
||||||
|
nuevoTramo.setDestino(nuevaParada);
|
||||||
|
nuevoTramo.setOrigem(viejoTramo.getOrigem());
|
||||||
|
}
|
||||||
|
|
||||||
|
return nuevoTramo;
|
||||||
|
} else {
|
||||||
|
return ptramo;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Parada crearNuevaParada(Parada parada, String cve, String descparada) {
|
||||||
|
Parada nuevaParada = new Parada();
|
||||||
|
nuevaParada.setCveparada(cve);
|
||||||
|
nuevaParada.setDescparada(descparada);
|
||||||
|
nuevaParada.setCiudad(parada.getCiudad());
|
||||||
|
nuevaParada.setRegionMetropolitana(parada.getRegionMetropolitana());
|
||||||
|
nuevaParada.setNodo(parada.getNodo());
|
||||||
|
nuevaParada.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
nuevaParada.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
nuevaParada.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return nuevaParada;
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = BusinessException.class)
|
@Transactional(rollbackFor = BusinessException.class)
|
||||||
public Ruta suscribir(Ruta entidad, List<ParadaSecuencia> lsParadasSequencia) throws BusinessException {
|
public Ruta suscribir(Ruta entidad, List<ParadaSecuencia> lsParadasSequencia) throws BusinessException {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
@ -87,7 +212,7 @@ public class RutaServiceImpl implements RutaService {
|
||||||
Boolean isClone = entidad.getIsClone() != null ? entidad.getIsClone() : Boolean.FALSE;
|
Boolean isClone = entidad.getIsClone() != null ? entidad.getIsClone() : Boolean.FALSE;
|
||||||
entidad = rutaDAO.suscribir(entidad);
|
entidad = rutaDAO.suscribir(entidad);
|
||||||
if (lsParadasSequencia != null) {
|
if (lsParadasSequencia != null) {
|
||||||
if(!isClone) {
|
if (!isClone) {
|
||||||
generarSecuencias(entidad, lsParadasSequencia);
|
generarSecuencias(entidad, lsParadasSequencia);
|
||||||
}
|
}
|
||||||
generarCombinacion(entidad);
|
generarCombinacion(entidad);
|
||||||
|
@ -250,8 +375,6 @@ public class RutaServiceImpl implements RutaService {
|
||||||
|
|
||||||
log.debug("Tramo:" + trBuscaOrigemDestino.getDesctramo());
|
log.debug("Tramo:" + trBuscaOrigemDestino.getDesctramo());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RutaCombinacion rc = new RutaCombinacion();
|
RutaCombinacion rc = new RutaCombinacion();
|
||||||
rc.setActivo(Boolean.TRUE);
|
rc.setActivo(Boolean.TRUE);
|
||||||
rc.setFecmodif(Calendar.getInstance().getTime());
|
rc.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
@ -271,9 +394,9 @@ public class RutaServiceImpl implements RutaService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean indVenta(Ruta ruta, Tramo trBuscaOrigemDestino){
|
private boolean indVenta(Ruta ruta, Tramo trBuscaOrigemDestino) {
|
||||||
for (RutaCombinacion rc : ruta.getRutaCombinacionList()){
|
for (RutaCombinacion rc : ruta.getRutaCombinacionList()) {
|
||||||
if (rc.getTramo().equals(trBuscaOrigemDestino)){
|
if (rc.getTramo().equals(trBuscaOrigemDestino)) {
|
||||||
return rc.getIndventa();
|
return rc.getIndventa();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,7 +411,6 @@ public class RutaServiceImpl implements RutaService {
|
||||||
return rutaDAO.buscarOrigen(ruta);
|
return rutaDAO.buscarOrigen(ruta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Ruta> buscarPorClaseServicioEmpresa(ClaseServicio claseServicio, Empresa empresa) {
|
public List<Ruta> buscarPorClaseServicioEmpresa(ClaseServicio claseServicio, Empresa empresa) {
|
||||||
return rutaDAO.buscarPorClaseServicioEmpresa(claseServicio, empresa);
|
return rutaDAO.buscarPorClaseServicioEmpresa(claseServicio, empresa);
|
||||||
}
|
}
|
||||||
|
@ -337,12 +459,12 @@ public class RutaServiceImpl implements RutaService {
|
||||||
return rutaDAO.buscaRuta(palavraPesquisaRuta);
|
return rutaDAO.buscaRuta(palavraPesquisaRuta);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Ruta> buscaRutasFromOrgao(OrgaoConcedente orgao){
|
public List<Ruta> buscaRutasFromOrgao(OrgaoConcedente orgao) {
|
||||||
return rutaDAO.buscaRutasFromOrgao(orgao);
|
return rutaDAO.buscaRutasFromOrgao(orgao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Ruta> buscarRutasPorEmpresas(List<Empresa> lsEmp){
|
public List<Ruta> buscarRutasPorEmpresas(List<Empresa> lsEmp) {
|
||||||
return rutaDAO.buscarPorRutaPorEmpresas(lsEmp);
|
return rutaDAO.buscarPorRutaPorEmpresas(lsEmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,12 +478,12 @@ public class RutaServiceImpl implements RutaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getNumSecuenciaOrigen(Integer rutaId, Integer origenId){
|
public Integer getNumSecuenciaOrigen(Integer rutaId, Integer origenId) {
|
||||||
return obtenerID(rutaId).numSecuenciaOrigen(origenId);
|
return obtenerID(rutaId).numSecuenciaOrigen(origenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getNumSecuenciaDestino(Integer rutaId, Integer destinoId){
|
public Integer getNumSecuenciaDestino(Integer rutaId, Integer destinoId) {
|
||||||
return obtenerID(rutaId).numSecuenciaDestino(destinoId);
|
return obtenerID(rutaId).numSecuenciaDestino(destinoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,4 +532,51 @@ public class RutaServiceImpl implements RutaService {
|
||||||
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao) {
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao) {
|
||||||
return rutaDAO.buscarRutasPorEmpresaOrgaoConcedente(empresa, orgao);
|
return rutaDAO.buscarRutasPorEmpresaOrgaoConcedente(empresa, orgao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CambioRutaTramo {
|
||||||
|
private Tramo viejoTramo;
|
||||||
|
private Tramo nuevoTramo;
|
||||||
|
private Parada viejaParada;
|
||||||
|
private Parada nuevaParada;
|
||||||
|
|
||||||
|
public CambioRutaTramo(Tramo viejoTramo, Tramo nuevoTramo, Parada viejaParada, Parada nuevaParada) {
|
||||||
|
super();
|
||||||
|
this.viejoTramo = viejoTramo;
|
||||||
|
this.nuevoTramo = nuevoTramo;
|
||||||
|
this.viejaParada = viejaParada;
|
||||||
|
this.nuevaParada = nuevaParada;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tramo getViejoTramo() {
|
||||||
|
return viejoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViejoTramo(Tramo viejoTramo) {
|
||||||
|
this.viejoTramo = viejoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tramo getNuevoTramo() {
|
||||||
|
return nuevoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNuevoTramo(Tramo nuevoTramo) {
|
||||||
|
this.nuevoTramo = nuevoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getViejaParada() {
|
||||||
|
return viejaParada;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViejaParada(Parada viejaParada) {
|
||||||
|
this.viejaParada = viejaParada;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getNuevaParada() {
|
||||||
|
return nuevaParada;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNuevaParada(Parada nuevaParada) {
|
||||||
|
this.nuevaParada = nuevaParada;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue