Mantis: 0004070 e 0004071

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@27798 d1611594-4594-4d17-8e1d-87c2c4800839
master
rodrigo 2013-06-14 19:37:36 +00:00
parent 7202e44ee5
commit 00768ad6bb
5 changed files with 175 additions and 144 deletions

View File

@ -17,6 +17,10 @@ public interface PuntoVentaDAO extends GenericDAO<PuntoVenta, Integer> {
public List<PuntoVenta> buscaLike(String strEstacion); public List<PuntoVenta> buscaLike(String strEstacion);
public List<PuntoVenta> busca(String nomPuntoVenta, String numPuntoVenta); public List<PuntoVenta> busca(String nomPuntoVenta, String numPuntoVenta);
public List<PuntoVenta> buscaPuntoVenta(String numPuntoVenta); public List<PuntoVenta> buscaPuntoVenta(String numPuntoVenta);
public List<PuntoVenta> buscaPuntoVentaParada(Parada parada); public List<PuntoVenta> buscaPuntoVentaParada(Parada parada);
public List<PuntoVenta> buscarPuntoVentaSubordinados(PuntoVenta puntoVenta);
} }

View File

@ -74,4 +74,13 @@ public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Inte
return c.list(); return c.list();
} }
@Override
public List<PuntoVenta> buscarPuntoVentaSubordinados(PuntoVenta puntoVenta) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
c.add(Restrictions.eq("puntoVentaPadre", puntoVenta));
return c.list();
}
} }

View File

@ -132,6 +132,9 @@ public class PuntoVenta implements Serializable {
private Boolean indValidaStock; private Boolean indValidaStock;
@Column(name = "TIEMPOCANCELACION") @Column(name = "TIEMPOCANCELACION")
private Integer tiempoCancelacion; private Integer tiempoCancelacion;
@OneToOne
@JoinColumn(name = "PUNTOVENTAPADRE_ID")
private PuntoVenta puntoVentaPadre;
public PtovtaComissao getComissaoId() { public PtovtaComissao getComissaoId() {
return comissaoId; return comissaoId;
@ -585,4 +588,12 @@ public class PuntoVenta implements Serializable {
public void setTiempoCancelacion(Integer tiempoCancelacion) { public void setTiempoCancelacion(Integer tiempoCancelacion) {
this.tiempoCancelacion = tiempoCancelacion; this.tiempoCancelacion = tiempoCancelacion;
} }
public PuntoVenta getPuntoVentaPadre() {
return puntoVentaPadre;
}
public void setPuntoVentaPadre(PuntoVenta puntoVentaPadre) {
this.puntoVentaPadre = puntoVentaPadre;
}
} }

View File

@ -17,6 +17,10 @@ public interface PuntoVentaService extends GenericService<PuntoVenta, Integer> {
public List<PuntoVenta> buscaLike(String strEstacion); public List<PuntoVenta> buscaLike(String strEstacion);
public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta); public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta);
public List<PuntoVenta> buscaPuntoVenta(String numPuntoVenta); public List<PuntoVenta> buscaPuntoVenta(String numPuntoVenta);
public List<PuntoVenta> buscaPuntoVentaParada(Parada paradaId); public List<PuntoVenta> buscaPuntoVentaParada(Parada paradaId);
public List<PuntoVenta> buscarPuntoVentaSubordinados(PuntoVenta puntoVenta);
} }

View File

@ -4,22 +4,20 @@
*/ */
package com.rjconsultores.ventaboletos.service.impl; package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa;
import com.rjconsultores.ventaboletos.entidad.PtovtaEstoque;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService;
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
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;
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
/** /**
* *
* @author Administrador * @author Administrador
@ -29,8 +27,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
@Autowired @Autowired
private PuntoVentaDAO puntoVentaDAO; private PuntoVentaDAO puntoVentaDAO;
@Autowired
private PtovtaEmpresaService ptoVtaService;
public List<PuntoVenta> obtenerTodos() { public List<PuntoVenta> obtenerTodos() {
return puntoVentaDAO.obtenerTodos(); return puntoVentaDAO.obtenerTodos();
@ -121,4 +117,11 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
public List<PuntoVenta> buscaPuntoVentaParada(Parada paradaId) { public List<PuntoVenta> buscaPuntoVentaParada(Parada paradaId) {
return puntoVentaDAO.buscaPuntoVentaParada(paradaId); return puntoVentaDAO.buscaPuntoVentaParada(paradaId);
} }
@Override
public List<PuntoVenta> buscarPuntoVentaSubordinados(PuntoVenta puntoVenta) {
List<PuntoVenta> lsPuntoVentaSubordinados = puntoVentaDAO.buscarPuntoVentaSubordinados(puntoVenta);
return lsPuntoVentaSubordinados;
}
} }