278 lines
7.5 KiB
Java
278 lines
7.5 KiB
Java
/*
|
|
* To change this template, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package com.rjconsultores.ventaboletos.utilerias;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.Properties;
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
/**
|
|
* Clase con las propriedad especificas de los clientes
|
|
*
|
|
* @author Administrador
|
|
*/
|
|
public class ApplicationProperties {
|
|
|
|
private static Logger log = Logger.getLogger(ApplicationProperties.class);
|
|
private static ApplicationProperties INSTANCE;
|
|
private static Properties p;
|
|
|
|
private ApplicationProperties() {
|
|
p = new Properties();
|
|
this.readConfiguration();
|
|
}
|
|
|
|
private void readConfiguration() {
|
|
try {
|
|
|
|
InputStream is = new ClassPathResource("/com/rjconsultores/ventaboletos/web/cliente/conf/application.properties").getInputStream();
|
|
p.load(is);
|
|
is.close();
|
|
} catch (IOException e) {
|
|
log.error(e);
|
|
}
|
|
}
|
|
|
|
public static ApplicationProperties getInstance() {
|
|
if (INSTANCE == null) {
|
|
INSTANCE = new ApplicationProperties();
|
|
}
|
|
|
|
return INSTANCE;
|
|
}
|
|
|
|
/**
|
|
* Indica se la informacion de equivalencia es visible
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean mostrarEquivalencia() {
|
|
String property = p.getProperty("equivalencia.mostrar", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica se o campo empresa é obrigatório
|
|
* @return
|
|
*/
|
|
public boolean empresaObrigatoria() {
|
|
String property = p.getProperty("empresa.obrigatoria", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica se es gerado o campo equivalencia corrida na tabela de corrida
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean gerarCampoEquivalenciaCorrida() {
|
|
String property = p.getProperty("corrida.gerarCampoEquivalencia", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica exibe o combo de Division na Gera��o de Corridas do Esquema Operacional.
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean exibirDivisionConfiguracionCorrida() {
|
|
String property = p.getProperty("esquemaOperacional.configuracionCorrida.exibeDivision", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica se va a exhibir la cuenta contable en el catalogo de tipos de eventos
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean exhibirCuentaContableTiposEventos() {
|
|
String property = p.getProperty("eventosExtras.tiposEventos.exhibirCuentaContable", "1");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica se va a exhibir la "aba" de excepciones de tramo_km en la pantalla de tramos
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean exhibirExcepcionesTramoKm() {
|
|
String property = p.getProperty("tramos.exhibirExcepcionesTramoKm", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
* Indica se vai exibir botão na modificação massiva de tarifa de geração automatica de tarifas
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean generarTarifasAutomatica() {
|
|
String property = p.getProperty("tarifa.generarTarifasAutomatica", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean generarRotinaFolios() {
|
|
String property = p.getProperty("no.cheque.folio", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean habilitarPricingCategoria() {
|
|
String property = p.getProperty("pricing.categoria.habilitar", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean rutaConMasDeUnaClase() {
|
|
String property = p.getProperty("ruta.masdeunaclase", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean diagramaAutobusDosPestana() {
|
|
String property = p.getProperty("diagramaautobus.dospestana", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean contrasenaValidaComplejidad() {
|
|
String property = p.getProperty("contrasena.validaComplejidad", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean habilitarCustomSequence() {
|
|
String property = p.getProperty("custom.sequence", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean integracionTotvs() {
|
|
String property = p.getProperty("integracion.totvs", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean integracionAG() {
|
|
String property = p.getProperty("integracion.AG", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean integracionAGWS() {
|
|
String property = p.getProperty("integracion.agws", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean integracionRioCard() {
|
|
String property = p.getProperty("integracion.riocard", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean diagramaAutobusTrem() {
|
|
String property = p.getProperty("layoutdiagramaautobus.trem", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean validaEstadoNoNomeLocalidade() {
|
|
String property = p.getProperty("validaEstadoNomeLocalidade", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean podeEditarClienteFidelidade() {
|
|
String property = p.getProperty("podeEditarClienteFidelidade", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean validaSobreposicaoVigencia() {
|
|
String property = p.getProperty("validaSobreposicaoVigencia", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean usaCPFComoFidelidade(){
|
|
String property = p.getProperty("usaCPFComoFidelidade", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean exibeTpp() {
|
|
String property = p.getProperty("exibeTpp", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean codAnttNaoObrigatorio() {
|
|
String property = p.getProperty("codAnttNaoObrigatorio", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean artespPedagioIdaVoltaDivPor2() {
|
|
String property = p.getProperty("artespPedagioIdaVoltaDivPor2", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean calculoPeajeReunidasANTT() {
|
|
String property = p.getProperty("calculoPeajeReunidasANTT", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public Integer maxSizeNumCorrida() {
|
|
String property = p.getProperty("maxSizeNumCorrida", "-1");
|
|
return Integer.parseInt(property);
|
|
}
|
|
|
|
public boolean criarTarifaApenasTrechoVendido() {
|
|
String property = p.getProperty("criarTarifaApenasTrechoVendido", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean exibirEstacaoCadastroUsuario() {
|
|
String property = p.getProperty("exibirEstacaoCadastroUsuario", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean utillizaCartaoLiberCard() {
|
|
String property = p.getProperty("utilizaLibercard", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
/**
|
|
*
|
|
* Indica se ao salvar um ponto de venda será validado se para todas as empresas informadas para venda também será necessário informar o fechamento.
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean validaContaCorrenteEmpesaPtoVta() {
|
|
String property = p.getProperty("puntoVenta.validaCtaCteEmpresa", "1");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean isDataSourceComissaoBancoProducao() {
|
|
String property = p.getProperty("datasource.conferencia.comissao", "0");
|
|
return property.equals("0");
|
|
}
|
|
|
|
public boolean isPermiteVariasImpressorasMesmaEmpresa() {
|
|
String property = p.getProperty("permiteVariasImpressorasMesmaEmpresa", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean isFormaPagoPricingInativo() {
|
|
String property = p.getProperty("formaPagoPricingInativo", "1");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean exibirPuntoVentaCadastroAIDF() {
|
|
String property = p.getProperty("exibirPuntoVentaCadastroAIDF", "0");
|
|
return property.equals("1");
|
|
}
|
|
public boolean isPuntoVentaCadastroAIDFObrigatorio() {
|
|
String property = p.getProperty("puntoVentaCadastroAIDFObrigatorio", "0");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean enderecoClienteObrigatorio() {
|
|
String property = p.getProperty("cliente.enderecoObrigatorio", "1");
|
|
return property.equals("1");
|
|
}
|
|
|
|
public boolean isPermiteLayoutInternacional() {
|
|
String property = p.getProperty("permiteLayoutInternacional", "0");
|
|
return property.equals("1");
|
|
}
|
|
}
|