1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.dataaccess.impl;
17
18 import org.kuali.ole.module.purap.dataaccess.StatusCodeAndDescriptionForPurapDocumentsDao;
19 import org.kuali.rice.core.framework.persistence.jdbc.dao.PlatformAwareDaoBaseJdbc;
20 import org.springframework.dao.DataAccessException;
21 import org.springframework.jdbc.support.rowset.SqlRowSet;
22
23 import java.util.HashMap;
24 import java.util.Map;
25
26
27
28
29 public class StatusCodeAndDescriptionForPurapDocumentsDaoJdbc extends PlatformAwareDaoBaseJdbc implements StatusCodeAndDescriptionForPurapDocumentsDao {
30 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(StatusCodeAndDescriptionForPurapDocumentsDaoJdbc.class);
31
32
33
34
35 public Map<String, String> getRequisitionDocumentStatuses() {
36 LOG.debug("getRequisitionDocumentStatuses() started");
37
38 Map<String, String> requistionStatuses = new HashMap<String, String>();
39
40 try {
41 SqlRowSet statusesRowSet = getJdbcTemplate().queryForRowSet("SELECT * FROM PUR_REQS_STAT_T ORDER BY REQS_STAT_CD");
42
43 while (statusesRowSet.next()) {
44 requistionStatuses.put(statusesRowSet.getString("REQS_STAT_CD"), statusesRowSet.getString("REQS_STAT_DESC"));
45 }
46
47 LOG.debug("getRequisitionDocumentStatuses() exited");
48
49 return requistionStatuses;
50 } catch (DataAccessException dae) {
51 return requistionStatuses;
52 }
53 }
54
55
56
57
58 public Map<String, String> getPurchaseOrderDocumentStatuses() {
59 LOG.debug("getPurchaseOrderDocumentStatuses() started");
60
61 Map<String, String> purchaseOrderStatuses = new HashMap<String, String>();
62 try {
63 SqlRowSet statusesRowSet = getJdbcTemplate().queryForRowSet("SELECT * FROM PUR_PO_STAT_T ORDER BY PO_STAT_CD");
64
65 while (statusesRowSet.next()) {
66 purchaseOrderStatuses.put(statusesRowSet.getString("PO_STAT_CD"), statusesRowSet.getString("PO_STAT_DESC"));
67 }
68
69 LOG.debug("getPurchaseOrderDocumentStatuses() exited");
70
71 return purchaseOrderStatuses;
72 } catch (DataAccessException dae) {
73 return purchaseOrderStatuses;
74 }
75 }
76
77
78
79
80 public Map<String, String> getPaymentRequestDocumentStatuses() {
81 LOG.debug("getPaymentRequestDocumentStatuses() started");
82
83 Map<String, String> paymentRequestStatuses = new HashMap<String, String>();
84
85 try {
86 SqlRowSet statusesRowSet = getJdbcTemplate().queryForRowSet("SELECT * FROM AP_PMT_RQST_STAT_T ORDER BY PMT_RQST_STAT_CD");
87
88 while (statusesRowSet.next()) {
89 paymentRequestStatuses.put(statusesRowSet.getString("PMT_RQST_STAT_CD"), statusesRowSet.getString("PMT_RQST_STAT_DESC"));
90 }
91
92 LOG.debug("getPaymentRequestDocumentStatuses() exited");
93
94 return paymentRequestStatuses;
95 } catch (DataAccessException dae) {
96 return paymentRequestStatuses;
97 }
98 }
99
100
101
102
103 public Map<String, String> getVendorCreditMemoDocumentStatuses() {
104 LOG.debug("getVendorCreditMemoDocumentStatuses() started");
105
106 Map<String, String> vendorCreditMemoStatuses = new HashMap<String, String>();
107
108 try {
109 SqlRowSet statusesRowSet = getJdbcTemplate().queryForRowSet("SELECT * FROM AP_CRDT_MEMO_STAT_T ORDER BY CRDT_MEMO_STAT_CD");
110
111 while (statusesRowSet.next()) {
112 vendorCreditMemoStatuses.put(statusesRowSet.getString("CRDT_MEMO_STAT_CD"), statusesRowSet.getString("CRDT_MEMO_STAT_DESC"));
113 }
114
115 LOG.debug("getVendorCreditMemoDocumentStatuses() exited");
116
117 return vendorCreditMemoStatuses;
118 } catch (DataAccessException dae) {
119 return vendorCreditMemoStatuses;
120 }
121 }
122
123
124
125
126 public Map<String, String> getLineItemReceivingDocumentStatuses() {
127 LOG.debug("getLineItemReceivingDocumentStatuses() started");
128
129 Map<String, String> lineItemReceivingStatuses = new HashMap<String, String>();
130
131 try {
132 SqlRowSet statusesRowSet = getJdbcTemplate().queryForRowSet("SELECT * FROM PUR_RCVNG_LN_STAT_T ORDER BY RCVNG_LN_STAT_CD");
133
134 while (statusesRowSet.next()) {
135 lineItemReceivingStatuses.put(statusesRowSet.getString("RCVNG_LN_STAT_CD"), statusesRowSet.getString("RCVNG_LN_STAT_DESC"));
136 }
137
138 LOG.debug("getLineItemReceivingDocumentStatuses() exited");
139
140 return lineItemReceivingStatuses;
141 } catch (DataAccessException dae) {
142 return lineItemReceivingStatuses;
143 }
144 }
145 }