001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.pdp.service.impl;
017:
018: import java.sql.Date;
019: import java.sql.Timestamp;
020: import java.util.Iterator;
021: import java.util.List;
022:
023: import org.kuali.module.pdp.bo.PaymentGroup;
024: import org.kuali.module.pdp.bo.PaymentProcess;
025: import org.kuali.module.pdp.dao.PaymentGroupDao;
026: import org.kuali.module.pdp.service.PaymentGroupService;
027: import org.springframework.transaction.annotation.Transactional;
028:
029: @Transactional
030: public class PaymentGroupServiceImpl implements PaymentGroupService {
031: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
032: .getLogger(PaymentGroupServiceImpl.class);
033:
034: private PaymentGroupDao paymentGroupDao;
035:
036: public void setPaymentGroupDao(PaymentGroupDao c) {
037: paymentGroupDao = c;
038: }
039:
040: /**
041: * @see org.kuali.module.pdp.service.PaymentGroupService#getDisbursementNumbersByDisbursementType(java.lang.Integer, java.lang.String)
042: */
043: public List<Integer> getDisbursementNumbersByDisbursementType(
044: Integer pid, String disbursementType) {
045: LOG.debug("getDisbursementNumbersByDisbursementType() started");
046:
047: return paymentGroupDao
048: .getDisbursementNumbersByDisbursementType(pid,
049: disbursementType);
050: }
051:
052: /**
053: * @see org.kuali.module.pdp.service.PaymentGroupService#getByDisbursementTypeStatusCode(java.lang.String, java.lang.String)
054: */
055: public Iterator getByDisbursementTypeStatusCode(
056: String disbursementType, String paymentStatusCode) {
057: LOG.debug("getByDisbursementTypeStatusCode() started");
058:
059: return paymentGroupDao.getByDisbursementTypeStatusCode(
060: disbursementType, paymentStatusCode);
061: }
062:
063: /**
064: * @see org.kuali.module.pdp.service.PaymentGroupService#getByProcessId(java.lang.Integer)
065: */
066: public Iterator getByProcessId(Integer pid) {
067: LOG.debug("getByProcessId() started");
068:
069: return paymentGroupDao.getByProcessId(pid);
070: }
071:
072: /**
073: * @see org.kuali.module.pdp.service.PaymentGroupService#getByProcess(org.kuali.module.pdp.bo.PaymentProcess)
074: */
075: public Iterator getByProcess(PaymentProcess p) {
076: LOG.debug("getByProcess() started");
077:
078: return paymentGroupDao.getByProcess(p);
079: }
080:
081: /**
082: * @see org.kuali.module.pdp.service.PaymentGroupService#save(org.kuali.module.pdp.bo.PaymentGroup)
083: */
084: public void save(PaymentGroup pg) {
085: LOG.debug("save() started");
086:
087: paymentGroupDao.save(pg);
088: }
089:
090: /**
091: * @see org.kuali.module.pdp.service.PaymentGroupService#get(java.lang.Integer)
092: */
093: public PaymentGroup get(Integer id) {
094: LOG.debug("get() started");
095:
096: return paymentGroupDao.get(id);
097: }
098:
099: /**
100: * @see org.kuali.module.pdp.service.PaymentGroupService#getByBatchId(java.lang.Integer)
101: */
102: public List getByBatchId(Integer batchId) {
103: LOG.debug("getByBatchId() started");
104:
105: return paymentGroupDao.getByBatchId(batchId);
106: }
107:
108: /**
109: * @see org.kuali.module.pdp.service.PaymentGroupService#getByDisbursementNumber(java.lang.Integer)
110: */
111: public List getByDisbursementNumber(Integer disbursementNbr) {
112: LOG.debug("getByDisbursementNumber() started");
113:
114: return paymentGroupDao.getByDisbursementNumber(disbursementNbr);
115: }
116:
117: /**
118: * @see org.kuali.module.pdp.service.PaymentGroupService#processPaidGroup(org.kuali.module.pdp.bo.PaymentGroup, java.sql.Date)
119: */
120: public void processPaidGroup(PaymentGroup group, Date processDate) {
121: LOG.debug("processPaidGroup() started");
122:
123: Timestamp ts = new Timestamp(processDate.getTime());
124: group.setEpicPaymentPaidExtractedDate(ts);
125: group.setLastUpdate(ts);
126: paymentGroupDao.save(group);
127: }
128:
129: /**
130: * @see org.kuali.module.pdp.service.PaymentGroupService#processCancelledGroup(org.kuali.module.pdp.bo.PaymentGroup,
131: * java.sql.Date)
132: */
133: public void processCancelledGroup(PaymentGroup group,
134: Date processDate) {
135: LOG.debug("processCancelledGroup() started");
136:
137: Timestamp ts = new Timestamp(processDate.getTime());
138: group.setEpicPaymentCancelledExtractedDate(ts);
139: group.setLastUpdate(ts);
140: paymentGroupDao.save(group);
141: }
142: }
|