Permitir assento com letra
parent
ebc9334098
commit
2a3bae157e
|
@ -143,4 +143,6 @@ public class Constantes {
|
||||||
|
|
||||||
public static final String CNPJ_OBRIGATORIO_ORDEN_SERVICO = "CNPJ_OBRIGATORIO_ORDEN_SERVICO";
|
public static final String CNPJ_OBRIGATORIO_ORDEN_SERVICO = "CNPJ_OBRIGATORIO_ORDEN_SERVICO";
|
||||||
|
|
||||||
|
public static final String NUM_ASIENTO_CON_LETRA = "NUM_ASIENTO_CON_LETRA";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,5 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface PricingAsientoDAO extends GenericDAO<PricingAsiento, Integer> {
|
public interface PricingAsientoDAO extends GenericDAO<PricingAsiento, Integer> {
|
||||||
|
|
||||||
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, Integer asiento);
|
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, String asiento);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class PricingAsientoHibernateDAO extends GenericHibernateDAO<PricingAsien
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, Integer asiento) {
|
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, String asiento) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Pricing.ATIVO));
|
c.add(Restrictions.eq("activo", Pricing.ATIVO));
|
||||||
c.add(Restrictions.eq("pricing", pricing));
|
c.add(Restrictions.eq("pricing", pricing));
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface PricingAsientoService extends GenericService<PricingAsiento, Integer> {
|
public interface PricingAsientoService extends GenericService<PricingAsiento, Integer> {
|
||||||
|
|
||||||
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, Integer value);
|
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, String value);
|
||||||
|
|
||||||
public void borrar(List<PricingAsiento> pricingAsientos);
|
public void borrar(List<PricingAsiento> pricingAsientos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,14 +15,17 @@ 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.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.dao.EsquemaAsientoDAO;
|
import com.rjconsultores.ventaboletos.dao.EsquemaAsientoDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.RutaSecuenciaDAO;
|
import com.rjconsultores.ventaboletos.dao.RutaSecuenciaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus;
|
import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus;
|
||||||
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento;
|
||||||
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
import com.rjconsultores.ventaboletos.service.DiagramaAutobusService;
|
import com.rjconsultores.ventaboletos.service.DiagramaAutobusService;
|
||||||
import com.rjconsultores.ventaboletos.service.EsquemaAsientoService;
|
import com.rjconsultores.ventaboletos.service.EsquemaAsientoService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
|
import com.rjconsultores.ventaboletos.service.RutaSecuenciaService;
|
||||||
|
@ -51,6 +54,9 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RutaSecuenciaService rutaSecuenciaService;
|
private RutaSecuenciaService rutaSecuenciaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ConstanteService constanteService;
|
||||||
|
|
||||||
private EsquemaAsiento suscribir(EsquemaAsiento entidad) {
|
private EsquemaAsiento suscribir(EsquemaAsiento entidad) {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
@ -217,7 +223,11 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
|
||||||
ini++;
|
ini++;
|
||||||
}
|
}
|
||||||
} else {
|
} 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]);
|
todosAsientos.add(asientos[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class PricingAsientoServiceImpl implements PricingAsientoService {
|
||||||
pricingAsientoDAO.actualizacion(entidad);
|
pricingAsientoDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, Integer asiento) {
|
public List<PricingAsiento> obtenerPricingCategoria(Pricing pricing, String asiento) {
|
||||||
return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento);
|
return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue