fixed bug#17744
dev:Wilian qua: Merge da branch da aguia. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@99550 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
43e6375210
commit
eb307505f9
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoTramo;
|
||||||
|
|
||||||
|
public interface ConfRestricaoTramoDAO extends GenericDAO<ConfRestricaoTramo, Long> {
|
||||||
|
|
||||||
|
}
|
|
@ -71,4 +71,6 @@ public interface RutaDAO extends GenericDAO<Ruta, Integer> {
|
||||||
|
|
||||||
public List<Ruta> buscarRutasVendaEmbarcada(List<Integer> empresasIds, Integer rutaId, String numeroLinha, String descRuta, ClaseServicio classe);
|
public List<Ruta> buscarRutasVendaEmbarcada(List<Integer> empresasIds, Integer rutaId, String numeroLinha, String descRuta, ClaseServicio classe);
|
||||||
|
|
||||||
|
public List<Ruta> buscaLikeComboBox(String stringConsulta);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.ConfRestricaoTramoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoTramo;
|
||||||
|
|
||||||
|
@Repository("confRestricaoTramoDAO")
|
||||||
|
public class ConfRestricaoTramoHibernateDAO extends GenericHibernateDAO<ConfRestricaoTramo, Long>
|
||||||
|
implements ConfRestricaoTramoDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConfRestricaoTramoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,9 +12,11 @@ import org.hibernate.Criteria;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SQLQuery;
|
import org.hibernate.SQLQuery;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.MatchMode;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Projections;
|
import org.hibernate.criterion.Projections;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.hibernate.criterion.SimpleExpression;
|
||||||
import org.hibernate.transform.AliasToBeanResultTransformer;
|
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||||
import org.hibernate.type.LongType;
|
import org.hibernate.type.LongType;
|
||||||
import org.hibernate.type.StringType;
|
import org.hibernate.type.StringType;
|
||||||
|
@ -37,7 +39,6 @@ import com.rjconsultores.ventaboletos.vo.ruta.RutaVO;
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
*/
|
*/
|
||||||
@Repository("rutaDAO")
|
@Repository("rutaDAO")
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> implements RutaDAO {
|
public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> implements RutaDAO {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -394,7 +395,6 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
||||||
if(numeroLinha != null) {
|
if(numeroLinha != null) {
|
||||||
List<String> numRutas = Arrays.asList(numeroLinha.split(","));
|
List<String> numRutas = Arrays.asList(numeroLinha.split(","));
|
||||||
c.add(Restrictions.in("numRuta", numRutas));
|
c.add(Restrictions.in("numRuta", numRutas));
|
||||||
// c.add(Restrictions.eq("numRuta", numeroLinha));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(descRuta != null && !descRuta.isEmpty()) {
|
if(descRuta != null && !descRuta.isEmpty()) {
|
||||||
|
@ -413,4 +413,24 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ruta> buscaLikeComboBox(String stringConsulta) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
final SimpleExpression validaNumRuta = Restrictions.like("numRuta", stringConsulta, MatchMode.START);
|
||||||
|
final SimpleExpression validaDescruta = Restrictions.like("descruta", stringConsulta, MatchMode.ANYWHERE);
|
||||||
|
|
||||||
|
// c.createAlias("claseServicio", "claseServicio");
|
||||||
|
|
||||||
|
c.add(Restrictions.or(validaNumRuta, validaDescruta));
|
||||||
|
// c.setProjection(Projections.projectionList()
|
||||||
|
// .add(Projections.groupProperty("numRuta"))
|
||||||
|
// .add(Projections.property("descruta"))
|
||||||
|
// .add(Projections.property("claseServicio.descclase")));
|
||||||
|
|
||||||
|
c.addOrder(Order.asc("numRuta"));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@SequenceGenerator(name = "CONF_RESTRICAO_CANALVENTA_SEQ", sequenceName = "CONF_RESTRICAO_CANALVENTA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CONF_RESTRICAO_CANALVENTA_SEQ", sequenceName = "CONF_RESTRICAO_CANALVENTA_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CONF_RESTRICAO_CANALVENTA")
|
@Table(name = "CONF_RESTRICAO_CANALVENTA")
|
||||||
|
@ -37,32 +39,43 @@ public class ConfRestricaoCanalVenta implements Serializable {
|
||||||
private String descConfRestricaoCanalVenta;
|
private String descConfRestricaoCanalVenta;
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "TIPOPTOVTA_ID")
|
@JoinColumn(name = "TIPOPTOVTA_ID")
|
||||||
|
@Deprecated
|
||||||
private TipoPuntoVenta tipoPuntoVenta;
|
private TipoPuntoVenta tipoPuntoVenta;
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "ORIGEN_ID")
|
@JoinColumn(name = "ORIGEN_ID")
|
||||||
|
@Deprecated
|
||||||
private Parada origem;
|
private Parada origem;
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "DESTINO_ID")
|
@JoinColumn(name = "DESTINO_ID")
|
||||||
|
@Deprecated
|
||||||
private Parada destino;
|
private Parada destino;
|
||||||
@Column(name = "TEMPOPERMITIR")
|
@Column(name = "TEMPOPERMITIR")
|
||||||
|
@Deprecated
|
||||||
private Date tempoPermitir;
|
private Date tempoPermitir;
|
||||||
@Column(name = "CORRIDA_ID")
|
@Column(name = "CORRIDA_ID")
|
||||||
private Integer corridaId;
|
private Integer corridaId;
|
||||||
@Column(name = "FECCORRIDA")
|
@Column(name = "FECCORRIDA")
|
||||||
private Date fecCorrida;
|
private Date fecCorrida;
|
||||||
@Column(name = "SEGUNDA")
|
@Column(name = "SEGUNDA")
|
||||||
|
@Deprecated
|
||||||
private Boolean segunda;
|
private Boolean segunda;
|
||||||
@Column(name = "TERCA")
|
@Column(name = "TERCA")
|
||||||
|
@Deprecated
|
||||||
private Boolean terca;
|
private Boolean terca;
|
||||||
@Column(name = "QUARTA")
|
@Column(name = "QUARTA")
|
||||||
|
@Deprecated
|
||||||
private Boolean quarta;
|
private Boolean quarta;
|
||||||
@Column(name = "QUINTA")
|
@Column(name = "QUINTA")
|
||||||
|
@Deprecated
|
||||||
private Boolean quinta;
|
private Boolean quinta;
|
||||||
@Column(name = "SEXTA")
|
@Column(name = "SEXTA")
|
||||||
|
@Deprecated
|
||||||
private Boolean sexta;
|
private Boolean sexta;
|
||||||
@Column(name = "SABADO")
|
@Column(name = "SABADO")
|
||||||
|
@Deprecated
|
||||||
private Boolean sabado;
|
private Boolean sabado;
|
||||||
@Column(name = "DOMINGO")
|
@Column(name = "DOMINGO")
|
||||||
|
@Deprecated
|
||||||
private Boolean domingo;
|
private Boolean domingo;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
|
@ -92,6 +105,10 @@ public class ConfRestricaoCanalVenta implements Serializable {
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fecfinvigencia;
|
private Date fecfinvigencia;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@Where(clause="activo=1")
|
||||||
|
private List<ConfRestricaoTramo> lsConfRestricaoTramo;
|
||||||
|
|
||||||
public ConfRestricaoCanalVenta() {
|
public ConfRestricaoCanalVenta() {
|
||||||
super();
|
super();
|
||||||
indexibeconsultavendaweb = false;
|
indexibeconsultavendaweb = false;
|
||||||
|
@ -114,34 +131,37 @@ public class ConfRestricaoCanalVenta implements Serializable {
|
||||||
this.descConfRestricaoCanalVenta = descConfRestricaoCanalVenta;
|
this.descConfRestricaoCanalVenta = descConfRestricaoCanalVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public TipoPuntoVenta getTipoPuntoVenta() {
|
public TipoPuntoVenta getTipoPuntoVenta() {
|
||||||
return tipoPuntoVenta;
|
return tipoPuntoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) {
|
public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) {
|
||||||
this.tipoPuntoVenta = tipoPuntoVenta;
|
this.tipoPuntoVenta = tipoPuntoVenta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public Parada getOrigem() {
|
public Parada getOrigem() {
|
||||||
return origem;
|
return origem;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setOrigem(Parada origem) {
|
public void setOrigem(Parada origem) {
|
||||||
this.origem = origem;
|
this.origem = origem;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Parada getDestino() {
|
public Parada getDestino() {
|
||||||
return destino;
|
return destino;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setDestino(Parada destino) {
|
public void setDestino(Parada destino) {
|
||||||
this.destino = destino;
|
this.destino = destino;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Date getTempoPermitir() {
|
public Date getTempoPermitir() {
|
||||||
return tempoPermitir;
|
return tempoPermitir;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setTempoPermitir(Date tempoPermitir) {
|
public void setTempoPermitir(Date tempoPermitir) {
|
||||||
this.tempoPermitir = tempoPermitir;
|
this.tempoPermitir = tempoPermitir;
|
||||||
}
|
}
|
||||||
|
@ -161,59 +181,59 @@ public class ConfRestricaoCanalVenta implements Serializable {
|
||||||
public void setFecCorrida(Date fecCorrida) {
|
public void setFecCorrida(Date fecCorrida) {
|
||||||
this.fecCorrida = fecCorrida;
|
this.fecCorrida = fecCorrida;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getSegunda() {
|
public Boolean getSegunda() {
|
||||||
return segunda;
|
return segunda;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setSegunda(Boolean segunda) {
|
public void setSegunda(Boolean segunda) {
|
||||||
this.segunda = segunda;
|
this.segunda = segunda;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getTerca() {
|
public Boolean getTerca() {
|
||||||
return terca;
|
return terca;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setTerca(Boolean terca) {
|
public void setTerca(Boolean terca) {
|
||||||
this.terca = terca;
|
this.terca = terca;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getQuarta() {
|
public Boolean getQuarta() {
|
||||||
return quarta;
|
return quarta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setQuarta(Boolean quarta) {
|
public void setQuarta(Boolean quarta) {
|
||||||
this.quarta = quarta;
|
this.quarta = quarta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getQuinta() {
|
public Boolean getQuinta() {
|
||||||
return quinta;
|
return quinta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setQuinta(Boolean quinta) {
|
public void setQuinta(Boolean quinta) {
|
||||||
this.quinta = quinta;
|
this.quinta = quinta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getSexta() {
|
public Boolean getSexta() {
|
||||||
return sexta;
|
return sexta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setSexta(Boolean sexta) {
|
public void setSexta(Boolean sexta) {
|
||||||
this.sexta = sexta;
|
this.sexta = sexta;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getSabado() {
|
public Boolean getSabado() {
|
||||||
return sabado;
|
return sabado;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setSabado(Boolean sabado) {
|
public void setSabado(Boolean sabado) {
|
||||||
this.sabado = sabado;
|
this.sabado = sabado;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public Boolean getDomingo() {
|
public Boolean getDomingo() {
|
||||||
return domingo;
|
return domingo;
|
||||||
}
|
}
|
||||||
|
@Deprecated
|
||||||
public void setDomingo(Boolean domingo) {
|
public void setDomingo(Boolean domingo) {
|
||||||
this.domingo = domingo;
|
this.domingo = domingo;
|
||||||
}
|
}
|
||||||
|
@ -332,6 +352,17 @@ public class ConfRestricaoCanalVenta implements Serializable {
|
||||||
this.fecfinvigencia = fecfinvigencia;
|
this.fecfinvigencia = fecfinvigencia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ConfRestricaoTramo> getLsConfRestricaoTramo() {
|
||||||
|
if(lsConfRestricaoTramo== null) {
|
||||||
|
lsConfRestricaoTramo = new ArrayList<ConfRestricaoTramo>();
|
||||||
|
}
|
||||||
|
return lsConfRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsConfRestricaoTramo(List<ConfRestricaoTramo> lsConfRestricaoTramo) {
|
||||||
|
this.lsConfRestricaoTramo = lsConfRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
|
|
@ -11,6 +11,7 @@ import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.SequenceGenerator;
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
|
@ -39,6 +40,10 @@ public class ConfRestricaoExcecao implements Serializable {
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
|
@JoinColumn(name = "CONFRESTRICAOTRAMO_ID", referencedColumnName = "CONFRESTRICAOTRAMO_ID")
|
||||||
|
@OneToOne
|
||||||
|
private ConfRestricaoTramo confRestricaoTramo;
|
||||||
|
|
||||||
|
|
||||||
public Integer getConfRestricaoExcecaoId() {
|
public Integer getConfRestricaoExcecaoId() {
|
||||||
return confRestricaoExcecaoId;
|
return confRestricaoExcecaoId;
|
||||||
|
@ -88,28 +93,58 @@ public class ConfRestricaoExcecao implements Serializable {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfRestricaoTramo getConfRestricaoTramo() {
|
||||||
|
return confRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfRestricaoTramo(ConfRestricaoTramo confRestricaoTramo) {
|
||||||
|
this.confRestricaoTramo = confRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((confRestricaoExcecaoId == null) ? 0 : confRestricaoExcecaoId.hashCode());
|
result = prime * result + ((activo == null) ? 0 : activo.hashCode());
|
||||||
|
result = prime * result + ((confRestricaoTramo == null) ? 0 : confRestricaoTramo.hashCode());
|
||||||
|
result = prime * result + ((fecExcecao == null) ? 0 : fecExcecao.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
if (obj == null)
|
}
|
||||||
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
if (getClass() != obj.getClass())
|
}
|
||||||
|
if (!(obj instanceof ConfRestricaoExcecao)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
ConfRestricaoExcecao other = (ConfRestricaoExcecao) obj;
|
ConfRestricaoExcecao other = (ConfRestricaoExcecao) obj;
|
||||||
if (confRestricaoExcecaoId == null) {
|
if (activo == null) {
|
||||||
if (other.confRestricaoExcecaoId != null)
|
if (other.activo != null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!confRestricaoExcecaoId.equals(other.confRestricaoExcecaoId))
|
}
|
||||||
|
} else if (!activo.equals(other.activo)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
if (confRestricaoTramo == null) {
|
||||||
|
if (other.confRestricaoTramo != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!confRestricaoTramo.equals(other.confRestricaoTramo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (fecExcecao == null) {
|
||||||
|
if (other.fecExcecao != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!fecExcecao.equals(other.fecExcecao)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.SequenceGenerator;
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
|
@ -40,6 +41,9 @@ public class ConfRestricaoPtovta implements Serializable {
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
|
@JoinColumn(name = "CONFRESTRICAOTRAMO_ID", referencedColumnName = "CONFRESTRICAOTRAMO_ID")
|
||||||
|
@OneToOne
|
||||||
|
private ConfRestricaoTramo confRestricaoTramo;
|
||||||
|
|
||||||
public Integer getConfRestricaoPtovtaId() {
|
public Integer getConfRestricaoPtovtaId() {
|
||||||
return confRestricaoPtovtaId;
|
return confRestricaoPtovtaId;
|
||||||
|
@ -89,28 +93,59 @@ public class ConfRestricaoPtovta implements Serializable {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfRestricaoTramo getConfRestricaoTramo() {
|
||||||
|
return confRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfRestricaoTramo(ConfRestricaoTramo confRestricaoTramo) {
|
||||||
|
this.confRestricaoTramo = confRestricaoTramo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
result = prime * result + ((confRestricaoPtovtaId == null) ? 0 : confRestricaoPtovtaId.hashCode());
|
result = prime * result + ((activo == null) ? 0 : activo.hashCode());
|
||||||
|
result = prime * result + ((confRestricaoTramo == null) ? 0 : confRestricaoTramo.hashCode());
|
||||||
|
result = prime * result + ((puntoVenta == null) ? 0 : puntoVenta.hashCode());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) {
|
||||||
return true;
|
return true;
|
||||||
if (obj == null)
|
}
|
||||||
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
if (getClass() != obj.getClass())
|
}
|
||||||
|
if (!(obj instanceof ConfRestricaoPtovta)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
ConfRestricaoPtovta other = (ConfRestricaoPtovta) obj;
|
ConfRestricaoPtovta other = (ConfRestricaoPtovta) obj;
|
||||||
if (confRestricaoPtovtaId == null) {
|
if (activo == null) {
|
||||||
if (other.confRestricaoPtovtaId != null)
|
if (other.activo != null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (!confRestricaoPtovtaId.equals(other.confRestricaoPtovtaId))
|
}
|
||||||
|
} else if (!activo.equals(other.activo)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
if (confRestricaoTramo == null) {
|
||||||
|
if (other.confRestricaoTramo != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!confRestricaoTramo.equals(other.confRestricaoTramo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (puntoVenta == null) {
|
||||||
|
if (other.puntoVenta != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!puntoVenta.equals(other.puntoVenta)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,274 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "CONF_RESTRICAO_TRAMO_SEQ", sequenceName = "CONF_RESTRICAO_TRAMO_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CONF_RESTRICAO_TRAMO")
|
||||||
|
public class ConfRestricaoTramo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONF_RESTRICAO_TRAMO_SEQ")
|
||||||
|
@Column(name = "CONFRESTRICAOTRAMO_ID")
|
||||||
|
private Long confRestricaoTramoId;
|
||||||
|
|
||||||
|
@JoinColumn(name = "CONFRESTRICAOCANALVENTA_ID", referencedColumnName = "CONFRESTRICAOCANALVENTA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private ConfRestricaoCanalVenta confRestricaoCanalVenta;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "TIPOPTOVTA_ID")
|
||||||
|
private TipoPuntoVenta tipoPuntoVenta;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "ORIGEN_ID")
|
||||||
|
private Parada origem;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "DESTINO_ID")
|
||||||
|
private Parada destino;
|
||||||
|
@Column(name = "TEMPOPERMITIR")
|
||||||
|
private Date tempoPermitir;
|
||||||
|
|
||||||
|
@Column(name = "SEGUNDA")
|
||||||
|
private Boolean segunda;
|
||||||
|
@Column(name = "TERCA")
|
||||||
|
private Boolean terca;
|
||||||
|
@Column(name = "QUARTA")
|
||||||
|
private Boolean quarta;
|
||||||
|
@Column(name = "QUINTA")
|
||||||
|
private Boolean quinta;
|
||||||
|
@Column(name = "SEXTA")
|
||||||
|
private Boolean sexta;
|
||||||
|
@Column(name = "SABADO")
|
||||||
|
private Boolean sabado;
|
||||||
|
@Column(name = "DOMINGO")
|
||||||
|
private Boolean domingo;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Long getConfRestricaoTramoId() {
|
||||||
|
return confRestricaoTramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfRestricaoTramoId(Long confRestricaoTramoId) {
|
||||||
|
this.confRestricaoTramoId = confRestricaoTramoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfRestricaoCanalVenta getConfRestricaoCanalVenta() {
|
||||||
|
return confRestricaoCanalVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfRestricaoCanalVenta(ConfRestricaoCanalVenta confRestricaoCanalVenta) {
|
||||||
|
this.confRestricaoCanalVenta = confRestricaoCanalVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoPuntoVenta getTipoPuntoVenta() {
|
||||||
|
return tipoPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) {
|
||||||
|
this.tipoPuntoVenta = tipoPuntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getOrigem() {
|
||||||
|
return origem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigem(Parada origem) {
|
||||||
|
this.origem = origem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(Parada destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getTempoPermitir() {
|
||||||
|
return tempoPermitir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTempoPermitir(Date tempoPermitir) {
|
||||||
|
this.tempoPermitir = tempoPermitir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getSegunda() {
|
||||||
|
return segunda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSegunda(Boolean segunda) {
|
||||||
|
this.segunda = segunda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getTerca() {
|
||||||
|
return terca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerca(Boolean terca) {
|
||||||
|
this.terca = terca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getQuarta() {
|
||||||
|
return quarta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuarta(Boolean quarta) {
|
||||||
|
this.quarta = quarta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getQuinta() {
|
||||||
|
return quinta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuinta(Boolean quinta) {
|
||||||
|
this.quinta = quinta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getSexta() {
|
||||||
|
return sexta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSexta(Boolean sexta) {
|
||||||
|
this.sexta = sexta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getSabado() {
|
||||||
|
return sabado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSabado(Boolean sabado) {
|
||||||
|
this.sabado = sabado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getDomingo() {
|
||||||
|
return domingo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDomingo(Boolean domingo) {
|
||||||
|
this.domingo = domingo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
if (confRestricaoTramoId != null)
|
||||||
|
builder.append(confRestricaoTramoId).append(" - ");
|
||||||
|
if (tipoPuntoVenta != null)
|
||||||
|
builder.append(tipoPuntoVenta).append(" - ");
|
||||||
|
if (origem != null)
|
||||||
|
builder.append(origem).append(" - ");
|
||||||
|
if (destino != null)
|
||||||
|
builder.append(destino);
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((activo == null) ? 0 : activo.hashCode());
|
||||||
|
result = prime * result + ((confRestricaoCanalVenta == null) ? 0 : confRestricaoCanalVenta.hashCode());
|
||||||
|
result = prime * result + ((destino == null) ? 0 : destino.hashCode());
|
||||||
|
result = prime * result + ((origem == null) ? 0 : origem.hashCode());
|
||||||
|
result = prime * result + ((tipoPuntoVenta == null) ? 0 : tipoPuntoVenta.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof ConfRestricaoTramo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ConfRestricaoTramo other = (ConfRestricaoTramo) obj;
|
||||||
|
if (activo == null) {
|
||||||
|
if (other.activo != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!activo.equals(other.activo)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (confRestricaoCanalVenta == null) {
|
||||||
|
if (other.confRestricaoCanalVenta != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!confRestricaoCanalVenta.equals(other.confRestricaoCanalVenta)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (destino == null) {
|
||||||
|
if (other.destino != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!destino.equals(other.destino)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (origem == null) {
|
||||||
|
if (other.origem != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!origem.equals(other.origem)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (tipoPuntoVenta == null) {
|
||||||
|
if (other.tipoPuntoVenta != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!tipoPuntoVenta.equals(other.tipoPuntoVenta)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoTramo;
|
||||||
|
|
||||||
|
public interface ConfRestricaoTramoService extends GenericService<ConfRestricaoTramo, Long> {
|
||||||
|
|
||||||
|
}
|
|
@ -116,4 +116,6 @@ public interface RutaService {
|
||||||
|
|
||||||
public Parada validaParada(String descripcionParada, Parada paradaAntiga) throws Exception;
|
public Parada validaParada(String descripcionParada, Parada paradaAntiga) throws Exception;
|
||||||
|
|
||||||
|
public List<Ruta> buscaLikeComboBox(String stringConsulta);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -29,29 +28,6 @@ public class ConfRestricaoCanalVentaServiceImpl implements ConfRestricaoCanalVen
|
||||||
@Override
|
@Override
|
||||||
public ConfRestricaoCanalVenta suscribirActualizar(ConfRestricaoCanalVenta entidad) throws BusinessException {
|
public ConfRestricaoCanalVenta suscribirActualizar(ConfRestricaoCanalVenta entidad) throws BusinessException {
|
||||||
|
|
||||||
if (StringUtils.isBlank(entidad.getDescConfRestricaoCanalVenta() )){
|
|
||||||
throw new BusinessException("confRestricaoCanalVentaService.MSG.descripcionObliga");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entidad.getTipoPuntoVenta() == null){
|
|
||||||
throw new BusinessException("confRestricaoCanalVentaService.MSG.canalObliga");
|
|
||||||
}
|
|
||||||
|
|
||||||
//se a ruta não é informada, é obrigatório informar a origem e destino
|
|
||||||
if ( (entidad.getRuta() == null) && ( (entidad.getOrigem() == null) || (entidad.getDestino() == null)) ){
|
|
||||||
throw new BusinessException("confRestricaoCanalVentaService.MSG.oriDestObliga");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ((entidad.getOrigem() != null) && (entidad.getDestino() == null)) || ((entidad.getOrigem() == null) && (entidad.getDestino() != null)) ){
|
|
||||||
throw new BusinessException("confRestricaoCanalVentaService.MSG.oriDestObliga");
|
|
||||||
}
|
|
||||||
|
|
||||||
// lsConfRestricaoCanalVenta = obtenerTodos();
|
|
||||||
//
|
|
||||||
// if(isBloqueoExistente(entidad, lsConfRestricaoCanalVenta)){
|
|
||||||
// throw new BusinessException("editarConfRestricaoCanalVentaController.MSG.bloqueoExistente");
|
|
||||||
// }
|
|
||||||
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.ConfRestricaoTramoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoTramo;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConfRestricaoTramoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("confRestricaoTramoService")
|
||||||
|
public class ConfRestricaoTramoServiceImpl implements ConfRestricaoTramoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ConfRestricaoTramoDAO confRestricaoTramoDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfRestricaoTramo> obtenerTodos() {
|
||||||
|
return confRestricaoTramoDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfRestricaoTramo obtenerID(Long id) {
|
||||||
|
return confRestricaoTramoDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public ConfRestricaoTramo suscribir(ConfRestricaoTramo entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return confRestricaoTramoDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public ConfRestricaoTramo actualizacion(ConfRestricaoTramo entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return confRestricaoTramoDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public void borrar(ConfRestricaoTramo entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
confRestricaoTramoDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,6 @@ 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.Comparator;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ import com.rjconsultores.ventaboletos.vo.ruta.RutaVO;
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
*/
|
*/
|
||||||
@Service("rutaService")
|
@Service("rutaService")
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class RutaServiceImpl implements RutaService {
|
public class RutaServiceImpl implements RutaService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -268,7 +266,6 @@ public class RutaServiceImpl implements RutaService {
|
||||||
lsRutaSecuencia.clear();
|
lsRutaSecuencia.clear();
|
||||||
StringBuilder sb = new StringBuilder("Tramo(s) inexistente(s):");
|
StringBuilder sb = new StringBuilder("Tramo(s) inexistente(s):");
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
boolean msg = false;
|
|
||||||
for (int i = 0; i < lsParadasSequencia.size() - 1; i++) {
|
for (int i = 0; i < lsParadasSequencia.size() - 1; i++) {
|
||||||
Parada ori = lsParadasSequencia.get(i).getParada();
|
Parada ori = lsParadasSequencia.get(i).getParada();
|
||||||
Via via = lsParadasSequencia.get(i).getVia();
|
Via via = lsParadasSequencia.get(i).getVia();
|
||||||
|
@ -373,10 +370,6 @@ public class RutaServiceImpl implements RutaService {
|
||||||
|
|
||||||
lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta);
|
lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta);
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
Boolean gerou = true;
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < lsRutaSecuencia.size(); i++) {
|
for (int i = 0; i < lsRutaSecuencia.size(); i++) {
|
||||||
Tramo tramoSecuencia1 = lsRutaSecuencia.get(i).getTramo();
|
Tramo tramoSecuencia1 = lsRutaSecuencia.get(i).getTramo();
|
||||||
Parada origem = tramoSecuencia1.getOrigem();
|
Parada origem = tramoSecuencia1.getOrigem();
|
||||||
|
@ -524,14 +517,14 @@ public class RutaServiceImpl implements RutaService {
|
||||||
return rutaDAO.buscarPorRutaPorEmpresas(lsEmp);
|
return rutaDAO.buscarPorRutaPorEmpresas(lsEmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class RutaComparator implements Comparator<Ruta> {
|
// private class RutaComparator implements Comparator<Ruta> {
|
||||||
@Override
|
// @Override
|
||||||
public int compare(Ruta r1, Ruta r2) {
|
// public int compare(Ruta r1, Ruta r2) {
|
||||||
String name1 = r1.getDescruta();
|
// String name1 = r1.getDescruta();
|
||||||
String name2 = r2.getDescruta();
|
// String name2 = r2.getDescruta();
|
||||||
return name1.compareTo(name2);
|
// return name1.compareTo(name2);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getNumSecuenciaOrigen(Integer rutaId, Integer origenId) {
|
public Integer getNumSecuenciaOrigen(Integer rutaId, Integer origenId) {
|
||||||
|
@ -549,12 +542,10 @@ public class RutaServiceImpl implements RutaService {
|
||||||
List<ParadaSecuenciaCombinacaoLinha> sequencias = null;
|
List<ParadaSecuenciaCombinacaoLinha> sequencias = null;
|
||||||
|
|
||||||
if (lsParadasSecuencia != null) {
|
if (lsParadasSecuencia != null) {
|
||||||
ClaseServicio claseServicio = ruta.getClaseServicio();
|
|
||||||
sequencias = new ArrayList<ParadaSecuenciaCombinacaoLinha>();
|
sequencias = new ArrayList<ParadaSecuenciaCombinacaoLinha>();
|
||||||
|
|
||||||
for (ParadaSecuencia sequenciaInformada : lsParadasSecuencia) {
|
for (ParadaSecuencia sequenciaInformada : lsParadasSecuencia) {
|
||||||
|
|
||||||
Parada origem = sequenciaInformada.getParada();
|
|
||||||
Via via = sequenciaInformada.getVia();
|
Via via = sequenciaInformada.getVia();
|
||||||
|
|
||||||
ParadaSecuenciaCombinacaoLinha paradaSecuenciaCombinacaoLinha = new ParadaSecuenciaCombinacaoLinha();
|
ParadaSecuenciaCombinacaoLinha paradaSecuenciaCombinacaoLinha = new ParadaSecuenciaCombinacaoLinha();
|
||||||
|
@ -631,4 +622,9 @@ public class RutaServiceImpl implements RutaService {
|
||||||
this.nuevaParada = nuevaParada;
|
this.nuevaParada = nuevaParada;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ruta> buscaLikeComboBox(String stringConsulta) {
|
||||||
|
return rutaDAO.buscaLikeComboBox(stringConsulta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ public final class DateUtil {
|
||||||
|
|
||||||
public static String ddMMaaHHmm = "dd/MM/yyyy hh:mm";
|
public static String ddMMaaHHmm = "dd/MM/yyyy hh:mm";
|
||||||
public static String ddMMaa = "dd/MM/yyyy";
|
public static String ddMMaa = "dd/MM/yyyy";
|
||||||
|
public static String HHmm = "HH:mm";
|
||||||
public static String formatGMT = "yyyy-MM-dd'T'HH:mm:ss";
|
public static String formatGMT = "yyyy-MM-dd'T'HH:mm:ss";
|
||||||
public static String formatExp = "yyyyMMdd";
|
public static String formatExp = "yyyyMMdd";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue