Search in sources :

Example 1 with FlatFileInformation

use of org.kuali.kfs.sys.batch.FlatFileInformation in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method copyAllMessage.

private void copyAllMessage(Object parsedObject, PhysicalFlatFileInformation physicalFlatFileInformation) {
    List<AchIncomeFile> achIncomeFiles = (List<AchIncomeFile>) parsedObject;
    for (AchIncomeFile achIncomeFile : achIncomeFiles) {
        FlatFileInformation fileInformation = new FlatFileInformation();
        FlatFileTransactionInformation information = achIncomeFile.getFlatFileTransactionInformation();
        fileInformation.getOrAddFlatFileData(achIncomeFile.getInterchangeControlNumber(), information);
        fileInformation.addFileInfoMessage(achIncomeFile.getEmailMessageText());
        physicalFlatFileInformation.getFlatFileInfomationList().add(fileInformation);
    }
}
Also used : AchIncomeFile(edu.cornell.kfs.fp.businessobject.AchIncomeFile) List(java.util.List) ArrayList(java.util.ArrayList) PhysicalFlatFileInformation(org.kuali.kfs.sys.batch.PhysicalFlatFileInformation) FlatFileInformation(org.kuali.kfs.sys.batch.FlatFileInformation) FlatFileTransactionInformation(org.kuali.kfs.sys.batch.FlatFileTransactionInformation)

Example 2 with FlatFileInformation

use of org.kuali.kfs.sys.batch.FlatFileInformation in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method loadFile.

public boolean loadFile(String fileName, PhysicalFlatFileInformation physicalFlatFileInformation) {
    boolean valid = true;
    byte[] fileByteContent = safelyLoadFileBytes(fileName);
    if (LOG.isInfoEnabled()) {
        LOG.info("Attempting to parse the file ");
    }
    Object parsedObject;
    try {
        parsedObject = batchInputFileService.parse(batchInputFileType, fileByteContent);
    } catch (org.kuali.kfs.sys.exception.ParseException e) {
        LOG.error("Error parsing batch file: " + e.getMessage());
        FlatFileInformation fileInformation = new FlatFileInformation();
        fileInformation.addFileInfoMessage("Unable to process file" + StringUtils.substringAfterLast(fileName, "\\") + "." + e.getMessage());
        physicalFlatFileInformation.getFlatFileInfomationList().add(fileInformation);
        return false;
    }
    if (parsedObject != null) {
        valid = validate(parsedObject);
        copyAllMessage(parsedObject, physicalFlatFileInformation);
        if (valid) {
            loadAchIncomeTransactions(parsedObject);
        }
    }
    return valid;
}
Also used : PhysicalFlatFileInformation(org.kuali.kfs.sys.batch.PhysicalFlatFileInformation) FlatFileInformation(org.kuali.kfs.sys.batch.FlatFileInformation)

Aggregations

FlatFileInformation (org.kuali.kfs.sys.batch.FlatFileInformation)2 PhysicalFlatFileInformation (org.kuali.kfs.sys.batch.PhysicalFlatFileInformation)2 AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 FlatFileTransactionInformation (org.kuali.kfs.sys.batch.FlatFileTransactionInformation)1