Changeset 118 for trunk


Ignore:
Timestamp:
Apr 17, 2009, 12:17:55 AM (16 years ago)
Author:
gav
Message:

First commit of Asset domain, including domain-classes, controllers, views and bootstrap.

Location:
trunk
Files:
62 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r117 r118  
    3232    {
    3333        println "BootStrapping demo data..."
    34    
     34
     35/*******************
     36START OF TASK
     37
     38*******************/
     39
    3540//TypeOfPersonGroup
    3641        def personGroupTypeInstance
     
    346351        BootStrapSaveAndTest(assignedPersonInstance)
    347352
     353/*******************
     354START OF INVENTORY
     355
     356*******************/
     357
    348358//Site
    349359        def siteInstance
     
    354364        siteInstance = new Site(name: "Jasper Street Depot")
    355365        BootStrapSaveAndTest(siteInstance)
    356 
    357 //Asset
    358         def assetInstance
    359 
    360         assetInstance = new Asset(name: "RockCrusher1")
    361         BootStrapSaveAndTest(assetInstance)
    362 
    363366
    364367//InventoryStore
     
    513516        BootStrapSaveAndTest(storedItemInstance)
    514517
     518/*******************
     519START OF ASSET
     520
     521*******************/
     522
     523//Frequency
     524        def frequencyInstance
     525
     526        //Frequency #1
     527        frequencyInstance = new Frequency(frequency: "Daily")
     528        BootStrapSaveAndTest(frequencyInstance)
     529
     530        //Frequency #2
     531        frequencyInstance = new Frequency(frequency: "Monthly")
     532        BootStrapSaveAndTest(frequencyInstance)
     533
     534        //Frequency #3
     535        frequencyInstance = new Frequency(frequency: "Quarterly")
     536        BootStrapSaveAndTest(frequencyInstance)
     537
     538        //Frequency #4
     539        frequencyInstance = new Frequency(frequency: "Annually")
     540        BootStrapSaveAndTest(frequencyInstance)
     541
     542//LifePlan
     543        def lifeplanInstance
     544
     545        lifeplanInstance = new LifePlan(name: "Initial Plan",
     546                                                                timeInHours: 1,
     547                                                                maintenanceAction: "Visual inspection")
     548        BootStrapSaveAndTest(lifeplanInstance)
     549
     550//Form
     551        def formInstance
     552
     553        formInstance = new Form(name: "Form 1")
     554        BootStrapSaveAndTest(formInstance)
     555
     556//SystemSection
     557    def systemSectionInstance
     558
     559    systemSectionInstance = new SystemSection(name: "Press Section",
     560                                                                                   lifeplan: LifePlan.get(1))
     561    BootStrapSaveAndTest(systemSectionInstance)
     562
     563//AssetType
     564        def assetTypeInstance
     565        assetTypeInstance = new AssetType(name: "Folder",
     566                        lifeplan: LifePlan.get(1),
     567                        systemSection: SystemSection.get(1))
     568        BootStrapSaveAndTest(assetTypeInstance)
     569
     570        assetTypeInstance = new AssetType(name: "Print Unit",
     571                        lifeplan: LifePlan.get(1),
     572                        systemSection: SystemSection.get(1))
     573        BootStrapSaveAndTest(assetTypeInstance)
     574   
     575//Assembly
     576        def assemblyInstance
     577        assemblyInstance = new Assembly(name: "Delivery Belts",
     578                        lifeplan: LifePlan.get(1))
     579        BootStrapSaveAndTest(assemblyInstance)
     580   
     581        assemblyInstance = new Assembly(name: "Print Couple",
     582                        lifeplan: LifePlan.get(1))
     583        BootStrapSaveAndTest(assemblyInstance)
     584
     585//SubAssembly
     586        def subAssemblyInstance
     587        subAssemblyInstance = new SubAssembly(name: "Centre Belt",
     588                        lifeplan: LifePlan.get(1))
     589        BootStrapSaveAndTest(subAssemblyInstance)
     590   
     591        subAssemblyInstance = new SubAssembly(name: "Form Roller",
     592                        lifeplan: LifePlan.get(1))
     593        BootStrapSaveAndTest(subAssemblyInstance)
     594
     595//ComponentItem
     596    def componentItemInstance
     597    componentItemInstance = new ComponentItem(name: "Centre Pulley",
     598                                                                                        fmeaNumber: 1,
     599                                                                                       lifeplan: LifePlan.get(1))
     600    BootStrapSaveAndTest(componentItemInstance)
     601
     602    componentItemInstance = new ComponentItem(name: "Bearing",
     603                                                                                        fmeaNumber: 1,
     604                                                                                       lifeplan: LifePlan.get(1))
     605    BootStrapSaveAndTest(componentItemInstance)
     606
     607
     608//Asset
     609        def assetInstance
     610
     611        //Asset #1
     612        assetInstance = new Asset(name: "Print Unit 23",
     613                                                        lifeplan: LifePlan.get(1),
     614                                                        assetType: AssetType.get(1),
     615                                                        riskPriorityNumber: 1)
     616        BootStrapSaveAndTest(assetInstance)
     617
    515618//Finally did it all work.       
    516619        if(BootStrapDemoDataSuccessful) {
  • trunk/grails-app/domain/Asset.groovy

    r116 r118  
    11class Asset {
     2    LifePlan lifeplan
     3    AssetType assetType
    24    String name
    35    String description = ""
     6    String locationLongText = ""
     7    Integer riskPriorityNumber
     8    String modelNumber = ""
     9    String serialNumber = ""
     10    Integer purchaseCost = 0
     11    Date manufacturedDate = new Date()
     12   
    413    boolean isActive = true
    514
     
    918//
    1019//     static constraints = {
    11 //
    1220//     }
    1321
Note: See TracChangeset for help on using the changeset viewer.