1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.ole.fp.businessobject;
17  
18  import java.sql.Date;
19  import java.util.LinkedHashMap;
20  
21  import org.apache.commons.lang.StringUtils;
22  import org.apache.commons.lang.time.DateUtils;
23  import org.kuali.rice.core.api.util.type.KualiDecimal;
24  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
25  import org.springframework.util.ObjectUtils;
26  
27  
28  
29  
30  
31  
32  public class CheckBase extends PersistableBusinessObjectBase implements Check {
33      private String checkNumber;
34      private Date checkDate;
35      private String description;
36      private Integer sequenceId;
37      private KualiDecimal amount;
38      private String documentNumber;
39      private String financialDocumentTypeCode;
40      private String cashieringStatus;
41      private Integer financialDocumentDepositLineNumber;
42  
43      
44  
45  
46      public CheckBase() {
47          super();
48          this.sequenceId = new Integer(1);
49          this.amount = KualiDecimal.ZERO;
50      }
51  
52      
53  
54  
55  
56  
57      @Override
58      public Date getCheckDate() {
59          return checkDate;
60      }
61  
62      
63  
64  
65  
66  
67      @Override
68      public void setCheckDate(Date checkDate) {
69          this.checkDate = checkDate;
70      }
71  
72      
73  
74  
75  
76  
77      @Override
78      public String getCheckNumber() {
79          return checkNumber;
80      }
81  
82      
83  
84  
85  
86  
87      @Override
88      public void setCheckNumber(String checkNumber) {
89          this.checkNumber = checkNumber;
90      }
91  
92      
93  
94  
95  
96  
97      @Override
98      public String getDescription() {
99          return description;
100     }
101 
102     
103 
104 
105 
106 
107     @Override
108     public void setDescription(String description) {
109         this.description = description;
110     }
111 
112     
113 
114 
115 
116 
117     @Override
118     public Integer getSequenceId() {
119         return sequenceId;
120     }
121 
122     
123 
124 
125 
126 
127     @Override
128     public void setSequenceId(Integer sequenceId) {
129         this.sequenceId = sequenceId;
130     }
131 
132     
133 
134 
135 
136 
137     @Override
138     public KualiDecimal getAmount() {
139         return amount;
140     }
141 
142     
143 
144 
145 
146 
147     @Override
148     public void setAmount(KualiDecimal amount) {
149         this.amount = amount;
150     }
151 
152 
153     
154 
155 
156 
157 
158     @Override
159     public String getDocumentNumber() {
160         return documentNumber;
161     }
162 
163     
164 
165 
166 
167 
168     @Override
169     public void setDocumentNumber(String documentNumber) {
170         this.documentNumber = documentNumber;
171     }
172 
173     
174 
175 
176 
177 
178     @Override
179     public String getCashieringStatus() {
180         return cashieringStatus;
181     }
182 
183     
184 
185 
186 
187 
188     @Override
189     public void setCashieringStatus(String financialDocumentColumnTypeCode) {
190         this.cashieringStatus = financialDocumentColumnTypeCode;
191     }
192 
193     
194 
195 
196 
197 
198     @Override
199     public String getFinancialDocumentTypeCode() {
200         return financialDocumentTypeCode;
201     }
202 
203     
204 
205 
206 
207 
208     @Override
209     public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
210         this.financialDocumentTypeCode = financialDocumentTypeCode;
211     }
212 
213     
214 
215 
216 
217 
218     @Override
219     public Integer getFinancialDocumentDepositLineNumber() {
220         return financialDocumentDepositLineNumber;
221     }
222 
223     
224 
225 
226 
227 
228     @Override
229     public void setFinancialDocumentDepositLineNumber(Integer financialDocumentDepositLineNumber) {
230         this.financialDocumentDepositLineNumber = financialDocumentDepositLineNumber;
231     }
232 
233     
234 
235 
236     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
237         LinkedHashMap m = new LinkedHashMap();
238 
239         m.put("sequenceId", this.sequenceId);
240         m.put("checkNumber", this.checkNumber);
241         m.put("amount", this.amount);
242         m.put("checkDate", this.checkDate);
243         m.put("financialDocumentDepositLineNumber", this.financialDocumentDepositLineNumber);
244         m.put("description", this.description);
245         m.put("documentHeaderId", this.documentNumber);
246         m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
247         m.put("cashieringStatus", this.cashieringStatus);
248 
249         return m;
250     }
251 
252 
253     
254 
255 
256     @Override
257     public boolean isLike(Check other) {
258         boolean like = false;
259 
260         if (StringUtils.equals(checkNumber, other.getCheckNumber())) {
261             if (StringUtils.equals(description, other.getDescription())) {
262                 if (StringUtils.equals(financialDocumentTypeCode, other.getFinancialDocumentTypeCode()) && StringUtils.equals(cashieringStatus, other.getCashieringStatus())) {
263                     if (StringUtils.equals(documentNumber, other.getDocumentNumber())) {
264                         if (ObjectUtils.nullSafeEquals(sequenceId, other.getSequenceId())) {
265                             if (ObjectUtils.nullSafeEquals(financialDocumentDepositLineNumber, other.getFinancialDocumentDepositLineNumber())) {
266 
267                                 if (DateUtils.isSameDay(checkDate, other.getCheckDate())) {
268                                     if ((amount != null) && amount.equals(other.getAmount())) {
269                                         like = true;
270                                     }
271                                 }
272                             }
273                         }
274                     }
275                 }
276             }
277         }
278 
279         return like;
280     }
281 }