1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.kuali.ole.pdp.service.impl;
21
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25
26 import org.kuali.ole.pdp.PdpPropertyConstants;
27 import org.kuali.ole.pdp.businessobject.CustomerProfile;
28 import org.kuali.ole.pdp.service.CustomerProfileService;
29 import org.kuali.rice.krad.service.BusinessObjectService;
30 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
31 import org.springframework.transaction.annotation.Transactional;
32
33 @Transactional
34 public class CustomerProfileServiceImpl implements CustomerProfileService {
35 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CustomerProfileServiceImpl.class);
36
37 private BusinessObjectService businessObjectService;
38
39 public CustomerProfile get(String chartCode, String unitCode, String subUnitCode) {
40 Map fieldValues = new HashMap();
41
42 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_CHART_CODE, chartCode);
43 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_UNIT_CODE, unitCode);
44 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_SUB_UNIT_CODE, subUnitCode);
45 List customerProfileList = (List) KRADServiceLocatorWeb.getLegacyDataAdapter().findMatching(CustomerProfile.class, fieldValues);
46 if (customerProfileList.isEmpty()) return null;
47
48 return (CustomerProfile) customerProfileList.get(0);
49 }
50
51
52
53
54
55
56 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
57 this.businessObjectService = businessObjectService;
58 }
59 }