random intermediate commit
This commit is contained in:
parent
7f79078c6a
commit
010efaa917
11 changed files with 120 additions and 3 deletions
10
pom.xml
10
pom.xml
|
|
@ -40,15 +40,19 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mariadb.jdbc</groupId>
|
<groupId>com.h2database</groupId> <!---->
|
||||||
<artifactId>mariadb-java-client</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.example</groupId>
|
||||||
|
<artifactId>batchprocessing</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package de.avatic.taricdb.batch;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class ImporterConfiguration {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package de.avatic.taricdb.batch.processors;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.batch.item.ItemProcessor;
|
||||||
|
|
||||||
|
public class ExtractZipItemProcessor implements ItemProcessor<File,List<File>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<File> process(File item) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package de.avatic.taricdb.batch.processors;
|
||||||
|
|
||||||
|
public class FootnoteItemProcessor {
|
||||||
|
|
||||||
|
}
|
||||||
11
src/main/java/de/avatic/taricdb/model/UploadFile.java
Normal file
11
src/main/java/de/avatic/taricdb/model/UploadFile.java
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
package de.avatic.taricdb.model;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class UploadFile {
|
||||||
|
|
||||||
|
int id;
|
||||||
|
|
||||||
|
UploadFileType type;
|
||||||
|
|
||||||
|
}
|
||||||
26
src/main/java/de/avatic/taricdb/model/UploadFileType.java
Normal file
26
src/main/java/de/avatic/taricdb/model/UploadFileType.java
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
package de.avatic.taricdb.model;
|
||||||
|
|
||||||
|
public enum UploadFileType {
|
||||||
|
ZIP("null"),
|
||||||
|
DUTIES("Duties Import 01-99.xlsx"),
|
||||||
|
BUSINESS_CODE("TARIC Business codes.xlsx"),
|
||||||
|
GEO_COMPOSITION("Geographical areas composition.xlsx"),
|
||||||
|
GEO("Geographical areas descriptions.xlsx"),
|
||||||
|
LEGAL_BASES("Legal bases.xlsx"),
|
||||||
|
MEASURE_CONDITIONS("Measure conditions.xlsx"),
|
||||||
|
MEASURE_EXCLUSIONS("Measure exclusions.xlsx"),
|
||||||
|
MEASURE_FOOTNOTES("Measure footnotes.xlsx"),
|
||||||
|
NOMENCLATURE_DE("Nomenclature DE.xlsx"),
|
||||||
|
NOMENCLATURE_FR("Nomenclature FR.xlsx"),
|
||||||
|
NOMENCLATURE_EN("Nomenclature EN.xlsx"),
|
||||||
|
DECLARABLE_CODES("Declarable codes.xlsx"),
|
||||||
|
ADDITIONAL_CODES("Additional codes descriptions.xlsx"),
|
||||||
|
BOX_44("Box 44 codes of the SAD.xlsx"),
|
||||||
|
FOOTNOTES("Footnotes descriptions.xlsx"),
|
||||||
|
NOMENCLATURE_FOOTNOTES("Nomenclature footnotes.xlsx");
|
||||||
|
|
||||||
|
UploadFileType(String fileName) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package de.avatic.taricdb.repository;
|
||||||
|
|
||||||
|
public class UploadFileRepository {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package de.avatic.taricdb.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class UploadService {
|
||||||
|
|
||||||
|
}
|
||||||
15
src/main/java/de/avatic/taricdb/web/UploadController.java
Normal file
15
src/main/java/de/avatic/taricdb/web/UploadController.java
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
package de.avatic.taricdb.web;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class UploadController {
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
public void startConversion() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
spring.application.name=taricdb
|
spring.application.name=taricdb
|
||||||
|
spring.batch.job.enabled= false
|
||||||
|
|
@ -1,3 +1,15 @@
|
||||||
|
-- upload tables
|
||||||
|
create table if not exists "upload_file"
|
||||||
|
(
|
||||||
|
id INT NOT NULL PRIMARY KEY,
|
||||||
|
file_name TEXT,
|
||||||
|
file_type ENUM("zip", "duties", "business_codes", "geo_composition", "geo", "legal_bases", "measure_conditions", "measure_exclusions",
|
||||||
|
"measure_footnotes", "nomenclature_de", "nomenclature_en", , "nomenclature_fr", "declarable_codes", "additional_codes", "box44",
|
||||||
|
"footnotes", "nomenclature_footnotes")
|
||||||
|
blob LONGBLOB
|
||||||
|
parent_zip INT
|
||||||
|
);
|
||||||
|
|
||||||
-- meta tables, like units and certificates
|
-- meta tables, like units and certificates
|
||||||
create table if not exists "legal_base"
|
create table if not exists "legal_base"
|
||||||
(
|
(
|
||||||
|
|
@ -110,6 +122,12 @@ create table if not exists "nomenclature"
|
||||||
is_leaf_start_date DATE,
|
is_leaf_start_date DATE,
|
||||||
parent_id INT -- TODO: for each child do: alter table nomenclature add constraint parent_nomenclature foreign key (parent_id) references nomenclature(id) on delete set null;
|
parent_id INT -- TODO: for each child do: alter table nomenclature add constraint parent_nomenclature foreign key (parent_id) references nomenclature(id) on delete set null;
|
||||||
);
|
);
|
||||||
|
create table if not exists "nomenclature_footnote"
|
||||||
|
(
|
||||||
|
id INT NOT NULL PRIMARY KEY,
|
||||||
|
FOREIGN KEY (footnote_id) REFERENCES footnote(id),
|
||||||
|
FOREIGN KEY (nomenclature_id) REFERENCES nomenclature(id)
|
||||||
|
);
|
||||||
create table if not exists "additional_code"
|
create table if not exists "additional_code"
|
||||||
(
|
(
|
||||||
id INT NOT NULL PRIMARY KEY,
|
id INT NOT NULL PRIMARY KEY,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue