parent
e5a78d3339
commit
3924e30038
6
pom.xml
6
pom.xml
|
@ -4,12 +4,12 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ventaboletosadm</artifactId>
|
||||
<version>1.41.0</version>
|
||||
<version>1.42.0</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<properties>
|
||||
<modelWeb.version>1.30.0</modelWeb.version>
|
||||
<flyway.version>1.24.0</flyway.version>
|
||||
<modelWeb.version>1.31.0</modelWeb.version>
|
||||
<flyway.version>1.25.0</flyway.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
|
|
@ -36,7 +36,6 @@ import java.util.regex.Pattern;
|
|||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.brazilutils.br.cpfcnpj.Cnpj;
|
||||
import org.brazilutils.br.cpfcnpj.Cpf;
|
||||
import org.brazilutils.validation.ValidationException;
|
||||
|
@ -87,11 +86,13 @@ import com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce;
|
|||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailFlexBus;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaImposto;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaMercadoPagoConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaPMArtespConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaSaferConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
||||
import com.rjconsultores.ventaboletos.entidad.InscricaoEstadual;
|
||||
import com.rjconsultores.ventaboletos.entidad.InstiFinanceira;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoCstGratuidade;
|
||||
|
@ -109,11 +110,13 @@ import com.rjconsultores.ventaboletos.service.EmpresaEmailFlexBusService;
|
|||
import com.rjconsultores.ventaboletos.service.EmpresaEmailService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaImpostoService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaMercadoPagoConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaPMArtespConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaSaferConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
||||
import com.rjconsultores.ventaboletos.service.InstiFinanceiraService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoEventoExtraService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
||||
|
@ -135,7 +138,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderComEmpTipoEvent
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaImposto;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaInscricaoEstadual;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.security.SecurityEmpresaToken;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -181,6 +183,11 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
@Autowired
|
||||
private EmpresaMercadoPagoConfigService empresaMercadoPagoConfigService;
|
||||
|
||||
@Autowired
|
||||
private EmpresaPMArtespConfigService empresaPMArtespConfigService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoConcedenteService;
|
||||
|
||||
private Empresa empresa;
|
||||
private EmpresaEmail empresaEmail;
|
||||
private EmpresaEmailEComerce empresaEmailEComerce;
|
||||
|
@ -476,6 +483,17 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
|
||||
private Checkbox chkIndntegracaoAGR;
|
||||
|
||||
//Integracao PM ARTESP
|
||||
private Checkbox chkAtivarIntegracaoPMARTESP;
|
||||
private Textbox txtUrlIntegracaoARTESP;
|
||||
private Textbox txtTokenIntegracaoARTESP;
|
||||
|
||||
private MyComboboxEstandar cmbTipoDePassagem;
|
||||
private MyComboboxEstandar cmbOrgaoConcedente;
|
||||
|
||||
private EmpresaPMArtespConfig empresaPMArtespConfig;
|
||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||
|
||||
private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
|
||||
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
|
||||
|
||||
|
@ -486,6 +504,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
lsCategorias = categoriaService.obtenerTodasCategoriasVisibles();
|
||||
lsFormaPagos = formaPagoService.obtenerTodos();
|
||||
lsTipoEventoExtras = tipoEventoExtraService.obtenerTodos();
|
||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||
|
||||
empresa = (Empresa) Executions.getCurrent().getArg().get("empresa");
|
||||
empresaList = (MyListbox) Executions.getCurrent().getArg().get("empresaList");
|
||||
|
@ -502,6 +521,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
empresaSaferConfig = empresaSaferConfigService.buscarPorEmpresa(empresa);
|
||||
empresaAdyenConfig = empresaAdyenConfigService.buscarPorEmpresa(empresa);
|
||||
empresaMercadoPagoConfig = empresaMercadoPagoConfigService.buscarPorEmpresa(empresa);
|
||||
empresaPMArtespConfig = empresaPMArtespConfigService.buscarPorEmpresa(empresa);
|
||||
}
|
||||
|
||||
if (empresa != null && empresa.getEmpresaId() != null) {
|
||||
|
@ -609,6 +629,21 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
carregarConfiguracaoMercadoPago();
|
||||
}
|
||||
|
||||
if(empresaPMArtespConfig != null) {
|
||||
chkAtivarIntegracaoPMARTESP.setChecked(empresaPMArtespConfig.getValidacaoAtiva());
|
||||
|
||||
txtUrlIntegracaoARTESP.setText(empresaPMArtespConfig.getUrlApi());
|
||||
txtTokenIntegracaoARTESP.setText(empresaPMArtespConfig.getApiKey());
|
||||
|
||||
if(empresaPMArtespConfig.getOrgaoConcedente() != null) {
|
||||
cmbOrgaoConcedente.setText(empresaPMArtespConfig.getOrgaoConcedente().getDescOrgao());
|
||||
}
|
||||
|
||||
if(empresaPMArtespConfig.getCategoria() != null) {
|
||||
cmbTipoDePassagem.setText(empresaPMArtespConfig.getCategoria().getDesccategoria());
|
||||
}
|
||||
}
|
||||
|
||||
if (empresa.getIndfechatarifa() == null) {
|
||||
rdgFechaSalida.setChecked(Boolean.TRUE);
|
||||
} else if (empresa.getIndfechatarifa()) {
|
||||
|
@ -1055,6 +1090,11 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
empresa.setCidade(cidade);
|
||||
}
|
||||
|
||||
if(!isValidosCamposIntegracaoPMArtesp()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (empresa.getIndExterna() == null) {
|
||||
empresa.setIndExterna(Boolean.FALSE);
|
||||
|
@ -1303,6 +1343,8 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
empresaMercadoPagoConfigService.actualizacion(empresaMercadoPagoConfig);
|
||||
}
|
||||
|
||||
//INTEGRACAO TIPO DE PASSAGEM PM ARTESP
|
||||
salvarEmpresaPMArtespConfig();
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarEmpresaController.MSG.suscribirOK"),
|
||||
Labels.getLabel("editarEmpresaController.window.title"),
|
||||
|
@ -1337,6 +1379,53 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isValidosCamposIntegracaoPMArtesp() throws InterruptedException {
|
||||
if(chkAtivarIntegracaoPMARTESP.isChecked()) {
|
||||
|
||||
if(cmbOrgaoConcedente.getSelectedItem() == null || cmbTipoDePassagem.getSelectedItem() == null ||
|
||||
txtTokenIntegracaoARTESP.getValue() == null || txtUrlIntegracaoARTESP.getValue() == null) {
|
||||
|
||||
Messagebox.show(Labels.getLabel("editarEmpresaController.MSG.InfoCamposIntegracaoPMArtespInvalido"),
|
||||
Labels.getLabel("editarEmpresaController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void salvarEmpresaPMArtespConfig() {
|
||||
boolean atualizar = true;
|
||||
|
||||
if(empresaPMArtespConfig == null) {
|
||||
empresaPMArtespConfig = new EmpresaPMArtespConfig();
|
||||
atualizar = false;
|
||||
}
|
||||
|
||||
empresaPMArtespConfig.setEmpresa(empresa);
|
||||
|
||||
if(cmbOrgaoConcedente.getSelectedItem() != null) {
|
||||
OrgaoConcedente orgao = (OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue();
|
||||
empresaPMArtespConfig.setOrgaoConcedente(orgao);
|
||||
}
|
||||
|
||||
if(cmbTipoDePassagem.getSelectedItem() != null) {
|
||||
Categoria categoria = (Categoria) cmbTipoDePassagem.getSelectedItem().getValue();
|
||||
empresaPMArtespConfig.setCategoria(categoria);
|
||||
}
|
||||
|
||||
empresaPMArtespConfig.setApiKey(txtTokenIntegracaoARTESP.getValue());
|
||||
empresaPMArtespConfig.setUrlApi(txtUrlIntegracaoARTESP.getValue());
|
||||
|
||||
empresaPMArtespConfig.setValidacaoAtiva(chkAtivarIntegracaoPMARTESP.isChecked());
|
||||
|
||||
if(atualizar) {
|
||||
empresaPMArtespConfig = empresaPMArtespConfigService.actualizacion(empresaPMArtespConfig);
|
||||
} else {
|
||||
empresaPMArtespConfig = empresaPMArtespConfigService.suscribir(empresaPMArtespConfig);
|
||||
}
|
||||
}
|
||||
|
||||
private Date buscarHora(Date horaEmbarque) {
|
||||
if (horaEmbarque != null) {
|
||||
GregorianCalendar gHoraSalida = new GregorianCalendar();
|
||||
|
@ -2919,4 +3008,36 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
|
|||
return !cadastroEmpresaNova;
|
||||
}
|
||||
|
||||
public MyComboboxEstandar getCmbTipoDePassagem() {
|
||||
return cmbTipoDePassagem;
|
||||
}
|
||||
|
||||
public void setCmbTipoDePassagem(MyComboboxEstandar cmbTipoDePassagem) {
|
||||
this.cmbTipoDePassagem = cmbTipoDePassagem;
|
||||
}
|
||||
|
||||
public EmpresaPMArtespConfig getEmpresaPMArtespConfig() {
|
||||
return empresaPMArtespConfig;
|
||||
}
|
||||
|
||||
public void setEmpresaPMArtespConfig(EmpresaPMArtespConfig empresaPMArtespConfig) {
|
||||
this.empresaPMArtespConfig = empresaPMArtespConfig;
|
||||
}
|
||||
|
||||
public MyComboboxEstandar getCmbOrgaoConcedente() {
|
||||
return cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setCmbOrgaoConcedente(MyComboboxEstandar cmbOrgaoConcedente) {
|
||||
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public List<OrgaoConcedente> getLsOrgaoConcedente() {
|
||||
return lsOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setLsOrgaoConcedente(List<OrgaoConcedente> lsOrgaoConcedente) {
|
||||
this.lsOrgaoConcedente = lsOrgaoConcedente;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -455,6 +455,7 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.OrgaoComprovanteCustomizado</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.HeaderTabelaEsquemaCorrida</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Disponibilidad</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaPMArtespConfig</value>
|
||||
</list>
|
||||
</property>
|
||||
|
||||
|
|
|
@ -2057,6 +2057,16 @@ editarEmpresaController.lblBtnCadastrarPOSMercadoPago.value = Cadastrar POS
|
|||
editarEmpresaController.lblMsgCadastrarStoreMercadoPago.value = Store cadastrada com sucesso
|
||||
editarEmpresaController.lblMsgCadastrarPOSMercadoPago.value = POS cadastrada com sucesso
|
||||
|
||||
editarEmpresaController.lblIntegracoesTipoPassagem.value=Integrações Tipo de Passagem
|
||||
editarEmpresaController.lblTabPMArtesp.value=Integração PM Artesp
|
||||
editarEmpresaController.lblOrgaoConcedenteIntegracao.value=Orgão Concedente
|
||||
editarEmpresaController.lblTipoDePassagemIntegracao.value=Tipo de Passagem
|
||||
editarEmpresaController.lblAtivarArtesp.value=Ativar Validação
|
||||
editarEmpresaController.lblUrlApiPMArtesp.value=URL API
|
||||
editarEmpresaController.lblApiKeyPMArtesp.value=API KEY
|
||||
editarEmpresaController.MSG.InfoCamposIntegracaoPMArtespInvalido= Ao habilitar a integração PM Artesp, os campos passam ser obrigatorios.
|
||||
editarEmpresaController.lblUrlApiPMArtesp.value.ajuda=URL API deve conter os dados {RE}, {EMBARQUE} e {DESEMBARQUE}, que serão subtituidos no momento da validação de gratuidade pelo totalbus.
|
||||
|
||||
# Muestra o ponto de Pesquisa de Venda
|
||||
busquedaPuntoVentaController.window.title = Ponto de Venda ( Agência )
|
||||
busquedaPuntoVentaController.btnRefresh.tooltiptext = Atualizar
|
||||
|
|
|
@ -65,6 +65,9 @@
|
|||
<tab id="tabMercadoPago"
|
||||
label="${c:l('editarEmpresaController.lblMercadoPago.value')}" />
|
||||
|
||||
<tab
|
||||
label="${c:l('editarEmpresaController.lblIntegracoesTipoPassagem.value')}" />
|
||||
|
||||
</tabs>
|
||||
|
||||
<tabpanels style="overflow: auto">
|
||||
|
@ -2488,6 +2491,78 @@
|
|||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel>
|
||||
|
||||
<tabbox>
|
||||
<tabs>
|
||||
<tab label="${c:l('editarEmpresaController.lblTabPMArtesp.value')}" />
|
||||
</tabs>
|
||||
|
||||
<tabpanels>
|
||||
|
||||
<tabpanel>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="25%" />
|
||||
<column width="75%" />
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.lblAtivarArtesp.value')}" />
|
||||
<checkbox id="chkAtivarIntegracaoPMARTESP"
|
||||
value="@{winEditarEmpresa$composer.empresaPMArtespConfig.validacaoAtiva}"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<hlayout>
|
||||
<label value="${c:l('editarEmpresaController.lblUrlApiPMArtesp.value')}" />
|
||||
<image src="/gui/img/Question_mark_1.png" tooltiptext="${c:l('editarEmpresaController.lblUrlApiPMArtesp.value.ajuda')}"
|
||||
style="cursor: help" />
|
||||
</hlayout>
|
||||
|
||||
<textbox
|
||||
id="txtUrlIntegracaoARTESP" width="80%" maxlength="500"
|
||||
value="@{winEditarEmpresa$composer.empresaPMArtespConfig.urlApi}" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.lblApiKeyPMArtesp.value')}" />
|
||||
<textbox
|
||||
id="txtTokenIntegracaoARTESP" width="80%" maxlength="4000"
|
||||
value="@{winEditarEmpresa$composer.empresaPMArtespConfig.apiKey}" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.lblOrgaoConcedenteIntegracao.value')}" />
|
||||
<combobox
|
||||
id="cmbOrgaoConcedente" width="30%" mold="rounded"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarEmpresa$composer.lsOrgaoConcedente}"
|
||||
selectedItem="@{winEditarPuntoVenta$composer.empresaPMArtespConfig.orgaoConcedente}"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="${c:l('editarEmpresaController.lblTipoDePassagemIntegracao.value')}" />
|
||||
<combobox
|
||||
id="cmbTipoDePassagem" width="30%" mold="rounded"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winEditarEmpresa$composer.lsCategorias}"
|
||||
selectedItem="@{winEditarPuntoVenta$composer.empresaPMArtespConfig.categoria}"
|
||||
/>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
|
||||
</grid>
|
||||
|
||||
</tabpanel>
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
</tabpanel>
|
||||
|
||||
|
|
Loading…
Reference in New Issue