diff --git a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/service/OleDeliverRequestDocumentHelperServiceImpl.java b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/service/OleDeliverRequestDocumentHelperServiceImpl.java index 449df4ef3a..f299d61aa3 100644 --- a/ole-app/olefs/src/main/java/org/kuali/ole/deliver/service/OleDeliverRequestDocumentHelperServiceImpl.java +++ b/ole-app/olefs/src/main/java/org/kuali/ole/deliver/service/OleDeliverRequestDocumentHelperServiceImpl.java @@ -1721,6 +1721,22 @@ else if(oleDeliverRequestBoList.get(i).getHoldExpirationDate() != null && oleDe } } } + else { + if (oleDeliverRequestBoList.get(i).getHoldExpirationDate() == null && oleDeliverRequestBoList.get(i).getRequestExpiryDate() != null && + fmt.format(oleDeliverRequestBoList.get(i).getRequestExpiryDate()).compareTo(fmt.format(new Date(System.currentTimeMillis()))) < 0) { + deleteRequest(oleDeliverRequestBoList.get(i).getRequestId(), oleDeliverRequestBoList.get(i).getItemUuid(), oleDeliverRequestBoList.get(i).getOperatorCreateId(), oleDeliverRequestBoList.get(i).getLoanTransactionRecordNumber(), ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.REQUEST_EXPIRED)); + } + else if (oleDeliverRequestBoList.get(i).getHoldExpirationDate() != null && + (fmt.format(oleDeliverRequestBoList.get(i).getHoldExpirationDate())).compareTo(fmt.format(new Date(System.currentTimeMillis()))) < 0) { + deleteRequest(oleDeliverRequestBoList.get(i).getRequestId(), oleDeliverRequestBoList.get(i).getItemUuid(), oleDeliverRequestBoList.get(i).getOperatorCreateId(), oleDeliverRequestBoList.get(i).getLoanTransactionRecordNumber(), ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.REQUEST_EXPIRED)); + } + else if(oleDeliverRequestBoList.get(i).getHoldExpirationDate() != null && oleDeliverRequestBoList.get(i).getRequestExpiryDate() != null) { + if((fmt.format(oleDeliverRequestBoList.get(i).getRequestExpiryDate()).compareTo(fmt.format(new Date(System.currentTimeMillis()))) < 0) && + (fmt.format(oleDeliverRequestBoList.get(i).getHoldExpirationDate()).compareTo(fmt.format(new Date(System.currentTimeMillis()))) < 0)) { + deleteRequest(oleDeliverRequestBoList.get(i).getRequestId(), oleDeliverRequestBoList.get(i).getItemUuid(), oleDeliverRequestBoList.get(i).getOperatorCreateId(), oleDeliverRequestBoList.get(i).getLoanTransactionRecordNumber(), ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.REQUEST_EXPIRED)); + } + } + } } catch (Exception e) { LOG.info("Exception occured while deleting the request with request Id : " + oleDeliverRequestBoList.get(i).getRequestId());