1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.service.impl;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.kuali.ole.coa.businessobject.SubObjectCode;
22 import org.kuali.ole.coa.service.SubObjectCodeService;
23 import org.kuali.ole.sys.OLEPropertyConstants;
24 import org.kuali.ole.sys.context.SpringContext;
25 import org.kuali.ole.sys.service.NonTransactional;
26 import org.kuali.ole.sys.service.UniversityDateService;
27 import org.kuali.rice.krad.service.BusinessObjectService;
28
29
30
31
32
33
34 @NonTransactional
35 public class SubObjectCodeServiceImpl implements SubObjectCodeService {
36 private UniversityDateService universityDateService;
37
38
39
40
41
42 public SubObjectCode getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode) {
43
44 Map<String, Object> keys = new HashMap<String, Object>();
45 keys.put(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR, universityFiscalYear);
46 keys.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
47 keys.put(OLEPropertyConstants.ACCOUNT_NUMBER, accountNumber);
48 keys.put(OLEPropertyConstants.FINANCIAL_OBJECT_CODE, financialObjectCode);
49 keys.put(OLEPropertyConstants.FINANCIAL_SUB_OBJECT_CODE, financialSubObjectCode);
50 return (SubObjectCode)SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(SubObjectCode.class, keys);
51 }
52
53
54
55
56
57 public SubObjectCode getByPrimaryIdForCurrentYear(String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode) {
58 return this.getByPrimaryId(universityDateService.getCurrentFiscalYear(), chartOfAccountsCode, accountNumber, financialObjectCode, financialSubObjectCode);
59 }
60
61
62
63
64
65
66 public void setUniversityDateService(UniversityDateService universityDateService) {
67 this.universityDateService = universityDateService;
68 }
69 }