Skip to content

Commit eeff036

Browse files
Merge branch 'release/4.00.11'
2 parents dd5df18 + da9e87d commit eeff036

File tree

7 files changed

+101
-14
lines changed

7 files changed

+101
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Notas de versão
22

3-
- Adicionado CTe Simplificado
3+
- Atualizado URL QRCode MG
44
- Atualizado Cacert

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java-CTe [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_CTe.svg) ](https://github.com/Samuel-Oliveira/Java_CTe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-cte.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-cte/4.00.10/jar)
1+
# Java-CTe [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_CTe.svg) ](https://github.com/Samuel-Oliveira/Java_CTe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-cte.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-cte/4.00.11/jar)
22
API Java para consumo do WebService de CTe
33

44
## Dúvidas, Sugestões ou Consultoria
@@ -18,14 +18,14 @@ Para Iniciar :
1818
<dependency>
1919
<groupId>br.com.swconsultoria</groupId>
2020
<artifactId>java-cte</artifactId>
21-
<version>4.00.10</version>
21+
<version>4.00.11</version>
2222
</dependency>
2323
```
2424

2525
- Gradle :
2626
```groovy
2727
dependencies {
28-
implementation "br.com.swconsultoria:java-cte:4.00.10"
28+
implementation "br.com.swconsultoria:java-cte:4.00.11"
2929
}
3030
```
3131

@@ -35,6 +35,10 @@ ________________________________________________________________________________
3535

3636
# Historico de Versões
3737

38+
## v4.00.11 - 22/04/2025
39+
- Atualizado URL QRCode MG
40+
- Atualizado Cacert
41+
3842
## v4.00.10 - 11/12/2024
3943
- Atualizado Cacert
4044
- Adicionado CTe Simplificado

docs/docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java-CTe [![Build Status](https://travis-ci.org/Samuel-Oliveira/Java_CTe.svg?branch=master)](https://travis-ci.org/Samuel-Oliveira/Java_CTe) [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_CTe.svg) ](https://github.com/Samuel-Oliveira/Java_CTe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-cte.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-cte/4.00.10/jar)
1+
# Java-CTe [![Build Status](https://travis-ci.org/Samuel-Oliveira/Java_CTe.svg?branch=master)](https://travis-ci.org/Samuel-Oliveira/Java_CTe) [![MIT License](https://img.shields.io/github/license/Samuel-Oliveira/Java_CTe.svg) ](https://github.com/Samuel-Oliveira/Java_CTe/blob/master/LICENSE) [![Maven Central](https://img.shields.io/maven-central/v/br.com.swconsultoria/java-cte.svg?label=Maven%20Central)](https://search.maven.org/artifact/br.com.swconsultoria/java-cte/4.00.11/jar)
22
API Java para consumo do WebService de CTe
33

44
## Dúvidas, Sugestões ou Consultoria
@@ -8,7 +8,7 @@ API Java para consumo do WebService de CTe
88
<img src="https://swconsultoria.com.br/pix.png" width="200">
99

1010
Para Iniciar :
11-
- Caso use Libs baixe o [java-cte-4.00.10.jar](https://github.com/Samuel-Oliveira/Java_CTe/raw/master/java-cte-4.00.10.jar) e o adicione às bibliotecas de Seu Projeto.
11+
- Caso use Libs baixe o [java-cte-4.00.11.jar](https://github.com/Samuel-Oliveira/Java_CTe/raw/master/java-cte-4.00.11.jar) e o adicione às bibliotecas de Seu Projeto.
1212

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

@@ -17,14 +17,14 @@ Para Iniciar :
1717
<dependency>
1818
<groupId>br.com.swconsultoria</groupId>
1919
<artifactId>java-cte</artifactId>
20-
<version>4.00.10</version>
20+
<version>4.00.11</version>
2121
</dependency>
2222
```
2323

2424
- Gradle :
2525
```groovy
2626
dependencies {
27-
implementation "br.com.swconsultoria:java-cte:4.00.10"
27+
implementation "br.com.swconsultoria:java-cte:4.00.11"
2828
}
2929
```
3030

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-cte</artifactId>
5-
<version>4.00.11-SNAPSHOT</version>
5+
<version>4.00.12-SNAPSHOT</version>
66
<name>Java_CTe</name>
77
<description>API Java para consumo do WebService de CTe</description>
88
<url>https://github.com/Samuel-Oliveira/Java_CTe</url>
@@ -85,7 +85,7 @@
8585
<dependency>
8686
<groupId>br.com.swconsultoria</groupId>
8787
<artifactId>java_certificado</artifactId>
88-
<version>3.8</version>
88+
<version>3.9</version>
8989
</dependency>
9090

9191
<!-- Ini4J -->

src/main/java/br/com/swconsultoria/cte/dom/ConfiguracoesCte.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ public static ConfiguracoesCte criarConfiguracoes(EstadosEnum estado, AmbienteEn
167167

168168
log.info(String.format("JAVA-CTE | Samuel Oliveira | [email protected] " +
169169
"| VERSAO=%s | DATA_VERSAO=%s | PASTA_SCHEMAS=%s | AMBIENTE=%s | ESTADO=%s",
170-
"4.00.10",
171-
"11/12/2024",
170+
"4.00.11",
171+
"22/04/2025",
172172
pastaSchemas,
173173
ambiente,
174174
estado.getNome().toUpperCase()));

src/main/resources/WebServicesCte.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ CTeConsultaCadastro_3.00=
101101
RecepcaoEventoAN_3.00=https://homologacao.nfe.fazenda.sp.gov.br/cteWEB/services/CteRecepcaoEvento.asmx
102102

103103
[CTe_MG_P]
104-
URL-QRCode=https://cte.fazenda.mg.gov.br/portalcte/sistema/qrcode.xhtml
104+
URL-QRCode=https://portalcte.fazenda.mg.gov.br/portalcte/sistema/qrcode.xhtml
105105
URL-ConsultaCTe=https://dfe-portal.svrs.rs.gov.br/CTE/Consulta
106106
CTeConsultaCadastro_3.00=https://nfe.fazenda.mg.gov.br/nfe2/services/cadconsultacadastro2
107107
RecepcaoEventoAN_3.00=https://nfe.fazenda.sp.gov.br/cteWEB/services/CteRecepcaoEvento.asmx
@@ -125,7 +125,7 @@ CTeRecepcaoGTVe_4.00=https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoGTVeV
125125
CTeRecepcaoSimp_4.00=https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoSimpV4
126126

127127
[CTe_MG_H]
128-
URL-QRCode=https://cte.fazenda.mg.gov.br/portalcte/sistema/qrcode.xhtml
128+
URL-QRCode=https://portalcte.fazenda.mg.gov.br/portalcte/sistema/qrcode.xhtml
129129
URL-ConsultaCTe=https://dfe-portal.svrs.rs.gov.br/CTE/Consulta
130130
CTeConsultaCadastro_3.00=https://hnfe.fazenda.mg.gov.br/nfe2/services/cadconsultacadastro2
131131
RecepcaoEventoAN_3.00=https://homologacao.nfe.fazenda.sp.gov.br/cteWEB/services/CteRecepcaoEvento.asmx
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package br.com.swconsultoria.cte; /**
2+
*
3+
*/
4+
5+
import br.com.swconsultoria.cte.dom.ConfiguracoesCte;
6+
import br.com.swconsultoria.cte.dom.enuns.AmbienteEnum;
7+
import br.com.swconsultoria.cte.dom.enuns.EstadosEnum;
8+
import br.com.swconsultoria.cte.dom.enuns.EventosEnum;
9+
import br.com.swconsultoria.cte.dom.enuns.StatusCteEnum;
10+
import br.com.swconsultoria.cte.exception.CteException;
11+
import br.com.swconsultoria.cte.schema_400.evPrestDesacordo.EvPrestDesacordo;
12+
import br.com.swconsultoria.cte.schema_400.evPrestDesacordo.TEvento;
13+
import br.com.swconsultoria.cte.schema_400.evPrestDesacordo.TRetEvento;
14+
import br.com.swconsultoria.cte.util.ConstantesCte;
15+
import br.com.swconsultoria.cte.util.ObjetoCTeUtil;
16+
import br.com.swconsultoria.cte.util.XmlCteUtil;
17+
18+
import java.time.LocalDateTime;
19+
20+
/**
21+
* @author Samuel Oliveira
22+
*/
23+
public class TestePrestacaoDesacordoCte {
24+
25+
public static void main(String[] args) {
26+
27+
try {
28+
// Dados para pegar do CTE
29+
String chave = "";
30+
String cnpj = "";
31+
32+
//Pegar Do usuário - Opcional.
33+
String obs = "";
34+
35+
// Inicia As Configurações
36+
ConfiguracoesCte config = TesteConfig.iniciaConfiguracoes(EstadosEnum.GO, AmbienteEnum.HOMOLOGACAO);
37+
38+
String id = "ID610110" + chave + "001";
39+
TEvento evento = new TEvento();
40+
evento.setVersao(ConstantesCte.VERSAO.CTE);
41+
42+
TEvento.InfEvento infEvento = new TEvento.InfEvento();
43+
infEvento.setId(id);
44+
infEvento.setCOrgao(config.getEstado().getCodigoUF());
45+
infEvento.setTpAmb(config.getAmbiente().getCodigo());
46+
infEvento.setCNPJ(cnpj);
47+
infEvento.setChCTe(chave);
48+
infEvento.setDhEvento(XmlCteUtil.dataCte(LocalDateTime.now()));
49+
infEvento.setTpEvento(EventosEnum.CCE.getCodigo());
50+
infEvento.setNSeqEvento("001");
51+
52+
EvPrestDesacordo evPrestDesacordo = new EvPrestDesacordo();
53+
evPrestDesacordo.setDescEvento("Prestacao do Servico em Desacordo");
54+
evPrestDesacordo.setIndDesacordoOper("1");
55+
evPrestDesacordo.setXObs(obs);
56+
57+
TEvento.InfEvento.DetEvento detEvento = new TEvento.InfEvento.DetEvento();
58+
detEvento.setVersaoEvento(ConstantesCte.VERSAO.CTE);
59+
detEvento.setAny(ObjetoCTeUtil.objectToElement(evPrestDesacordo, EvPrestDesacordo.class, "evPrestDesacordo"));
60+
61+
infEvento.setDetEvento(detEvento);
62+
evento.setInfEvento(infEvento);
63+
64+
//Envia o Evento de Cancelamento
65+
TRetEvento retorno = Cte.prestacaoDesacordoCte(config, evento, true);
66+
67+
//Valida o Retorno
68+
if (!StatusCteEnum.EVENTO_VINCULADO.getCodigo().equals(retorno.getInfEvento().getCStat())) {
69+
throw new CteException(retorno.getInfEvento().getCStat() + " - " + retorno.getInfEvento().getXMotivo());
70+
}
71+
72+
//Resultado
73+
System.out.println();
74+
System.out.println("# Chave: " + retorno.getInfEvento().getChCTe());
75+
System.out.println("# Status: " + retorno.getInfEvento().getCStat() + " - " + retorno.getInfEvento().getXMotivo());
76+
System.out.println("# Protocolo: " + retorno.getInfEvento().getNProt());
77+
78+
} catch (Exception e) {
79+
System.err.println();
80+
System.err.println("# Erro: " + e.getMessage());
81+
}
82+
}
83+
}

0 commit comments

Comments
 (0)