Creazione servizio di importazione ack intesa
This commit is contained in:
@@ -15,9 +15,8 @@ public enum EntityImportType {
|
||||
DOCUMENTI_VENDITA("DOCUMENTI VENDITA"),
|
||||
PROSPECT("PROSPECT"),
|
||||
LISTINI_ACQUISTO("LISTINI ACQUISTO"),
|
||||
|
||||
LISTINI_VENDITA("LISTINI VENDITA"),
|
||||
|
||||
ACK("ACK"),
|
||||
INVENTARIO("INVENTARIO"),
|
||||
RAPPORTINI("RAPPORTINI"),
|
||||
RAPPORTINI_FG("RAPPORTINI FG"),
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250217124909 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_ACK", "INTESA", "ATTIVO", "N",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "EMAIL_FOR_LOG", null,
|
||||
"Inserire il file l'indirizzo email per inviare il log dell'importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "FILE_FILTER", null,
|
||||
"Inserire il criterio di filtro dei file o il nome del file specifio (seguire la sintassi di java)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "GG_CANC_FILE", null,
|
||||
"Giorni per la cancellazione dei file dalla cartella di appoggio", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "IMPORT_REST", "S",
|
||||
"Inserire S/N per attivare/disattivare il salvataggio con i servizi REST", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "LISTENING", "N",
|
||||
"Se LISTENIG = 'N' la procedura di importazione non si potrà mai mettere in ascolto sulla directory perchè nella procedura vengono prese in considerazione più file.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "PATH_FILE", null,
|
||||
"Directory contente i file da importare.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ACK", "INTESA", "PATH_FILE_IMPORTED", null,
|
||||
"Directory dove vengono spostati i file dopo l'importazione.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Salpar_VgAlimenti)){
|
||||
updateSetupValue("IMPORT_ACK", "INTESA", "ATTIVO", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package it.integry.ems.document.Import;
|
||||
|
||||
import it.integry.ems.Import.base.BaseEntityImporter;
|
||||
import it.integry.ems.Import.base.IEntityImporter;
|
||||
import it.integry.ems.document.Import.service.AckImportService;
|
||||
import it.integry.ems.document.Import.service.DocumentiAcquistoImportService;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AckImporter extends BaseEntityImporter<List<EntityBase>> implements IEntityImporter<List<EntityBase>> {
|
||||
|
||||
@Override
|
||||
public List<EntityBase> doImport() throws Exception {
|
||||
Format enumFormat = Format.fromString(super.format);
|
||||
List<EntityBase> entities;
|
||||
|
||||
if (enumFormat != null) {
|
||||
switch (enumFormat) {
|
||||
case INTESA:
|
||||
entities = getContextBean(AckImportService.class)
|
||||
.importAckIntesa(type, format, requestDto);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Tipo " + format + " non supportato");
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Tipo " + format + " non definito");
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
public enum Format {
|
||||
INTESA("INTESA");
|
||||
|
||||
private String text;
|
||||
|
||||
Format(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public static Format fromString(String text) {
|
||||
for (Format b : Format.values()) {
|
||||
if (b.text.equalsIgnoreCase(text)) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.ems.document.Import.service;
|
||||
|
||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Scope(value = "request")
|
||||
public class AckImportService {
|
||||
|
||||
public List<EntityBase> importAckIntesa(String type, String format, ImportRequestDTO requestDto) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.ems.Import.base.EntityImporterUtility;
|
||||
import it.integry.ems.Import.enums.EntityImportType;
|
||||
import it.integry.ems._context.EmsCoreContext;
|
||||
import it.integry.ems.document.Import.AckImporter;
|
||||
import it.integry.ems.document.Import.DocumentiImporter;
|
||||
import it.integry.ems.document.export.DocumentiExporter;
|
||||
import it.integry.ems.export.base.EntityExporterUtility;
|
||||
@@ -41,6 +42,7 @@ public class EmsDocumentContext {
|
||||
EntityImporterUtility.addTypeBinding(EntityImportType.DOCUMENTI_ACQUISTO, DocumentiImporter.class);
|
||||
EntityImporterUtility.addTypeBinding(EntityImportType.DOCUMENTI_VENDITA, DocumentiImporter.class);
|
||||
EntityImporterUtility.addTypeBinding(EntityImportType.DOCUMENTI_LAVORAZIONE, DocumentiImporter.class);
|
||||
EntityImporterUtility.addTypeBinding(EntityImportType.ACK, AckImporter.class);
|
||||
EntityExporterUtility.addTypeBinding(EntityExportType.DOCUMENTI, DocumentiExporter.class);
|
||||
EntityExporterUtility.addTypeBinding(EntityExportType.DOCUMENTI_VENDITA, DocumentiExporter.class);
|
||||
EntityExporterUtility.addTypeBinding(EntityExportType.DOCUMENTI_ACQUISTO, DocumentiExporter.class);
|
||||
|
||||
Reference in New Issue
Block a user