- ajustes jj
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@24397 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
6474559df2
commit
f7c0bb1722
|
@ -11,6 +11,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.Transformer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.FetchMode;
|
||||
import org.hibernate.Query;
|
||||
|
@ -26,7 +27,6 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -60,16 +60,12 @@ public class MarcaHibernateDAO extends GenericHibernateDAO<Marca, Short>
|
|||
|
||||
public List<Marca> buscarTodosExceto(Usuario usuario, Integer... idMarca) {
|
||||
String hql = " select new com.rjconsultores.ventaboletos.entidad.Marca(marca.marcaId, marca.descmarca) from Marca marca, UsuarioEmpresa ue" +
|
||||
" where marca.empresa = ue.empresa and ue.usuarioLog := usuarioId ";
|
||||
" where marca.empresa = ue.empresa and ue.usuarioLog = :usuarioId ";
|
||||
|
||||
for(Integer marca: idMarca){
|
||||
|
||||
hql = hql + " and marca.marcaId <> "+ marca.shortValue();
|
||||
|
||||
}
|
||||
hql = hql + " and marca.marcaId not in ( " + StringUtils.join(idMarca, ",") + ")";
|
||||
|
||||
Query sq = getSession().createQuery(hql);
|
||||
sq.setParameter("usuarioId", usuario.getUsuarioId());
|
||||
sq.setParameter("usuarioId", usuario);
|
||||
List<Marca> lsMarca = sq.list();
|
||||
return lsMarca;
|
||||
|
||||
|
@ -83,17 +79,15 @@ public class MarcaHibernateDAO extends GenericHibernateDAO<Marca, Short>
|
|||
return lsMarca;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<Marca> buscarMarcaPorEmpresa(List<Empresa> empresa) {
|
||||
if ( (empresa == null) || (empresa.isEmpty())){
|
||||
if ((empresa == null) || (empresa.isEmpty())) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Collection idsEmpresa = CollectionUtils.transformedCollection(empresa, new Transformer() {
|
||||
|
||||
@Override
|
||||
public Object transform(Object input) {
|
||||
return ((Empresa)input).getEmpresaId();
|
||||
return ((Empresa) input).getEmpresaId();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ public class CategoriaCorrida implements Serializable {
|
|||
private Integer usuarioId;
|
||||
@JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID")
|
||||
@ManyToOne
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
private CorridaCtrl corridaCtrl;
|
||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
|
|
|
@ -23,6 +23,9 @@ import javax.persistence.Temporal;
|
|||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -57,6 +60,7 @@ public class CategoriaCtrl implements Serializable {
|
|||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaMarca> categoriaMarcaList;
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
private List<CategoriaCorrida> categoriaCorridaList;
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaMercado> categoriaMercadoList;
|
||||
|
|
|
@ -70,6 +70,10 @@ public class RutaServiceImpl implements RutaService {
|
|||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
if (entidad.getVentaOffLine() == null){
|
||||
entidad.setVentaOffLine(false);
|
||||
}
|
||||
|
||||
entidad = rutaDAO.suscribir(entidad);
|
||||
if (lsParadasSequencia != null) {
|
||||
generarSecuencias(entidad, lsParadasSequencia);
|
||||
|
|
|
@ -124,7 +124,13 @@ public class TramoRutaServiceImpl implements TramoRutaService {
|
|||
ruta.setClaseServicio(rutaTramoVO.getClaseServicio());
|
||||
ruta.setOrgaoConcedente(rutaTramoVO.getOrgaoConcedente());
|
||||
ruta.setIndNombreObligatorio(rutaTramoVO.getSolicitaNombrePasajero());
|
||||
|
||||
if (rutaTramoVO.getVentaHandHeld() == null){
|
||||
ruta.setVentaOffLine(false);
|
||||
}else{
|
||||
ruta.setVentaOffLine(rutaTramoVO.getVentaHandHeld());
|
||||
}
|
||||
|
||||
ruta.setLsRutaEmpresa(lsRutaEmpresa);
|
||||
ruta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
ruta.setActivo(Boolean.TRUE);
|
||||
|
|
Loading…
Reference in New Issue