Skip to content

Commit

Permalink
[MODORDERS-1209]. Fix sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
BKadirkhodjaev committed Dec 5, 2024
1 parent 285b261 commit d4d605d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/org/folio/service/claiming/ClaimingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private Future<Map<String, List<String>>> groupPieceIdsByVendorId(List<String> p
return Future.succeededFuture();
}
var uniquePiecePoLinePairs = pieces.stream()
.filter(Objects::nonNull).filter(piece -> Objects.nonNull(piece.getId()) & Objects.nonNull(piece.getPoLineId()))
.filter(Objects::nonNull).filter(piece -> Objects.nonNull(piece.getId()) && Objects.nonNull(piece.getPoLineId()))
.map(piece -> Pair.of(piece.getPoLineId(), piece.getId())).distinct()
.toList();
logger.info("groupPieceIdsByVendorId:: Prepared unique piece-poLine pairs, pairs: {}", uniquePiecePoLinePairs);
Expand Down Expand Up @@ -173,7 +173,8 @@ private Future<ClaimingResults> createJobsByVendor(JsonObject config, Map<String
log.info("createJobsByVendor:: Creating jobs by vendor, vendors by pieces count: {}", pieceIdsByVendorId.size());
if (CollectionUtils.isEmpty(pieceIdsByVendorId)) {
logger.info("createJobsByVendor:: No jobs are created, pieceIdsByVendorId is empty");
return Future.succeededFuture(new ClaimingResults().withClaimingPieceResults(createErrorClaimingResults(pieceIdsByVendorId, CANNOT_GROUP_PIECES_BY_VENDOR_MESSAGE)));
return Future.succeededFuture(new ClaimingResults()
.withClaimingPieceResults(createErrorClaimingResults(pieceIdsByVendorId, CANNOT_GROUP_PIECES_BY_VENDOR_MESSAGE)));
}
return collectResultsOnSuccess(createUpdatePiecesAndJobFutures(config, pieceIdsByVendorId, requestContext))
.map(updatedPieceLists -> {
Expand All @@ -193,7 +194,8 @@ private List<Future<List<String>>> createUpdatePiecesAndJobFutures(JsonObject co
pieceIdsByVendorId.forEach((vendorId, pieceIds) -> config.stream()
.filter(entry -> isExportTypeClaimsAndCorrectVendorId(vendorId, entry) && Objects.nonNull(entry.getValue()))
.forEach(entry -> {
logger.info("createJobsByVendor:: Preparing job integration detail for vendor, vendor id: {}, pieces: {}, job key: {}", vendorId, pieceIds.size(), entry.getKey());
logger.info("createJobsByVendor:: Preparing job integration detail for vendor, vendor id: {}, pieces: {}, job key: {}",
vendorId, pieceIds.size(), entry.getKey());
updatePiecesAndJobFutures.add(updatePiecesAndCreateJob(pieceIds, entry, requestContext));
}));
return updatePiecesAndJobFutures;
Expand Down

0 comments on commit d4d605d

Please sign in to comment.