use of org.kuali.kfs.vnd.businessobject.SupplierDiversity in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImpl method createVendorSupplierDiversityForDropDownData.
private VendorSupplierDiversity createVendorSupplierDiversityForDropDownData(String pmwDiversityStatusDescription, String pmwDiversityCertifiedExpirationDate, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap) {
VendorSupplierDiversity kfsVendorVendorSupplierDiversity = null;
if (ObjectUtils.isNotNull(pmwDiversityStatusDescription) && paymentWorksToKfsDiversityMap.containsKey(pmwDiversityStatusDescription)) {
SupplierDiversity supplierDiversityFromMap = paymentWorksToKfsDiversityMap.get(pmwDiversityStatusDescription);
java.sql.Date expirationDate = null;
if (StringUtils.containsIgnoreCase(pmwDiversityStatusDescription, PaymentWorksConstants.DIVERSITY_EXPIRATION_DATE_CERTIFIED) && (ObjectUtils.isNotNull(pmwDiversityCertifiedExpirationDate))) {
try {
SimpleDateFormat userEnteredDateFormat = new SimpleDateFormat(KFSConstants.MONTH_DAY_YEAR_DATE_FORMAT);
java.util.Date userEnteredDate = userEnteredDateFormat.parse(pmwDiversityCertifiedExpirationDate);
expirationDate = new java.sql.Date(userEnteredDate.getTime());
} catch (ParseException pe) {
LOG.info("createVendorSupplierDiversityForDropDownData: ParseException caught while attempting to create VendorSupplierDiversity object for PaymentWorks diveristy " + pmwDiversityStatusDescription + " with PaymentWorks user entered certified expiration date value of " + pmwDiversityCertifiedExpirationDate + ". Setting diversity expiration date to one year from today.");
expirationDate = addOneYearToDate(getDateTimeService().getCurrentDate());
}
} else {
expirationDate = addOneYearToDate(getDateTimeService().getCurrentDate());
}
kfsVendorVendorSupplierDiversity = buildVendorSupplierDiversity(supplierDiversityFromMap.getVendorSupplierDiversityCode(), expirationDate);
}
return kfsVendorVendorSupplierDiversity;
}
use of org.kuali.kfs.vnd.businessobject.SupplierDiversity in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImpl method buildVendorDiversitiesFromPmwFormCheckboxes.
private List<VendorSupplierDiversity> buildVendorDiversitiesFromPmwFormCheckboxes(PaymentWorksVendor pmwVendor, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap, List<VendorSupplierDiversity> kfsVendorSupplierDiversities) {
ArrayList<String> pmwDiversities = new ArrayList<String>(Arrays.asList(pmwVendor.getDiversityClassifications().split("\\s*,\\s*")));
if (!pmwDiversities.isEmpty()) {
for (String pmwDiversity : pmwDiversities) {
if (paymentWorksToKfsDiversityMap.containsKey(pmwDiversity)) {
SupplierDiversity supplierDiversityFromMap = paymentWorksToKfsDiversityMap.get(pmwDiversity);
kfsVendorSupplierDiversities.add(buildVendorSupplierDiversity(supplierDiversityFromMap.getVendorSupplierDiversityCode(), addOneYearToDate(getDateTimeService().getCurrentDate())));
} else {
LOG.info("buildVendorDiversities:: PaymentWorks Vendor : " + pmwVendor.getRequestingCompanyLegalName() + " Diversity Value : " + pmwDiversity + " does not have corresponding KFS SupplierDiversity defined.");
}
}
}
return kfsVendorSupplierDiversities;
}
use of org.kuali.kfs.vnd.businessobject.SupplierDiversity 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;
}
Aggregations