Skip to content

Commit

Permalink
Merge branch 'release/4.00.25'
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Oliveira committed Jul 30, 2023
2 parents bf6bec7 + 189bc48 commit d0ff869
Show file tree
Hide file tree
Showing 8 changed files with 1,374 additions and 24 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Notas de versão

- Atualizado Java Certificado (Ver https://github.com/Samuel-Oliveira/Java_Certificado)
- Atualizado Cacert (Sefaz Minas)
- Adicionado ZoneId direto a configuracao e removido da Chamada dos metodos. O padrao de ZoneId é America/Sao_Paulo
- Corrigido erro Inutilizacão CE
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Java-NFe [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_NFe.svg) ](https://github.com/Samuel-Oliveira/Java_NFe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-nfe.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-nfe/4.00.24/jar)
# Java-NFe [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_NFe.svg) ](https://github.com/Samuel-Oliveira/Java_NFe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-nfe.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-nfe/4.00.25/jar)
Biblioteca Java para consumo do WebService de NFe/NFCe

## Dúvidas, Sugestões ou Consultoria
Expand All @@ -17,7 +17,7 @@ Para Iniciar :
<dependency>
<groupId>br.com.swconsultoria</groupId>
<artifactId>java-nfe</artifactId>
<version>4.00.24</version>
<version>4.00.25</version>
</dependency>
```

Expand All @@ -29,7 +29,7 @@ repositories {
}
}
dependencies {
implementation "br.com.swconsultoria:java-nfe:4.00.24"
implementation "br.com.swconsultoria:java-nfe:4.00.25"
}
```

Expand All @@ -39,6 +39,9 @@ ________________________________________________________________________________

# Historico de Versões

## v4.00.25 - 30/07/2023 - Schemas PL.009k
- Corrigido erro Inutilizacão CE

## v4.00.24 - 05/05/2023 - Schemas PL.009k
- Atualizado Java Certificado (Ver https://github.com/Samuel-Oliveira/Java_Certificado)
- Atualizado Cacert (Sefaz Minas)
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/Samuel-Oliveira/Java_NFe.svg?branch=master)](https://travis-ci.org/Samuel-Oliveira/Java_NFe) [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_NFe.svg) ](https://github.com/Samuel-Oliveira/Java_NFe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-nfe.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-nfe/4.00.24/jar) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Samuel-Oliveira/Java_NFe.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Samuel-Oliveira/Java_NFe/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/Samuel-Oliveira/Java_NFe.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Samuel-Oliveira/Java_NFe/alerts/)
[![Build Status](https://travis-ci.org/Samuel-Oliveira/Java_NFe.svg?branch=master)](https://travis-ci.org/Samuel-Oliveira/Java_NFe) [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_NFe.svg) ](https://github.com/Samuel-Oliveira/Java_NFe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-nfe.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-nfe/4.00.25/jar) [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/Samuel-Oliveira/Java_NFe.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Samuel-Oliveira/Java_NFe/context:java) [![Total alerts](https://img.shields.io/lgtm/alerts/g/Samuel-Oliveira/Java_NFe.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Samuel-Oliveira/Java_NFe/alerts/)

***Biblioteca Java para consumo do WebService de NFe/NFCe***

Expand All @@ -11,7 +11,7 @@
</p>

Para Iniciar :
- Caso use Libs baixe o [java-nfe-4.00.24.jar](https://github.com/Samuel-Oliveira/Java_NFe/raw/master/java-nfe-4.00.24.jar) e o adicione às bibliotecas de Seu Projeto.
- Caso use Libs baixe o [java-nfe-4.00.25.jar](https://github.com/Samuel-Oliveira/Java_NFe/raw/master/java-nfe-4.00.25.jar) e o adicione às bibliotecas de Seu Projeto.

- Baixe o [Schemas.rar](https://github.com/Samuel-Oliveira/Java_NFe/raw/master/schemas.zip) e extraia na sua Máquina.

Expand All @@ -20,7 +20,7 @@ Para Iniciar :
<dependency>
<groupId>br.com.swconsultoria</groupId>
<artifactId>java-nfe</artifactId>
<version>4.00.24</version>
<version>4.00.25</version>
</dependency>
```

Expand All @@ -32,7 +32,7 @@ repositories {
}
}
dependencies {
implementation "br.com.swconsultoria:java-nfe:4.00.24"
implementation "br.com.swconsultoria:java-nfe:4.00.25"
}
```

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.swconsultoria</groupId>
<artifactId>java-nfe</artifactId>
<version>4.00.24-SNAPSHOT</version>
<version>4.00.26-SNAPSHOT</version>
<name>Java_NFe</name>
<description>Api java para consumo do webService de nota fiscal eletronica</description>
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
Expand Down
41 changes: 30 additions & 11 deletions src/main/java/br/com/swconsultoria/nfe/Inutilizar.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
import br.com.swconsultoria.nfe.dom.enuns.AssinaturaEnum;
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum;
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
import br.com.swconsultoria.nfe.exception.NfeException;
import br.com.swconsultoria.nfe.schema_4.inutNFe.TInutNFe;
Expand Down Expand Up @@ -45,21 +46,39 @@ static TRetInutNFe inutiliza(ConfiguracoesNfe config, TInutNFe inutNFe, Document

OMElement ome = AXIOMUtil.stringToOM(xml);

NFeInutilizacao4Stub.NfeDadosMsg dadosMsg = new NFeInutilizacao4Stub.NfeDadosMsg();
dadosMsg.setExtraElement(ome);
if (EstadosEnum.CE.equals(config.getEstado()) ) {
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeDadosMsg dadosMsgCe =
new br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeDadosMsg();
dadosMsgCe.setExtraElement(ome);
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub stubCe = new br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));

NFeInutilizacao4Stub stub = new NFeInutilizacao4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));
// Timeout
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
stubCe._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
stubCe._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
}
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeResultMsg resultCe = stubCe.nfeInutilizacaoNF(dadosMsgCe);

// Timeout
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
log.info("[XML-RETORNO]: " + resultCe.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(resultCe.getExtraElement().toString(), TRetInutNFe.class);
} else{
NFeInutilizacao4Stub.NfeDadosMsg dadosMsg = new NFeInutilizacao4Stub.NfeDadosMsg();
dadosMsg.setExtraElement(ome);
NFeInutilizacao4Stub stub = new NFeInutilizacao4Stub(
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));

// Timeout
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
}
NFeInutilizacao4Stub.NfeResultMsg result = stub.nfeInutilizacaoNF(dadosMsg);

log.info("[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetInutNFe.class);
}
NFeInutilizacao4Stub.NfeResultMsg result = stub.nfeInutilizacaoNF(dadosMsg);

log.info("[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetInutNFe.class);
} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage(),e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static ConfiguracoesNfe criarConfiguracoes(EstadosEnum estado, AmbienteEn

if (Logger.getLogger("").isLoggable(Level.SEVERE)) {
System.err.println("####################################################################");
System.err.println(" Api Java Nfe - Versão 4.00.24 - 06/05/2023");
System.err.println(" Api Java Nfe - Versão 4.00.25 - 30/07/2023");
if (Logger.getLogger("").isLoggable(Level.WARNING)) {
System.err.println(" Samuel Olivera - samuel@swconsultoria.com.br ");
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public boolean isContigenciaSVC() {
}

/**
* Atribui um valor para contigenciaSCAN. Caso True, as operações da NF-e
* Atribui um valor para contigenciaSVC. Caso True, as operações da NF-e
* funcionarão no modo de Contingência. <br>
* Usar para situações em que não for possível estabelecer conexão com o
* WebService SEFAZ Origem.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* NFeInutilizacao4CallbackHandler.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: 1.7.5 Built on : May 06, 2017 (03:45:26 BST)
*/
package br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce;


/**
* NFeInutilizacao4CallbackHandler Callback class, Users can extend this class and implement
* their own receiveResult and receiveError methods.
*/
public abstract class NFeInutilizacao4CallbackHandler {
protected Object clientData;

/**
* User can pass in any object that needs to be accessed once the NonBlocking
* Web service call is finished and appropriate method of this CallBack is called.
* @param clientData Object mechanism by which the user can pass in user data
* that will be avilable at the time this callback is called.
*/
public NFeInutilizacao4CallbackHandler(Object clientData) {
this.clientData = clientData;
}

/**
* Please use this constructor if you don't want to set any clientData
*/
public NFeInutilizacao4CallbackHandler() {
this.clientData = null;
}

/**
* Get the client data
*/
public Object getClientData() {
return clientData;
}

/**
* auto generated Axis2 call back method for nfeInutilizacaoNF method
* override this method for handling normal response from nfeInutilizacaoNF operation
*/
public void receiveResultnfeInutilizacaoNF(
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeResultMsg result) {
}

/**
* auto generated Axis2 Error handler
* override this method for handling error response from nfeInutilizacaoNF operation
*/
public void receiveErrornfeInutilizacaoNF(java.lang.Exception e) {
}
}
Loading

0 comments on commit d0ff869

Please sign in to comment.