fixes bug #7163
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@53257 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
6b93e5c87c
commit
b2caceab1d
|
@ -181,6 +181,9 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
listManuais.add(item);
|
||||
}
|
||||
|
||||
if (!getConexao().isClosed())
|
||||
getConexao().close();
|
||||
|
||||
return listManuais;
|
||||
}
|
||||
|
||||
|
@ -284,6 +287,9 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
listRedZ.add(item);
|
||||
}
|
||||
|
||||
if (!getConexao().isClosed())
|
||||
getConexao().close();
|
||||
|
||||
return listRedZ;
|
||||
}
|
||||
|
||||
|
@ -504,6 +510,9 @@ public class FiscalHibernateDAO extends GenericHibernateDAO<String, String> impl
|
|||
importacionNaoFiscalVOs.add(importacionNaoFiscal);
|
||||
}
|
||||
|
||||
if (!getConexao().isClosed())
|
||||
getConexao().close();
|
||||
|
||||
return importacionNaoFiscalVOs;
|
||||
}
|
||||
|
||||
|
|
|
@ -506,11 +506,11 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
corrida.setAutobus(null);
|
||||
corrida.setClaseServicio(esquemaCorrida.getClaseServicio());
|
||||
corrida.setConductor(null);
|
||||
// if(esquemaCorrida.getIndCorridaExtra()){
|
||||
// corrida.setTipoServicio(new Short("2"));
|
||||
// }else{
|
||||
corrida.setTipoServicio(new Short("1"));
|
||||
// }
|
||||
// if(esquemaCorrida.getIndCorridaExtra()){
|
||||
// corrida.setTipoServicio(new Short("2"));
|
||||
// }else{
|
||||
corrida.setTipoServicio(new Short("1"));
|
||||
// }
|
||||
corrida.setInfoCorrida(esquemaCorrida.getInfoCorrida());
|
||||
Integer cantparados = esquemaCorrida.getCantparados();
|
||||
if (cantparados != null) {
|
||||
|
@ -597,7 +597,6 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
corridaTramo.setFechorllegada(llegada.getTime());
|
||||
|
||||
horaChegadaAnterior = fecHorallegada;
|
||||
|
||||
|
||||
corridaTramo.setFechortarjetaviaje(null);
|
||||
corridaTramo.setNodo(corridaCtrl.getNodo());
|
||||
|
@ -633,21 +632,21 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
if (husoHorVeranoLlegadaAnterior == null) {
|
||||
corridaTramo.setFechorsalidaH(corridaTramo.getFechorsalida());
|
||||
} else {
|
||||
|
||||
//Ajusta tambem o tempo de instancia do calculo do horario de verao
|
||||
if (esquemaTramo.getTiempoEstancia() != null){
|
||||
|
||||
// Ajusta tambem o tempo de instancia do calculo do horario de verao
|
||||
if (esquemaTramo.getTiempoEstancia() != null) {
|
||||
GregorianCalendar tmp = new GregorianCalendar();
|
||||
tmp.setTime(husoHorVeranoLlegadaAnterior);
|
||||
|
||||
|
||||
tmp.add(Calendar.MINUTE, esquemaTramo.getTiempoEstancia().getMinutes());
|
||||
tmp.add(Calendar.HOUR_OF_DAY, esquemaTramo.getTiempoEstancia().getHours());
|
||||
|
||||
|
||||
log.debug("Tempo Recorrido H + Estancia: " + sdf.format(tmp.getTime()));
|
||||
|
||||
|
||||
husoHorVeranoLlegadaAnterior = tmp.getTime();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
corridaTramo.setFechorsalidaH(husoHorVeranoLlegadaAnterior);
|
||||
}
|
||||
|
||||
|
@ -661,8 +660,6 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
corridaTramo.setFechorSalidaOriginalH(corridaTramo.getFechorSalidaOriginal());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (numSec == 1) {
|
||||
corrida.setFechorSalidaOriginalH(corridaTramo.getFechorsalidaH());
|
||||
}
|
||||
|
@ -1050,7 +1047,7 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
||||
TransactionStatus status = transactionManager.getTransaction(def);
|
||||
|
||||
List<EsquemaCorrida> lsEsquemaCorrida = esquemaCorridaService.buscaDentroVigenciaQtdeDiasNotNull(dataDeOriginal);
|
||||
List<EsquemaCorrida> lsEsquemaCorrida = esquemaCorridaService.buscaDentroVigenciaQtdeDiasNotNull(dataDeOriginal);
|
||||
for (EsquemaCorrida esquemaCorrida : lsEsquemaCorrida) {
|
||||
log.debug("esquemaCorrida=" + esquemaCorrida.getEsquemacorridaId());
|
||||
|
||||
|
@ -1078,23 +1075,23 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
dataAte = esquemaCorrida.getEsquemaOperacional().getFecfinvigencia();
|
||||
}
|
||||
|
||||
try {
|
||||
while (DateUtil.compareOnlyDate(dataDe, dataAte) <= 0) {
|
||||
try {
|
||||
while (DateUtil.compareOnlyDate(dataDe, dataAte) <= 0) {
|
||||
Boolean isFeriado = this.isFeriado(new java.sql.Date(dataDe.getTime()), esquemaCorrida);
|
||||
generarCorrida(esquemaCorrida, dataDe, false, isFeriado);
|
||||
generarCorrida(esquemaCorrida, dataDe, false, isFeriado);
|
||||
calendarData.setTime(dataDe);
|
||||
calendarData.add(Calendar.DATE, 1);
|
||||
dataDe = calendarData.getTime();
|
||||
}
|
||||
dataDe = calendarData.getTime();
|
||||
}
|
||||
log.info("commit bloco corridas");
|
||||
transactionManager.commit(status);
|
||||
transactionManager.commit(status);
|
||||
status = transactionManager.getTransaction(def);
|
||||
} catch (Throwable ex) {
|
||||
log.error("", ex);
|
||||
log.error(" Erro ao gerar corrida = " + esquemaCorrida.getNumCorrida() + " esquemaCorrida = " + esquemaCorrida.getEsquemacorridaId());
|
||||
log.error(" Erro ao gerar corrida = " + esquemaCorrida.getNumCorrida() + " esquemaCorrida = " + esquemaCorrida.getEsquemacorridaId());
|
||||
transactionManager.rollback(status);
|
||||
status = transactionManager.getTransaction(def);
|
||||
}
|
||||
status = transactionManager.getTransaction(def);
|
||||
}
|
||||
}
|
||||
|
||||
if (!status.isCompleted()) {
|
||||
|
@ -1336,6 +1333,9 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
|
||||
}
|
||||
|
||||
if (!conexao.isClosed())
|
||||
conexao.close();
|
||||
|
||||
} catch (SQLException e) {
|
||||
log.error("", e);
|
||||
}
|
||||
|
|
|
@ -600,6 +600,10 @@ public class FiscalServiceImpl implements FiscalService {
|
|||
gravarArq.print(fechamento + QUEBRA_LINHA);
|
||||
|
||||
gravarArq.close();
|
||||
|
||||
if (!conn.isClosed())
|
||||
conn.close();
|
||||
|
||||
return arquivo;
|
||||
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue