adresswandlung cargosoft
This commit is contained in:
parent
c14e1e41b3
commit
c6205b9c43
3 changed files with 205 additions and 83 deletions
|
|
@ -211,7 +211,7 @@ public class CargosoftMigrationRestService implements Serializable {
|
||||||
throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException {
|
throws QueryException, AccessDeniedException, ProcessingErrorException, PluginException, ModelException {
|
||||||
StringBuffer messageBuffer = new StringBuffer();
|
StringBuffer messageBuffer = new StringBuffer();
|
||||||
if (maxcount <= 0) {
|
if (maxcount <= 0) {
|
||||||
maxcount = 100;
|
maxcount = 10;
|
||||||
}
|
}
|
||||||
if (type == null || type.isEmpty()) {
|
if (type == null || type.isEmpty()) {
|
||||||
type = "workitem";
|
type = "workitem";
|
||||||
|
|
@ -228,10 +228,11 @@ public class CargosoftMigrationRestService implements Serializable {
|
||||||
log("├── found " + mapping.size() + " mappings", messageBuffer);
|
log("├── found " + mapping.size() + " mappings", messageBuffer);
|
||||||
|
|
||||||
String query = "(type:" + type + ") AND ($modelversion:rechnungseingang*)";
|
String query = "(type:" + type + ") AND ($modelversion:rechnungseingang*)";
|
||||||
int syncs = 0;
|
// int syncs = 0;
|
||||||
long l = System.currentTimeMillis();
|
long l = System.currentTimeMillis();
|
||||||
int batchSize = 100;
|
int batchSize = 100;
|
||||||
int totalObjects = 0;
|
int totalUpdates = 0;
|
||||||
|
|
||||||
log("├── migration cargosoft addresses....", messageBuffer);
|
log("├── migration cargosoft addresses....", messageBuffer);
|
||||||
log("│ ├── query=" + query, messageBuffer);
|
log("│ ├── query=" + query, messageBuffer);
|
||||||
|
|
||||||
|
|
@ -246,16 +247,19 @@ public class CargosoftMigrationRestService implements Serializable {
|
||||||
log("│ ├── read page " + pageIndex, messageBuffer);
|
log("│ ├── read page " + pageIndex, messageBuffer);
|
||||||
List<ItemCollection> invoiceList = documentService.find(query, batchSize, pageIndex);
|
List<ItemCollection> invoiceList = documentService.find(query, batchSize, pageIndex);
|
||||||
long l1 = System.currentTimeMillis();
|
long l1 = System.currentTimeMillis();
|
||||||
|
log("│ ├── ...verifying " + invoiceList.size() + " invoices...", messageBuffer);
|
||||||
int updates = migratateInvioceBPAddress(invoiceList, mapping);
|
int updates = migratateInvioceBPAddress(invoiceList, mapping);
|
||||||
syncs = syncs + updates;
|
totalUpdates = totalUpdates + updates;
|
||||||
log("│ ├── " + updates + " invoices migrated in " +
|
log("│ ├── " + updates + " invoices migrated in " +
|
||||||
(System.currentTimeMillis() - l1) + "ms ", messageBuffer);
|
(System.currentTimeMillis() - l1) + "ms ", messageBuffer);
|
||||||
// break;
|
// break;
|
||||||
|
if (totalUpdates >= maxcount) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
long duration = System.currentTimeMillis() - l;
|
long duration = System.currentTimeMillis() - l;
|
||||||
double objectsPerSecond = totalObjects / (duration / 1000.0);
|
double objectsPerSecond = totalUpdates / (duration / 1000.0);
|
||||||
log("├── Successfully " + syncs + " business partner objects synced in " + duration + "ms ("
|
log("├── Successfully " + totalUpdates + " invoices migrated in " + duration + "ms ("
|
||||||
+ String.format("%.1f", objectsPerSecond) + " objects/sec)", messageBuffer);
|
+ String.format("%.1f", objectsPerSecond) + " objects/sec)", messageBuffer);
|
||||||
|
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
|
|
@ -267,14 +271,21 @@ public class CargosoftMigrationRestService implements Serializable {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (ItemCollection invoice : invoices) {
|
for (ItemCollection invoice : invoices) {
|
||||||
String cdtrNumber = invoice.getItemValueString("cdtr.number");
|
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) {
|
if (newNumber != null) {
|
||||||
// migrate number
|
// migrate number
|
||||||
invoice.setItemValue("cdtr.number.old", cdtrNumber);
|
invoice.setItemValue("cdtr.number.old", cdtrNumber);
|
||||||
invoice.setItemValue("cdtr.number", newNumber);
|
invoice.setItemValue("cdtr.number", "K" + newNumber);
|
||||||
|
|
||||||
logger.info("│ ├── replace " + cdtrNumber + "->" + newNumber + " : " + invoice.getUniqueID());
|
logger.info("│ ├── replace " + cdtrNumber + " -> K" + newNumber + " : " + invoice.getUniqueID());
|
||||||
// documentService.save(invoice);
|
documentService.save(invoice);
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
alt;neu
|
fk_adr_nr_von;fk_adr_nr_nach
|
||||||
|
10310;21316
|
||||||
10633;21054
|
10633;21054
|
||||||
10741;21418
|
10741;21418
|
||||||
10807;20601
|
10807;20601
|
||||||
|
|
@ -351,6 +352,7 @@ alt;neu
|
||||||
17341;20816
|
17341;20816
|
||||||
17342;20814
|
17342;20814
|
||||||
17343;20809
|
17343;20809
|
||||||
|
17676;21460
|
||||||
17810;20802
|
17810;20802
|
||||||
17811;20800
|
17811;20800
|
||||||
17812;20799
|
17812;20799
|
||||||
|
|
@ -764,7 +766,6 @@ alt;neu
|
||||||
18987;21436
|
18987;21436
|
||||||
18991;21437
|
18991;21437
|
||||||
18992;21439
|
18992;21439
|
||||||
18993;21456
|
|
||||||
18996;20500
|
18996;20500
|
||||||
18999;20503
|
18999;20503
|
||||||
19001;21005
|
19001;21005
|
||||||
|
|
@ -950,8 +951,107 @@ alt;neu
|
||||||
19436;20613
|
19436;20613
|
||||||
19437;21184
|
19437;21184
|
||||||
19438;21186
|
19438;21186
|
||||||
10310;21316
|
|
||||||
19439;21188
|
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
|
70633;81054
|
||||||
70741;81418
|
70741;81418
|
||||||
70807;80601
|
70807;80601
|
||||||
|
|
@ -1427,9 +1527,7 @@ alt;neu
|
||||||
78064;80508
|
78064;80508
|
||||||
78065;80506
|
78065;80506
|
||||||
78066;80504
|
78066;80504
|
||||||
70310;81316
|
|
||||||
78067;81449
|
78067;81449
|
||||||
99267;80995
|
|
||||||
78072;81354
|
78072;81354
|
||||||
78079;81447
|
78079;81447
|
||||||
78080;81446
|
78080;81446
|
||||||
|
|
@ -1901,91 +1999,61 @@ alt;neu
|
||||||
79437;81184
|
79437;81184
|
||||||
79438;81186
|
79438;81186
|
||||||
79439;81188
|
79439;81188
|
||||||
79569;80556
|
79440;81528
|
||||||
79574;81311
|
79444;81529
|
||||||
87984;80760
|
79445;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
|
|
||||||
79447;81461
|
79447;81461
|
||||||
79448;81462
|
79448;81462
|
||||||
|
79450;81531
|
||||||
79452;81463
|
79452;81463
|
||||||
79453;81464
|
79453;81464
|
||||||
|
79454;81532
|
||||||
|
79455;81533
|
||||||
|
79457;81534
|
||||||
|
79458;81535
|
||||||
|
79459;81536
|
||||||
79462;81465
|
79462;81465
|
||||||
79463;81466
|
79463;81466
|
||||||
|
79464;81537
|
||||||
|
79471;81538
|
||||||
79479;81468
|
79479;81468
|
||||||
79480;81469
|
79480;81469
|
||||||
|
79482;81539
|
||||||
|
79485;81540
|
||||||
|
79488;81559
|
||||||
79490;81470
|
79490;81470
|
||||||
|
79493;81541
|
||||||
|
79494;81542
|
||||||
79497;81471
|
79497;81471
|
||||||
79499;81472
|
79499;81472
|
||||||
79503;81473
|
79503;81473
|
||||||
|
79504;81543
|
||||||
|
79506;81544
|
||||||
|
79507;81545
|
||||||
|
79508;81546
|
||||||
|
79510;81547
|
||||||
|
79513;81548
|
||||||
|
79514;81549
|
||||||
79527;81475
|
79527;81475
|
||||||
|
79532;81550
|
||||||
79534;81476
|
79534;81476
|
||||||
|
79537;81551
|
||||||
79540;81477
|
79540;81477
|
||||||
79545;81478
|
79545;81478
|
||||||
|
79546;81552
|
||||||
79554;81479
|
79554;81479
|
||||||
79555;81480
|
79555;81480
|
||||||
79558;81481
|
79558;81481
|
||||||
79564;81482
|
79564;81482
|
||||||
|
79567;81553
|
||||||
|
79569;80556
|
||||||
|
79570;81554
|
||||||
|
79571;81555
|
||||||
|
79573;81524
|
||||||
|
79574;81311
|
||||||
|
79575;81525
|
||||||
|
79579;81526
|
||||||
|
79580;81527
|
||||||
79586;81484
|
79586;81484
|
||||||
79587;81485
|
79587;81485
|
||||||
79591;81486
|
79591;81486
|
||||||
|
|
@ -2025,7 +2093,14 @@ alt;neu
|
||||||
79663;81518
|
79663;81518
|
||||||
79664;81519
|
79664;81519
|
||||||
79667;81520
|
79667;81520
|
||||||
|
79672;81557
|
||||||
|
79673;81556
|
||||||
|
79675;81522
|
||||||
79676;81460
|
79676;81460
|
||||||
79712;81483
|
79677;81523
|
||||||
79678;81521
|
79678;81521
|
||||||
19678;21521
|
79679;81558
|
||||||
|
79712;81483
|
||||||
|
87984;80760
|
||||||
|
99232;80958
|
||||||
|
99267;80995
|
||||||
|
|
|
@ -4656,6 +4656,18 @@ result.isValid=true;
|
||||||
<bpmn2:sequenceFlow id="sequenceFlow_Fb43tw" sourceRef="EventBasedGateway_3" targetRef="IntermediateThrowEvent_3">
|
<bpmn2:sequenceFlow id="sequenceFlow_Fb43tw" sourceRef="EventBasedGateway_3" targetRef="IntermediateThrowEvent_3">
|
||||||
<bpmn2:documentation id="documentation_ndw8uw"/>
|
<bpmn2:documentation id="documentation_ndw8uw"/>
|
||||||
</bpmn2:sequenceFlow>
|
</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>
|
||||||
<bpmn2:process id="process_2" name="Default Process" processType="Public">
|
<bpmn2:process id="process_2" name="Default Process" processType="Public">
|
||||||
<bpmn2:documentation id="documentation_yUm3kA"/>
|
<bpmn2:documentation id="documentation_yUm3kA"/>
|
||||||
|
|
@ -5831,6 +5843,30 @@ result.isValid=true;
|
||||||
<di:waypoint x="815.0" y="245.0"/>
|
<di:waypoint x="815.0" y="245.0"/>
|
||||||
<di:waypoint x="997.0" y="245.0"/>
|
<di:waypoint x="997.0" y="245.0"/>
|
||||||
</bpmndi:BPMNEdge>
|
</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:BPMNPlane>
|
||||||
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
|
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
|
||||||
<dc:Font name="arial" size="9.0"/>
|
<dc:Font name="arial" size="9.0"/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue