Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit c24e74c

Browse files
committed
BulkSupport for 1.2 RC1
1 parent 2d44e0f commit c24e74c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/main/java/org/energyos/espi/common/service/impl/ExportServiceImpl.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,14 +665,20 @@ public void exportBatchSubscription(Long subscriptionId,
665665
@Override
666666
public void exportBatchBulk(Long bulkId, String thirdParty, OutputStream outputStream,
667667
ExportFilter exportFilter) throws IOException {
668-
// TODO Work with bulkService rather than subscriptionService
668+
669669
String hrefFragment = "/Batch/Bulk/" + bulkId;
670-
List<Long> subscriptions = new ArrayList<Long> ();
670+
List<Long> usagePoints = new ArrayList<Long> ();
671671
List<Long> authorizations = authorizationService.findAllIdsByBulkId(thirdParty, bulkId);
672+
672673
for (Long authorizationId : authorizations) {
673-
subscriptions.add((subscriptionService.findByAuthorizationId(authorizationId)).getId());
674+
Subscription subscription = subscriptionService.findByAuthorizationId(authorizationId);
675+
for (UsagePoint up : subscription.getUsagePoints()) {
676+
usagePoints.add(up.getId());
677+
}
678+
674679
}
675-
exportEntriesFull(subscriptionService.findEntryTypeIterator(subscriptions),
680+
681+
exportEntriesFull(resourceService.findEntryTypeIterator(usagePoints, UsagePoint.class),
676682
outputStream, exportFilter, hrefFragment);
677683
}
678684

0 commit comments

Comments
 (0)