diff --git a/pom.xml b/pom.xml index 902aea369..2a0f2ec47 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.73.2 + 1.74.0 diff --git a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java index 92d3e2184..6a6ee5dd6 100644 --- a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java +++ b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java @@ -143,6 +143,9 @@ public class Constantes { public static final String CNPJ_OBRIGATORIO_ORDEN_SERVICO = "CNPJ_OBRIGATORIO_ORDEN_SERVICO"; + + public static final String NUM_ASIENTO_CON_LETRA = "NUM_ASIENTO_CON_LETRA"; + public static final String DESATIVAR_OBR_CAM_EMPRESA_IMPOSTO = "DESATIVAR_OBR_CAM_EMPRESA_IMPOSTO"; } diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java index 7dffd65dc..0a4c12fd9 100644 --- a/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/PricingAsientoDAO.java @@ -14,5 +14,5 @@ import java.util.List; */ public interface PricingAsientoDAO extends GenericDAO { - public List obtenerPricingCategoria(Pricing pricing, Integer asiento); + public List obtenerPricingCategoria(Pricing pricing, String asiento); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java index 7a11301d2..82e0a5fe5 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingAsientoHibernateDAO.java @@ -36,7 +36,7 @@ public class PricingAsientoHibernateDAO extends GenericHibernateDAO obtenerPricingCategoria(Pricing pricing, Integer asiento) { + public List obtenerPricingCategoria(Pricing pricing, String asiento) { Criteria c = getSession().createCriteria(getPersistentClass()); c.add(Restrictions.eq("activo", Pricing.ATIVO)); c.add(Restrictions.eq("pricing", pricing)); diff --git a/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java index 24c4040dc..ee733c77b 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java @@ -14,7 +14,7 @@ import java.util.List; */ public interface PricingAsientoService extends GenericService { - public List obtenerPricingCategoria(Pricing pricing, Integer value); + public List obtenerPricingCategoria(Pricing pricing, String value); public void borrar(List pricingAsientos); } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java index fadd6e04c..c806d40b4 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java @@ -15,14 +15,17 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.rjconsultores.ventaboletos.constantes.Constantes; import com.rjconsultores.ventaboletos.dao.EsquemaAsientoDAO; import com.rjconsultores.ventaboletos.dao.RutaSecuenciaDAO; +import com.rjconsultores.ventaboletos.entidad.Constante; import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ConstanteService; import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; import com.rjconsultores.ventaboletos.service.EsquemaAsientoService; import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; @@ -50,6 +53,9 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { @Autowired private RutaSecuenciaService rutaSecuenciaService; + + @Autowired + ConstanteService constanteService; private EsquemaAsiento suscribir(EsquemaAsiento entidad) { entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); @@ -217,7 +223,11 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { ini++; } } else { - Integer.parseInt(asientos[i]);// para validar + Constante constNumAsientoComLetra = constanteService.buscarPorNomeConstante(Constantes.NUM_ASIENTO_CON_LETRA); + if (!constNumAsientoComLetra.getValorconstante().equals("1")) { + Integer.parseInt(asientos[i]); + } + // para validar todosAsientos.add(asientos[i]); } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java index a55567a4d..9d2d5d014 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java @@ -60,7 +60,7 @@ public class PricingAsientoServiceImpl implements PricingAsientoService { pricingAsientoDAO.actualizacion(entidad); } - public List obtenerPricingCategoria(Pricing pricing, Integer asiento) { + public List obtenerPricingCategoria(Pricing pricing, String asiento) { return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento); }