AL-4135
parent
1d50cccf62
commit
05a7e1689f
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ventaboletosadm</artifactId>
|
||||
<version>1.63.2</version>
|
||||
<version>1.63.5</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -7,8 +7,10 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -20,6 +22,7 @@ import java.security.UnrecoverableEntryException;
|
|||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -33,6 +36,8 @@ import java.util.Map;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
@ -79,6 +84,7 @@ import com.rjconsultores.ventaboletos.entidad.ComEmpFormapago;
|
|||
import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaCertificadoConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaCieloLinkConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
|
||||
|
@ -97,6 +103,7 @@ 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.EnumTipoCertificado;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoCstGratuidade;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoEmail;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoOperacaoECommerce;
|
||||
|
@ -105,6 +112,7 @@ import com.rjconsultores.ventaboletos.rest.MercadoPagoService;
|
|||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.CiudadService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaAdyenConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaCertificadoConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaCieloLinkService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaEmailConfigService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaEmailEComerceService;
|
||||
|
@ -187,6 +195,8 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private EmpresaAdyenConfigService empresaAdyenConfigService;
|
||||
@Autowired
|
||||
private EmpresaMercadoPagoConfigService empresaMercadoPagoConfigService;
|
||||
@Autowired
|
||||
private EmpresaCertificadoConfigService empresaCertificadoConfigService;
|
||||
|
||||
@Autowired
|
||||
private EmpresaPMArtespConfigService empresaPMArtespConfigService;
|
||||
|
@ -203,6 +213,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private EmpresaSaferConfig empresaSaferConfig;
|
||||
private EmpresaAdyenConfig empresaAdyenConfig;
|
||||
private EmpresaMercadoPagoConfig empresaMercadoPagoConfig;
|
||||
private EmpresaCertificadoConfig empresaCertificadoConfigSaftao;
|
||||
private MyListbox empresaList;
|
||||
private MyTextbox txtNome;
|
||||
private MyTextbox txtCNPJ;
|
||||
|
@ -423,7 +434,6 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private Checkbox chkImprimirEmbarqueDesembarqCupom;
|
||||
private Checkbox chkIndSegundaViaSeguroOpcional;
|
||||
private Checkbox chkIndJurosCredito;
|
||||
private Checkbox chkIndSaftao;
|
||||
|
||||
private CKeditor messageConteudoEmail;
|
||||
private CKeditor messageConteudoEmailFiscal;
|
||||
|
@ -500,6 +510,11 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private Textbox txtUrlIntegracaoARTESP;
|
||||
private Textbox txtTokenIntegracaoARTESP;
|
||||
|
||||
private Label lblCertificadoSaftao;
|
||||
private Checkbox chkIndSaftao;
|
||||
private byte[] certificadoSaftao;
|
||||
private Tab tabSaftao;
|
||||
|
||||
private MyComboboxEstandar cmbTipoDePassagem;
|
||||
private MyComboboxEstandar cmbOrgaoConcedente;
|
||||
|
||||
|
@ -533,6 +548,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
empresaSaferConfig = empresaSaferConfigService.buscarPorEmpresa(empresa);
|
||||
empresaAdyenConfig = empresaAdyenConfigService.buscarPorEmpresa(empresa);
|
||||
empresaMercadoPagoConfig = empresaMercadoPagoConfigService.buscarPorEmpresa(empresa);
|
||||
empresaCertificadoConfigSaftao = empresaCertificadoConfigService.buscarPorEmpresa(empresa, EnumTipoCertificado.SAFTAO);
|
||||
empresaPMArtespConfig = empresaPMArtespConfigService.buscarPorEmpresa(empresa);
|
||||
}
|
||||
|
||||
|
@ -626,6 +642,16 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
if (empresaCertificadoConfigSaftao != null) {
|
||||
certificadoSaftao = empresaCertificadoConfigSaftao.getCertificado();
|
||||
if(certificadoSaftao != null){
|
||||
InputStream certStream = new ByteArrayInputStream(certificadoSaftao);
|
||||
if (certStream != null) {
|
||||
lblCertificadoSaftao.setValue(getCerticateInfoSaftao(certStream));
|
||||
}
|
||||
}
|
||||
}
|
||||
mostrarAbaSaftao();
|
||||
mostrarAbaSafer();
|
||||
|
||||
if (empresaAdyenConfig != null) {
|
||||
|
@ -2171,29 +2197,38 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
|
|||
lsStoreMercadoPago = new ArrayList<StoreVO>();
|
||||
lsPosMercadoPago = new ArrayList<PosVO>();
|
||||
|
||||
RetornoStoreVO retornoStoreVO = MercadoPagoService.getInstance().retornarStoreMercadoPago(
|
||||
txtUserIdMercadoPago.getValue(), txtUrlApiMercadoPago.getValue(), txtTokenMercadoPago.getValue());
|
||||
if (StringUtils.isNotBlank(txtUserIdMercadoPago.getValue())
|
||||
&& StringUtils.isNotBlank(txtUrlApiMercadoPago.getValue())
|
||||
&& StringUtils.isNotBlank(txtTokenMercadoPago.getValue())) {
|
||||
RetornoStoreVO retornoStoreVO = MercadoPagoService.getInstance().retornarStoreMercadoPago(
|
||||
txtUserIdMercadoPago.getValue(), txtUrlApiMercadoPago.getValue(), txtTokenMercadoPago.getValue());
|
||||
|
||||
if (retornoStoreVO != null){
|
||||
for (StoreVO vo : retornoStoreVO.getResults()) {
|
||||
if (store != null && vo.toString().equals(store)) {
|
||||
this.storeVO = vo;
|
||||
if (retornoStoreVO != null) {
|
||||
for (StoreVO vo : retornoStoreVO.getResults()) {
|
||||
if (store != null && vo.toString().equals(store)) {
|
||||
this.storeVO = vo;
|
||||
}
|
||||
lsStoreMercadoPago.add(vo);
|
||||
}
|
||||
lsStoreMercadoPago.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
RetornoPosVO retornoPosVO = MercadoPagoService.getInstance()
|
||||
.retornarPosMercadoPago(txtUrlApiMercadoPago.getValue(), txtTokenMercadoPago.getValue());
|
||||
if (StringUtils.isNotBlank(txtUrlApiMercadoPago.getValue())
|
||||
&& StringUtils.isNotBlank(txtTokenMercadoPago.getValue())) {
|
||||
|
||||
if (retornoPosVO != null) {
|
||||
for (PosVO vo : retornoPosVO.getResults()) {
|
||||
if (pos != null && vo.toString().equals(pos)) {
|
||||
this.posVO = vo;
|
||||
RetornoPosVO retornoPosVO = MercadoPagoService.getInstance()
|
||||
.retornarPosMercadoPago(txtUrlApiMercadoPago.getValue(), txtTokenMercadoPago.getValue());
|
||||
|
||||
if (retornoPosVO != null) {
|
||||
for (PosVO vo : retornoPosVO.getResults()) {
|
||||
if (pos != null && vo.toString().equals(pos)) {
|
||||
this.posVO = vo;
|
||||
}
|
||||
lsPosMercadoPago.add(vo);
|
||||
}
|
||||
lsPosMercadoPago.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Combobox getCmbEstadoInscEstadual() {
|
||||
|
@ -2805,6 +2840,12 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
|
|||
}
|
||||
}
|
||||
|
||||
private void mostrarAbaSaftao() {
|
||||
if (ApplicationProperties.getInstance().isCustomHabilitado(CustomEnum.IS_VENDA_SAFTAO.getDescricao(), true)) {
|
||||
tabSaftao.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void popularCombobox() {
|
||||
for (AuthType tipoAutorizacao : AuthType.values()) {
|
||||
Comboitem comboItem = new Comboitem(tipoAutorizacao.toString());
|
||||
|
@ -2891,6 +2932,52 @@ public void onClick$btnTestEmailFlexBus(Event ev) throws InterruptedException {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void uploadFileSaftao(UploadEvent event) {
|
||||
org.zkoss.util.media.Media media = event.getMedia();
|
||||
|
||||
try {
|
||||
String info = getCerticateInfoSaftao(media.getStreamData());
|
||||
|
||||
if (info != null) {
|
||||
certificadoSaftao = media.getByteData();
|
||||
lblCertificadoSaftao.setValue(info);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMarcaController.MSG.errorIMG") + " " + media,
|
||||
Labels.getLabel("editarEmpresaController.window.title"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error(ex);
|
||||
throw UiException.Aide.wrap(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private String getCerticateInfoSaftao(InputStream cerFileStream) throws IOException, Exception {
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(cerFileStream, writer, "UTF-8");
|
||||
|
||||
String privateKeyContent = writer != null ? writer.toString() : null;
|
||||
|
||||
if (privateKeyContent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
privateKeyContent = privateKeyContent.replaceAll("-----END PRIVATE KEY-----", "")
|
||||
.replaceAll("-----BEGIN PRIVATE KEY-----", "").replaceAll("-----BEGIN RSA PRIVATE KEY-----", "")
|
||||
.replaceAll("-----END RSA PRIVATE KEY-----", "").replaceAll("\r\n", "").replaceAll("\n", "");
|
||||
|
||||
KeyFactory kf = KeyFactory.getInstance("RSA");
|
||||
|
||||
PKCS8EncodedKeySpec keySpecPKCS8 = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyContent));
|
||||
|
||||
PrivateKey privKey = kf.generatePrivate(keySpecPKCS8);
|
||||
|
||||
return privKey.toString();
|
||||
}
|
||||
|
||||
public EmpresaEmailFlexBusService getEmpresaEmailFlexBusService() {
|
||||
return empresaEmailFlexBusService;
|
||||
}
|
||||
|
|
|
@ -385,6 +385,7 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaEmailEComerce</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaSaferConfig</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaCertificadoConfig</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.CtrlFechamentoCaixa</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.PtovtaAntifraude</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.OperadorEmbarcada</value>
|
||||
|
|
|
@ -9704,6 +9704,9 @@ editarEmpresaController.confMovFPTrocaVlrDeposito.help=Soma Forma de Pagamento '
|
|||
editarEmpresaController.indSegundaViaSeguroOpcional= Emite Segunda via do seguro opcional
|
||||
editarEmpresaController.indJurosCredito= Habilita juros no cartão de crédito
|
||||
editarEmpresaController.indSaftao= Enable SaftAO
|
||||
editarEmpresaController.saftao.titulo= SaftAO
|
||||
editarEmpresaController.lblCertificadoSaftao.value = Certificate Information
|
||||
editarEmpresaController.lblCarregarCertificadoSaftao.value = Upload Certificate
|
||||
|
||||
editarEmpresaController.encerraViagemFechorllegada.ajuda=Habilita o encerramento pela data de chegada. O padrão é a validação pela data de saída.
|
||||
editarEmpresaController.usaTabelaPrecoEmbarcada.ajuda=Utilizar tabela de preço da Embarcada
|
||||
|
|
|
@ -9395,6 +9395,9 @@ editarEmpresaController.indSegundaViaSeguroOpcional= Emite una segunda copia del
|
|||
editarEmpresaController.indSegundaViaSeguroOpcional.tooltip=Con este flag seleccionado, al emitir una 2da copia de boleto con seguro vinculado opcional, el sistema también emite la 2da copia del seguro y lo registra en caja en transacciones que no generan efectivo. Además, con esta bandera seleccionada, al cambiar/transferir un billete, el seguro anterior se cancela automáticamente en caja y el importe pagado se utiliza como “crédito” para pagar el nuevo seguro que se registrará en caja.
|
||||
editarEmpresaController.indJurosCredito= Habilita juros no cartão de crédito
|
||||
editarEmpresaController.indSaftao= Habilita SaftAO
|
||||
editarEmpresaController.saftao.titulo= SaftAO
|
||||
editarEmpresaController.lblCertificadoSaftao.value = Información certificada
|
||||
editarEmpresaController.lblCarregarCertificadoSaftao.value = Cargar certificado
|
||||
|
||||
editarEmpresaController.encerraViagemFechorllegada.ajuda=Controla o encerramento da viagem pela data de saída data de chegada da corrida.
|
||||
editarEmpresaController.usaTabelaPrecoEmbarcada.ajuda=Utilizar tabela de preço da Embarcada
|
||||
|
|
|
@ -9796,6 +9796,9 @@ editarEmpresaController.indJurosCredito= Habilita juros no cartão de crédito
|
|||
editarEmpresaController.indHabilitaVendaDeBilheteSemelhante= Hailita a venda de bilhete semelhante na mesma cesta de compra.
|
||||
editarEmpresaController.indHabilitaVendaDeBilheteSemelhante.help = Habilita a venda de bilhetes semelhante na mesma cesta de compra, respeitando o preço do primeiro bilhete.
|
||||
editarEmpresaController.indSaftao= Habilita SaftAO
|
||||
editarEmpresaController.saftao.titulo= SaftAO
|
||||
editarEmpresaController.lblCertificadoSaftao.value = Informações Certificado
|
||||
editarEmpresaController.lblCarregarCertificadoSaftao.value = Carregar Certificado
|
||||
|
||||
editarEmpresaController.indHabilitaTaxaConvenienciaSomenteVenda=Habilita Taxa de Conveniência apenas nas operações de venda.
|
||||
editarEmpresaController.indHabilitaTaxaConvenienciaSomenteVenda.help=Com a Flag marcada, a taxa de conveniência configurada no ponto de venda será aplicada apenas nas operações de venda. NÃO se aplica às operações de troca, transferência, marcação de aberto, etc.
|
||||
|
|
|
@ -66,10 +66,10 @@
|
|||
label="${c:l('editarEmpresaController.lblAdyen.value')}" />
|
||||
<tab id="tabMercadoPago"
|
||||
label="${c:l('editarEmpresaController.lblMercadoPago.value')}" />
|
||||
|
||||
<tab
|
||||
label="${c:l('editarEmpresaController.lblIntegracoesTipoPassagem.value')}" />
|
||||
|
||||
<tab id="tabSaftao" visible="false"
|
||||
label="${c:l('editarEmpresaController.saftao.titulo')}" />
|
||||
</tabs>
|
||||
|
||||
<tabpanels style="overflow: auto">
|
||||
|
@ -1071,7 +1071,6 @@
|
|||
<image src="/gui/img/Question_mark_1.png" tooltiptext="${c:l('editarEmpresaController.indJurosCredito')}" style="cursor: help" />
|
||||
</hlayout>
|
||||
</groupbox>
|
||||
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -1115,15 +1114,6 @@
|
|||
|
||||
</hlayout>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="${c:l('editarEmpresaController.indSaftao')}" />
|
||||
|
||||
<hlayout>
|
||||
<checkbox id="chkIndSaftao" value="@{winEditarEmpresa$composer.empresa.indSaftao}" />
|
||||
<image src="/gui/img/Question_mark_1.png" tooltiptext="${c:l('editarEmpresaController.indSaftao')}" style="cursor: help" />
|
||||
</hlayout>
|
||||
</groupbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
|
@ -2613,6 +2603,44 @@
|
|||
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel >
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="25%" />
|
||||
<column width="75%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarEmpresaController.indSaftao')}" />
|
||||
<checkbox id="chkIndSaftao" value="@{winEditarEmpresa$composer.empresa.indSaftao}" />
|
||||
</row>
|
||||
|
||||
<row spans="2">
|
||||
<groupbox>
|
||||
<caption
|
||||
label="${c:l('editarEmpresaController.lblCertificadoSaftao.value')}" />
|
||||
|
||||
<hlayout>
|
||||
|
||||
<fileupload
|
||||
label="${c:l('editarEmpresaController.lblCarregarCertificadoSaftao.value')}"
|
||||
onUpload="winEditarEmpresa$composer.uploadFileSaftao(event)" />
|
||||
|
||||
</hlayout>
|
||||
</groupbox>
|
||||
</row>
|
||||
|
||||
<row spans="2">
|
||||
<label id="lblCertificadoSaftao"
|
||||
multiline="true" />
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
|
|
Loading…
Reference in New Issue