From 48c7f126562c6fe181421544ad7e18ebd81eb82a Mon Sep 17 00:00:00 2001 From: SamuelOliveira Date: Sun, 26 Nov 2023 14:24:17 -0300 Subject: [PATCH 1/3] Finalizado versao 4.00.27 --- CHANGELOG.md | 3 ++- README.md | 12 ++++++++---- pom.xml | 2 +- .../swconsultoria/nfe/dom/ConfiguracoesNfe.java | 2 +- .../com/swconsultoria/nfe/util/XmlNfeUtil.java | 17 ++++++++++------- .../br/com/swconsultoria/nfe/util/XsdUtil.java | 6 ++++++ 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 159b4b89..475e3151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ # Notas de versão -- Atualizado Cacert MG \ No newline at end of file +- Atualizado Cacert MT +- Adicionado Conversao para RetDistDFeInt \ No newline at end of file diff --git a/README.md b/README.md index a6787572..68742808 100644 --- a/README.md +++ b/README.md @@ -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.26/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.27/jar) Biblioteca Java para consumo do WebService de NFe/NFCe ## Dúvidas, Sugestões ou Consultoria @@ -17,7 +17,7 @@ Para Iniciar : br.com.swconsultoria java-nfe - 4.00.26 + 4.00.27 ``` @@ -29,7 +29,7 @@ repositories { } } dependencies { - implementation "br.com.swconsultoria:java-nfe:4.00.26" + implementation "br.com.swconsultoria:java-nfe:4.00.27" } ``` @@ -39,8 +39,12 @@ ________________________________________________________________________________ # Historico de Versões +## v4.00.26 - 26/11/2023 - Schemas PL.009k +- Atualizado Cacert MT +- Adicionado Conversao para RetDistDFeInt + ## v4.00.26 - 21/08/2023 - Schemas PL.009k -- - Atualizado Cacert MG +- Atualizado Cacert MG ## v4.00.25 - 30/07/2023 - Schemas PL.009k - Corrigido erro Inutilizacão CE diff --git a/pom.xml b/pom.xml index 280fa7ab..1f6a76b7 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ br.com.swconsultoria java_certificado - 2.11 + 2.13 diff --git a/src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java b/src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java index 1f0fb795..bd60c56c 100644 --- a/src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java +++ b/src/main/java/br/com/swconsultoria/nfe/dom/ConfiguracoesNfe.java @@ -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.26 - 21/08/2023"); + System.err.println(" Api Java Nfe - Versão 4.00.27 - 26/11/2023"); if (Logger.getLogger("").isLoggable(Level.WARNING)) { System.err.println(" Samuel Olivera - samuel@swconsultoria.com.br "); } diff --git a/src/main/java/br/com/swconsultoria/nfe/util/XmlNfeUtil.java b/src/main/java/br/com/swconsultoria/nfe/util/XmlNfeUtil.java index 707443a0..8cc46450 100644 --- a/src/main/java/br/com/swconsultoria/nfe/util/XmlNfeUtil.java +++ b/src/main/java/br/com/swconsultoria/nfe/util/XmlNfeUtil.java @@ -27,6 +27,7 @@ import javax.xml.transform.stream.StreamSource; import java.io.*; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.security.InvalidParameterException; @@ -48,6 +49,8 @@ @Log public class XmlNfeUtil { + private XmlNfeUtil(){} + private static final String STATUS = "TConsStatServ"; private static final String SITUACAO_NFE = "TConsSitNFe"; private static final String ENVIO_NFE = "TEnviNFe"; @@ -65,30 +68,25 @@ public class XmlNfeUtil { private static final String RET_RECIBO_NFE = "TRetConsReciNFe"; private static final String RET_STATUS_SERVICO = "TRetConsStatServ"; private static final String RET_CONS_CAD = "TRetConsCad"; - + private static final String RET_DIST_DFE = "RetDistDFeInt"; private static final String RET_ENV_EVENTO = "TRetEnvEvento"; - private static final String RET_INUT_NFE = "TRetInutNFe"; - private static final String TPROCCANCELAR = "br.com.swconsultoria.nfe.schema.envEventoCancNFe.TProcEvento"; private static final String TPROCATORINTERESSADO = "br.com.swconsultoria.nfe.schema.envEventoAtorInteressado.TProcEvento"; private static final String TPROCCANCELARSUBST = "br.com.swconsultoria.nfe.schema.envEventoCancSubst.TProcEvento"; private static final String TPROCCCE = "br.com.swconsultoria.nfe.schema.envcce.TProcEvento"; private static final String TPROCEPEC = "br.com.swconsultoria.nfe.schema.envEpec.TProcEvento"; private static final String TPROCMAN = "br.com.swconsultoria.nfe.schema.envConfRecebto.TProcEvento"; - private static final String TProtNFe = "TProtNFe"; private static final String TProtEnvi = "br.com.swconsultoria.nfe.schema_4.enviNFe.TProtNFe"; private static final String TProtCons = "br.com.swconsultoria.nfe.schema_4.retConsSitNFe.TProtNFe"; private static final String TProtReci = "br.com.swconsultoria.nfe.schema_4.retConsReciNFe.TProtNFe"; - private static final String CANCELAR = "br.com.swconsultoria.nfe.schema.envEventoCancNFe.TEnvEvento"; private static final String ATOR_INTERESSADO = "br.com.swconsultoria.nfe.schema.envEventoAtorInteressado.TEnvEvento"; private static final String CANCELAR_SUBSTITUICAO = "br.com.swconsultoria.nfe.schema.envEventoCancSubst.TEnvEvento"; private static final String CCE = "br.com.swconsultoria.nfe.schema.envcce.TEnvEvento"; private static final String EPEC = "br.com.swconsultoria.nfe.schema.envEpec.TEnvEvento"; private static final String MANIFESTAR = "br.com.swconsultoria.nfe.schema.envConfRecebto.TEnvEvento"; - private static final String RET_CANCELAR = "br.com.swconsultoria.nfe.schema.envEventoCancNFe.TRetEnvEvento"; private static final String RET_ATOR_INTERESSADO = "br.com.swconsultoria.nfe.schema.envEventoAtorInteressado.TRetEnvEvento"; private static final String RET_CANCELAR_SUBSTITUICAO = "br.com.swconsultoria.nfe.schema.envEventoCancSubst.TRetEnvEvento"; @@ -191,6 +189,11 @@ public static String objectToXml(Object obj, Charset encode) throws JAXBExce element = new br.com.swconsultoria.nfe.schema.retConsCad.ObjectFactory().createRetConsCad((br.com.swconsultoria.nfe.schema.retConsCad.TRetConsCad) obj); break; + case RET_DIST_DFE: + context = JAXBContext.newInstance(br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt.class); + element = XsdUtil.distDFeInt.createRetDistDFeInt((br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt) obj); + break; + case TPROCEVENTO: switch (obj.getClass().getName()) { case TPROCCANCELAR: @@ -351,7 +354,7 @@ public static String gZipToXml(byte[] conteudo) throws IOException { } GZIPInputStream gis; gis = new GZIPInputStream(new ByteArrayInputStream(conteudo)); - BufferedReader bf = new BufferedReader(new InputStreamReader(gis, "UTF-8")); + BufferedReader bf = new BufferedReader(new InputStreamReader(gis, StandardCharsets.UTF_8)); StringBuilder outStr = new StringBuilder(); String line; while ((line = bf.readLine()) != null) { diff --git a/src/main/java/br/com/swconsultoria/nfe/util/XsdUtil.java b/src/main/java/br/com/swconsultoria/nfe/util/XsdUtil.java index 1b180dac..2e872ebc 100644 --- a/src/main/java/br/com/swconsultoria/nfe/util/XsdUtil.java +++ b/src/main/java/br/com/swconsultoria/nfe/util/XsdUtil.java @@ -20,6 +20,7 @@ public class XsdUtil { private static final QName _TRetEnvEvento_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "retEnvEvento"); private static final QName _TRetInutNFe_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "retInutNFe"); private static final QName _TDistDFeInt_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "distDFeInt"); + private static final QName _TRetDistDFeInt_QNAME = new QName("http://www.portalfiscal.inf.br/nfe", "retDistDFeInt"); public interface enviNfe { @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "TNfeProc", scope = br.com.swconsultoria.nfe.schema_4.enviNFe.TNfeProc.class) @@ -43,6 +44,11 @@ public interface distDFeInt { static JAXBElement createDistDFeInt(br.com.swconsultoria.nfe.schema.distdfeint.DistDFeInt value) { return new JAXBElement<>(_TDistDFeInt_QNAME, br.com.swconsultoria.nfe.schema.distdfeint.DistDFeInt.class, br.com.swconsultoria.nfe.schema.distdfeint.DistDFeInt.class, value); } + @XmlElementDecl(namespace = "http://www.portalfiscal.inf.br/nfe", name = "retDistDFeInt", scope = br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt.class) + static JAXBElement createRetDistDFeInt(br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt value) { + return new JAXBElement<>(_TRetDistDFeInt_QNAME, br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt.class, + br.com.swconsultoria.nfe.schema.retdistdfeint.RetDistDFeInt.class, value); + } } public interface retConsReciNfe { From 8137c529fa79d912f64d9dafd2a7b253bc9e6c1f Mon Sep 17 00:00:00 2001 From: SamuelOliveira Date: Sun, 26 Nov 2023 14:27:06 -0300 Subject: [PATCH 2/3] [maven-release-plugin] prepare release java-nfe-4.00.27 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1f6a76b7..3d18e0e4 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 br.com.swconsultoria java-nfe - 4.00.27-SNAPSHOT + 4.00.27 Java_NFe Api java para consumo do webService de nota fiscal eletronica https://github.com/Samuel-Oliveira/Java_NFe @@ -19,7 +19,7 @@ git@github.com:Samuel-Oliveira/Java_NFe.git scm:git:git@github.com:Samuel-Oliveira/Java_NFe.git scm:git:git@github.com:Samuel-Oliveira/Java_NFe.git - java-nfe + java-nfe-4.00.27 From 65701d92475519f88f99187cafff4d3a3b54abd3 Mon Sep 17 00:00:00 2001 From: SamuelOliveira Date: Sun, 26 Nov 2023 14:27:06 -0300 Subject: [PATCH 3/3] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3d18e0e4..a1d2d38a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 br.com.swconsultoria java-nfe - 4.00.27 + 4.00.28-SNAPSHOT Java_NFe Api java para consumo do webService de nota fiscal eletronica https://github.com/Samuel-Oliveira/Java_NFe @@ -19,7 +19,7 @@ git@github.com:Samuel-Oliveira/Java_NFe.git scm:git:git@github.com:Samuel-Oliveira/Java_NFe.git scm:git:git@github.com:Samuel-Oliveira/Java_NFe.git - java-nfe-4.00.27 + java-nfe