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.springframework.transaction.annotation.Transactional;
31
32 @Transactional
33 public class CustomerProfileServiceImpl implements CustomerProfileService {
34 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CustomerProfileServiceImpl.class);
35
36 private BusinessObjectService businessObjectService;
37
38 public CustomerProfile get(String chartCode, String unitCode, String subUnitCode) {
39 Map fieldValues = new HashMap();
40
41 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_CHART_CODE, chartCode);
42 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_UNIT_CODE, unitCode);
43 fieldValues.put(PdpPropertyConstants.CustomerProfile.CUSTOMER_PROFILE_SUB_UNIT_CODE, subUnitCode);
44 List customerProfileList = (List) this.businessObjectService.findMatching(CustomerProfile.class, fieldValues);
45 if (customerProfileList.isEmpty()) return null;
46
47 return (CustomerProfile) customerProfileList.get(0);
48 }
49
50
51
52
53
54
55 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
56 this.businessObjectService = businessObjectService;
57 }
58 }