RED-9139-pageOrderHotfix
This commit is contained in:
parent
947cbe4cd2
commit
f1f2d02266
@ -2,6 +2,7 @@ package com.iqser.red.service.redaction.v1.server.mapper;
|
|||||||
|
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -60,6 +61,7 @@ public class DocumentDataMapper {
|
|||||||
|
|
||||||
List<DocumentPage> documentPageData = document.getPages()
|
List<DocumentPage> documentPageData = document.getPages()
|
||||||
.stream()
|
.stream()
|
||||||
|
.sorted(Comparator.comparingInt(Page::getNumber))
|
||||||
.map(DocumentDataMapper::toPageData)
|
.map(DocumentDataMapper::toPageData)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|||||||
@ -44,11 +44,6 @@ public class DocumentGraphMapper {
|
|||||||
DocumentTree documentTree = new DocumentTree(document);
|
DocumentTree documentTree = new DocumentTree(document);
|
||||||
Context context = new Context(documentData, documentTree);
|
Context context = new Context(documentData, documentTree);
|
||||||
|
|
||||||
context.pageData.addAll(documentData.getDocumentPages().getDocumentPagesList()
|
|
||||||
.stream()
|
|
||||||
.map(DocumentGraphMapper::buildPage)
|
|
||||||
.toList());
|
|
||||||
|
|
||||||
context.documentTree.getRoot().getChildren().addAll(buildEntries(documentData.getDocumentStructure().getRoot().getChildrenList(), context));
|
context.documentTree.getRoot().getChildren().addAll(buildEntries(documentData.getDocumentStructure().getRoot().getChildrenList(), context));
|
||||||
|
|
||||||
document.setDocumentTree(context.documentTree);
|
document.setDocumentTree(context.documentTree);
|
||||||
@ -227,7 +222,10 @@ public class DocumentGraphMapper {
|
|||||||
Context(DocumentData documentData, DocumentTree documentTree) {
|
Context(DocumentData documentData, DocumentTree documentTree) {
|
||||||
|
|
||||||
this.documentTree = documentTree;
|
this.documentTree = documentTree;
|
||||||
this.pageData = new ArrayList<>();
|
this.pageData = documentData.getDocumentPages().getDocumentPagesList()
|
||||||
|
.stream()
|
||||||
|
.map(DocumentGraphMapper::buildPage)
|
||||||
|
.toList();
|
||||||
this.documentTextData = documentData.getDocumentTextData();
|
this.documentTextData = documentData.getDocumentTextData();
|
||||||
this.documentPositionData = documentData.getDocumentPositionData();
|
this.documentPositionData = documentData.getDocumentPositionData();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user