From f5fd0bc202e5acc7c204e44a86587f1cb62c0723 Mon Sep 17 00:00:00 2001 From: dhaeb Date: Fri, 12 Mar 2021 15:04:32 +0100 Subject: [PATCH 1/3] add assembly plugin --- dsfinvk-cli/pom.xml | 35 +++++++++++++++++++ .../src/main/resources/META-INF/MANIFEST.MF | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 dsfinvk-cli/src/main/resources/META-INF/MANIFEST.MF diff --git a/dsfinvk-cli/pom.xml b/dsfinvk-cli/pom.xml index dca449c..8f3a02b 100644 --- a/dsfinvk-cli/pom.xml +++ b/dsfinvk-cli/pom.xml @@ -30,4 +30,39 @@ + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.3.0 + + + + + com.opencore.dsfinvk.cli.DsfinvkTool + + + + jar-with-dependencies + + + + + + make-assembly + package + + single + + + + + + + diff --git a/dsfinvk-cli/src/main/resources/META-INF/MANIFEST.MF b/dsfinvk-cli/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000..17c84a8 --- /dev/null +++ b/dsfinvk-cli/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Main-Class: com.opencore.dsfinvk.cli.DsfinvkTool + From d5ba80c84ee18a1f8435c224321d3f66b2d12843 Mon Sep 17 00:00:00 2001 From: dhaeb Date: Fri, 12 Mar 2021 15:07:31 +0100 Subject: [PATCH 2/3] fix module info --- dsfinvk-models/src/main/java/module-info.java | 2 +- .../com/opencore/dsfinvk/parser/DsfinvkParser.java | 14 ++++---------- dsfinvk-parser/src/main/java/module-info.java | 12 ++++++------ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/dsfinvk-models/src/main/java/module-info.java b/dsfinvk-models/src/main/java/module-info.java index 6f52b45..f11fbf6 100644 --- a/dsfinvk-models/src/main/java/module-info.java +++ b/dsfinvk-models/src/main/java/module-info.java @@ -1,7 +1,7 @@ module com.opencore.dsfinvk.models { requires java.validation; - requires com.opencore.gdpdu.models; + requires gdpdu.models; exports com.opencore.dsfinvk.models.stammdaten; exports com.opencore.dsfinvk.models.einzelaufzeichnung; diff --git a/dsfinvk-parser/src/main/java/com/opencore/dsfinvk/parser/DsfinvkParser.java b/dsfinvk-parser/src/main/java/com/opencore/dsfinvk/parser/DsfinvkParser.java index 9b73a71..a4f1f19 100644 --- a/dsfinvk-parser/src/main/java/com/opencore/dsfinvk/parser/DsfinvkParser.java +++ b/dsfinvk-parser/src/main/java/com/opencore/dsfinvk/parser/DsfinvkParser.java @@ -25,12 +25,7 @@ import com.opencore.dsfinvk.models.kassenabschluss.ZGVTyp; import com.opencore.dsfinvk.models.kassenabschluss.ZWaehrungen; import com.opencore.dsfinvk.models.kassenabschluss.ZZahlart; -import com.opencore.dsfinvk.models.stammdaten.StammAbschluss; -import com.opencore.dsfinvk.models.stammdaten.StammAgenturen; -import com.opencore.dsfinvk.models.stammdaten.StammKassen; -import com.opencore.dsfinvk.models.stammdaten.StammOrte; -import com.opencore.dsfinvk.models.stammdaten.StammTerminals; -import com.opencore.dsfinvk.models.stammdaten.StammUst; +import com.opencore.dsfinvk.models.stammdaten.*; import com.opencore.gdpdu.common.exceptions.ParsingException; import com.opencore.gdpdu.data.GdpduDataParser; import com.opencore.gdpdu.index.GdpduIndexParser; @@ -45,7 +40,6 @@ public class DsfinvkParser { private static final Logger LOG = LoggerFactory.getLogger(DsfinvkParser.class); private static final Map> TABLE_MAP = new HashMap<>(); - private static final GdpduDataParser GDPDU_DATA_PARSER = new GdpduDataParser(); public static void parseAndValidate(String indexXmlFile) throws IOException, ParsingException { parseAndValidate(new File(Objects.requireNonNull(indexXmlFile))); @@ -53,7 +47,7 @@ public static void parseAndValidate(String indexXmlFile) throws IOException, Par public static void parseAndValidate(File indexXmlFile) throws IOException, ParsingException { Objects.requireNonNull(indexXmlFile); - DataSet index = GdpduIndexParser.parseXmlFile(indexXmlFile, GdpduIndexParser.ParseMode.LENIENT); + DataSet index = GdpduIndexParser.parseXmlFile(indexXmlFile); for (Media media : index.getMedia()) { for (Table table : media.getTables()) { @@ -93,7 +87,7 @@ public static void parseAndValidate(File indexXmlFile) throws IOException, Parsi } public static List parseTable(File indexXml, String tableName, Class clazz) throws ParsingException { - return GDPDU_DATA_PARSER.parseTable(indexXml, tableName, clazz); + return GdpduDataParser.parseTable(indexXml, tableName, clazz); } public static Class getClassForFilename(String fileName) { @@ -123,7 +117,7 @@ public static Class getClassForFilename(String fileName) { TABLE_MAP.put(StammKassen.FILENAME, StammKassen.class); TABLE_MAP.put(StammOrte.FILENAME, StammOrte.class); TABLE_MAP.put(StammTerminals.FILENAME, StammTerminals.class); - //TABLE_MAP.put(StammTse.F) + TABLE_MAP.put(StammTse.FILENAME, StammTse.class); TABLE_MAP.put(StammUst.FILENAME, StammUst.class); } diff --git a/dsfinvk-parser/src/main/java/module-info.java b/dsfinvk-parser/src/main/java/module-info.java index 8a8b920..ca52dc5 100644 --- a/dsfinvk-parser/src/main/java/module-info.java +++ b/dsfinvk-parser/src/main/java/module-info.java @@ -1,14 +1,14 @@ module com.opencore.dsfinvk.parser { - requires com.opencore.gdpdu.common; - requires com.opencore.gdpdu.data; - requires com.opencore.gdpdu.models; - requires com.opencore.gdpdu.index; - requires commons.csv; - requires java.validation; requires java.xml; requires java.desktop; requires com.opencore.dsfinvk.models; + requires gdpdu.common; + requires gdpdu.data.parser; + requires gdpdu.index.parser; + requires gdpdu.models; + requires org.slf4j; + } From 988ac0e4b4c4761c234c9026251ca5f3ac9dafce Mon Sep 17 00:00:00 2001 From: Jyothsna Boni Date: Tue, 16 Mar 2021 10:51:09 +0100 Subject: [PATCH 3/3] LD-3179: Remove VAT ID validation from the BankopfUst.java . (This vat Id refers to the custom vat id hence need not be validated ) - The TSE_TA_SIG and TSE_TA_SIGZ should have alphanumeric data type - Add the required properties in the class StammTse and also check for the field lengths and field types --- .../bonkopf/BonkopfUst.java | 2 +- .../bonkopf/TseTransaktionen.java | 4 +- .../dsfinvk/models/stammdaten/StammTse.java | 113 +++++++++++++++++- 3 files changed, 111 insertions(+), 8 deletions(-) diff --git a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/BonkopfUst.java b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/BonkopfUst.java index 04bfe00..a7bfb5d 100644 --- a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/BonkopfUst.java +++ b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/BonkopfUst.java @@ -19,7 +19,7 @@ public class BonkopfUst extends BaseBon { public static final String FILENAME = "transactions_vat.csv"; @NotNull - @ValidVatId + // @ValidVatId @Column(value = "UST_SCHLUESSEL", type = DataType.Numeric) private String ustSchluessel; diff --git a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/TseTransaktionen.java b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/TseTransaktionen.java index 5dc32ea..47e5779 100644 --- a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/TseTransaktionen.java +++ b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/einzelaufzeichnung/bonkopf/TseTransaktionen.java @@ -34,11 +34,11 @@ public class TseTransaktionen extends BaseBon { private String tseTaVorgangsart; @NotNull - @Column(value = "TSE_TA_SIGZ", type = DataType.Numeric) + @Column(value = "TSE_TA_SIGZ", type = DataType.AlphaNumeric) private Long tseTaSigz; @NotNull - @Column(value = "TSE_TA_SIG", type = DataType.Numeric) + @Column(value = "TSE_TA_SIG", type = DataType.AlphaNumeric) private String tseTaSig; @Column(value = "TSE_TA_FEHLER", type = DataType.AlphaNumeric) diff --git a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/stammdaten/StammTse.java b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/stammdaten/StammTse.java index 9ebee99..c0c0693 100644 --- a/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/stammdaten/StammTse.java +++ b/dsfinvk-models/src/main/java/com/opencore/dsfinvk/models/stammdaten/StammTse.java @@ -1,24 +1,127 @@ package com.opencore.dsfinvk.models.stammdaten; +import java.util.StringJoiner; + +import javax.validation.constraints.Size; + import com.opencore.dsfinvk.models.BaseModel; +import com.opencore.gdpdu.index.annotations.Column; +import com.opencore.gdpdu.index.models.DataType; // TODO: Fertig stellen, hier gibt es Probleme wg. der Enums und vor allem der "dynamischen" TSE_ZERTIFIKAT* Spalten public class StammTse extends BaseModel { + public static final String FILENAME = "tse.csv"; + + @Column(value = "TSE_ID", type = DataType.Numeric) private long tseId; - + + @Size(max = 68) + @Column(value = "TSE_SERIAL", type = DataType.AlphaNumeric) private String tseSerial; - private TseSigAlgo tseSigAlgo; + @Size(max = 21) + @Column(value = "TSE_SIG_ALGO", type = DataType.AlphaNumeric) + private String tseSigAlgo; + @Size(max = 31) + @Column(value = "TSE_ZEITFORMAT", type = DataType.AlphaNumeric) private String tseZeitformat; - private TsePdEncoding tsePdEncoding; + @Size(max = 5) + @Column(value = "TSE_PD_ENCODING", type = DataType.AlphaNumeric) + private String tsePdEncoding; + @Size(max = 512) + @Column(value = "TSE_PUBLIC_KEY", type = DataType.AlphaNumeric) private String tsePublicKey; - + + @Size(max = 1000) + @Column(value = "TSE_ZERTIFIKAT_I", type = DataType.AlphaNumeric) private String tseZertifikatI; - + + @Size(max = 1000) + @Column(value = "TSE_ZERTIFIKAT_II", type = DataType.AlphaNumeric) private String tseZertifikatII; +public String getTseSigAlgo() { + return tseSigAlgo; +} + +public void setTseSigAlgo(String tseSigAlgo) { + this.tseSigAlgo = tseSigAlgo; +} + +public long getTseId() { + return tseId; +} + +public void setTseId(long tseId) { + this.tseId = tseId; +} + +public String getTseSerial() { + return tseSerial; +} + +public void setTseSerial(String tseSerial) { + this.tseSerial = tseSerial; +} + +public String getTseZeitformat() { + return tseZeitformat; +} + +public void setTseZeitformat(String tseZeitformat) { + this.tseZeitformat = tseZeitformat; +} + +public String getTsePdEncoding() { + return tsePdEncoding; +} + +public void setTsePdEncoding(String tsePdEncoding) { + this.tsePdEncoding = tsePdEncoding; +} + +public String getTsePublicKey() { + return tsePublicKey; +} + +public void setTsePublicKey(String tsePublicKey) { + this.tsePublicKey = tsePublicKey; +} + +public String getTseZertifikatI() { + return tseZertifikatI; +} + +public void setTseZertifikatI(String tseZertifikatI) { + this.tseZertifikatI = tseZertifikatI; +} + +public String getTseZertifikatII() { + return tseZertifikatII; +} + +public void setTseZertifikatII(String tseZertifikatII) { + this.tseZertifikatII = tseZertifikatII; +} + +public String toString(){ + return new StringJoiner(", ", StammTse.class.getSimpleName() + "[", "]") + .add("tseId='" + tseId + "'") + .add("tseSerial='" + tseSerial + "'") + .add("tseSigAlgo='" + tseSigAlgo + "'") + .add("tseZeitformat='" + tseZeitformat + "'") + .add("tsePdEncoding='" + tsePdEncoding + "'") + .add("tsePublicKey='" + tsePublicKey + "'") + .add("tseZertifikatI='" + tseZertifikatI + "'") + .add("tseZertifikatII='" + tseZertifikatII + "'") + .add("zKasseId='" + getzKasseId() + "'") + .add("zErstellung=" + getzErstellung()) + .add("zNr=" + getzNr()) + .toString(); +} + }