Skip to content

Commit

Permalink
Merge branch 'PR-1709-dev' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Sep 3, 2024
2 parents f4e650c + 2952ca1 commit e7f8df4
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public RequestItemResponseData performService(RequestItemInitiationData initData
RequestId ncipRequestId = new RequestId();
ItemDescription itemDescription = new ItemDescription();
LocationNameInstance locationNameInstance = new LocationNameInstance();
LocationNameInstance libraryNameInstance = new LocationNameInstance();
UserId optionalUserId = new UserId();
try {
JsonObject requestItemResponseDetails = ((FolioRemoteServiceManager)serviceManager).requestItem(initData);
Expand All @@ -70,17 +71,20 @@ public RequestItemResponseData performService(RequestItemInitiationData initData
String barcode = null;
String callNumber = null;
String locationName = null;
String libraryName = null;
if(requestItemResponseDetails.getJsonObject("item") != null) {
JsonObject item = requestItemResponseDetails.getJsonObject("item");
barcode = item.getString("barcode");
callNumber = item.getString("callNumber");
if (item.getJsonObject("location") != null) {
locationName = item.getJsonObject("location").getString("name") + " : " + item.getJsonObject("location").getString("libraryName");
locationName = item.getJsonObject("location").getString("name");
libraryName = item.getJsonObject("location").getString("libraryName");
}
}
ncipRequestId.setRequestIdentifierValue(assignedRequestId);
itemDescription.setCallNumber(callNumber);
locationNameInstance.setLocationNameValue(locationName);
libraryNameInstance.setLocationNameValue(libraryName);
itemId.setItemIdentifierValue(barcode);
optionalUserId.setUserIdentifierValue(requesterId);
}
Expand All @@ -94,8 +98,9 @@ public RequestItemResponseData performService(RequestItemInitiationData initData
Location location = new Location();
LocationType locationType = new LocationType(Constants.SCHEME, Constants.ITEM);
LocationName locationName = new LocationName();
locationNameInstance.setLocationNameLevel(BigDecimal.ONE);
locationName.setLocationNameInstances(List.of(locationNameInstance));
locationNameInstance.setLocationNameLevel(new BigDecimal(4));
libraryNameInstance.setLocationNameLevel(new BigDecimal(3));
locationName.setLocationNameInstances(List.of(libraryNameInstance, locationNameInstance));
location.setLocationName(locationName);
location.setLocationType(locationType);
ItemOptionalFields itemOptionalFields = new ItemOptionalFields();
Expand Down

0 comments on commit e7f8df4

Please sign in to comment.