fixes bug #AL-2734
parent
2668b47e78
commit
9e2be5e93d
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.8.0</version>
|
<version>1.8.1</version>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>rj-releases</id>
|
<id>rj-releases</id>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||||
|
@ -22,5 +23,6 @@ public interface BoletoDAO extends GenericDAO<Boleto, Long> {
|
||||||
public String getSequenciaBoletoId();
|
public String getSequenciaBoletoId();
|
||||||
public String getSequenciaNumOperacion();
|
public String getSequenciaNumOperacion();
|
||||||
public String getSequenciaNumReservacion();
|
public String getSequenciaNumReservacion();
|
||||||
void insertBoletoRserva(Boleto miBoletoTemporal);
|
void insertBoletoReserva(Boleto miBoletoTemporal);
|
||||||
|
public boolean isExisteBoletoPorCorrida(Integer corridaId, Date fecCorrida);
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,5 +109,7 @@ public interface CorridaDAO extends GenericDAO<Corrida, Corrida.Id> {
|
||||||
public Integer buscarOcupacaoCorrida(Corrida corrida);
|
public Integer buscarOcupacaoCorrida(Corrida corrida);
|
||||||
|
|
||||||
public List<Corrida> buscarCorridas(Parada ori, Parada des, Date dataInicio, Date dataFinal, ClaseServicio cs,
|
public List<Corrida> buscarCorridas(Parada ori, Parada des, Date dataInicio, Date dataFinal, ClaseServicio cs,
|
||||||
Ruta linha, Empresa empresa);
|
Ruta linha, Empresa empresa);
|
||||||
|
|
||||||
|
public Corrida buscarCorridaAtivaPorId(Id id);
|
||||||
}
|
}
|
|
@ -41,4 +41,5 @@ public interface PuntoVentaDAO extends GenericDAO<PuntoVenta, Integer> {
|
||||||
|
|
||||||
public List<PuntoVenta> buscaPuntoVentaEmpresa(Empresa empresa);
|
public List<PuntoVenta> buscaPuntoVentaEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,13 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SQLQuery;
|
import org.hibernate.SQLQuery;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
|
@ -20,6 +24,9 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.BoletoDAO;
|
import com.rjconsultores.ventaboletos.dao.BoletoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ActivoUtil;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
|
||||||
import com.rjconsultores.ventaboletos.vo.embarcada.PtoVtaUsuarioUltimaVendaDispositivoVO;
|
import com.rjconsultores.ventaboletos.vo.embarcada.PtoVtaUsuarioUltimaVendaDispositivoVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +35,7 @@ import com.rjconsultores.ventaboletos.vo.embarcada.PtoVtaUsuarioUltimaVendaDispo
|
||||||
*/
|
*/
|
||||||
@Repository("boletoDAO")
|
@Repository("boletoDAO")
|
||||||
public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implements BoletoDAO {
|
public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implements BoletoDAO {
|
||||||
|
private static Logger log = Logger.getLogger(BoletoHibernateDAO.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
public BoletoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public BoletoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
|
@ -65,6 +72,27 @@ public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implem
|
||||||
return (Boleto) c.uniqueResult();
|
return (Boleto) c.uniqueResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExisteBoletoPorCorrida(Integer corridaId, Date fecCorrida) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
StringBuilder hql = new StringBuilder();
|
||||||
|
hql.append(" select ");
|
||||||
|
hql.append(" count(*) from boleto b where " );
|
||||||
|
hql.append(" b.corrida_id = :corridaId and b.feccorrida = :feccorrida and ROWNUM = 1 and b.activo = :isActivo");
|
||||||
|
Query query = getSession().createSQLQuery(hql.toString());
|
||||||
|
query.setInteger("isActivo", ActivoUtil.ATIVO);
|
||||||
|
query.setDate("feccorrida", fecCorrida);
|
||||||
|
query.setInteger("corridaId", corridaId);
|
||||||
|
|
||||||
|
BigDecimal qtde = (BigDecimal) query.uniqueResult();
|
||||||
|
return qtde !=null && MoneyHelper.isMaior(qtde, BigDecimal.ZERO) ;
|
||||||
|
}catch(Exception e) {
|
||||||
|
log.error("Erro buscar Bole to por corrida para corrida=" + corridaId + "data:" + DateUtil.getStringDate(fecCorrida), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public String getSequenciaBoletoId(){
|
public String getSequenciaBoletoId(){
|
||||||
String sql = "SELECT BOLETO_SEQ.nextval FROM DUAL";
|
String sql = "SELECT BOLETO_SEQ.nextval FROM DUAL";
|
||||||
Object o = this.getSession().createSQLQuery(sql).uniqueResult();
|
Object o = this.getSession().createSQLQuery(sql).uniqueResult();
|
||||||
|
@ -84,7 +112,7 @@ public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertBoletoRserva(Boleto miBoletoTemporal){
|
public void insertBoletoReserva(Boleto miBoletoTemporal){
|
||||||
SQLQuery query = getSession().createSQLQuery(getSqlInsertBoletoRserva());
|
SQLQuery query = getSession().createSQLQuery(getSqlInsertBoletoRserva());
|
||||||
|
|
||||||
query.setLong("boletoId", miBoletoTemporal.getBoletoId());
|
query.setLong("boletoId", miBoletoTemporal.getBoletoId());
|
||||||
|
@ -130,7 +158,7 @@ public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implem
|
||||||
query.setBigDecimal("preciopagado", miBoletoTemporal.getPreciopagado());
|
query.setBigDecimal("preciopagado", miBoletoTemporal.getPreciopagado());
|
||||||
query.setBigDecimal("preciobase", miBoletoTemporal.getPreciobase());
|
query.setBigDecimal("preciobase", miBoletoTemporal.getPreciobase());
|
||||||
query.setInteger("ptovtaventaId", miBoletoTemporal.getPtovtaventaId());
|
query.setInteger("ptovtaventaId", miBoletoTemporal.getPtovtaventaId());
|
||||||
query.setInteger("puntoventaId", miBoletoTemporal.getPuntoVenta().getPuntoventaId());
|
query.setInteger("puntoventaId", miBoletoTemporal.getPuntoVentaId());
|
||||||
query.setInteger("rutaId", miBoletoTemporal.getRutaId());
|
query.setInteger("rutaId", miBoletoTemporal.getRutaId());
|
||||||
query.setInteger("temporeservafidelidade", miBoletoTemporal.getTemporeservafidelidade());
|
query.setInteger("temporeservafidelidade", miBoletoTemporal.getTemporeservafidelidade());
|
||||||
query.setInteger("tipoventaId", miBoletoTemporal.getTipoventaId());
|
query.setInteger("tipoventaId", miBoletoTemporal.getTipoventaId());
|
||||||
|
|
|
@ -819,6 +819,30 @@ public class CorridaHibernateDAO extends GenericHibernateDAO<Corrida, Corrida.Id
|
||||||
query.setMaxResults(1);
|
query.setMaxResults(1);
|
||||||
return (Corrida)query.uniqueResult();
|
return (Corrida)query.uniqueResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Corrida buscarCorridaAtivaPorId(Id id) {
|
||||||
|
|
||||||
|
StringBuilder hql = new StringBuilder();
|
||||||
|
|
||||||
|
hql.append(" from Corrida corrida ");
|
||||||
|
hql.append(" where corrida.id.feccorrida = :feccorrida ");
|
||||||
|
hql.append(" and corrida.id.corridaId = :corridaId )");
|
||||||
|
hql.append(" and corrida.activo = 1 )");
|
||||||
|
|
||||||
|
Query query = getSession().createQuery(hql.toString());
|
||||||
|
query.setDate("feccorrida", id.getFeccorrida());
|
||||||
|
query.setInteger("corridaId", id.getCorridaId());
|
||||||
|
|
||||||
|
query.setMaxResults(1);
|
||||||
|
return (Corrida)query.uniqueResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Corrida> buscaCorridaFutura(){
|
||||||
|
List<Corrida> corridaList = new ArrayList<Corrida>();
|
||||||
|
|
||||||
|
return corridaList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Corrida> buscarCorridaRelAproveitamento(Parada origem, Parada destino,
|
public List<Corrida> buscarCorridaRelAproveitamento(Parada origem, Parada destino,
|
||||||
|
|
|
@ -290,5 +290,6 @@ public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Inte
|
||||||
|
|
||||||
return qr.list();
|
return qr.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,8 @@ public class Boleto implements java.io.Serializable {
|
||||||
@Column(name = "DESTINO_ID", precision = 7, scale = 0)
|
@Column(name = "DESTINO_ID", precision = 7, scale = 0)
|
||||||
private Integer destinoId;
|
private Integer destinoId;
|
||||||
|
|
||||||
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
@Column(name = "PUNTOVENTA_ID")
|
||||||
@ManyToOne
|
private Integer puntoVentaId;
|
||||||
private PuntoVenta puntoVenta;
|
|
||||||
|
|
||||||
@Column(name = "CORRIDA_ID", precision = 7, scale = 0)
|
@Column(name = "CORRIDA_ID", precision = 7, scale = 0)
|
||||||
private Integer corridaId;
|
private Integer corridaId;
|
||||||
|
@ -338,7 +337,7 @@ public class Boleto implements java.io.Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boleto(long boletoId, String numasiento, Integer categoriaId, String numfoliosistema, Byte claseservicioId,
|
public Boleto(long boletoId, String numasiento, Integer categoriaId, String numfoliosistema, Byte claseservicioId,
|
||||||
Short marcaId, Integer origenId, Integer destinoId, PuntoVenta puntoVenta, Integer corridaId,
|
Short marcaId, Integer origenId, Integer destinoId, Integer puntoVentaId, Integer corridaId,
|
||||||
Date feccorrida, String nombpasajero, BigDecimal preciobase, BigDecimal preciopagado,
|
Date feccorrida, String nombpasajero, BigDecimal preciobase, BigDecimal preciopagado,
|
||||||
BigDecimal descuentoamparado, Byte tipoventaId, String numseriepreimpresa, String numfoliopreimpreso,
|
BigDecimal descuentoamparado, Byte tipoventaId, String numseriepreimpresa, String numfoliopreimpreso,
|
||||||
Date fechorviaje, Date fechorventa, BigDecimal numkmviaje, String numoperacion, String indstatusoperacion,
|
Date fechorviaje, Date fechorventa, BigDecimal numkmviaje, String numoperacion, String indstatusoperacion,
|
||||||
|
@ -367,7 +366,7 @@ public class Boleto implements java.io.Serializable {
|
||||||
this.marcaId = marcaId;
|
this.marcaId = marcaId;
|
||||||
this.origenId = origenId;
|
this.origenId = origenId;
|
||||||
this.destinoId = destinoId;
|
this.destinoId = destinoId;
|
||||||
this.puntoVenta = puntoVenta;
|
this.puntoVentaId = puntoVentaId;
|
||||||
this.corridaId = corridaId;
|
this.corridaId = corridaId;
|
||||||
this.feccorrida = feccorrida;
|
this.feccorrida = feccorrida;
|
||||||
this.nombpasajero = nombpasajero;
|
this.nombpasajero = nombpasajero;
|
||||||
|
@ -521,14 +520,6 @@ public class Boleto implements java.io.Serializable {
|
||||||
this.destinoId = destinoId;
|
this.destinoId = destinoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PuntoVenta getPuntoVenta() {
|
|
||||||
return puntoVenta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
|
||||||
this.puntoVenta = puntoVenta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getCorridaId() {
|
public Integer getCorridaId() {
|
||||||
return this.corridaId;
|
return this.corridaId;
|
||||||
}
|
}
|
||||||
|
@ -1249,4 +1240,12 @@ public class Boleto implements java.io.Serializable {
|
||||||
public void setFechorventaH(Date fechorventaH) {
|
public void setFechorventaH(Date fechorventaH) {
|
||||||
this.fechorventaH = fechorventaH;
|
this.fechorventaH = fechorventaH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPuntoVentaId() {
|
||||||
|
return puntoVentaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVentaId(Integer puntoVentaId) {
|
||||||
|
this.puntoVentaId = puntoVentaId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,5 @@ public interface BoletoService {
|
||||||
String numFidelidade, Integer claseservicioId, Short marcaId, Date fecViaje, Integer empresaCorridaId, String nombPassageiro,
|
String numFidelidade, Integer claseservicioId, Short marcaId, Date fecViaje, Integer empresaCorridaId, String nombPassageiro,
|
||||||
BigDecimal valorSeguro, BigDecimal valorTaxaEmbarque, BigDecimal valorPedagio) throws Exception;
|
BigDecimal valorSeguro, BigDecimal valorTaxaEmbarque, BigDecimal valorPedagio) throws Exception;
|
||||||
|
|
||||||
|
public boolean isExisteBoletoPorCorrida(Integer corridaId, Date fecCorrida);
|
||||||
}
|
}
|
|
@ -14,6 +14,7 @@ import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
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.Corrida.Id;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,4 +81,10 @@ public interface CorridaService extends GenericService<Corrida, Corrida.Id> {
|
||||||
public Boolean existeCorrida(Long id);
|
public Boolean existeCorrida(Long id);
|
||||||
|
|
||||||
public Integer buscarOcupacaoCorrida(Corrida corrida);
|
public Integer buscarOcupacaoCorrida(Corrida corrida);
|
||||||
|
|
||||||
|
public Boolean generarCorrida(Date dataGeracao, List<EsquemaCorrida> lsEsquemaCorrida, boolean isGeracaoAutomaticaCorrida);
|
||||||
|
|
||||||
|
public Corrida buscarPorId(Corrida.Id id);
|
||||||
|
|
||||||
|
public Corrida buscarCorridaAtivaPorId(Id id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,4 +48,5 @@ public interface PuntoVentaService {
|
||||||
public List<PuntoVentaVO> buscaPuntoVentaEmpresaSemECF(Empresa empresa);
|
public List<PuntoVentaVO> buscaPuntoVentaEmpresaSemECF(Empresa empresa);
|
||||||
|
|
||||||
List<PuntoVenta> buscarPuntoVentaPtoVtaComissao(List<Empresa> empresas);
|
List<PuntoVenta> buscarPuntoVentaPtoVtaComissao(List<Empresa> empresas);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class BoletoServiceImpl implements BoletoService {
|
||||||
miBoletoTemporal.setOrigenId(unoTerminalOrigenId);
|
miBoletoTemporal.setOrigenId(unoTerminalOrigenId);
|
||||||
miBoletoTemporal.setPreciopricing(BigDecimal.ZERO);
|
miBoletoTemporal.setPreciopricing(BigDecimal.ZERO);
|
||||||
miBoletoTemporal.setPorccategoria(null);
|
miBoletoTemporal.setPorccategoria(null);
|
||||||
miBoletoTemporal.setPuntoVenta(miPuntoVenta);
|
miBoletoTemporal.setPuntoVentaId(unPuntoVenta.intValue());
|
||||||
miBoletoTemporal.setPtovtaventaId(miPuntoVenta.getPuntoventaId());
|
miBoletoTemporal.setPtovtaventaId(miPuntoVenta.getPuntoventaId());
|
||||||
miBoletoTemporal.setRutaId(rutaId);
|
miBoletoTemporal.setRutaId(rutaId);
|
||||||
miBoletoTemporal.setTemporeservafidelidade(tempoReserva!=null ? tempoReserva.intValue() : 0);
|
miBoletoTemporal.setTemporeservafidelidade(tempoReserva!=null ? tempoReserva.intValue() : 0);
|
||||||
|
@ -118,7 +118,7 @@ public class BoletoServiceImpl implements BoletoService {
|
||||||
miBoletoTemporal.setUsuario(usuario);
|
miBoletoTemporal.setUsuario(usuario);
|
||||||
miBoletoTemporal.setActivo(true);
|
miBoletoTemporal.setActivo(true);
|
||||||
// Cria boleto de reserva
|
// Cria boleto de reserva
|
||||||
boletoDAO.insertBoletoRserva(miBoletoTemporal);
|
boletoDAO.insertBoletoReserva(miBoletoTemporal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,6 +191,10 @@ public class BoletoServiceImpl implements BoletoService {
|
||||||
return "01" + (String.format("%010d", Integer.valueOf(numReservacopnSeq).intValue()));
|
return "01" + (String.format("%010d", Integer.valueOf(numReservacopnSeq).intValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExisteBoletoPorCorrida(Integer corridaId, Date fecCorrida) {
|
||||||
|
return boletoDAO.isExisteBoletoPorCorrida(corridaId, fecCorrida);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,13 +197,10 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
return corridaDAO.actualizacion(entidad);
|
return corridaDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void borrar(Corrida entidad) {
|
public void borrar(Corrida entidad) {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
corridaDAO.borrar(entidad);
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
||||||
entidad.setActivo(ActivoUtil.ATIVO);
|
|
||||||
|
|
||||||
corridaDAO.actualizacion(entidad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -915,7 +912,7 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
return b - a;
|
return b - a;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean generarCorrida(Date dataGeracao, List<EsquemaCorrida> lsEsquemaCorrida, boolean isGeracaoAutomaticaCorrida) {
|
public Boolean generarCorrida(Date dataGeracao, List<EsquemaCorrida> lsEsquemaCorrida, boolean isGeracaoAutomaticaCorrida) {
|
||||||
|
|
||||||
DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
DefaultTransactionDefinition def = new DefaultTransactionDefinition(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
||||||
|
|
||||||
|
@ -1027,12 +1024,15 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
}catch (Exception e) {
|
||||||
|
log.error("Erro ao gerar corrida", e );
|
||||||
|
}
|
||||||
|
finally {
|
||||||
if ((status != null) && (!status.isCompleted())) {
|
if ((status != null) && (!status.isCompleted())) {
|
||||||
transactionManager.commit(status);
|
transactionManager.commit(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Valida se existe configuração de reserva para o cliente e crria Cria reserva
|
//Valida se existe configuração de reserva para o cliente e cria Cria reserva
|
||||||
if(corrida !=null) {
|
if(corrida !=null) {
|
||||||
if(unUsuarioId!=null && unPuntoVenta!=null && estacionId!=null) {
|
if(unUsuarioId!=null && unPuntoVenta!=null && estacionId!=null) {
|
||||||
validaCriaReservaCliente(corrida, unUsuarioId, unPuntoVenta, estacionId);
|
validaCriaReservaCliente(corrida, unUsuarioId, unPuntoVenta, estacionId);
|
||||||
|
@ -1715,5 +1715,18 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
public Integer buscarOcupacaoCorrida(Corrida corrida) {
|
public Integer buscarOcupacaoCorrida(Corrida corrida) {
|
||||||
return corridaDAO.buscarOcupacaoCorrida(corrida);
|
return corridaDAO.buscarOcupacaoCorrida(corrida);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Corrida buscarPorId(Id id) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return corridaDAO.buscarPorId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Corrida buscarCorridaAtivaPorId(Id id) {
|
||||||
|
return corridaDAO.buscarCorridaAtivaPorId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,6 +188,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
return entidad;
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void integraAG(PuntoVenta entidad) throws IntegracionException{
|
private void integraAG(PuntoVenta entidad) throws IntegracionException{
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue