Skip to content

Commit 174eefc

Browse files
Adicionado Impressao
1 parent bf0c7ed commit 174eefc

25 files changed

+3794
-74
lines changed

pom.xml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>br.com.swconsultoria</groupId>
55
<artifactId>java-nfe</artifactId>
6-
<version>4.00.40</version>
6+
<version>4.00.41</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>
@@ -41,6 +41,9 @@
4141
<jmockit.version>1.49</jmockit.version>
4242
<junit-jupiter.version>5.13.3</junit-jupiter.version>
4343
<lombok.version>1.18.38</lombok.version>
44+
<jasper.version>6.20.6</jasper.version>
45+
<barbecue.version>1.5-beta1</barbecue.version>
46+
<zxing.version>3.2.1</zxing.version>
4447
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
4548
<central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
4649
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
@@ -172,6 +175,36 @@
172175
<version>${lombok.version}</version>
173176
<scope>provided</scope>
174177
</dependency>
178+
<dependency>
179+
<groupId>net.sf.jasperreports</groupId>
180+
<artifactId>jasperreports</artifactId>
181+
<version>${jasper.version}</version>
182+
<scope>provided</scope>
183+
</dependency>
184+
<dependency>
185+
<groupId>net.sf.jasperreports</groupId>
186+
<artifactId>jasperreports-fonts</artifactId>
187+
<version>${jasper.version}</version>
188+
<scope>provided</scope>
189+
</dependency>
190+
<dependency>
191+
<groupId>net.sourceforge.barbecue</groupId>
192+
<artifactId>barbecue</artifactId>
193+
<version>${barbecue.version}</version>
194+
<scope>provided</scope>
195+
</dependency>
196+
<dependency>
197+
<groupId>com.google.zxing</groupId>
198+
<artifactId>core</artifactId>
199+
<version>${zxing.version}</version>
200+
<scope>provided</scope>
201+
</dependency>
202+
<dependency>
203+
<groupId>com.google.zxing</groupId>
204+
<artifactId>javase</artifactId>
205+
<version>${zxing.version}</version>
206+
<scope>provided</scope>
207+
</dependency>
175208
</dependencies>
176209

177210
<build>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package br.com.swconsultoria.nfe.exception;
2+
3+
public class DanfeException extends RuntimeException {
4+
5+
public DanfeException(String message) {
6+
super(message);
7+
}
8+
9+
public DanfeException(String message, Throwable cause) {
10+
super(message, cause);
11+
}
12+
13+
public DanfeException(Throwable cause) {
14+
super(cause);
15+
}
16+
}

src/main/java/br/com/swconsultoria/nfe/exception/NfeException.java

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,15 @@
77
*/
88
public class NfeException extends Exception {
99

10-
private static final long serialVersionUID = -5054900660251852366L;
11-
12-
String message;
13-
14-
/**
15-
* Construtor da classe.
16-
*
17-
* @param e
18-
*/
19-
public NfeException(Throwable e) {
20-
super(e);
21-
}
22-
23-
24-
/**
25-
* Construtor da classe.
26-
*
27-
* @param message
28-
*/
2910
public NfeException(String message) {
30-
this((Throwable) null);
31-
this.message = message;
11+
super(message);
3212
}
3313

34-
/**
35-
* Construtor da classe.
36-
*
37-
* @param message
38-
* @param cause
39-
*/
4014
public NfeException(String message, Throwable cause) {
41-
this(cause);
42-
this.message = message;
15+
super(message, cause);
4316
}
4417

45-
/**
46-
* @return the message
47-
*/
48-
public String getMessage() {
49-
return message;
18+
public NfeException(Throwable cause) {
19+
super(cause);
5020
}
51-
52-
/**
53-
* @param message the message to set
54-
*/
55-
public void setMessage(String message) {
56-
this.message = message;
57-
}
58-
59-
6021
}

src/main/java/br/com/swconsultoria/nfe/exception/NfeValidacaoException.java

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,15 @@
77
*/
88
public class NfeValidacaoException extends NfeException {
99

10-
private static final long serialVersionUID = 2224963351733125955L;
11-
String message;
12-
13-
/**
14-
* Construtor da classe.
15-
*
16-
* @param e
17-
*/
1810
public NfeValidacaoException(Throwable e) {
1911
super(e);
2012
}
2113

22-
23-
/**
24-
* Construtor da classe.
25-
*
26-
* @param message
27-
*/
2814
public NfeValidacaoException(String message) {
29-
this((Throwable) null);
30-
this.message = message;
15+
super(message);
3116
}
3217

33-
/**
34-
* @return the message
35-
*/
36-
public String getMessage() {
37-
return message;
18+
public NfeValidacaoException(String message, Throwable cause) {
19+
super(message, cause);
3820
}
39-
40-
/**
41-
* @param message the message to set
42-
*/
43-
public void setMessage(String message) {
44-
this.message = message;
45-
}
46-
47-
4821
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package br.com.swconsultoria.nfe.impressao;
2+
3+
public class ConstantesImpressaoNfeUtil {
4+
private ConstantesImpressaoNfeUtil() {}
5+
6+
//PATHS
7+
public static final String PATH_NFE = "/nfeProc/NFe/infNFe/det";
8+
public static final String PATH_NFCE = "/";
9+
public static final String PATH_CCE = "/procEventoNFe";
10+
//PARAM LOGO
11+
public static final String PARAM_LOGO_NFE = "Logo";
12+
public static final String PARAM_LOGO_NFCE = "Logo";
13+
//PATH LOGO
14+
public static final String PATH_LOGO_NFE = "/img/nfe.png";
15+
public static final String PATH_LOGO_NFCE = "/img/nfce.png";
16+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package br.com.swconsultoria.nfe.impressao;
2+
3+
import net.sf.jasperreports.engine.JasperReport;
4+
5+
import java.util.HashMap;
6+
import java.util.Map;
7+
8+
/**
9+
* Model resposnsavel por armazenar as informações da Impressao
10+
*/
11+
public class ImpressaoDTO {
12+
13+
private String xml;
14+
private JasperReport jasper;
15+
private String pathExpression;
16+
private Map<String, Object> parametros;
17+
18+
public String getXml() {
19+
return xml;
20+
}
21+
22+
public void setXml(String xml) {
23+
this.xml = xml;
24+
}
25+
26+
public JasperReport getJasper() {
27+
return jasper;
28+
}
29+
30+
public void setJasper(JasperReport jasper) {
31+
this.jasper = jasper;
32+
}
33+
34+
public String getPathExpression() {
35+
return pathExpression;
36+
}
37+
38+
public void setPathExpression(String pathExpression) {
39+
this.pathExpression = pathExpression;
40+
}
41+
42+
public Map<String, Object> getParametros() {
43+
if (this.parametros == null) {
44+
this.parametros = new HashMap<>();
45+
}
46+
return parametros;
47+
}
48+
}

0 commit comments

Comments
 (0)