use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksSupplierDiversityMapDatabaseRow in project cu-kfs by CU-CommunityApps.
the class KfsSupplierDiversityDaoJdbc method buildPmwToKfsSupplierDiversityMap.
@Override
public Map<String, SupplierDiversity> buildPmwToKfsSupplierDiversityMap() {
Map<String, SupplierDiversity> pmwToKfsDiversityMap = new HashMap<String, SupplierDiversity>();
List<PaymentWorksSupplierDiversityMapDatabaseRow> pmwToKfsDiversityDatabaseRows = findActiveSupplierDiversitiesForMap();
if (ObjectUtils.isNotNull(pmwToKfsDiversityDatabaseRows) && !pmwToKfsDiversityDatabaseRows.isEmpty()) {
ListIterator<PaymentWorksSupplierDiversityMapDatabaseRow> kfsDiversityValueDatabaseRowsIterator = pmwToKfsDiversityDatabaseRows.listIterator();
while (kfsDiversityValueDatabaseRowsIterator.hasNext()) {
PaymentWorksSupplierDiversityMapDatabaseRow pmwToKfsSupplierDiversityRow = kfsDiversityValueDatabaseRowsIterator.next();
String mapKey = pmwToKfsSupplierDiversityRow.getPmwSupplierDiversityDescription();
SupplierDiversity mapValue = new SupplierDiversity();
mapValue.setVendorSupplierDiversityCode(pmwToKfsSupplierDiversityRow.getKfsSupplierDiversityCode());
mapValue.setVendorSupplierDiversityDescription(pmwToKfsSupplierDiversityRow.getKfsSupplierDiversityDescription());
mapValue.setActive(true);
pmwToKfsDiversityMap.put(mapKey, mapValue);
}
}
for (String key : pmwToKfsDiversityMap.keySet()) {
SupplierDiversity value = pmwToKfsDiversityMap.get(key);
LOG.info("buildPmwToKfsSupplierDiversityMap: key: pmwDiversityDescription = " + key + " value: kfsDiversityCode = " + value.getVendorSupplierDiversityCode() + " kfsDiversityDescription = " + value.getVendorSupplierDiversityDescription());
}
return pmwToKfsDiversityMap;
}
use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksSupplierDiversityMapDatabaseRow in project cu-kfs by CU-CommunityApps.
the class KfsSupplierDiversityDaoJdbc method findActiveSupplierDiversitiesForMap.
private List<PaymentWorksSupplierDiversityMapDatabaseRow> findActiveSupplierDiversitiesForMap() {
try {
RowMapper<PaymentWorksSupplierDiversityMapDatabaseRow> mapRow = new RowMapper<PaymentWorksSupplierDiversityMapDatabaseRow>() {
public PaymentWorksSupplierDiversityMapDatabaseRow mapRow(ResultSet resultSet, int rowNumber) throws SQLException {
PaymentWorksSupplierDiversityMapDatabaseRow pmwToKfsSupplierDiversity = new PaymentWorksSupplierDiversityMapDatabaseRow();
pmwToKfsSupplierDiversity.setKfsSupplierDiversityCode(resultSet.getString(KFS_SUPP_DVRST_CD_COL));
pmwToKfsSupplierDiversity.setKfsSupplierDiversityDescription(resultSet.getString(KFS_SUPP_DVRST_DESC_COL));
pmwToKfsSupplierDiversity.setPmwSupplierDiversityDescription(resultSet.getString(PMW_SUPP_DVRST_DESC_COL));
return pmwToKfsSupplierDiversity;
}
};
return this.getJdbcTemplate().query(KFS_SUPPLIER_DIVERSITY_SQL, mapRow);
} catch (Exception e) {
LOG.info("findActiveSupplierDiversitiesForMap Exception: " + e.getMessage());
return null;
}
}
Aggregations