From 2978d27a243a99c7a8568fdd7a90c2c03d17f002 Mon Sep 17 00:00:00 2001 From: thiago Date: Wed, 30 Aug 2017 22:58:54 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20bug=20#9685=20-=20Altera=C3=A7=C3=A3o?= =?UTF-8?q?=20para=20aceitar=20a=20configura=C3=A7=C3=A3o=20de=20tipo=20de?= =?UTF-8?q?=20passagem=20normal.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@73346 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/CategoriaCtrl.java | 36 +++++++++---------- .../service/CategoriaCtrlService.java | 4 ++- .../impl/CategoriaCtrlServiceImpl.java | 28 +++++++++------ 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java index c465b28a8..5f98fb572 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java @@ -8,21 +8,21 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; + import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.SequenceGenerator; import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; @@ -69,9 +69,9 @@ public class CategoriaCtrl implements Serializable { private List categoriaOrgaoList; @OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl") private List categoriaRutaList; - + public CategoriaCtrl() { - + } public CategoriaCtrl(Integer categoriactrlId) { @@ -126,7 +126,7 @@ public class CategoriaCtrl implements Serializable { /** * Regresa las categorias que son visibles al usuario. * Ejemplo de categoria que no es visible: ADULTO - Id = 1 - * @return + * @return */ public List getCategoriaDescuentoVisiblesList() { List listCategoriasVisibles = new ArrayList(); @@ -134,19 +134,19 @@ public class CategoriaCtrl implements Serializable { for (CategoriaDescuento cd : lsCategorias) { boolean esVisible = true; - for (Integer id : idsCategoriasNoVisible) { - if(cd.getCategoria()!=null){ - if (id.equals(cd.getCategoria().getCategoriaId())) { - esVisible = false; - } - } - } - + // for (Integer id : idsCategoriasNoVisible) { + // if(cd.getCategoria()!=null){ + // if (id.equals(cd.getCategoria().getCategoriaId())) { + // esVisible = false; + // } + // } + // } + if (esVisible) { listCategoriasVisibles.add(cd); } } - + return listCategoriasVisibles; } @@ -186,7 +186,7 @@ public class CategoriaCtrl implements Serializable { public void setCategoriaClaseList(List categoriaClaseList) { this.categoriaClaseList = categoriaClaseList; } - + public List getCategoriaOrgaoList() { //return categoriaMarcaList; List tmp = new ArrayList(); @@ -200,7 +200,7 @@ public class CategoriaCtrl implements Serializable { return tmp; } - + public List getCategoriaRutaList() { List tmp = new ArrayList(); if (categoriaRutaList != null) { @@ -213,11 +213,11 @@ public class CategoriaCtrl implements Serializable { return tmp; } - + public void setCategoriaorgaoList(List categoriaOrgaoList) { this.categoriaOrgaoList = categoriaOrgaoList; } - + public void setCategoriarutaList(List categoriaRutaList) { this.categoriaRutaList = categoriaRutaList; } diff --git a/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java b/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java index fd5a87615..5703bca1c 100644 --- a/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java +++ b/src/com/rjconsultores/ventaboletos/service/CategoriaCtrlService.java @@ -7,7 +7,7 @@ package com.rjconsultores.ventaboletos.service; import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; /** - * + * * @author Administrador */ public interface CategoriaCtrlService { @@ -16,6 +16,8 @@ public interface CategoriaCtrlService { public CategoriaCtrl suscribir(CategoriaCtrl entidad); + public CategoriaCtrl checarCategoriaAdulto(CategoriaCtrl entidad); + public CategoriaCtrl actualizacion(CategoriaCtrl entidad); public void borrar(CategoriaCtrl entidad); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java index f82fff5f9..9a365440a 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/CategoriaCtrlServiceImpl.java @@ -4,6 +4,15 @@ */ package com.rjconsultores.ventaboletos.service.impl; +import java.math.BigDecimal; +import java.util.ArrayList; +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.CategoriaCtrlDAO; import com.rjconsultores.ventaboletos.dao.CategoriaDAO; import com.rjconsultores.ventaboletos.entidad.CategoriaClase; @@ -15,16 +24,9 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; import com.rjconsultores.ventaboletos.service.CategoriaCtrlService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; -import java.math.BigDecimal; -import java.util.ArrayList; -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; /** - * + * * @author Administrador */ @Service("categoriaCtrlService") @@ -37,10 +39,12 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService { @Autowired private CategoriaDAO categoriaDAO; + @Override public CategoriaCtrl obtenerID(Integer id) { return categoriaCtrlDAO.obtenerID(id); } + @Override @Transactional public CategoriaCtrl suscribir(CategoriaCtrl entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); @@ -54,10 +58,11 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService { /** * Verifica se existe la categoria adulto. Sino existe, la adicciona. - * + * * @param categoriaCtrl */ - private void checarCategoriaAdulto(CategoriaCtrl categoriaCtrl) { + @Override + public CategoriaCtrl checarCategoriaAdulto(CategoriaCtrl categoriaCtrl) { boolean existeAdulto = false; List lsCategorias = new ArrayList(); lsCategorias.addAll(categoriaCtrl.getCategoriaDescuentoList()); @@ -72,8 +77,10 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService { lsCategorias.add(categoriaDescuentoAdulto); } categoriaCtrl.setCategoriaDescuentoList(lsCategorias); + return categoriaCtrl; } + @Override @Transactional public CategoriaCtrl actualizacion(CategoriaCtrl entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); @@ -83,6 +90,7 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService { return categoriaCtrlDAO.actualizacion(entidad); } + @Override @Transactional public void borrar(CategoriaCtrl entidad) {