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..a1d2d38a 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.28-SNAPSHOT Java_NFe Api java para consumo do webService de nota fiscal eletronica https://github.com/Samuel-Oliveira/Java_NFe @@ -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 {