update pom and fix status

This commit is contained in:
CITE\amentis 2024-09-24 15:03:31 +03:00
parent f0db67d3e0
commit 604ec09f78
2 changed files with 7 additions and 7 deletions

View File

@ -217,16 +217,16 @@ public class WordFileTransformerService implements FileTransformerClient {
buildPlanSectionField(planEntity, document, fieldModel); buildPlanSectionField(planEntity, document, fieldModel);
} }
} }
final boolean isFinalized = planEntity.getStatus() != null && planEntity.getStatus().equals(PlanStatus.Finalized); final boolean isFinalized = planEntity.getStatus() != null && planEntity.getStatus().getInternalStatus() != null && planEntity.getStatus().getInternalStatus().equals(PlanStatus.Finalized);
final boolean isPublic = planEntity.getPublicAfter() != null && planEntity.getPublicAfter().isAfter(Instant.now()); final boolean isPublic = planEntity.getPublicAfter() != null && planEntity.getPublicAfter().isAfter(Instant.now());
List<DescriptionModel> descriptions = planEntity.getDescriptions() == null ? new ArrayList<>() : planEntity.getDescriptions().stream() List<DescriptionModel> descriptions = planEntity.getDescriptions() == null ? new ArrayList<>() : planEntity.getDescriptions().stream()
.filter(item -> item.getStatus() != DescriptionStatus.Canceled) .filter(item -> item.getStatus()!= null && item.getStatus().getInternalStatus() != null && item.getStatus().getInternalStatus() != DescriptionStatus.Canceled)
.filter(item -> !isPublic && !isFinalized || item.getStatus() == DescriptionStatus.Finalized) .filter(item -> !isPublic && !isFinalized || (item.getStatus().getInternalStatus() != null && item.getStatus().getInternalStatus() == DescriptionStatus.Finalized))
.filter(item -> item.getSectionId().equals(sectionModel.getId())) .filter(item -> item.getSectionId().equals(sectionModel.getId()))
.sorted(Comparator.comparing(DescriptionModel::getCreatedAt)).toList(); .sorted(Comparator.comparing(DescriptionModel::getCreatedAt)).toList();
if (!descriptions.isEmpty()) { if (!descriptions.isEmpty()) {
buildSectionDescriptions(document, descriptions); buildSectionDescriptions(document, descriptions);
} }

View File

@ -27,7 +27,7 @@
<dependency> <dependency>
<groupId>org.opencdmp</groupId> <groupId>org.opencdmp</groupId>
<artifactId>file-transformer-base</artifactId> <artifactId>file-transformer-base</artifactId>
<version>0.0.24</version> <version>0.0.25</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>