Skip to content

Commit

Permalink
Update src/main/java/it/gov/pagopa/payhub/activities/service/treasury…
Browse files Browse the repository at this point in the history
…/TreasuryOpiParserService.java

Co-authored-by: antonioT90 <[email protected]>
  • Loading branch information
domenicogi and antonioT90 authored Jan 7, 2025
1 parent 332925d commit d8dbc0c
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ public TreasuryIufResult parseData(Path treasuryOpiFilePath, IngestionFlowFileDT
.findFirst()
.orElseThrow(() -> new TreasuryOpiInvalidFileException("Cannot parse treasury Opi file " + ingestionFlowFile));

List<TreasuryDTO> stringListMap = op2TreasuriesMap.get(TreasuryOperationEnum.INSERT);
stringListMap.forEach(treasuryDTO -> {
treasuryDao.insert(treasuryDTO);
iufList.add(treasuryDTO.getIuf());
});
List<TreasuryDTO> newTreasuries = op2TreasuriesMap.get(TreasuryOperationEnum.INSERT);
List<String> iufList = stringListMap.stream()
.map(treasuryDTO -> {
treasuryDao.insert(treasuryDTO);
return treasuryDTO.getIuf();
})
.distinct()
.toList();

return new TreasuryIufResult(iufList.stream().toList(), true);
}
Expand Down

0 comments on commit d8dbc0c

Please sign in to comment.