diff --git a/redaction-report-service-v1/pom.xml b/redaction-report-service-v1/pom.xml
index 64b5469..70b59ae 100644
--- a/redaction-report-service-v1/pom.xml
+++ b/redaction-report-service-v1/pom.xml
@@ -24,7 +24,7 @@
- 2.197.0
+ 2.198.0
5.2.3
diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/pom.xml b/redaction-report-service-v1/redaction-report-service-server-v1/pom.xml
index 185abc0..5b0ccf0 100644
--- a/redaction-report-service-v1/redaction-report-service-server-v1/pom.xml
+++ b/redaction-report-service-v1/redaction-report-service-server-v1/pom.xml
@@ -86,7 +86,7 @@
com.iqser.red.service
- persistence-service-external-api-v2
+ persistence-service-internal-api-v1
${persistence-service.version}
diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/client/ComponentClient.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/client/ComponentClient.java
index be0d519..334b19c 100644
--- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/client/ComponentClient.java
+++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/client/ComponentClient.java
@@ -2,9 +2,9 @@ package com.iqser.red.service.redaction.report.v1.server.client;
import org.springframework.cloud.openfeign.FeignClient;
-import com.iqser.red.service.persistence.service.v2.api.external.resource.ComponentResource;
+import com.iqser.red.service.persistence.service.v1.api.internal.resources.InternalComponentResource;
-@FeignClient(name = "ComponentResource", url = "${persistence-service.url}")
-public interface ComponentClient extends ComponentResource {
+@FeignClient(name = "InternalComponentResource", url = "${persistence-service.url}")
+public interface ComponentClient extends InternalComponentResource {
}
diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ComponentRowsReportService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ComponentRowsReportService.java
index ea0ecac..c0e76d4 100644
--- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ComponentRowsReportService.java
+++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ComponentRowsReportService.java
@@ -3,12 +3,13 @@ package com.iqser.red.service.redaction.report.v1.server.service;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.stereotype.Service;
+import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileAttributeConfig;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileModel;
-import com.iqser.red.service.persistence.service.v2.api.external.model.FileComponents;
import com.iqser.red.service.redaction.report.v1.server.client.ComponentClient;
import com.iqser.red.service.redaction.report.v1.server.client.FileAttributesConfigClient;
import com.iqser.red.service.redaction.report.v1.server.model.ExcelModel;
@@ -25,44 +26,33 @@ public class ComponentRowsReportService {
ComponentClient componentResource;
FileAttributesConfigClient fileAttributesClient;
- static int FILENAME_COL = 0;
- static int COMPONENT_NAME_COL = 1;
- static int COMPONENT_VALUE_COL = 2;
+ static int COMPONENT_NAME_COL = 0;
+ static int COMPONENT_VALUE_STARTING_COL = 1;
public void addComponentRows(Sheet sheet, FileModel fileModel, ExcelModel excelModel) {
- FileComponents fileComponents = componentResource.getComponents(fileModel.getDossierTemplateId(), fileModel.getDossierId(), fileModel.getId(), false);
+ ComponentLog componentLog = componentResource.getComponentLog(fileModel.getDossierId(), fileModel.getId(), true);
AtomicInteger rowIndex = new AtomicInteger(excelModel.getRedactionPlaceholderRow());
String oecd = getOecdNumber(fileModel);
- int fileNameRow = rowIndex.getAndIncrement();
- sheet.createRow(fileNameRow);
- excelModel.getWrittenRows().add(fileNameRow);
- Cell fileNameCell = sheet.getRow(fileNameRow).createCell(FILENAME_COL);
- fileNameCell.setCellValue(fileComponents.getFilename() + "-" + oecd);
- fileComponents.getComponents().forEach((componentName, values) -> {
+ componentLog.getComponentLogEntries().forEach(componentLogEntry -> {
- if (values.isEmpty()) {
+ if (componentLogEntry.getComponentValues().isEmpty()) {
return;
}
- int componentNameRow = rowIndex.getAndIncrement();
- sheet.createRow(componentNameRow);
- excelModel.getWrittenRows().add(componentNameRow);
+ int componentRowIdx = rowIndex.getAndIncrement();
+ Row componentRow = sheet.createRow(componentRowIdx);
+ excelModel.getWrittenRows().add(componentRowIdx);
- Cell componentNameCell = sheet.getRow(componentNameRow).createCell(COMPONENT_NAME_COL);
- componentNameCell.setCellValue(componentName.replaceAll("_", " "));
+ Cell componentNameCell = componentRow.createCell(COMPONENT_NAME_COL);
+ componentNameCell.setCellValue(oecd + "-" + componentLogEntry.getName().replaceAll("_", " "));
- Cell valueCell = sheet.getRow(componentNameRow).createCell(COMPONENT_VALUE_COL);
- valueCell.setCellValue(values.get(0));
-
- for (String value : values.subList(1, values.size())) {
- int additionalValueRow = rowIndex.getAndIncrement();
- Cell additionalValueCell = sheet.createRow(additionalValueRow).createCell(COMPONENT_VALUE_COL);
- excelModel.getWrittenRows().add(additionalValueRow);
- additionalValueCell.setCellValue(value);
+ for (int valueIdx = 0; valueIdx < componentLogEntry.getComponentValues().size(); valueIdx++) {
+ String value = componentLogEntry.getComponentValues().get(valueIdx).getValue();
+ componentRow.createCell(COMPONENT_VALUE_STARTING_COL + valueIdx).setCellValue(value);
}
});