1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.businessobject;
17
18 import org.kuali.ole.integration.purap.CapitalAssetLocation;
19 import org.kuali.ole.integration.purap.CapitalAssetSystem;
20 import org.kuali.ole.integration.purap.ItemCapitalAsset;
21
22 import java.util.LinkedHashMap;
23
24
25
26
27
28
29 public class PurchaseOrderCapitalAssetSystem extends PurchasingCapitalAssetSystemBase {
30
31 private String documentNumber;
32
33
34
35
36 public PurchaseOrderCapitalAssetSystem() {
37 super();
38 }
39
40 public PurchaseOrderCapitalAssetSystem(CapitalAssetSystem originalSystem) {
41 super();
42 if (originalSystem != null) {
43 this.setCapitalAssetSystemDescription(originalSystem.getCapitalAssetSystemDescription());
44 this.setCapitalAssetNotReceivedCurrentFiscalYearIndicator(originalSystem.isCapitalAssetNotReceivedCurrentFiscalYearIndicator());
45 this.setCapitalAssetTypeCode(originalSystem.getCapitalAssetTypeCode());
46 this.setCapitalAssetManufacturerName(originalSystem.getCapitalAssetManufacturerName());
47 this.setCapitalAssetModelDescription(originalSystem.getCapitalAssetModelDescription());
48 this.setCapitalAssetNoteText(originalSystem.getCapitalAssetNoteText());
49 populatePurchaseOrderItemCapitalAssets(originalSystem);
50 populateCapitalAssetLocations(originalSystem);
51 this.setCapitalAssetCountAssetNumber(originalSystem.getCapitalAssetCountAssetNumber());
52 }
53 }
54
55 private void populatePurchaseOrderItemCapitalAssets(CapitalAssetSystem originalSystem) {
56 for (ItemCapitalAsset reqAsset : originalSystem.getItemCapitalAssets()) {
57 PurchaseOrderItemCapitalAsset poAsset = new PurchaseOrderItemCapitalAsset(reqAsset.getCapitalAssetNumber());
58 this.getItemCapitalAssets().add(poAsset);
59 }
60 }
61
62 private void populateCapitalAssetLocations(CapitalAssetSystem originalSystem) {
63 for (CapitalAssetLocation reqLocation : originalSystem.getCapitalAssetLocations()) {
64 PurchaseOrderCapitalAssetLocation poLocation = new PurchaseOrderCapitalAssetLocation();
65 poLocation.setItemQuantity(reqLocation.getItemQuantity());
66 poLocation.setCampusCode(reqLocation.getCampusCode());
67 poLocation.setOffCampusIndicator(reqLocation.isOffCampusIndicator());
68 poLocation.setBuildingCode(reqLocation.getBuildingCode());
69 poLocation.setBuildingRoomNumber(reqLocation.getBuildingRoomNumber());
70 poLocation.setCapitalAssetLine1Address(reqLocation.getCapitalAssetLine1Address());
71 poLocation.setCapitalAssetCityName(reqLocation.getCapitalAssetCityName());
72 poLocation.setCapitalAssetStateCode(reqLocation.getCapitalAssetStateCode());
73 poLocation.setCapitalAssetPostalCode(reqLocation.getCapitalAssetPostalCode());
74 poLocation.setCapitalAssetCountryCode(reqLocation.getCapitalAssetCountryCode());
75 this.getCapitalAssetLocations().add(poLocation);
76 }
77 }
78
79 public String getDocumentNumber() {
80 return documentNumber;
81 }
82
83
84 public Class getCapitalAssetLocationClass() {
85 return PurchaseOrderCapitalAssetLocation.class;
86 }
87
88 @Override
89 public Class getItemCapitalAssetClass() {
90 return PurchaseOrderItemCapitalAsset.class;
91 }
92
93 public void setDocumentNumber(String documentNumber) {
94 this.documentNumber = documentNumber;
95 }
96
97 @Override
98 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
99 LinkedHashMap m = new LinkedHashMap();
100 if (this.documentNumber != null) {
101 m.put("documentNumber", this.documentNumber.toString());
102 }
103 if (this.getCapitalAssetSystemIdentifier() != null) {
104 m.put("capitalAssetSystemIdentifier", this.getCapitalAssetSystemIdentifier().toString());
105 }
106 return m;
107 }
108 }