1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.module.cg.businessobject;
18
19 import java.sql.Date;
20 import java.sql.Timestamp;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.LinkedHashMap;
24 import java.util.List;
25
26 import org.kuali.ole.coa.businessobject.CFDA;
27 import org.kuali.ole.integration.cg.ContractAndGrantsProposal;
28 import org.kuali.ole.sys.OLEConstants;
29 import org.kuali.ole.sys.context.SpringContext;
30 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
31 import org.kuali.rice.core.api.util.type.KualiDecimal;
32 import org.kuali.rice.kim.api.identity.Person;
33 import org.kuali.rice.krad.bo.PersistableBusinessObject;
34 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
35 import org.kuali.rice.krad.service.LookupService;
36 import org.kuali.rice.krad.util.ObjectUtils;
37
38
39
40
41 public class Proposal extends PersistableBusinessObjectBase implements MutableInactivatable, ContractAndGrantsProposal {
42
43 private Long proposalNumber;
44 private Date proposalBeginningDate;
45 private Date proposalEndingDate;
46
47
48
49
50
51
52
53
54 @SuppressWarnings( { "unused" })
55 private KualiDecimal proposalTotalAmount;
56
57 private KualiDecimal proposalDirectCostAmount;
58 private KualiDecimal proposalIndirectCostAmount;
59 private Date proposalRejectedDate;
60 private Timestamp proposalLastUpdateDate;
61 private Date proposalDueDate;
62 private KualiDecimal proposalTotalProjectAmount;
63 private Date proposalSubmissionDate;
64 private boolean proposalFederalPassThroughIndicator;
65 private String oldProposalNumber;
66 private String grantNumber;
67 private Date proposalClosingDate;
68 private String proposalAwardTypeCode;
69 private String agencyNumber;
70 private String proposalStatusCode;
71 private String federalPassThroughAgencyNumber;
72 private String cfdaNumber;
73 private String proposalFellowName;
74 private String proposalPurposeCode;
75 private String proposalProjectTitle;
76 private boolean active;
77 private List<ProposalSubcontractor> proposalSubcontractors;
78 private List<ProposalOrganization> proposalOrganizations;
79 private List<ProposalProjectDirector> proposalProjectDirectors;
80 private List<ProposalResearchRisk> proposalResearchRisks;
81
82 private ProposalAwardType proposalAwardType;
83 private Agency agency;
84 private ProposalStatus proposalStatus;
85 private Agency federalPassThroughAgency;
86 private ProposalPurpose proposalPurpose;
87 private CFDA cfda;
88 private ProposalOrganization primaryProposalOrganization;
89 private String routingOrg;
90 private String routingChart;
91 private LookupService lookupService;
92 private Award award;
93
94
95 private transient String lookupPersonUniversalIdentifier;
96 private transient Person lookupPerson;
97
98
99 private final String userLookupRoleNamespaceCode = OLEConstants.ParameterNamespaces.OLE;
100 private final String userLookupRoleName = OLEConstants.SysKimApiConstants.CONTRACTS_AND_GRANTS_PROJECT_DIRECTOR;
101
102
103
104
105 @SuppressWarnings( { "unchecked" })
106 public Proposal() {
107
108
109 proposalSubcontractors = new ArrayList<ProposalSubcontractor>();
110 proposalOrganizations = new ArrayList<ProposalOrganization>();
111 proposalProjectDirectors = new ArrayList<ProposalProjectDirector>();
112 proposalResearchRisks = new ArrayList<ProposalResearchRisk>();
113 }
114
115
116
117
118
119
120 @Override
121 public Award getAward() {
122 return award;
123 }
124
125
126
127
128
129
130 public void setAward(Award award) {
131 this.award = award;
132 }
133
134
135
136
137
138 @Override
139 public List buildListOfDeletionAwareLists() {
140 List<Collection<PersistableBusinessObject>> managedLists = super.buildListOfDeletionAwareLists();
141 managedLists.add((List) getProposalSubcontractors());
142 managedLists.add((List) getProposalOrganizations());
143 managedLists.add((List)getProposalProjectDirectors());
144
145 return managedLists;
146 }
147
148
149
150
151
152
153 @Override
154 public Long getProposalNumber() {
155 return proposalNumber;
156 }
157
158
159
160
161
162
163 public void setProposalNumber(Long proposalNumber) {
164 this.proposalNumber = proposalNumber;
165 }
166
167
168
169
170
171
172 @Override
173 public Date getProposalBeginningDate() {
174 return proposalBeginningDate;
175 }
176
177
178
179
180
181
182 public void setProposalBeginningDate(Date proposalBeginningDate) {
183 this.proposalBeginningDate = proposalBeginningDate;
184 }
185
186
187
188
189
190
191 @Override
192 public Date getProposalEndingDate() {
193 return proposalEndingDate;
194 }
195
196
197
198
199
200
201 public void setProposalEndingDate(Date proposalEndingDate) {
202 this.proposalEndingDate = proposalEndingDate;
203 }
204
205
206
207
208
209
210 @Override
211 public KualiDecimal getProposalTotalAmount() {
212 KualiDecimal direct = getProposalDirectCostAmount();
213 KualiDecimal indirect = getProposalIndirectCostAmount();
214 return ObjectUtils.isNull(direct) || ObjectUtils.isNull(indirect) ? null : direct.add(indirect);
215 }
216
217
218
219
220
221
222
223 public void setProposalTotalAmount(KualiDecimal proposalTotalAmount) {
224
225 }
226
227
228
229
230
231
232
233
234
235 @Override protected void prePersist() {
236 super.prePersist();
237 proposalTotalAmount = getProposalTotalAmount();
238 }
239
240
241
242
243
244
245
246
247
248 @Override protected void preUpdate() {
249 super.preUpdate();
250 proposalTotalAmount = getProposalTotalAmount();
251 }
252
253
254
255
256
257
258 @Override
259 public KualiDecimal getProposalDirectCostAmount() {
260 return proposalDirectCostAmount;
261 }
262
263
264
265
266
267
268 public void setProposalDirectCostAmount(KualiDecimal proposalDirectCostAmount) {
269 this.proposalDirectCostAmount = proposalDirectCostAmount;
270 }
271
272
273
274
275
276
277 @Override
278 public KualiDecimal getProposalIndirectCostAmount() {
279 return proposalIndirectCostAmount;
280 }
281
282
283
284
285
286
287 public void setProposalIndirectCostAmount(KualiDecimal proposalIndirectCostAmount) {
288 this.proposalIndirectCostAmount = proposalIndirectCostAmount;
289 }
290
291
292
293
294
295
296 @Override
297 public Date getProposalRejectedDate() {
298 return proposalRejectedDate;
299 }
300
301
302
303
304
305
306 public void setProposalRejectedDate(Date proposalRejectedDate) {
307 this.proposalRejectedDate = proposalRejectedDate;
308 }
309
310
311
312
313
314
315 @Override
316 public Timestamp getProposalLastUpdateDate() {
317 return proposalLastUpdateDate;
318 }
319
320
321
322
323
324
325 public void setProposalLastUpdateDate(Timestamp proposalLastUpdateDate) {
326 this.proposalLastUpdateDate = proposalLastUpdateDate;
327 }
328
329
330
331
332
333
334 @Override
335 public Date getProposalDueDate() {
336 return proposalDueDate;
337 }
338
339
340
341
342
343
344 public void setProposalDueDate(Date proposalDueDate) {
345 this.proposalDueDate = proposalDueDate;
346 }
347
348
349
350
351
352
353 @Override
354 public KualiDecimal getProposalTotalProjectAmount() {
355 return proposalTotalProjectAmount;
356 }
357
358
359
360
361
362
363 public void setProposalTotalProjectAmount(KualiDecimal proposalTotalProjectAmount) {
364 this.proposalTotalProjectAmount = proposalTotalProjectAmount;
365 }
366
367
368
369
370
371
372 @Override
373 public Date getProposalSubmissionDate() {
374 return proposalSubmissionDate;
375 }
376
377
378
379
380
381
382 public void setProposalSubmissionDate(Date proposalSubmissionDate) {
383 this.proposalSubmissionDate = proposalSubmissionDate;
384 }
385
386
387
388
389
390
391 @Override
392 public boolean getProposalFederalPassThroughIndicator() {
393 return proposalFederalPassThroughIndicator;
394 }
395
396
397
398
399
400
401 public void setProposalFederalPassThroughIndicator(boolean proposalFederalPassThroughIndicator) {
402 this.proposalFederalPassThroughIndicator = proposalFederalPassThroughIndicator;
403 }
404
405
406
407
408
409
410 @Override
411 public String getOldProposalNumber() {
412 return oldProposalNumber;
413 }
414
415
416
417
418
419
420 public void setOldProposalNumber(String oldProposalNumber) {
421 this.oldProposalNumber = oldProposalNumber;
422 }
423
424
425
426
427
428
429 @Override
430 public String getGrantNumber() {
431 return grantNumber;
432 }
433
434
435
436
437
438
439 public void setGrantNumber(String grantNumber) {
440 this.grantNumber = grantNumber;
441 }
442
443
444
445
446
447
448 @Override
449 public Date getProposalClosingDate() {
450 return proposalClosingDate;
451 }
452
453
454
455
456
457
458 public void setProposalClosingDate(Date proposalClosingDate) {
459 this.proposalClosingDate = proposalClosingDate;
460 }
461
462
463
464
465
466
467 @Override
468 public String getProposalAwardTypeCode() {
469 return proposalAwardTypeCode;
470 }
471
472
473
474
475
476
477 public void setProposalAwardTypeCode(String proposalAwardTypeCode) {
478 this.proposalAwardTypeCode = proposalAwardTypeCode;
479 }
480
481
482
483
484
485
486 @Override
487 public String getAgencyNumber() {
488 return agencyNumber;
489 }
490
491
492
493
494
495
496 public void setAgencyNumber(String agencyNumber) {
497 this.agencyNumber = agencyNumber;
498 }
499
500
501
502
503
504
505 @Override
506 public String getProposalStatusCode() {
507 return proposalStatusCode;
508 }
509
510
511
512
513
514
515 public void setProposalStatusCode(String proposalStatusCode) {
516 this.proposalStatusCode = proposalStatusCode;
517 }
518
519
520
521
522
523
524 @Override
525 public String getFederalPassThroughAgencyNumber() {
526 return federalPassThroughAgencyNumber;
527 }
528
529
530
531
532
533
534 public void setFederalPassThroughAgencyNumber(String federalPassThroughAgencyNumber) {
535 this.federalPassThroughAgencyNumber = federalPassThroughAgencyNumber;
536 }
537
538
539
540
541
542
543 @Override
544 public String getCfdaNumber() {
545 return cfdaNumber;
546 }
547
548
549
550
551
552
553 public void setCfdaNumber(String cfdaNumber) {
554 this.cfdaNumber = cfdaNumber;
555 }
556
557
558
559
560
561
562 @Override
563 public String getProposalFellowName() {
564 return proposalFellowName;
565 }
566
567
568
569
570
571
572 public void setProposalFellowName(String proposalFellowName) {
573 this.proposalFellowName = proposalFellowName;
574 }
575
576
577
578
579
580
581 @Override
582 public String getProposalPurposeCode() {
583 return proposalPurposeCode;
584 }
585
586
587
588
589
590
591 public void setProposalPurposeCode(String proposalPurposeCode) {
592 this.proposalPurposeCode = proposalPurposeCode;
593 }
594
595
596
597
598
599
600 @Override
601 public String getProposalProjectTitle() {
602 return proposalProjectTitle;
603 }
604
605
606
607
608
609
610 public void setProposalProjectTitle(String proposalProjectTitle) {
611 this.proposalProjectTitle = proposalProjectTitle;
612 }
613
614
615
616
617
618
619 @Override
620 public boolean isActive() {
621 return active;
622 }
623
624
625
626
627
628
629 @Override
630 public void setActive(boolean active) {
631 this.active = active;
632 }
633
634
635
636
637
638
639 public ProposalAwardType getProposalAwardType() {
640 return proposalAwardType;
641 }
642
643
644
645
646
647
648
649 @Deprecated
650 public void setProposalAwardType(ProposalAwardType proposalAwardType) {
651 this.proposalAwardType = proposalAwardType;
652 }
653
654
655
656
657
658
659 public Agency getAgency() {
660 return agency;
661 }
662
663
664
665
666
667
668
669 @Deprecated
670 public void setAgency(Agency agency) {
671 this.agency = agency;
672 }
673
674
675
676
677
678
679 public ProposalStatus getProposalStatus() {
680 return proposalStatus;
681 }
682
683
684
685
686
687
688
689 @Deprecated
690 public void setProposalStatus(ProposalStatus proposalStatus) {
691 this.proposalStatus = proposalStatus;
692 }
693
694
695
696
697
698
699 public Agency getFederalPassThroughAgency() {
700 return federalPassThroughAgency;
701 }
702
703
704
705
706
707
708
709 @Deprecated
710 public void setFederalPassThroughAgency(Agency federalPassThroughAgency) {
711 this.federalPassThroughAgency = federalPassThroughAgency;
712 }
713
714
715
716
717
718
719 public ProposalPurpose getProposalPurpose() {
720 return proposalPurpose;
721 }
722
723
724
725
726
727
728
729 @Deprecated
730 public void setProposalPurpose(ProposalPurpose proposalPurpose) {
731 this.proposalPurpose = proposalPurpose;
732 }
733
734
735
736
737
738
739 public CFDA getCfda() {
740 return cfda;
741 }
742
743
744
745
746
747
748
749 @Deprecated
750 public void setCfda(CFDA cfda) {
751 this.cfda = cfda;
752 }
753
754
755
756
757
758
759 public List<ProposalSubcontractor> getProposalSubcontractors() {
760 return proposalSubcontractors;
761 }
762
763
764
765
766
767
768 public void setProposalSubcontractors(List<ProposalSubcontractor> proposalSubcontractors) {
769 this.proposalSubcontractors = proposalSubcontractors;
770 }
771
772
773
774
775
776
777 public List<ProposalOrganization> getProposalOrganizations() {
778 return proposalOrganizations;
779 }
780
781
782
783
784 public void setProposalOrganizations(List<ProposalOrganization> proposalOrganizations) {
785 this.proposalOrganizations = proposalOrganizations;
786 }
787
788
789
790
791 public List<ProposalProjectDirector> getProposalProjectDirectors() {
792 return proposalProjectDirectors;
793 }
794
795
796
797
798 public void setProposalProjectDirectors(List<ProposalProjectDirector> proposalProjectDirectors) {
799 this.proposalProjectDirectors = proposalProjectDirectors;
800 }
801
802
803
804
805 public List<ProposalResearchRisk> getProposalResearchRisks() {
806 return proposalResearchRisks;
807 }
808
809
810
811
812 public List<ProposalResearchRisk> getActiveProposalResearchRisks() {
813 List<ProposalResearchRisk> activeRisks = new ArrayList<ProposalResearchRisk>();
814 for (ProposalResearchRisk risk : proposalResearchRisks) {
815 if (risk.isActive()) {
816 activeRisks.add(risk);
817 }
818 }
819 return activeRisks;
820 }
821
822
823
824
825
826 public void setProposalResearchRisks(List<ProposalResearchRisk> proposalResearchRisks) {
827 this.proposalResearchRisks = proposalResearchRisks;
828 }
829
830
831
832
833 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
834 LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
835 if (this.proposalNumber != null) {
836 m.put("proposalNumber", this.proposalNumber.toString());
837 }
838 return m;
839 }
840
841
842
843
844
845
846 public Person getLookupPerson() {
847 return lookupPerson;
848 }
849
850
851
852
853
854
855 public void setLookupPerson(Person lookupPerson) {
856 this.lookupPerson = lookupPerson;
857 }
858
859
860
861
862
863
864 public String getLookupPersonUniversalIdentifier() {
865 lookupPerson = SpringContext.getBean(org.kuali.rice.kim.api.identity.PersonService.class).updatePersonIfNecessary(lookupPersonUniversalIdentifier, lookupPerson);
866 return lookupPersonUniversalIdentifier;
867 }
868
869
870
871
872
873
874 public void setLookupPersonUniversalIdentifier(String lookupPersonId) {
875 this.lookupPersonUniversalIdentifier = lookupPersonId;
876 }
877
878
879
880
881
882
883
884 public LookupService getLookupService() {
885 return lookupService;
886 }
887
888
889
890
891
892
893
894 public String getRoutingChart() {
895 return routingChart;
896 }
897
898
899
900
901
902
903 public void setRoutingChart(String routingChart) {
904 this.routingChart = routingChart;
905 }
906
907
908
909
910
911
912 public String getRoutingOrg() {
913 return routingOrg;
914 }
915
916
917
918
919
920
921 public void setRoutingOrg(String routingOrg) {
922 this.routingOrg = routingOrg;
923 }
924
925
926
927
928
929
930 public ProposalOrganization getPrimaryProposalOrganization() {
931 for (ProposalOrganization po : proposalOrganizations) {
932 if (po != null && po.isProposalPrimaryOrganizationIndicator()) {
933 setPrimaryProposalOrganization(po);
934 break;
935 }
936 }
937
938 return primaryProposalOrganization;
939 }
940
941
942
943
944
945
946 public void setLookupService(LookupService lookupService) {
947 this.lookupService = lookupService;
948 }
949
950
951
952
953
954
955 public void setPrimaryProposalOrganization(ProposalOrganization primaryProposalOrganization) {
956 this.primaryProposalOrganization = primaryProposalOrganization;
957 this.routingChart = primaryProposalOrganization.getChartOfAccountsCode();
958 this.routingOrg = primaryProposalOrganization.getOrganizationCode();
959 }
960
961
962 public String getUserLookupRoleNamespaceCode() {
963 return userLookupRoleNamespaceCode;
964 }
965
966 public void setUserLookupRoleNamespaceCode(String userLookupRoleNamespaceCode) {
967 }
968
969 public String getUserLookupRoleName() {
970 return userLookupRoleName;
971 }
972
973 public void setUserLookupRoleName(String userLookupRoleName) {
974 }
975 }
976