ajuste de geração de corrida de acordo com feriado
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@23893 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
61d86a1423
commit
0c66ac077d
|
@ -1,6 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.sql.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.sql.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
@ -13,6 +15,7 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.FeriadoDAO;
|
import com.rjconsultores.ventaboletos.dao.FeriadoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||||
|
|
||||||
|
|
||||||
@Repository("feriadoDAO")
|
@Repository("feriadoDAO")
|
||||||
|
@ -35,12 +38,15 @@ public class FeriadoHibernateDAO extends GenericHibernateDAO<Feriado, Integer>
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Feriado> buscar(Date descferiado) {
|
public List<Feriado> buscar(Date descferiado) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
String hql = " select new com.rjconsultores.ventaboletos.entidad.Feriado(feriado.feriadoId, feriado.fecferiado,feriado.descferiado) from Feriado feriado" +
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
" where feriado.activo = 1 and feriado.fecferiado =:data";
|
||||||
c.add(Restrictions.eq("fecferiado", descferiado));
|
|
||||||
|
|
||||||
|
|
||||||
return c.list();
|
|
||||||
|
Query sq = getSession().createQuery(hql);
|
||||||
|
sq.setParameter("data", descferiado);
|
||||||
|
List<Feriado> lsMarca = sq.list();
|
||||||
|
return lsMarca;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,17 @@ public class EsquemaCorrida implements Serializable {
|
||||||
@Column(name = "INDGENERAFERIADO")
|
@Column(name = "INDGENERAFERIADO")
|
||||||
private String indGeneraFeriado;
|
private String indGeneraFeriado;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static List<String> tpGeneraFeriadoList = new ArrayList<String>();
|
||||||
|
|
||||||
|
static{
|
||||||
|
|
||||||
|
tpGeneraFeriadoList.add("GERAR SEMPRE");
|
||||||
|
tpGeneraFeriadoList.add("GERAR SO QUANDO FOR FERIADO");
|
||||||
|
tpGeneraFeriadoList.add("GERAR QUANDO NAO FOR FERIADO");
|
||||||
|
}
|
||||||
|
|
||||||
public String getTipocorrida() {
|
public String getTipocorrida() {
|
||||||
return tipocorrida;
|
return tipocorrida;
|
||||||
}
|
}
|
||||||
|
@ -407,6 +418,16 @@ public class EsquemaCorrida implements Serializable {
|
||||||
this.indGeneraFeriado = indGeneraFeriado;
|
this.indGeneraFeriado = indGeneraFeriado;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static List<String> getTpGeneraFeriadoList() {
|
||||||
|
return tpGeneraFeriadoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setTpGeneraFeriadoList(List<String> tpGeneraFeriadoList) {
|
||||||
|
EsquemaCorrida.tpGeneraFeriadoList = tpGeneraFeriadoList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class Feriado implements Serializable {
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FERIADO_SEQ")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FERIADO_SEQ")
|
||||||
private Integer feriadoId;
|
private Integer feriadoId;
|
||||||
@Column(name = "FECFERIADO")
|
@Column(name = "FECFERIADO")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.DATE)
|
||||||
private Date fecferiado;
|
private Date fecferiado;
|
||||||
@Column(name = "DESCFERIADO")
|
@Column(name = "DESCFERIADO")
|
||||||
private String descferiado;
|
private String descferiado;
|
||||||
|
@ -54,7 +54,14 @@ public class Feriado implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Feriado() {
|
public Feriado(Integer feriadoId, Date fecferiado, String descferiado) {
|
||||||
|
super();
|
||||||
|
this.feriadoId = feriadoId;
|
||||||
|
this.fecferiado = fecferiado;
|
||||||
|
this.descferiado = descferiado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Feriado() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Feriado(Integer feriadoId) {
|
public Feriado(Integer feriadoId) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.sql.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
||||||
|
|
|
@ -36,6 +36,7 @@ import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaTramo;
|
import com.rjconsultores.ventaboletos.entidad.EsquemaTramo;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Feriado;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RolOperativo;
|
import com.rjconsultores.ventaboletos.entidad.RolOperativo;
|
||||||
|
@ -50,6 +51,7 @@ import com.rjconsultores.ventaboletos.service.CorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaAsientoService;
|
import com.rjconsultores.ventaboletos.service.EsquemaAsientoService;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaTramoService;
|
import com.rjconsultores.ventaboletos.service.EsquemaTramoService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.FeriadoService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TramoServicioService;
|
import com.rjconsultores.ventaboletos.service.TramoServicioService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
@ -90,6 +92,8 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
private int cantCorridaGenerada;
|
private int cantCorridaGenerada;
|
||||||
@Transient
|
@Transient
|
||||||
private int cantCorridaCommit;
|
private int cantCorridaCommit;
|
||||||
|
@Autowired
|
||||||
|
private FeriadoService feriadoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public CorridaServiceImpl(@Qualifier("transactionManager") PlatformTransactionManager transactionManager) {
|
public CorridaServiceImpl(@Qualifier("transactionManager") PlatformTransactionManager transactionManager) {
|
||||||
|
@ -143,73 +147,91 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
return corridaDAO.buscarFiltro(ori, des, hora, cs);
|
return corridaDAO.buscarFiltro(ori, des, hora, cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean temCorridaDiaSemana(Integer diaSemana, EsquemaCorrida esquemaCorrida) {
|
|
||||||
|
private Boolean geraDiaSemana (Integer diaSemana,EsquemaCorrida esquemaCorrida){
|
||||||
|
Boolean retorno = Boolean.FALSE;
|
||||||
|
switch (diaSemana) {
|
||||||
|
case 1: {
|
||||||
|
// diaSemana = "Domingo";
|
||||||
|
if (esquemaCorrida.getInddomingo() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getInddomingo()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2: {
|
||||||
|
// diaSemana = "Segunda";
|
||||||
|
if (esquemaCorrida.getIndlunes() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndlunes()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3: {
|
||||||
|
// diaSemana = "Terca";
|
||||||
|
if (esquemaCorrida.getIndmartes() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndmartes()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4: {
|
||||||
|
// diaSemana = "Quarta";
|
||||||
|
if (esquemaCorrida.getIndmiercoles() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndmiercoles()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5: {
|
||||||
|
// diaSemana = "Quinta";
|
||||||
|
if (esquemaCorrida.getIndjueves() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndjueves()) {
|
||||||
|
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 6: {
|
||||||
|
// diaSemana = "Sexta";
|
||||||
|
if (esquemaCorrida.getIndviernes() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndviernes()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 7: {
|
||||||
|
// diaSemana = "Sabado";
|
||||||
|
if (esquemaCorrida.getIndsabado() == null) {
|
||||||
|
retorno = Boolean.FALSE;
|
||||||
|
} else if (esquemaCorrida.getIndsabado()) {
|
||||||
|
retorno = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retorno;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean temCorridaDiaSemana(Integer diaSemana, EsquemaCorrida esquemaCorrida, Boolean isFeriado) {
|
||||||
Boolean retorno = Boolean.FALSE;
|
Boolean retorno = Boolean.FALSE;
|
||||||
|
|
||||||
switch (diaSemana) {
|
if(esquemaCorrida.getIndGeneraFeriado() != null){
|
||||||
case 1: {
|
if (esquemaCorrida.getIndGeneraFeriado().equals("S")){
|
||||||
// diaSemana = "Domingo";
|
retorno = geraDiaSemana(diaSemana,esquemaCorrida);
|
||||||
if (esquemaCorrida.getInddomingo() == null) {
|
}else if (isFeriado){
|
||||||
retorno = Boolean.FALSE;
|
if (esquemaCorrida.getIndGeneraFeriado().equals("F")){
|
||||||
} else if (esquemaCorrida.getInddomingo()) {
|
retorno = geraDiaSemana(diaSemana,esquemaCorrida);
|
||||||
retorno = Boolean.TRUE;
|
}
|
||||||
}
|
}else if (esquemaCorrida.getIndGeneraFeriado().equals("N")){
|
||||||
break;
|
retorno = geraDiaSemana(diaSemana,esquemaCorrida);
|
||||||
}
|
}
|
||||||
case 2: {
|
|
||||||
// diaSemana = "Segunda";
|
|
||||||
if (esquemaCorrida.getIndlunes() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndlunes()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: {
|
|
||||||
// diaSemana = "Terca";
|
|
||||||
if (esquemaCorrida.getIndmartes() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndmartes()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: {
|
|
||||||
// diaSemana = "Quarta";
|
|
||||||
if (esquemaCorrida.getIndmiercoles() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndmiercoles()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: {
|
|
||||||
// diaSemana = "Quinta";
|
|
||||||
if (esquemaCorrida.getIndjueves() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndjueves()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6: {
|
|
||||||
// diaSemana = "Sexta";
|
|
||||||
if (esquemaCorrida.getIndviernes() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndviernes()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7: {
|
|
||||||
// diaSemana = "Sabado";
|
|
||||||
if (esquemaCorrida.getIndsabado() == null) {
|
|
||||||
retorno = Boolean.FALSE;
|
|
||||||
} else if (esquemaCorrida.getIndsabado()) {
|
|
||||||
retorno = Boolean.TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return retorno;
|
return retorno;
|
||||||
|
@ -289,6 +311,16 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
return dataCorreta;
|
return dataCorreta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFeriado (java.sql.Date data){
|
||||||
|
|
||||||
|
List<Feriado> feriadoList = feriadoService.buscar(data);
|
||||||
|
if (feriadoList.isEmpty()){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Genera una corrida para el esquemaCorrida informado en el dia y fecha
|
* Genera una corrida para el esquemaCorrida informado en el dia y fecha
|
||||||
* informados.
|
* informados.
|
||||||
|
@ -300,14 +332,14 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
* @param dataGeracao
|
* @param dataGeracao
|
||||||
* @return - La corrida generada o null si no fue generada.
|
* @return - La corrida generada o null si no fue generada.
|
||||||
*/
|
*/
|
||||||
public Corrida generarCorrida(EsquemaCorrida esquemaCorrida, Date dataGeracao, boolean isPisoExtra) {
|
public Corrida generarCorrida(EsquemaCorrida esquemaCorrida, Date dataGeracao, boolean isPisoExtra, Boolean isFeriado) {
|
||||||
GregorianCalendar calendario = new GregorianCalendar();
|
GregorianCalendar calendario = new GregorianCalendar();
|
||||||
calendario.setTime(dataGeracao);
|
calendario.setTime(dataGeracao);
|
||||||
|
|
||||||
Integer diaSemana = calendario.get(Calendar.DAY_OF_WEEK);
|
Integer diaSemana = calendario.get(Calendar.DAY_OF_WEEK);
|
||||||
Corrida corrida = null;
|
Corrida corrida = null;
|
||||||
if ((esquemaCorrida.getStatusCorrida() != null) && (esquemaCorrida.getStatusCorrida().equals("A"))) {
|
if ((esquemaCorrida.getStatusCorrida() != null) && (esquemaCorrida.getStatusCorrida().equals("A"))) {
|
||||||
if (temCorridaDiaSemana(diaSemana, esquemaCorrida)) {
|
if (temCorridaDiaSemana(diaSemana, esquemaCorrida,isFeriado)) {
|
||||||
try {
|
try {
|
||||||
Ruta ruta = esquemaCorrida.getRuta();
|
Ruta ruta = esquemaCorrida.getRuta();
|
||||||
ClaseServicio claseServicio = esquemaCorrida.getClaseServicio();
|
ClaseServicio claseServicio = esquemaCorrida.getClaseServicio();
|
||||||
|
@ -521,13 +553,15 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
TransactionStatus status = transactionManager.getTransaction(def);
|
TransactionStatus status = transactionManager.getTransaction(def);
|
||||||
cantCorridaGenerada = 0;
|
cantCorridaGenerada = 0;
|
||||||
cantCorridaCommit = 1;
|
cantCorridaCommit = 1;
|
||||||
|
java.sql.Date data = new java.sql.Date(dataGeracao.getTime());
|
||||||
|
Boolean isFeriado = this.isFeriado(data);
|
||||||
|
|
||||||
for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) {
|
for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) {
|
||||||
log.info("esquema=" + esquemaCorrida.getEsquemacorridaId() + " numCorrida=" + esquemaCorrida.getNumCorrida());
|
log.info("esquema=" + esquemaCorrida.getEsquemacorridaId() + " numCorrida=" + esquemaCorrida.getNumCorrida());
|
||||||
|
|
||||||
if (!esquemaCorridaDAO.esHijoRebote(esquemaCorrida)) {
|
if (!esquemaCorridaDAO.esHijoRebote(esquemaCorrida)) {
|
||||||
|
|
||||||
Corrida corrida = generarCorrida(esquemaCorrida, dataGeracao, false);
|
Corrida corrida = generarCorrida(esquemaCorrida, dataGeracao, false, isFeriado);
|
||||||
Corrida corridaPisoExtra = null;
|
Corrida corridaPisoExtra = null;
|
||||||
|
|
||||||
if (corrida == null) {// Si no gener<65> la corrida, no va a
|
if (corrida == null) {// Si no gener<65> la corrida, no va a
|
||||||
|
@ -546,7 +580,7 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
esquemaCorrida.setRolOperativo(esquemaCorrida.getRolOperativo2());
|
esquemaCorrida.setRolOperativo(esquemaCorrida.getRolOperativo2());
|
||||||
esquemaCorrida.setClaseServicio(esquemaCorrida.getClaseServicio2());
|
esquemaCorrida.setClaseServicio(esquemaCorrida.getClaseServicio2());
|
||||||
|
|
||||||
corridaPisoExtra = generarCorrida(esquemaCorrida, dataGeracao, true);
|
corridaPisoExtra = generarCorrida(esquemaCorrida, dataGeracao, true, isFeriado);
|
||||||
if (corrida != null && corridaPisoExtra != null) {
|
if (corrida != null && corridaPisoExtra != null) {
|
||||||
// Voltando RolOperativo e Classe de Servi<76>o
|
// Voltando RolOperativo e Classe de Servi<76>o
|
||||||
esquemaCorrida.setRolOperativo(ro);
|
esquemaCorrida.setRolOperativo(ro);
|
||||||
|
@ -568,7 +602,7 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
|
|
||||||
log.info("Corrida Rebote=" + esquemaCorrida.getEsquemacorridaId());
|
log.info("Corrida Rebote=" + esquemaCorrida.getEsquemacorridaId());
|
||||||
|
|
||||||
Corrida corridaRebote = generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), dataGeracao, false);
|
Corrida corridaRebote = generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), dataGeracao, false, isFeriado);
|
||||||
Corrida corridaPisoExtraRebote = null;
|
Corrida corridaPisoExtraRebote = null;
|
||||||
|
|
||||||
boolean generaReboteDiaSeguinte = false;
|
boolean generaReboteDiaSeguinte = false;
|
||||||
|
@ -584,7 +618,7 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
ecRebote.setRolOperativo(ecRebote.getRolOperativo2());
|
ecRebote.setRolOperativo(ecRebote.getRolOperativo2());
|
||||||
ecRebote.setClaseServicio(ecRebote.getClaseServicio2());
|
ecRebote.setClaseServicio(ecRebote.getClaseServicio2());
|
||||||
|
|
||||||
corridaPisoExtraRebote = generarCorrida(ecRebote, dataGeracao, true);
|
corridaPisoExtraRebote = generarCorrida(ecRebote, dataGeracao, true, isFeriado);
|
||||||
if (corridaRebote != null && corridaPisoExtraRebote != null) {
|
if (corridaRebote != null && corridaPisoExtraRebote != null) {
|
||||||
// Salvando Referencia da Corrida no piso extra
|
// Salvando Referencia da Corrida no piso extra
|
||||||
corridaPisoExtraRebote.setCorridaPiso(corridaRebote);
|
corridaPisoExtraRebote.setCorridaPiso(corridaRebote);
|
||||||
|
@ -698,7 +732,9 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
Calendar tmp = Calendar.getInstance();
|
Calendar tmp = Calendar.getInstance();
|
||||||
tmp.setTime(dataGeracao);
|
tmp.setTime(dataGeracao);
|
||||||
tmp.add(Calendar.DAY_OF_MONTH, 1);
|
tmp.add(Calendar.DAY_OF_MONTH, 1);
|
||||||
return generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), tmp.getTime(), false);
|
java.sql.Date data = new java.sql.Date(dataGeracao.getTime());
|
||||||
|
Boolean isFeriado = this.isFeriado(data) ;
|
||||||
|
return generarCorrida(esquemaCorrida.getEsquemaCorridaRebote(), tmp.getTime(), false, isFeriado);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Integer> getDiaDeLaSemana(TramoTiempo tramoTiempo) {
|
private List<Integer> getDiaDeLaSemana(TramoTiempo tramoTiempo) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.sql.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
Loading…
Reference in New Issue