[fixes bug #5209]
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@34913 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1b712376a4
commit
daa0b7df06
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAgrupacion;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RJ Consultores
|
||||
*/
|
||||
public interface EsquemaAgrupacionDAO extends GenericDAO<EsquemaAgrupacion, Integer> {
|
||||
|
||||
public List<EsquemaAgrupacion> buscar(EsquemaAgrupacion esquemaAgrupacion);
|
||||
|
||||
public EsquemaAgrupacion obtenerByEsquemaAgrupacion(Integer numAgrupacion);
|
||||
|
||||
public boolean buscarNumAgrupacion(Integer numAgrupacion);
|
||||
|
||||
}
|
|
@ -54,6 +54,8 @@ public interface EsquemaCorridaDAO extends GenericDAO<EsquemaCorrida, Integer> {
|
|||
*/
|
||||
public List<Integer> existe(Ruta ruta, Integer paradaId);
|
||||
|
||||
public EsquemaCorrida obtenerByEsquemaCorrida(Integer numCorrida);
|
||||
|
||||
public List<EsquemaCorrida> buscaDentroVigenciaQtdeDiasNull(Date dataGeracao);
|
||||
|
||||
public List<EsquemaCorrida> buscaDentroVigenciaQtdeDiasNotNull(Date dataDe);
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Disjunction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.EsquemaAgrupacionDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAgrupacion;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RJ Consultores
|
||||
*/
|
||||
@Repository("esquemaAgrupacionDAO")
|
||||
public class EsquemaAgrupacionHibernateDAO extends GenericHibernateDAO<EsquemaAgrupacion, Integer> implements EsquemaAgrupacionDAO {
|
||||
|
||||
@Autowired
|
||||
public EsquemaAgrupacionHibernateDAO(
|
||||
@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsquemaAgrupacion suscribir(final EsquemaAgrupacion entity) {
|
||||
|
||||
String sql = "SELECT VTABOL.ESQUEMA_AGRUPACION_SEQ.NEXTVAL FROM DUAL";
|
||||
Object o = this.getSession().createSQLQuery(sql).uniqueResult();
|
||||
entity.setEsquemaagrupacionId(Integer.valueOf(o.toString()));
|
||||
|
||||
EsquemaAgrupacion esquemaAgrupacion = super.suscribir(entity);
|
||||
this.getSession().flush();
|
||||
return esquemaAgrupacion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EsquemaAgrupacion> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public List<EsquemaAgrupacion> buscar(EsquemaAgrupacion esquemaAgrupacion) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("esquemaAgrupacion", esquemaAgrupacion));
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public EsquemaAgrupacion obtenerByEsquemaAgrupacion(
|
||||
Integer ec) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
||||
c.add(Restrictions.eq("numagrupacion", ec));
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return (EsquemaAgrupacion) c.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean buscarNumAgrupacion(Integer numAgrupacion) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
c.add(Restrictions.eq("numagrupacion", numAgrupacion));
|
||||
|
||||
if (c.list().isEmpty()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Disjunction;
|
||||
|
@ -56,6 +57,16 @@ public class EsquemaCorridaHibernateDAO extends GenericHibernateDAO<EsquemaCorri
|
|||
return c.list();
|
||||
}
|
||||
|
||||
public EsquemaCorrida obtenerByEsquemaCorrida(
|
||||
Integer ec) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
||||
c.add(Restrictions.eq("numCorrida", ec));
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return (EsquemaCorrida) c.list().get(NumberUtils.INTEGER_ZERO);
|
||||
}
|
||||
|
||||
public List<EsquemaCorrida> buscar(Marca marca, RolOperativo rolOperativo,
|
||||
Ruta ruta, ClaseServicio claseServicio) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
|
|
@ -203,6 +203,9 @@ public class Corrida implements Serializable {
|
|||
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
|
||||
private Date fechorSalidaOriginalH;
|
||||
|
||||
@Column(name = "ESQUEMAAGRUPACION_ID")
|
||||
private Integer esquemaAgrupacionId;
|
||||
|
||||
public String getIndTipoVenta() {
|
||||
return indTipoVenta;
|
||||
}
|
||||
|
@ -498,6 +501,14 @@ public class Corrida implements Serializable {
|
|||
this.fechorSalidaOriginalH = fechorSalidaOriginalH;
|
||||
}
|
||||
|
||||
public Integer getEsquemaAgrupacionId() {
|
||||
return esquemaAgrupacionId;
|
||||
}
|
||||
|
||||
public void setEsquemaAgrupacionId(Integer esquemaAgrupacionId) {
|
||||
this.esquemaAgrupacionId = esquemaAgrupacionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id.toString();
|
||||
|
|
|
@ -33,6 +33,15 @@ public class DetDiagramaAutobus implements Serializable {
|
|||
public final static String TV = "TV";//TELEVISION
|
||||
public final static String PT = "PT";//PORTA TRAJE
|
||||
public final static String CF = "CF";//CAFE
|
||||
public final static String ME = "ME";//MESA
|
||||
|
||||
public final static String ORIENTACION_W = "W";//OESTTE
|
||||
public final static String ORIENTACION_S = "S";//SUL
|
||||
public final static String ORIENTACION_E = "E";//LESTE
|
||||
public final static String ORIENTACION_N = "S";//NORTE
|
||||
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -61,6 +70,8 @@ public class DetDiagramaAutobus implements Serializable {
|
|||
@JoinColumn(name = "DIAGRAMAAUTOBUS_ID", referencedColumnName = "DIAGRAMAAUTOBUS_ID")
|
||||
@ManyToOne
|
||||
private DiagramaAutobus diagramaAutobus;
|
||||
@Column(name = "ORIENTACION")
|
||||
private String orientacion;
|
||||
|
||||
public DetDiagramaAutobus() {
|
||||
}
|
||||
|
@ -145,6 +156,14 @@ public class DetDiagramaAutobus implements Serializable {
|
|||
this.diagramaAutobus = diagramaAutobus;
|
||||
}
|
||||
|
||||
public String getOrientacion() {
|
||||
return orientacion;
|
||||
}
|
||||
|
||||
public void setOrientacion(String orientacion) {
|
||||
this.orientacion = orientacion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.OneToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "ESQUEMA_AGRUPACION_SEQ", sequenceName = "ESQUEMA_AGRUPACION_SEQ", allocationSize = 1)
|
||||
@Table(name = "ESQUEMA_AGRUPACION")
|
||||
public class EsquemaAgrupacion implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_AGRUPACION_SEQ")
|
||||
@Column(name = "ESQUEMAAGRUPACION_ID")
|
||||
private Integer esquemaagrupacionId;
|
||||
@Column(name = "DESCAGRUPACION ")
|
||||
private String descagrupacion;
|
||||
@Column(name = "NUMAGRUPACION")
|
||||
private Integer numagrupacion;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@JoinColumn(name = "ESQUEMAAGRUPACION_ID", referencedColumnName = "ESQUEMAAGRUPACION_ID")
|
||||
@OneToMany
|
||||
private List<EsquemaCorrida> esquemaCorridaList;
|
||||
|
||||
public EsquemaAgrupacion() {
|
||||
}
|
||||
|
||||
public EsquemaAgrupacion(Integer esquemaagrupacionId) {
|
||||
this.esquemaagrupacionId = esquemaagrupacionId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Integer getEsquemaagrupacionId() {
|
||||
return esquemaagrupacionId;
|
||||
}
|
||||
|
||||
public void setEsquemaagrupacionId(Integer esquemaagrupacionId) {
|
||||
this.esquemaagrupacionId = esquemaagrupacionId;
|
||||
}
|
||||
|
||||
public String getDescagrupacion() {
|
||||
return descagrupacion;
|
||||
}
|
||||
|
||||
public void setDescagrupacion(String descagrupacion) {
|
||||
this.descagrupacion = descagrupacion;
|
||||
}
|
||||
|
||||
public Integer getNumagrupacion() {
|
||||
return numagrupacion;
|
||||
}
|
||||
|
||||
public void setNumagrupacion(Integer numagrupacion) {
|
||||
this.numagrupacion = numagrupacion;
|
||||
}
|
||||
|
||||
public List<EsquemaCorrida> getEsquemaCorridaList() {
|
||||
|
||||
if (this.esquemaCorridaList != null) {
|
||||
List<EsquemaCorrida> esquemaList = new ArrayList<EsquemaCorrida>();
|
||||
|
||||
for (EsquemaCorrida ec : this.esquemaCorridaList) {
|
||||
if (ec.getActivo()) {
|
||||
esquemaList.add(ec);
|
||||
}
|
||||
}
|
||||
return esquemaList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setEsquemaCorridaList(List<EsquemaCorrida> esquemaCorrida) {
|
||||
this.esquemaCorridaList = esquemaCorrida;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
hash += (esquemaagrupacionId != null ? esquemaagrupacionId.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (!(object instanceof EsquemaAgrupacion)) {
|
||||
return false;
|
||||
}
|
||||
EsquemaAgrupacion other = (EsquemaAgrupacion) object;
|
||||
if ((this.esquemaagrupacionId == null && other.esquemaagrupacionId != null) || (this.esquemaagrupacionId != null && !this.esquemaagrupacionId.equals(other.esquemaagrupacionId))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "entidad.test.EsquemaAgrupacion[esquemaagrupacionId=" + esquemaagrupacionId + "]";
|
||||
}
|
||||
}
|
|
@ -120,6 +120,8 @@ public class EsquemaCorrida implements Serializable {
|
|||
private String indGeneraFeriado;
|
||||
@Column(name = "CANTDIASGENERACION")
|
||||
private Integer cantDiasGeneracion;
|
||||
@Column(name = "ESQUEMAAGRUPACION_ID")
|
||||
private Integer esquemaAgrupacionId;
|
||||
|
||||
public enum GerarFeriado {
|
||||
// Declaração dos enum
|
||||
|
@ -443,6 +445,14 @@ public class EsquemaCorrida implements Serializable {
|
|||
this.cantDiasGeneracion = cantDiasGeracion;
|
||||
}
|
||||
|
||||
public Integer getEsquemaAgrupacionId() {
|
||||
return esquemaAgrupacionId;
|
||||
}
|
||||
|
||||
public void setEsquemaAgrupacionId(Integer esquemaAgrupacionId) {
|
||||
this.esquemaAgrupacionId = esquemaAgrupacionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
|
|
|
@ -10,5 +10,13 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
|||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
public interface CategoriaCtrlService extends GenericService<CategoriaCtrl, Integer> {
|
||||
public interface CategoriaCtrlService {
|
||||
|
||||
public CategoriaCtrl obtenerID(Integer id);
|
||||
|
||||
public CategoriaCtrl suscribir(CategoriaCtrl entidad);
|
||||
|
||||
public CategoriaCtrl actualizacion(CategoriaCtrl entidad);
|
||||
|
||||
public void borrar(CategoriaCtrl entidad);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAgrupacion;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RJ Consultores
|
||||
*/
|
||||
public interface EsquemaAgrupacionService extends GenericService<EsquemaAgrupacion, Integer> {
|
||||
|
||||
public List<EsquemaAgrupacion> buscar(EsquemaAgrupacion esquemaAgrupacion);
|
||||
|
||||
public EsquemaAgrupacion obtenerByEsquemaAgrupacion(Integer numAgrupacion);
|
||||
|
||||
public boolean buscarNumAgrupacion(Integer numAgrupacion);
|
||||
|
||||
}
|
|
@ -47,4 +47,6 @@ public interface EsquemaCorridaService extends GenericService<EsquemaCorrida, In
|
|||
public List<EsquemaCorrida> buscaDentroVigenciaQtdeDiasNull(Date dataGeracao);
|
||||
|
||||
public List<EsquemaCorrida> buscaDentroVigenciaQtdeDiasNotNull(Date dataDe);
|
||||
|
||||
public EsquemaCorrida obtenerByEsquemaCorrida(Integer numCorrida);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,10 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empleado;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -16,8 +17,6 @@ public interface UsuarioService extends GenericService<Usuario, Integer> {
|
|||
|
||||
public List<Usuario> buscarPeloNome(String nome);
|
||||
|
||||
public String encriptarSenha(String salt, String senha);
|
||||
|
||||
public Usuario buscarPeloNomeSenha(String stUsuario, String senha);
|
||||
|
||||
public List<Usuario> buscarPorEmpleado(Empleado get);
|
||||
|
|
|
@ -161,7 +161,14 @@ public class AutorizaFolioServiceImpl implements AutorizaFolioService {
|
|||
|
||||
FolioPreimpreso folio = folioPreimpresoService.buscaFolioPreImpressoEstacionImpresora(estacion, empresa);
|
||||
|
||||
if (folio == null) {
|
||||
//condição para qd o folio foi gerado indevidamente pelo cliente de venda. Antes de a rotina abaixo ter sido executada
|
||||
//se o numserie é 0, é um folio inválido
|
||||
if ( (folio != null) && (folio.getNumeserie().equals("0"))) {
|
||||
folioPreimpresoService.borrar(folio);
|
||||
folio = null;
|
||||
}
|
||||
|
||||
if ( folio == null ) {
|
||||
|
||||
RequisicionBoleto requisicionBoleto = geraRequisicionBoleto(estacion, empresa);
|
||||
AbastoBoleto abastoBoleto = geraAbastoBoleto(requisicionBoleto);
|
||||
|
|
|
@ -31,15 +31,12 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
||||
|
||||
public static final int CATEGORIA_ADULTO = 1;
|
||||
private static final int CANT_MAX_CATEGORIA_ADULTO = 80;
|
||||
@Autowired
|
||||
private CategoriaCtrlDAO categoriaCtrlDAO;
|
||||
@Autowired
|
||||
private CategoriaDAO categoriaDAO;
|
||||
|
||||
public List<CategoriaCtrl> obtenerTodos() {
|
||||
return categoriaCtrlDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public CategoriaCtrl obtenerID(Integer id) {
|
||||
return categoriaCtrlDAO.obtenerID(id);
|
||||
}
|
||||
|
@ -125,7 +122,7 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
private CategoriaDescuento getCategoriaDescuentoAdulto(CategoriaCtrl categoriaCtrl) {
|
||||
CategoriaDescuento cd = new CategoriaDescuento();
|
||||
cd.setActivo(Boolean.TRUE);
|
||||
cd.setCantautorizada(50);
|
||||
cd.setCantautorizada(CANT_MAX_CATEGORIA_ADULTO);
|
||||
cd.setCategoria(categoriaDAO.obtenerID(CATEGORIA_ADULTO));
|
||||
cd.setDescuentoimporte(BigDecimal.ZERO);
|
||||
cd.setDescuentoporc(BigDecimal.ZERO);
|
||||
|
|
|
@ -503,6 +503,8 @@ public class CorridaServiceImpl implements CorridaService {
|
|||
}
|
||||
corrida.setDestino(destino);
|
||||
|
||||
corrida.setEsquemaAgrupacionId(esquemaCorrida.getEsquemaAgrupacionId());
|
||||
|
||||
corrida.setEmpresa(esquemaCorrida.getEmpresa());
|
||||
corrida.setEmpresa1(esquemaCorrida.getEmpresa1());
|
||||
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
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.EsquemaAgrupacionDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAgrupacion;
|
||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||
import com.rjconsultores.ventaboletos.service.EsquemaAgrupacionService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author RJ Consultores
|
||||
*/
|
||||
@Service("esquemaAgrupacionService")
|
||||
public class EsquemaAgrupacionServiceImpl implements EsquemaAgrupacionService {
|
||||
|
||||
@Autowired
|
||||
private EsquemaAgrupacionDAO esquemaAgrupacionDAO;
|
||||
|
||||
public List<EsquemaAgrupacion> obtenerTodos() {
|
||||
return esquemaAgrupacionDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public EsquemaAgrupacion obtenerID(Integer id) {
|
||||
return esquemaAgrupacionDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public EsquemaAgrupacion suscribir(EsquemaAgrupacion entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return esquemaAgrupacionDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public EsquemaAgrupacion actualizacion(EsquemaAgrupacion entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return esquemaAgrupacionDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(EsquemaAgrupacion entidad) {
|
||||
entidad = (entidad.getEsquemaagrupacionId() == null) ? entidad : esquemaAgrupacionDAO.obtenerID(entidad.getEsquemaagrupacionId());
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
esquemaAgrupacionDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
public List<EsquemaAgrupacion> buscar(EsquemaAgrupacion esquemaAgrupacion) {
|
||||
return esquemaAgrupacionDAO.buscar(esquemaAgrupacion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsquemaAgrupacion obtenerByEsquemaAgrupacion(Integer id) {
|
||||
return esquemaAgrupacionDAO.obtenerByEsquemaAgrupacion(id);
|
||||
}
|
||||
|
||||
public boolean buscarNumAgrupacion(Integer numAgrupacion) {
|
||||
return esquemaAgrupacionDAO.buscarNumAgrupacion(numAgrupacion);
|
||||
}
|
||||
}
|
|
@ -179,4 +179,9 @@ public class EsquemaCorridaServiceImpl implements EsquemaCorridaService {
|
|||
public List<Integer> existe(Ruta ruta, Integer paradaId) {
|
||||
return esquemaCorridaDAO.existe(ruta, paradaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsquemaCorrida obtenerByEsquemaCorrida(Integer id) {
|
||||
return esquemaCorridaDAO.obtenerByEsquemaCorrida(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,15 +34,6 @@ public class UsuarioServiceImpl implements UsuarioService, UserDetailsService {
|
|||
return usuarioDAO.buscarPeloNome(nome);
|
||||
}
|
||||
|
||||
public String encriptarSenha(String login, String senha) {
|
||||
org.springframework.security.authentication.encoding.Md5PasswordEncoder a =
|
||||
new org.springframework.security.authentication.encoding.Md5PasswordEncoder();
|
||||
|
||||
System.out.println("sfdsdfsfsdoifiosdfoijsdaoi´jasi´jsd");
|
||||
|
||||
return a.encodePassword(senha, login);
|
||||
}
|
||||
|
||||
public List<Usuario> obtenerTodos() {
|
||||
return usuarioDAO.obtenerTodos();
|
||||
}
|
||||
|
|
|
@ -110,4 +110,18 @@ public class ApplicationProperties {
|
|||
return property.equals("1");
|
||||
}
|
||||
|
||||
public boolean habilitarPricingCategoria() {
|
||||
String property = p.getProperty("pricing.categoria.habilitar", "0");
|
||||
return property.equals("1");
|
||||
}
|
||||
|
||||
public boolean rutaConMasDeUnaClase() {
|
||||
String property = p.getProperty("ruta.masdeunaclase", "0");
|
||||
return property.equals("1");
|
||||
}
|
||||
public boolean diagramaAutobusDosPestana() {
|
||||
String property = p.getProperty("diagramaautobus.dospestana", "0");
|
||||
return property.equals("1");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue