diff --git a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java index cb7af35..7bfb48c 100644 --- a/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java +++ b/office-alexander-logistics-app/src/main/java/com/alexanderlogistics/api/CargosoftMigrationRestService.java @@ -211,7 +211,7 @@ public class CargosoftMigrationRestService implements Serializable { throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException { StringBuffer messageBuffer = new StringBuffer(); if (maxcount <= 0) { - maxcount = 100; + maxcount = 10; } if (type == null || type.isEmpty()) { type = "workitem"; @@ -228,10 +228,11 @@ public class CargosoftMigrationRestService implements Serializable { log("├── found " + mapping.size() + " mappings", messageBuffer); String query = "(type:" + type + ") AND ($modelversion:rechnungseingang*)"; - int syncs = 0; + // int syncs = 0; long l = System.currentTimeMillis(); int batchSize = 100; - int totalObjects = 0; + int totalUpdates = 0; + log("├── migration cargosoft addresses....", messageBuffer); log("│ ├── query=" + query, messageBuffer); @@ -246,16 +247,19 @@ public class CargosoftMigrationRestService implements Serializable { log("│ ├── read page " + pageIndex, messageBuffer); List invoiceList = documentService.find(query, batchSize, pageIndex); long l1 = System.currentTimeMillis(); - + log("│ ├── ...verifying " + invoiceList.size() + " invoices...", messageBuffer); int updates = migratateInvioceBPAddress(invoiceList, mapping); - syncs = syncs + updates; + totalUpdates = totalUpdates + updates; log("│ ├── " + updates + " invoices migrated in " + (System.currentTimeMillis() - l1) + "ms ", messageBuffer); // break; + if (totalUpdates >= maxcount) { + break; + } } long duration = System.currentTimeMillis() - l; - double objectsPerSecond = totalObjects / (duration / 1000.0); - log("├── Successfully " + syncs + " business partner objects synced in " + duration + "ms (" + double objectsPerSecond = totalUpdates / (duration / 1000.0); + log("├── Successfully " + totalUpdates + " invoices migrated in " + duration + "ms (" + String.format("%.1f", objectsPerSecond) + " objects/sec)", messageBuffer); isRunning = false; @@ -267,14 +271,21 @@ public class CargosoftMigrationRestService implements Serializable { int count = 0; for (ItemCollection invoice : invoices) { String cdtrNumber = invoice.getItemValueString("cdtr.number"); - String newNumber = map.get(cdtrNumber); + if (cdtrNumber.isBlank()) { + logger.warning(" ..Invoice " + invoice.getUniqueID() + " has no cdtr.number!"); + continue; + } + + // logger.info("==> check cdtr.number: " + cdtrNumber); + // K überspringen + String newNumber = map.get(cdtrNumber.substring(1)); if (newNumber != null) { // migrate number invoice.setItemValue("cdtr.number.old", cdtrNumber); - invoice.setItemValue("cdtr.number", newNumber); + invoice.setItemValue("cdtr.number", "K" + newNumber); - logger.info("│ ├── replace " + cdtrNumber + "->" + newNumber + " : " + invoice.getUniqueID()); - // documentService.save(invoice); + logger.info("│ ├── replace " + cdtrNumber + " -> K" + newNumber + " : " + invoice.getUniqueID()); + documentService.save(invoice); count++; } diff --git a/office-alexander-logistics-app/src/main/resources/agl_wandlung_20250822.csv b/office-alexander-logistics-app/src/main/resources/agl_wandlung_20250822.csv index b935c20..57773b4 100644 --- a/office-alexander-logistics-app/src/main/resources/agl_wandlung_20250822.csv +++ b/office-alexander-logistics-app/src/main/resources/agl_wandlung_20250822.csv @@ -1,4 +1,5 @@ -alt;neu +fk_adr_nr_von;fk_adr_nr_nach +10310;21316 10633;21054 10741;21418 10807;20601 @@ -351,6 +352,7 @@ alt;neu 17341;20816 17342;20814 17343;20809 +17676;21460 17810;20802 17811;20800 17812;20799 @@ -764,7 +766,6 @@ alt;neu 18987;21436 18991;21437 18992;21439 -18993;21456 18996;20500 18999;20503 19001;21005 @@ -950,8 +951,107 @@ alt;neu 19436;20613 19437;21184 19438;21186 -10310;21316 19439;21188 +19440;21528 +19444;21529 +19445;21530 +19447;21461 +19448;21462 +19450;21531 +19452;21463 +19453;21464 +19454;21532 +19455;21533 +19457;21534 +19458;21535 +19459;21536 +19462;21465 +19463;21466 +19464;21537 +19469;21467 +19471;21538 +19479;21468 +19480;21469 +19482;21539 +19485;21540 +19488;21559 +19490;21470 +19493;21541 +19494;21542 +19497;21471 +19499;21472 +19503;21473 +19504;21543 +19506;21544 +19507;21545 +19508;21546 +19510;21547 +19513;21548 +19514;21549 +19515;21474 +19527;21475 +19532;21550 +19534;21476 +19537;21551 +19540;21477 +19545;21478 +19546;21552 +19554;21479 +19555;21480 +19558;21481 +19564;21482 +19567;21553 +19570;21554 +19571;21555 +19573;21524 +19575;21525 +19578;21483 +19579;21526 +19580;21527 +19586;21484 +19587;21485 +19591;21486 +19596;21487 +19597;21488 +19598;21489 +19599;21490 +19600;21491 +19603;21492 +19609;21493 +19610;21494 +19611;21495 +19613;21496 +19614;21497 +19615;21498 +19619;21499 +19620;21500 +19622;21501 +19631;21502 +19632;21503 +19633;21504 +19634;21505 +19637;21506 +19638;21507 +19640;21508 +19642;21509 +19644;21510 +19645;21511 +19649;21512 +19652;21513 +19655;21514 +19656;21515 +19658;21516 +19661;21517 +19663;21518 +19664;21519 +19667;21520 +19672;21557 +19673;21556 +19675;21522 +19677;21523 +19678;21521 +19679;21558 +70310;81316 70633;81054 70741;81418 70807;80601 @@ -1427,9 +1527,7 @@ alt;neu 78064;80508 78065;80506 78066;80504 -70310;81316 78067;81449 -99267;80995 78072;81354 78079;81447 78080;81446 @@ -1901,91 +1999,61 @@ alt;neu 79437;81184 79438;81186 79439;81188 -79569;80556 -79574;81311 -87984;80760 -99232;80958 -17676;21460 -19447;21461 -19448;21462 -19452;21463 -19453;21464 -19462;21465 -19463;21466 -19469;21467 -19479;21468 -19480;21469 -19490;21470 -19497;21471 -19499;21472 -19503;21473 -19515;21474 -19527;21475 -19534;21476 -19540;21477 -19545;21478 -19554;21479 -19555;21480 -19558;21481 -19564;21482 -19578;21483 -19586;21484 -19587;21485 -19591;21486 -19596;21487 -19597;21488 -19598;21489 -19599;21490 -19600;21491 -19603;21492 -19609;21493 -19610;21494 -19611;21495 -19613;21496 -19614;21497 -19615;21498 -19619;21499 -19620;21500 -19622;21501 -19631;21502 -19632;21503 -19633;21504 -19634;21505 -19637;21506 -19638;21507 -19640;21508 -19642;21509 -19644;21510 -19645;21511 -19649;21512 -19652;21513 -19655;21514 -19656;21515 -19658;21516 -19661;21517 -19663;21518 -19664;21519 -19667;21520 +79440;81528 +79444;81529 +79445;81530 79447;81461 79448;81462 +79450;81531 79452;81463 79453;81464 +79454;81532 +79455;81533 +79457;81534 +79458;81535 +79459;81536 79462;81465 79463;81466 +79464;81537 +79471;81538 79479;81468 79480;81469 +79482;81539 +79485;81540 +79488;81559 79490;81470 +79493;81541 +79494;81542 79497;81471 79499;81472 79503;81473 +79504;81543 +79506;81544 +79507;81545 +79508;81546 +79510;81547 +79513;81548 +79514;81549 79527;81475 +79532;81550 79534;81476 +79537;81551 79540;81477 79545;81478 +79546;81552 79554;81479 79555;81480 79558;81481 79564;81482 +79567;81553 +79569;80556 +79570;81554 +79571;81555 +79573;81524 +79574;81311 +79575;81525 +79579;81526 +79580;81527 79586;81484 79587;81485 79591;81486 @@ -2025,7 +2093,14 @@ alt;neu 79663;81518 79664;81519 79667;81520 +79672;81557 +79673;81556 +79675;81522 79676;81460 -79712;81483 +79677;81523 79678;81521 -19678;21521 \ No newline at end of file +79679;81558 +79712;81483 +87984;80760 +99232;80958 +99267;80995 \ No newline at end of file diff --git a/workflow/pl/rechnungseingang-pl-1.0.9.bpmn b/workflow/pl/rechnungseingang-pl-1.0.9.bpmn index 1d80c6f..bf4c0ed 100644 --- a/workflow/pl/rechnungseingang-pl-1.0.9.bpmn +++ b/workflow/pl/rechnungseingang-pl-1.0.9.bpmn @@ -4656,6 +4656,18 @@ result.isValid=true; + + + + + + + + + + + + @@ -5831,6 +5843,30 @@ result.isValid=true; + + + + + + + + + + + + + + + + + + + + + + + +