Skip to content

Commit

Permalink
Merge pull request #212 from ResearchCollectionsAndPreservation/stage…
Browse files Browse the repository at this point in the history
…3-dev

Stage3 dev to UAT
  • Loading branch information
mosesjoel authored Aug 28, 2021
2 parents 20311d4 + 7e29ac3 commit 7ae877c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,10 @@ private void checkGfaItemStatus(List<DeAccessionItem> deAccessionItems, List<DeA
if ((StringUtils.isNotBlank(gfaItemStatus) && commonUtil.checkIfImsItemStatusIsRequestableNotRetrievable(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus))) {
deAccessionDBResponseEntities.add(prepareFailureResponse(itemBarcode, deAccessionItem.getDeliveryLocation(), "Cannot Deaccession as Item is awaiting for Refile.Please try again later or contact ReCAP staff for further assistance.", itemEntity));
}
else if (StringUtils.isNotBlank(gfaItemStatus)
else if ((StringUtils.isNotBlank(gfaItemStatus) && !commonUtil.checkIfImsItemIsNotOnFile(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus))
&& ((ScsbCommonConstants.AVAILABLE.equals(scsbItemStatus) && commonUtil.checkIfImsItemStatusIsAvailableOrNotAvailable(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus, true))
|| (ScsbCommonConstants.NOT_AVAILABLE.equals(scsbItemStatus) && commonUtil.checkIfImsItemStatusIsAvailableOrNotAvailable(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus, false)))) {
|| (ScsbCommonConstants.NOT_AVAILABLE.equals(scsbItemStatus) && commonUtil.checkIfImsItemStatusIsAvailableOrNotAvailable(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus, false))
|| commonUtil.checkIfImsItemStatusIsRequestableNotRetrievable(itemEntity.getImsLocationEntity().getImsLocationCode(), gfaItemStatus))) {
barcodeAndStopCodeMap.put(itemBarcode.trim(), deAccessionItem.getDeliveryLocation());
} else {
deAccessionDBResponseEntities.add(prepareFailureResponse(itemBarcode, deAccessionItem.getDeliveryLocation(), MessageFormat.format(ScsbConstants.GFA_ITEM_STATUS_MISMATCH, recapAssistanceEmailTo, recapAssistanceEmailTo), itemEntity));
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/recap/util/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,17 @@ public boolean checkIfImsItemStatusIsRequestableNotRetrievable(String imsLocatio
return StringUtils.isNotBlank(imsItemStatusCodes) && StringUtils.startsWithAny(imsItemStatus, imsItemStatusCodes.split(","));
}

/**
* Checks if the IMS item status is Not on file (Item does not exist)
* @param imsLocationCode IMS Location Code
* @param imsItemStatus IMS Item Status
* @return boolean
*/
public boolean checkIfImsItemIsNotOnFile(String imsLocationCode, String imsItemStatus) {
String imsItemStatusCodes = propertyUtil.getPropertyByImsLocationAndKey(imsLocationCode, PropertyKeyConstants.IMS.IMS_NOT_ON_FILE_ITEM_STATUS_CODES);
return StringUtils.isNotBlank(imsItemStatusCodes) && StringUtils.startsWithAny(imsItemStatus, imsItemStatusCodes.split(","));
}

public ItemRequestInformation getItemRequestInformation(ItemEntity itemEntity) {
ItemRequestInformation itemRequestInformation = new ItemRequestInformation();
itemRequestInformation.setItemBarcodes(Collections.singletonList(itemEntity.getBarcode()));
Expand Down

0 comments on commit 7ae877c

Please sign in to comment.