fixes bug #7588
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@58752 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7ccc6ad523
commit
1b8e707921
|
@ -220,20 +220,19 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
Map<Integer, CasetaPeaje> casetas = buscaCasetas(pvos);
|
||||
Map<Integer, ExcepcionPeaje> excepciones = new HashMap<Integer, ExcepcionPeaje>();
|
||||
for (PeajeVO peaje : pvos){
|
||||
ExcepcionPeaje excepcion = getExcepcion(peaje.rutaId, peaje.origenId, peaje.destinoId);
|
||||
if (excepcion == null){
|
||||
excepcion = new ExcepcionPeaje();
|
||||
excepcion.setActivo(true);
|
||||
excepcion.setDestino(getParada(peaje.destinoId));
|
||||
excepcion.setFecmodif(Calendar.getInstance().getTime());
|
||||
excepcion.setOrigem(getParada(peaje.origenId));
|
||||
excepcion.setRuta(getRuta(peaje.rutaId));
|
||||
excepcion.setUsuarioId(1);
|
||||
}
|
||||
|
||||
ExcepcionPeaje excepcion = null;
|
||||
CasetaPeaje caseta = casetas.get(peaje.casetaPeajeId);
|
||||
|
||||
for (CasetaPeajeExcepcion cpe : caseta.getLsCasetaPeajeExcepcion()){
|
||||
if (excepcion == null){
|
||||
excepcion = new ExcepcionPeaje();
|
||||
excepcion.setActivo(true);
|
||||
excepcion.setDestino(getParada(peaje.destinoId));
|
||||
excepcion.setFecmodif(Calendar.getInstance().getTime());
|
||||
excepcion.setOrigem(getParada(peaje.origenId));
|
||||
excepcion.setRuta(getRuta(peaje.rutaId));
|
||||
excepcion.setUsuarioId(1);
|
||||
}
|
||||
ExcepcionPeajeVigencia epv = new ExcepcionPeajeVigencia();
|
||||
epv.setActivo(cpe.getActivo());
|
||||
epv.setExcepcionPeaje(excepcion);
|
||||
|
@ -253,9 +252,10 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
epv.setUsuarioId(1);
|
||||
epv.setCasetaPeaje(caseta);
|
||||
excepcion.getLsExcepcionPeajeVigencia().add(epv);
|
||||
}
|
||||
if (excepcion != null){
|
||||
getSession().saveOrUpdate(excepcion);
|
||||
}
|
||||
|
||||
getSession().saveOrUpdate(excepcion);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,9 @@ public class CasetaPeaje implements Serializable, Comparable<CasetaPeaje>, Clone
|
|||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@OneToMany(mappedBy = "casetaPeaje")
|
||||
@OneToMany(mappedBy = "casetaPeaje", fetch=FetchType.EAGER, cascade=CascadeType.ALL)
|
||||
@Where(clause="ACTIVO=1")
|
||||
@Fetch(value = FetchMode.SELECT)
|
||||
private List<CasetaPeajeExcepcion> lsCasetaPeajeExcepcion = new ArrayList<CasetaPeajeExcepcion>();
|
||||
@ManyToMany(fetch=FetchType.EAGER)
|
||||
@JoinTable(name = "RUTA_CASETA", joinColumns = { @JoinColumn(name = "CASETAPEAJE_ID") },
|
||||
|
|
Loading…
Reference in New Issue