/** * Determines the document had all its records corrected * * @return boolean */ public boolean isDocumentCorrected() { for (BarcodeInventoryErrorDetail detail : this.getBarcodeInventoryErrorDetail()) { if (detail .getErrorCorrectionStatusCode() .equals(CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR)) return false; } return true; }
/** * Invokes several methods that validates each barcode error record * * @param barcodeInventoryErrorDetails * @return boolean */ public boolean validateBarcodeInventoryErrorDetail( BarcodeInventoryErrorDocument document, boolean updateStatus) { String errorPath = ""; boolean valid = true; List<BarcodeInventoryErrorDetail> barcodeInventoryErrorDetails = document.getBarcodeInventoryErrorDetail(); List<BarcodeInventoryErrorDetail> inventory = new ArrayList<BarcodeInventoryErrorDetail>(); Long lineNumber = new Long(0); for (BarcodeInventoryErrorDetail barcodeInventoryErrorDetail : barcodeInventoryErrorDetails) { barcodeInventoryErrorDetail.setErrorDescription(""); if (barcodeInventoryErrorDetail .getErrorCorrectionStatusCode() .equals(CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR)) { valid = true; errorPath = CamsConstants.DOCUMENT_PATH + "." + CamsPropertyConstants.BarcodeInventory.BARCODE_INVENTORY_DETAIL + "[" + (lineNumber.intValue()) + "]"; GlobalVariables.getMessageMap().addToErrorPath(errorPath); Asset asset = validateTagNumberAndRetrieveActiveAsset( barcodeInventoryErrorDetail.getAssetTagNumber()); valid &= ObjectUtils.isNotNull(asset); valid &= this.validateCampusCode( barcodeInventoryErrorDetail.getCampusCode(), barcodeInventoryErrorDetail); if (ObjectUtils.isNotNull(asset)) { valid &= this.validateBuildingCodeAndRoomNumber(barcodeInventoryErrorDetail, asset); } // valid &= this.validateBuildingCode(barcodeInventoryErrorDetail.getBuildingCode(), // barcodeInventoryErrorDetail, asset); // valid &= // this.validateBuildingRoomNumber(barcodeInventoryErrorDetail.getBuildingRoomNumber(), // barcodeInventoryErrorDetail, asset); valid &= this.validateConditionCode( barcodeInventoryErrorDetail.getAssetConditionCode(), barcodeInventoryErrorDetail); valid &= this.validateInventoryDate(barcodeInventoryErrorDetail.getUploadScanTimestamp()); valid &= this.validateTaggingLock( barcodeInventoryErrorDetail.getAssetTagNumber(), document.getDocumentNumber()); if (!valid) { barcodeInventoryErrorDetail.setErrorCorrectionStatusCode( CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR); // Getting the errors from GlobalVariables. barcodeInventoryErrorDetail.setErrorDescription(getErrorMessages(errorPath)); } else { if (updateStatus) { barcodeInventoryErrorDetail.setErrorCorrectionStatusCode( CamsConstants.BarCodeInventoryError.STATUS_CODE_CORRECTED); } barcodeInventoryErrorDetail.setErrorDescription("NONE"); } GlobalVariables.getMessageMap().removeFromErrorPath(errorPath); } lineNumber++; } /* * Since this document displays the asset lock error messages on the error description field, we don't want to display the * same message at the top of the document. Therefore, deleteLockErrorMessages method deletes such errors from the * GlobalVariables object. */ deleteLockErrorMessages(); return true; }