Modifica import GSE

This commit is contained in:
2024-09-12 16:53:19 +02:00
parent 1dc43f7760
commit 46b8842db1

View File

@@ -150,7 +150,7 @@ public class OrdiniImportService {
Connection conn = multiDBTransactionManager.getPrimaryConnection();
HashMap<String, String> setup = setupGest.getImportSetupSection(conn, type, format);
Date dataDoc;
Date dataOrd;
String destinatario = null, citta = null;
String regex = "\\d{4}-\\d{2}-\\d{2}";
@@ -158,10 +158,11 @@ public class OrdiniImportService {
Matcher matcher = pattern.matcher(requestDTO.getFileName());
if (matcher.find()) {
dataDoc = UtilityString.parseDate(matcher.group());
dataOrd = UtilityString.parseDate(matcher.group());
} else {
throw new Exception("Data documento mancante");
throw new Exception("Data ordine mancante");
}
Date dataCons = UtilityDate.dateAdd(dataOrd, 1);
List<List<String>> records = UtilityCSV.readCSV(requestDTO.getRawContent(), ";");
if (records.isEmpty()) throw new Exception("File vuoto");
@@ -216,7 +217,7 @@ public class OrdiniImportService {
.setCodVdes((String) vtbDest.get("cod_vdes"))
.setCodMdep(setup.get("DEPOSITO_ORDINE"))
.setCodVage(codVage)
.setDataOrd(dataDoc)
.setDataOrd(dataOrd)
.setGestione("V")
.setNote(requestDTO.getFileName())
.setDtbOrdr(new ArrayList<>())
@@ -232,6 +233,7 @@ public class OrdiniImportService {
DtbOrdr dtbOrdr = new DtbOrdr();
dtbOrdr.setCodMart(record.get(1))
.setDataCons(dataCons)
.setQta(new BigDecimal(record.get(4)))
.setOperation(OperationType.INSERT);