Changeset 268 for trunk/grails-app/services
- Timestamp:
- Jan 14, 2010, 10:51:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/CreateDataService.groovy
r266 r268 60 60 createBaseSupplierType() 61 61 createBaseManufacturerType() 62 createBaseExtenededAttributeTypes() 62 63 63 64 // Tasks … … 76 77 77 78 // Assets 78 createBaseAssetExtenededAttributeTypes()79 79 80 80 // Record that data has been created. … … 128 128 createDemoTaskProcedure() 129 129 createDemoMaintenanceActions() 130 createDemoSystemSections() 131 createDemoAssetTypes() 132 createDemoAssemblies() 133 createDemoSubAssemblies() 134 createDemoComponentItems() 130 createDemoSections() 131 createDemoAssetSubItems() 135 132 createDemoAssets() 136 133 createDemoAssetExtenedAttributes() … … 993 990 } 994 991 995 def createDemoS ystemSections() {996 997 //S ystemSection998 def s ystemSectionInstance999 1000 //S ystemSection #11001 s ystemSectionInstance = new SystemSection(name: "Press Section",992 def createDemoSections() { 993 994 //Section 995 def sectionInstance 996 997 //Section #1 998 sectionInstance = new Section(name: "Press Section", 1002 999 site: Site.get(1), 1003 1000 department: Department.get(1)) 1004 saveAndTest(s ystemSectionInstance)1005 1006 //S ystemSection #21007 s ystemSectionInstance = new SystemSection(name: "RO System",1001 saveAndTest(sectionInstance) 1002 1003 //Section #2 1004 sectionInstance = new Section(name: "RO System", 1008 1005 site: Site.get(2), 1009 1006 department: Department.get(2)) 1010 saveAndTest(s ystemSectionInstance)1011 1012 //S ystemSection #31013 s ystemSectionInstance = new SystemSection(name: "Auxilliray Section",1007 saveAndTest(sectionInstance) 1008 1009 //Section #3 1010 sectionInstance = new Section(name: "Auxilliray Section", 1014 1011 site: Site.get(1), 1015 1012 department: Department.get(1)) 1016 saveAndTest(systemSectionInstance) 1017 } 1018 1019 def createDemoAssetTypes() { 1020 1021 //AssetType 1022 def assetTypeInstance 1023 1024 //AssetType #1 1025 assetTypeInstance = new AssetType(name: "Print Unit") 1026 saveAndTest(assetTypeInstance) 1027 1028 //AssetType #2 1029 assetTypeInstance = new AssetType(name: "Reactor Tower") 1030 saveAndTest(assetTypeInstance) 1031 } 1032 1033 def createDemoAssemblies() { 1034 1035 //Assembly 1036 def assemblyInstance 1037 1038 //Assembly #1 1039 assemblyInstance = new Assembly(name: "Print Couple", 1040 assetType: AssetType.get(1)) 1041 saveAndTest(assemblyInstance) 1042 // assemblyInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 1043 1044 //Assembly #2 1045 assemblyInstance = new Assembly(name: "Agitator", 1046 assetType: AssetType.get(2)) 1047 saveAndTest(assemblyInstance) 1048 } 1049 1050 def createDemoSubAssemblies() { 1051 1052 //SubAssembly 1053 def subAssemblyInstance 1054 1055 //SubAssembly #1 1056 subAssemblyInstance = new SubAssembly(name: "Cylinder", 1057 assembly: Assembly.get(1)) 1058 saveAndTest(subAssemblyInstance) 1059 1060 //SubAssembly #2 1061 subAssemblyInstance = new SubAssembly(name: "Gearmotor", 1062 assembly: Assembly.get(2)) 1063 saveAndTest(subAssemblyInstance) 1064 } 1065 1066 def createDemoComponentItems() { 1067 1068 //ComponentItem 1069 def componentItemInstance 1070 1071 //ComponentItem #1 1072 componentItemInstance = new ComponentItem(name: "Bearing", 1073 subAssembly: SubAssembly.get(1)) 1074 saveAndTest(componentItemInstance) 1075 1076 //ComponentItem #2 1077 componentItemInstance = new ComponentItem(name: "Drive shaft oil seal", 1078 subAssembly: SubAssembly.get(2)) 1079 saveAndTest(componentItemInstance) 1013 saveAndTest(sectionInstance) 1014 } 1015 1016 def createDemoAssetSubItems() { 1017 1018 // //AssetSubItem 1019 // def assetSubItemInstance 1020 // 1021 // //AssetSubItem #1 1022 // assetSubItemInstance = new AssetSubItem(name: "Print Unit") 1023 // saveAndTest(assetSubItemInstance) 1024 // 1025 // //AssetSubItem #2 1026 // assetSubItemInstance = new AssetSubItem(name: "Reactor Tower") 1027 // saveAndTest(assetSubItemInstance) 1080 1028 } 1081 1029 1082 1030 def createDemoAssets() { 1083 1031 1084 //Asset 1085 def assetInstance 1086 1087 //Asset #1 1088 assetInstance = new Asset(name: "Print Unit 22", 1089 assetType: AssetType.get(1), 1090 systemSection: SystemSection.get(1)) 1091 saveAndTest(assetInstance) 1092 // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 1093 1094 //Asset #2 1095 assetInstance = new Asset(name: "Print Unit 21", 1096 assetType: AssetType.get(1), 1097 systemSection: SystemSection.get(1)) 1098 saveAndTest(assetInstance) 1099 1100 //Asset #3 1101 assetInstance = new Asset(name: "Print Unit 23", 1102 assetType: AssetType.get(1), 1103 systemSection: SystemSection.get(1)) 1104 saveAndTest(assetInstance) 1105 1106 //Asset #4 1107 assetInstance = new Asset(name: "RO 1", 1108 assetType: AssetType.get(2), 1109 systemSection: SystemSection.get(2)) 1110 saveAndTest(assetInstance) 1111 } 1112 1113 def createBaseAssetExtenededAttributeTypes() { 1114 1115 //AssetExtendedAttributeType 1116 def assetExtendedAttributeInstanceType 1117 1118 //AssetExtendedAttributeType #1 1119 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Model Number") 1120 saveAndTest(assetExtendedAttributeInstanceType) 1121 1122 //AssetExtendedAttributeType #2 1123 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Purchase Cost") 1124 saveAndTest(assetExtendedAttributeInstanceType) 1125 1126 //AssetExtendedAttributeType #3 1127 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Serial Number") 1128 saveAndTest(assetExtendedAttributeInstanceType) 1129 1130 //AssetExtendedAttributeType #4 1131 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Manufactured Date") 1132 saveAndTest(assetExtendedAttributeInstanceType) 1133 1134 //AssetExtendedAttributeType #5 1135 assetExtendedAttributeInstanceType = new AssetExtendedAttributeType(name: "Location Description") 1136 saveAndTest(assetExtendedAttributeInstanceType) 1032 // //Asset 1033 // def assetInstance 1034 // 1035 // //Asset #1 1036 // assetInstance = new Asset(name: "Print Unit 22", 1037 // section: Section.get(1)) 1038 // saveAndTest(assetInstance) 1039 // // assetInstance.addToMaintenanceActions(MaintenanceAction.get(1)) 1040 // 1041 // //Asset #2 1042 // assetInstance = new Asset(name: "Print Unit 21", 1043 // assetSubItem: AssetSubItem.get(1), 1044 // section: Section.get(1)) 1045 // saveAndTest(assetInstance) 1046 // 1047 // //Asset #3 1048 // assetInstance = new Asset(name: "Print Unit 23", 1049 // assetSubItem: AssetSubItem.get(1), 1050 // section: Section.get(1)) 1051 // saveAndTest(assetInstance) 1052 // 1053 // //Asset #4 1054 // assetInstance = new Asset(name: "RO 1", 1055 // assetSubItem: AssetSubItem.get(2), 1056 // section: Section.get(2)) 1057 // saveAndTest(assetInstance) 1058 } 1059 1060 def createBaseExtenededAttributeTypes() { 1061 1062 //ExtendedAttributeType 1063 def extendedAttributeTypeInstance 1064 1065 //ExtendedAttributeType #1 1066 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Model Number") 1067 saveAndTest(extendedAttributeTypeInstance) 1068 1069 //ExtendedAttributeType #2 1070 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Purchase Cost") 1071 saveAndTest(extendedAttributeTypeInstance) 1072 1073 //ExtendedAttributeType #3 1074 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Serial Number") 1075 saveAndTest(extendedAttributeTypeInstance) 1076 1077 //ExtendedAttributeType #4 1078 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufactured Date") 1079 saveAndTest(extendedAttributeTypeInstance) 1080 1081 //ExtendedAttributeType #5 1082 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Location Description") 1083 saveAndTest(extendedAttributeTypeInstance) 1084 1085 //ExtendedAttributeType #6 1086 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Centre") 1087 saveAndTest(extendedAttributeTypeInstance) 1088 1089 //ExtendedAttributeType #7 1090 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Cost Code") 1091 saveAndTest(extendedAttributeTypeInstance) 1092 1093 //ExtendedAttributeType #8 1094 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Manufacturer's Number") 1095 saveAndTest(extendedAttributeTypeInstance) 1096 1097 //ExtendedAttributeType #9 1098 extendedAttributeTypeInstance = new ExtendedAttributeType(name: "Inventory Number") 1099 saveAndTest(extendedAttributeTypeInstance) 1137 1100 } 1138 1101 1139 1102 def createDemoAssetExtenedAttributes() { 1140 1103 1141 //AssetExtendedAttribute1142 def assetExtendedAttributeInstance1143 1144 //AssetExtendedAttribute #11145 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "PU Mark 2",1146 asset: Asset.get(1),1147 assetExtendedAttributeType: AssetExtendedAttributeType.get(1))1148 saveAndTest(assetExtendedAttributeInstance)1149 1150 //AssetExtendedAttribute #21151 assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "On the far side of Tank 5",1152 asset: Asset.get(1),1153 assetExtendedAttributeType: AssetExtendedAttributeType.get(5))1154 saveAndTest(assetExtendedAttributeInstance)1104 // //AssetExtendedAttribute 1105 // def assetExtendedAttributeInstance 1106 // 1107 // //AssetExtendedAttribute #1 1108 // assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "PU Mark 2", 1109 // asset: Asset.get(1), 1110 // assetExtendedAttributeType: ExtendedAttributeType.get(1)) 1111 // saveAndTest(assetExtendedAttributeInstance) 1112 // 1113 // //AssetExtendedAttribute #2 1114 // assetExtendedAttributeInstance = new AssetExtendedAttribute(value: "On the far side of Tank 5", 1115 // asset: Asset.get(1), 1116 // assetExtendedAttributeType: ExtendedAttributeType.get(5)) 1117 // saveAndTest(assetExtendedAttributeInstance) 1155 1118 } 1156 1119
Note: See TracChangeset
for help on using the changeset viewer.