Skip to content

Commit a6ef2d6

Browse files
Merge pull request #16 from asaasdev/sincronizar-versao
[STOR-966] Atualizar Cadeia de Certificado MT
2 parents a1a20b6 + 3ecb90a commit a6ef2d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+10794
-78
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Publish docs via GitHub Pages
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- master
6+
tags:
7+
- '4.*'
88

99
jobs:
1010
build:

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ name: Liberar nova versão
44
on:
55
workflow_dispatch:
66
push:
7-
branches:
8-
- 'master'
97
tags:
108
- '4.*'
119

@@ -35,12 +33,16 @@ jobs:
3533
timezoneMacos: "America/Sao_Paulo"
3634
timezoneWindows: "America/Sao_Paulo"
3735
- name: Criando executavel
38-
run: mvn -B package -Passembly --file pom.xml
36+
run: |
37+
mvn versions:set -DnewVersion=${{github.ref_name}}
38+
mvn -B package -Passembly --file pom.xml
39+
3940
- name: Criando pasta para Zip
40-
run: mkdir java-nfe && cp target/*.jar java-nfe && cp schemas.zip java-nfe
41+
run: mkdir java-nfe && cp target/java-nfe-${{github.ref_name}}.jar java-nfe && cp schemas.zip java-nfe
4142
- uses: montudor/action-zip@v1
4243
with:
43-
args: zip -qq -r java-nfe.zip java-nfe
44+
args: zip -qq -r java-nfe-${{github.ref_name}}.zip java-nfe
45+
4446
- name: Criando release
4547
uses: actions/create-release@v1
4648
id: create_release
@@ -58,6 +60,6 @@ jobs:
5860
GITHUB_TOKEN: ${{ github.token }}
5961
with:
6062
upload_url: ${{ steps.create_release.outputs.upload_url }}
61-
asset_path: ./java-nfe.zip
62-
asset_name: java-nfe.zip
63+
asset_path: ./java-nfe-${{github.ref_name}}.zip
64+
asset_name: java-nfe-${{github.ref_name}}.zip
6365
asset_content_type: application/zip

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Notas de versão
22

3-
- Atualizado Java Certificado (Ver https://github.com/Samuel-Oliveira/Java_Certificado)
4-
- Atualizado Cacert (Sefaz Minas)
5-
- Adicionado ZoneId direto a configuracao e removido da Chamada dos metodos. O padrao de ZoneId é America/Sao_Paulo
3+
- Atualizado Java Certificado
4+
- Correcao Null Pointer quando Lista Repositorio Windows.

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 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)
1+
# 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.31/jar)
22
Biblioteca Java para consumo do WebService de NFe/NFCe
33

44
## Dúvidas, Sugestões ou Consultoria
@@ -17,7 +17,7 @@ Para Iniciar :
1717
<dependency>
1818
<groupId>br.com.swconsultoria</groupId>
1919
<artifactId>java-nfe</artifactId>
20-
<version>4.00.24</version>
20+
<version>4.00.31</version>
2121
</dependency>
2222
```
2323

@@ -29,7 +29,7 @@ repositories {
2929
}
3030
}
3131
dependencies {
32-
implementation "br.com.swconsultoria:java-nfe:4.00.24"
32+
implementation "br.com.swconsultoria:java-nfe:4.00.31"
3333
}
3434
```
3535

@@ -39,6 +39,30 @@ ________________________________________________________________________________
3939

4040
# Historico de Versões
4141

42+
## v4.00.31 - 25/03/2024 - Schemas PL.009k
43+
- Atualizado Java Certificado
44+
- Correcao Null Pointer quando Lista Repositorio Windows.
45+
46+
## v4.00.30 - 20/03/2024 - Schemas PL.009k
47+
- Atualizado Java Certificado
48+
- Atualizado Cacert MT e MS (De novo)
49+
50+
## v4.00.29 - 02/03/2024 - Schemas PL.009k
51+
- Atualizado Java Certificado
52+
53+
## v4.00.28 - 20/01/2024 - Schemas PL.009k
54+
- Adicionado Eventos Suframa Vistoria E Internaliza
55+
56+
## v4.00.27 - 26/11/2023 - Schemas PL.009k
57+
- Atualizado Cacert MT
58+
- Adicionado Conversao para RetDistDFeInt
59+
60+
## v4.00.26 - 21/08/2023 - Schemas PL.009k
61+
- Atualizado Cacert MG
62+
63+
## v4.00.25 - 30/07/2023 - Schemas PL.009k
64+
- Corrigido erro Inutilizacão CE
65+
4266
## v4.00.24 - 05/05/2023 - Schemas PL.009k
4367
- Atualizado Java Certificado (Ver https://github.com/Samuel-Oliveira/Java_Certificado)
4468
- Atualizado Cacert (Sefaz Minas)

docs/docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![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/)
1+
[![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/)
22

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

@@ -11,7 +11,7 @@
1111
</p>
1212

1313
Para Iniciar :
14-
- 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.
14+
- 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.
1515

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

@@ -20,7 +20,7 @@ Para Iniciar :
2020
<dependency>
2121
<groupId>br.com.swconsultoria</groupId>
2222
<artifactId>java-nfe</artifactId>
23-
<version>4.00.24</version>
23+
<version>4.00.25</version>
2424
</dependency>
2525
```
2626

@@ -32,7 +32,7 @@ repositories {
3232
}
3333
}
3434
dependencies {
35-
implementation "br.com.swconsultoria:java-nfe:4.00.24"
35+
implementation "br.com.swconsultoria:java-nfe:4.00.25"
3636
}
3737
```
3838

pom-base.xml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>br.com.swconsultoria</groupId>
55
<artifactId>java-nfe</artifactId>
6-
<version>4.00.24-${versao}-SNAPSHOT</version>
6+
<version>4.00.32-${versao}-SNAPSHOT</version>
77
<name>Java_NFe</name>
88
<description>Api java para consumo do webService de nota fiscal eletronica</description>
99
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
@@ -48,12 +48,42 @@
4848
</developer>
4949
</developers>
5050

51+
<profiles>
52+
<profile>
53+
<id>assembly</id>
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-assembly-plugin</artifactId>
59+
<version>3.1.1</version>
60+
<configuration>
61+
<descriptorRefs>
62+
<descriptorRef>jar-with-dependencies</descriptorRef>
63+
</descriptorRefs>
64+
<appendAssemblyId>false</appendAssemblyId>
65+
</configuration>
66+
<executions>
67+
<execution>
68+
<id>make-assembly</id>
69+
<phase>package</phase>
70+
<goals>
71+
<goal>single</goal>
72+
</goals>
73+
</execution>
74+
</executions>
75+
</plugin>
76+
</plugins>
77+
</build>
78+
</profile>
79+
</profiles>
80+
5181
<dependencies>
5282
<!-- Certificado Utils -->
5383
<dependency>
5484
<groupId>br.com.swconsultoria</groupId>
5585
<artifactId>java_certificado</artifactId>
56-
<version>2.11-${versao}-SNAPSHOT</version>
86+
<version>3.4</version>
5787
</dependency>
5888
<!-- Ini4J -->
5989
<dependency>
@@ -165,7 +195,7 @@
165195
<plugin>
166196
<groupId>org.sonatype.plugins</groupId>
167197
<artifactId>nexus-staging-maven-plugin</artifactId>
168-
<version>1.6.8</version>
198+
<version>1.6.13</version>
169199
<extensions>true</extensions>
170200
<configuration>
171201
<serverId>sonatype-nexus</serverId>
@@ -176,33 +206,28 @@
176206
<plugin>
177207
<groupId>org.apache.maven.plugins</groupId>
178208
<artifactId>maven-release-plugin</artifactId>
179-
<version>2.5.3</version>
209+
<version>3.0.0</version>
180210
<configuration>
181211
<pushChanges>false</pushChanges>
182212
<localCheckout>true</localCheckout>
183213
</configuration>
184214
</plugin>
185215
<plugin>
186216
<groupId>org.apache.maven.plugins</groupId>
187-
<artifactId>maven-assembly-plugin</artifactId>
188-
<version>2.4</version>
189-
<configuration>
190-
<descriptorRefs>
191-
<descriptorRef>jar-with-dependencies</descriptorRef>
192-
</descriptorRefs>
193-
</configuration>
217+
<artifactId>maven-source-plugin</artifactId>
218+
<version>3.2.1</version>
194219
<executions>
195220
<execution>
196-
<phase>none</phase>
221+
<id>attach-sources</id>
197222
<goals>
198-
<goal>single</goal>
223+
<goal>jar</goal>
199224
</goals>
200225
</execution>
201226
</executions>
202227
</plugin>
203228
<plugin>
204229
<artifactId>maven-surefire-plugin</artifactId>
205-
<version>2.22.2</version>
230+
<version>3.0.0</version>
206231
<configuration>
207232
<argLine>
208233
-javaagent:src/test/resources/agent.jar

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>br.com.swconsultoria</groupId>
44
<artifactId>java-nfe</artifactId>
5-
<version>4.00.24-SNAPSHOT</version>
5+
<version>4.00.32-SNAPSHOT</version>
66
<name>Java_NFe</name>
77
<description>Api java para consumo do webService de nota fiscal eletronica</description>
88
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
@@ -84,7 +84,7 @@
8484
<dependency>
8585
<groupId>br.com.swconsultoria</groupId>
8686
<artifactId>java_certificado</artifactId>
87-
<version>2.10</version>
87+
<version>3.4</version>
8888
</dependency>
8989
<!-- Ini4J -->
9090
<dependency>

src/main/java/br/com/swconsultoria/nfe/Inutilizar.java

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
44
import br.com.swconsultoria.nfe.dom.enuns.AssinaturaEnum;
55
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
6+
import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum;
67
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
78
import br.com.swconsultoria.nfe.exception.NfeException;
89
import br.com.swconsultoria.nfe.schema_4.inutNFe.TInutNFe;
@@ -45,21 +46,39 @@ static TRetInutNFe inutiliza(ConfiguracoesNfe config, TInutNFe inutNFe, Document
4546

4647
OMElement ome = AXIOMUtil.stringToOM(xml);
4748

48-
NFeInutilizacao4Stub.NfeDadosMsg dadosMsg = new NFeInutilizacao4Stub.NfeDadosMsg();
49-
dadosMsg.setExtraElement(ome);
49+
if (EstadosEnum.CE.equals(config.getEstado()) ) {
50+
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeDadosMsg dadosMsgCe =
51+
new br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeDadosMsg();
52+
dadosMsgCe.setExtraElement(ome);
53+
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub stubCe = new br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub(
54+
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));
5055

51-
NFeInutilizacao4Stub stub = new NFeInutilizacao4Stub(
52-
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));
56+
// Timeout
57+
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
58+
stubCe._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
59+
stubCe._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
60+
}
61+
br.com.swconsultoria.nfe.wsdl.NFeInutilizacao.ce.NFeInutilizacao4Stub.NfeResultMsg resultCe = stubCe.nfeInutilizacaoNF(dadosMsgCe);
5362

54-
// Timeout
55-
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
56-
stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
57-
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
63+
log.info("[XML-RETORNO]: " + resultCe.getExtraElement().toString());
64+
return XmlNfeUtil.xmlToObject(resultCe.getExtraElement().toString(), TRetInutNFe.class);
65+
} else{
66+
NFeInutilizacao4Stub.NfeDadosMsg dadosMsg = new NFeInutilizacao4Stub.NfeDadosMsg();
67+
dadosMsg.setExtraElement(ome);
68+
NFeInutilizacao4Stub stub = new NFeInutilizacao4Stub(
69+
WebServiceUtil.getUrl(config, tipoDocumento, ServicosEnum.INUTILIZACAO));
70+
71+
// Timeout
72+
if (ObjetoUtil.verifica(config.getTimeout()).isPresent()) {
73+
stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, config.getTimeout());
74+
stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, config.getTimeout());
75+
}
76+
NFeInutilizacao4Stub.NfeResultMsg result = stub.nfeInutilizacaoNF(dadosMsg);
77+
78+
log.info("[XML-RETORNO]: " + result.getExtraElement().toString());
79+
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetInutNFe.class);
5880
}
59-
NFeInutilizacao4Stub.NfeResultMsg result = stub.nfeInutilizacaoNF(dadosMsg);
6081

61-
log.info("[XML-RETORNO]: " + result.getExtraElement().toString());
62-
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetInutNFe.class);
6382
} catch (RemoteException | XMLStreamException | JAXBException e) {
6483
throw new NfeException(e.getMessage(),e);
6584
}

src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum;
1010
import br.com.swconsultoria.nfe.util.ConstantesUtil;
1111
import br.com.swconsultoria.nfe.util.ObjetoUtil;
12+
import lombok.extern.java.Log;
1213

1314
import java.io.InputStream;
1415
import java.lang.reflect.Field;
1516
import java.nio.charset.Charset;
1617
import java.nio.charset.StandardCharsets;
1718
import java.time.ZoneId;
18-
import java.util.logging.Level;
19-
import java.util.logging.Logger;
2019

2120
/**
2221
* @author Samuel Oliveira
@@ -31,6 +30,7 @@
3130
* @see ConfiguracoesNfe
3231
* @see ConfiguracoesWebNfe
3332
*/
33+
@Log
3434
public class ConfiguracoesNfe {
3535

3636
private EstadosEnum estado;
@@ -107,16 +107,14 @@ public static ConfiguracoesNfe criarConfiguracoes(EstadosEnum estado, AmbienteEn
107107
}
108108
}
109109

110-
if (Logger.getLogger("").isLoggable(Level.SEVERE)) {
111-
System.err.println("####################################################################");
112-
System.err.println(" Api Java Nfe - Versão 4.00.24 - 06/05/2023");
113-
if (Logger.getLogger("").isLoggable(Level.WARNING)) {
114-
System.err.println(" Samuel Olivera - [email protected] ");
115-
}
116-
System.err.println(" Pasta Schemas: " + pastaSchemas);
117-
System.err.println(" Ambiente: " + (ambiente.equals(AmbienteEnum.PRODUCAO) ? "Produção" : "Homologação") + " - Estado: " + estado.getNome());
118-
System.err.println("####################################################################");
119-
}
110+
log.info(String.format("JAVA-NFE | Samuel Oliveira | [email protected] " +
111+
"| VERSAO=%s | DATA_VERSAO=%s | PASTA_SCHEMAS=%s | AMBIENTE=%s | ESTADO=%s",
112+
"4.00.31",
113+
"25/03/2024",
114+
pastaSchemas,
115+
ambiente,
116+
estado.getNome().toUpperCase()));
117+
120118
if (!certificado.isValido()) {
121119
throw new CertificadoException("Certificado Vencido/Inválido");
122120
}
@@ -199,7 +197,7 @@ public boolean isContigenciaSVC() {
199197
}
200198

201199
/**
202-
* Atribui um valor para contigenciaSCAN. Caso True, as operações da NF-e
200+
* Atribui um valor para contigenciaSVC. Caso True, as operações da NF-e
203201
* funcionarão no modo de Contingência. <br>
204202
* Usar para situações em que não for possível estabelecer conexão com o
205203
* WebService SEFAZ Origem.

0 commit comments

Comments
 (0)