01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.labor.service.impl;
17:
18: import java.util.List;
19: import java.util.Map;
20:
21: import org.kuali.module.labor.bo.AccountStatusBaseFunds;
22: import org.kuali.module.labor.dao.LaborBaseFundsDao;
23: import org.kuali.module.labor.service.LaborBaseFundsService;
24: import org.kuali.module.labor.service.LaborCalculatedSalaryFoundationTrackerService;
25: import org.springframework.transaction.annotation.Transactional;
26:
27: /**
28: * This class provides its clients with access to labor base fund entries in the backend data store.
29: *
30: * @see org.kuali.module.labor.bo.AccountStatusBaseFunds
31: */
32: @Transactional
33: public class LaborBaseFundsServiceImpl implements LaborBaseFundsService {
34: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
35: .getLogger(LaborBaseFundsServiceImpl.class);
36:
37: private LaborBaseFundsDao laborBaseFundsDao;
38: private LaborCalculatedSalaryFoundationTrackerService laborCalculatedSalaryFoundationTrackerService;
39:
40: /**
41: * @see org.kuali.module.labor.service.LaborBaseFundsService#findLaborBaseFunds(java.util.Map, boolean)
42: */
43: public List<AccountStatusBaseFunds> findLaborBaseFunds(
44: Map fieldValues, boolean isConsolidated) {
45: return laborBaseFundsDao.findLaborBaseFunds(fieldValues,
46: isConsolidated);
47: }
48:
49: /**
50: * @see org.kuali.module.labor.service.LaborBaseFundsService#findAccountStatusBaseFundsAndCSFTracker(java.util.Map, boolean)
51: */
52: public List<AccountStatusBaseFunds> findAccountStatusBaseFundsWithCSFTracker(
53: Map fieldValues, boolean isConsolidated) {
54: List<AccountStatusBaseFunds> baseFundsCollection = this
55: .findLaborBaseFunds(fieldValues, isConsolidated);
56: List<AccountStatusBaseFunds> CSFTrackersCollection = laborCalculatedSalaryFoundationTrackerService
57: .findCSFTrackersAsAccountStatusBaseFunds(fieldValues,
58: isConsolidated);
59:
60: for (AccountStatusBaseFunds CSFTracker : CSFTrackersCollection) {
61: if (baseFundsCollection.contains(CSFTracker)) {
62: int index = baseFundsCollection.indexOf(CSFTracker);
63: baseFundsCollection.get(index).setCsfAmount(
64: CSFTracker.getCsfAmount());
65: } else {
66: baseFundsCollection.add(CSFTracker);
67: }
68: }
69: return baseFundsCollection;
70: }
71:
72: /**
73: * Sets the laborBaseFundsDao attribute value.
74: *
75: * @param laborBaseFundsDao The laborBaseFundsDao to set.
76: */
77: public void setLaborBaseFundsDao(LaborBaseFundsDao laborBaseFundsDao) {
78: this .laborBaseFundsDao = laborBaseFundsDao;
79: }
80:
81: /**
82: * Sets the laborCalculatedSalaryFoundationTrackerService attribute value.
83: *
84: * @param laborCalculatedSalaryFoundationTrackerService The laborCalculatedSalaryFoundationTrackerService to set.
85: */
86: public void setLaborCalculatedSalaryFoundationTrackerService(
87: LaborCalculatedSalaryFoundationTrackerService laborCalculatedSalaryFoundationTrackerService) {
88: this.laborCalculatedSalaryFoundationTrackerService = laborCalculatedSalaryFoundationTrackerService;
89: }
90: }
|