diff --git a/Dockerfile-build b/Dockerfile-build index 56ffc90b..0489c360 100644 --- a/Dockerfile-build +++ b/Dockerfile-build @@ -8,5 +8,6 @@ ARG nexusPass WORKDIR /app COPY . /app +RUN find /root/.m2/repository -name "*.lastUpdated" -delete 2>/dev/null || true RUN mvn deploy -f pom-base.xml -s mavensettings.xml -Duser=$nexusUser -Dpassword=$nexusPass -Dversao=$nameSpace $DskipTests diff --git a/mavensettings.xml b/mavensettings.xml index 761a7f23..2c551225 100644 --- a/mavensettings.xml +++ b/mavensettings.xml @@ -35,12 +35,6 @@ - - - down.nexus.prod.baseerp.com.br - ${user} - ${password} - up.nexus.prod.baseerp.com.br diff --git a/pom-base.xml b/pom-base.xml index da395e37..b855116a 100644 --- a/pom-base.xml +++ b/pom-base.xml @@ -3,7 +3,7 @@ br.com.swconsultoria java-nfe - 4.1.1-${versao}-SNAPSHOT + 4.1.1-EVENTOGENERICOA3-${versao}-SNAPSHOT Java_NFe Api java para consumo do webService de nota fiscal eletronica https://github.com/Samuel-Oliveira/Java_NFe @@ -233,15 +233,9 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - sonatype-nexus - https://oss.sonatype.org/ - true - + org.apache.maven.plugins + maven-deploy-plugin + 3.1.2 org.apache.maven.plugins @@ -252,35 +246,6 @@ true - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - - attach-javadocs - - jar - - - - - false - - maven-surefire-plugin ${maven-surefire-plugin.version} diff --git a/pom.xml b/pom.xml index 995f905d..eda241f3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ br.com.swconsultoria java-nfe - 4.1.1 + 4.1.1-EVENTOGENERICOA3 Java_NFe Api java para consumo do webService de nota fiscal eletronica https://github.com/Samuel-Oliveira/Java_NFe diff --git a/src/main/java/br/com/swconsultoria/nfe/EventoGenericoA3.java b/src/main/java/br/com/swconsultoria/nfe/EventoGenericoA3.java new file mode 100644 index 00000000..9874aa90 --- /dev/null +++ b/src/main/java/br/com/swconsultoria/nfe/EventoGenericoA3.java @@ -0,0 +1,37 @@ +package br.com.swconsultoria.nfe; + +import javax.xml.bind.JAXBException; +import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe; +import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum; +import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum; +import br.com.swconsultoria.nfe.exception.NfeException; +import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoGenerico; +import br.com.swconsultoria.nfe.schemas_eventos.TProcEventoGenerico; +import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico; +import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico; +import br.com.swconsultoria.nfe.util.ConstantesUtil; +import br.com.swconsultoria.nfe.util.XmlNfeUtil; + +class EventoGenericoA3 { + + private EventoGenericoA3() {} + + static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado) + throws NfeException { + String xmlRetorno = EventosA3.enviarEvento(config, xmlAssinado, ServicosEnum.EVENTO_GENERICO, valida, DocumentoEnum.NFE); + return XmlNfeUtil.xmlToObject(xmlRetorno, TRetEnvEventoGenerico.class); + } + + static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno) + throws NfeException { + try { + TProcEventoGenerico procEvento = new TProcEventoGenerico(); + procEvento.setVersao(ConstantesUtil.VERSAO.EVENTO_GENERICO); + procEvento.setEvento(XmlNfeUtil.xmlToObject(xmlAssinado, TEnvEventoGenerico.class).getEvento().get(0)); + procEvento.setRetEvento(retorno); + return XmlNfeUtil.objectToXml(procEvento, config.getEncode()); + } catch (JAXBException e) { + throw new NfeException(e.getMessage(), e); + } + } +} diff --git a/src/main/java/br/com/swconsultoria/nfe/NfeA3.java b/src/main/java/br/com/swconsultoria/nfe/NfeA3.java index 6e2b4948..a6172844 100644 --- a/src/main/java/br/com/swconsultoria/nfe/NfeA3.java +++ b/src/main/java/br/com/swconsultoria/nfe/NfeA3.java @@ -8,6 +8,8 @@ import br.com.swconsultoria.nfe.exception.NfeException; import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoCancelamento; import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoCancelamento; +import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico; +import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico; import br.com.swconsultoria.nfe.schemas.RetDistDFeInt; import br.com.swconsultoria.nfe.schemas.TEnviNFe; import br.com.swconsultoria.nfe.schemas.TRetEnviNFe; @@ -25,11 +27,11 @@ public static String montaXmlA3(ConfiguracoesNfe config, TEnviNFe enviNFe) throw public static TEnviNFe montaNfeA3(ConfiguracoesNfe config, String xmlAssinado, boolean valida) throws NfeException { return EnviarA3.montaNfeA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, valida); } - + public static TRetEnviNFe enviarNfeA3(ConfiguracoesNfe config, TEnviNFe enviNFe, DocumentoEnum tipoDocumento) throws NfeException { return Enviar.enviaNfe(ConfiguracoesUtil.iniciaConfiguracoes(config), enviNFe, tipoDocumento); } - + public static String montaXmleventoCancelamento(ConfiguracoesNfe config, TEnvEventoCancelamento enviEvento) throws NfeException { return CancelarA3.montaXmleventoCancelamento(ConfiguracoesUtil.iniciaConfiguracoes(config), enviEvento); } @@ -81,4 +83,11 @@ public static String manifestacaoMontaXmlA3(ConfiguracoesNfe config, return ManifestacaoDestinatarioA3.montarXML(ConfiguracoesUtil.iniciaConfiguracoes(config), evento); } + public static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado) throws NfeException { + return EventoGenericoA3.eventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), valida, xmlAssinado); + } + + public static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno) throws NfeException { + return EventoGenericoA3.criaProcEventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, retorno); + } }