adresswandlung cargosoft

This commit is contained in:
Ralph Soika 2025-08-30 17:27:33 +02:00
parent c14e1e41b3
commit c6205b9c43
3 changed files with 205 additions and 83 deletions

View file

@ -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<ItemCollection> 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++;
}

View file

@ -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
79679;81558
79712;81483
87984;80760
99232;80958
99267;80995
1 alt fk_adr_nr_von neu fk_adr_nr_nach
2 10310 21316
3 10633 10633 21054 21054
4 10741 10741 21418 21418
5 10807 10807 20601 20601
352 17341 17341 20816 20816
353 17342 17342 20814 20814
354 17343 17343 20809 20809
355 17676 21460
356 17810 17810 20802 20802
357 17811 17811 20800 20800
358 17812 17812 20799 20799
766 18987 18987 21436 21436
767 18991 18991 21437 21437
768 18992 18992 21439 21439
18993 21456
769 18996 18996 20500 20500
770 18999 18999 20503 20503
771 19001 19001 21005 21005
951 19436 19436 20613 20613
952 19437 19437 21184 21184
953 19438 19438 21186 21186
10310 21316
954 19439 19439 21188 21188
955 19440 21528
956 19444 21529
957 19445 21530
958 19447 21461
959 19448 21462
960 19450 21531
961 19452 21463
962 19453 21464
963 19454 21532
964 19455 21533
965 19457 21534
966 19458 21535
967 19459 21536
968 19462 21465
969 19463 21466
970 19464 21537
971 19469 21467
972 19471 21538
973 19479 21468
974 19480 21469
975 19482 21539
976 19485 21540
977 19488 21559
978 19490 21470
979 19493 21541
980 19494 21542
981 19497 21471
982 19499 21472
983 19503 21473
984 19504 21543
985 19506 21544
986 19507 21545
987 19508 21546
988 19510 21547
989 19513 21548
990 19514 21549
991 19515 21474
992 19527 21475
993 19532 21550
994 19534 21476
995 19537 21551
996 19540 21477
997 19545 21478
998 19546 21552
999 19554 21479
1000 19555 21480
1001 19558 21481
1002 19564 21482
1003 19567 21553
1004 19570 21554
1005 19571 21555
1006 19573 21524
1007 19575 21525
1008 19578 21483
1009 19579 21526
1010 19580 21527
1011 19586 21484
1012 19587 21485
1013 19591 21486
1014 19596 21487
1015 19597 21488
1016 19598 21489
1017 19599 21490
1018 19600 21491
1019 19603 21492
1020 19609 21493
1021 19610 21494
1022 19611 21495
1023 19613 21496
1024 19614 21497
1025 19615 21498
1026 19619 21499
1027 19620 21500
1028 19622 21501
1029 19631 21502
1030 19632 21503
1031 19633 21504
1032 19634 21505
1033 19637 21506
1034 19638 21507
1035 19640 21508
1036 19642 21509
1037 19644 21510
1038 19645 21511
1039 19649 21512
1040 19652 21513
1041 19655 21514
1042 19656 21515
1043 19658 21516
1044 19661 21517
1045 19663 21518
1046 19664 21519
1047 19667 21520
1048 19672 21557
1049 19673 21556
1050 19675 21522
1051 19677 21523
1052 19678 21521
1053 19679 21558
1054 70310 81316
1055 70633 70633 81054 81054
1056 70741 70741 81418 81418
1057 70807 70807 80601 80601
1527 78064 78064 80508 80508
1528 78065 78065 80506 80506
1529 78066 78066 80504 80504
70310 81316
1530 78067 78067 81449 81449
99267 80995
1531 78072 78072 81354 81354
1532 78079 78079 81447 81447
1533 78080 78080 81446 81446
1999 79437 79437 81184 81184
2000 79438 79438 81186 81186
2001 79439 79439 81188 81188
2002 79569 79440 80556 81528
2003 79574 79444 81311 81529
2004 87984 79445 80760 81530
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
2005 79447 79447 81461 81461
2006 79448 79448 81462 81462
2007 79450 81531
2008 79452 79452 81463 81463
2009 79453 79453 81464 81464
2010 79454 81532
2011 79455 81533
2012 79457 81534
2013 79458 81535
2014 79459 81536
2015 79462 79462 81465 81465
2016 79463 79463 81466 81466
2017 79464 81537
2018 79471 81538
2019 79479 79479 81468 81468
2020 79480 79480 81469 81469
2021 79482 81539
2022 79485 81540
2023 79488 81559
2024 79490 79490 81470 81470
2025 79493 81541
2026 79494 81542
2027 79497 79497 81471 81471
2028 79499 79499 81472 81472
2029 79503 79503 81473 81473
2030 79504 81543
2031 79506 81544
2032 79507 81545
2033 79508 81546
2034 79510 81547
2035 79513 81548
2036 79514 81549
2037 79527 79527 81475 81475
2038 79532 81550
2039 79534 79534 81476 81476
2040 79537 81551
2041 79540 79540 81477 81477
2042 79545 79545 81478 81478
2043 79546 81552
2044 79554 79554 81479 81479
2045 79555 79555 81480 81480
2046 79558 79558 81481 81481
2047 79564 79564 81482 81482
2048 79567 81553
2049 79569 80556
2050 79570 81554
2051 79571 81555
2052 79573 81524
2053 79574 81311
2054 79575 81525
2055 79579 81526
2056 79580 81527
2057 79586 79586 81484 81484
2058 79587 79587 81485 81485
2059 79591 79591 81486 81486
2093 79663 79663 81518 81518
2094 79664 79664 81519 81519
2095 79667 79667 81520 81520
2096 79672 81557
2097 79673 81556
2098 79675 81522
2099 79676 79676 81460 81460
2100 79712 79677 81483 81523
2101 79678 79678 81521 81521
2102 19678 79679 21521 81558
2103 79712 81483
2104 87984 80760
2105 99232 80958
2106 99267 80995

View file

@ -4656,6 +4656,18 @@ result.isValid=true;
<bpmn2:sequenceFlow id="sequenceFlow_Fb43tw" sourceRef="EventBasedGateway_3" targetRef="IntermediateThrowEvent_3">
<bpmn2:documentation id="documentation_ndw8uw"/>
</bpmn2:sequenceFlow>
<bpmn2:association id="association_GKu21Q" sourceRef="DataObject_3" targetRef="Task_9">
<bpmn2:documentation id="documentation_acExYg"/>
</bpmn2:association>
<bpmn2:association id="association_6FlTcg" sourceRef="DataObject_3" targetRef="Task_3">
<bpmn2:documentation id="documentation_VDNhGg"/>
</bpmn2:association>
<bpmn2:association id="association_dOtLUw" sourceRef="DataObject_3" targetRef="Task_5">
<bpmn2:documentation id="documentation_Bx7JLA"/>
</bpmn2:association>
<bpmn2:association id="association_SZ0JqA" sourceRef="DataObject_3" targetRef="Task_6">
<bpmn2:documentation id="documentation_MoBdPg"/>
</bpmn2:association>
</bpmn2:process>
<bpmn2:process id="process_2" name="Default Process" processType="Public">
<bpmn2:documentation id="documentation_yUm3kA"/>
@ -5831,6 +5843,30 @@ result.isValid=true;
<di:waypoint x="815.0" y="245.0"/>
<di:waypoint x="997.0" y="245.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_GKu21Q" id="BPMNEdge_pBBH5w" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_10">
<di:waypoint x="969.0" y="1677.0"/>
<di:waypoint x="1070.0" y="1677.0"/>
<di:waypoint x="1070.0" y="1895.0"/>
<di:waypoint x="1170.0" y="1895.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_6FlTcg" id="BPMNEdge_PXHNDg" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_9">
<di:waypoint x="969.0" y="1677.0"/>
<di:waypoint x="1210.0" y="1677.0"/>
<di:waypoint x="1210.0" y="1805.0"/>
<di:waypoint x="1450.0" y="1805.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_dOtLUw" id="BPMNEdge_g4raQg" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_11">
<di:waypoint x="969.0" y="1677.0"/>
<di:waypoint x="1695.0" y="1677.0"/>
<di:waypoint x="1695.0" y="1805.0"/>
<di:waypoint x="2420.0" y="1805.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="association_SZ0JqA" id="BPMNEdge_QkZqAw" sourceElement="BPMNShape_DataObject_3" targetElement="BPMNShape_Task_6">
<di:waypoint x="969.0" y="1677.0"/>
<di:waypoint x="1555.0" y="1677.0"/>
<di:waypoint x="1555.0" y="1905.0"/>
<di:waypoint x="2140.0" y="1905.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
<dc:Font name="arial" size="9.0"/>