Changeset 175 for trunk/grails-app/services
- Timestamp:
- Oct 29, 2009, 8:30:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/CreateDataService.groovy
r164 r175 37 37 createBaseUnitsOfMeasure() 38 38 createBasePeriods() 39 createBaseSupplierType() 40 createBaseManufacturerType() 39 41 // Tasks 40 42 createBaseTaskStatus() … … 45 47 // Inventory 46 48 createBaseInventoryTypes() 49 createBaseInventoryMovementTypes() 47 50 createBaseMaintenancePolicies() 48 51 // Assets … … 60 63 createDemoSites() 61 64 createDemoDepartments() 65 createDemoSuppliers() 66 createDemoManufacturers() 62 67 // Tasks 63 68 createDemoTaskGroups() /// @todo: Perhaps this should be BaseData? … … 68 73 // Inventory 69 74 createDemoInventoryStores() /// @todo: Perhaps a 'createQuickStartData' method? 70 createDemo StoreLocations()75 createDemoInventoryLocations() 71 76 createDemoInventoryGroups() /// @todo: Perhaps a 'createQuickStartData' method? 72 77 createDemoInventoryItems() 73 createDemoStoredItems()74 78 // Assets 75 79 createDemoLifePlan() … … 310 314 } 311 315 316 def createBaseSupplierType() { 317 318 // SupplierType 319 def supplierTypeInstance 320 321 // SupplierType #1 322 supplierTypeInstance = new SupplierType(name: "OEM", 323 description: "Original equipment supplier") 324 saveAndTest(supplierTypeInstance) 325 326 // SupplierType #2 327 supplierTypeInstance = new SupplierType(name: "Local", 328 description: "Local supplier") 329 saveAndTest(supplierTypeInstance) 330 } 331 332 def createBaseManufacturerType() { 333 334 // ManufacturerType 335 def manufacturerTypeInstance 336 337 // ManufacturerType #1 338 manufacturerTypeInstance = new ManufacturerType(name: "OEM", 339 description: "Original equipment manufacturer") 340 saveAndTest(manufacturerTypeInstance) 341 342 // ManufacturerType #2 343 manufacturerTypeInstance = new ManufacturerType(name: "Alternate", 344 description: "Not original equipment manufacturer") 345 saveAndTest(manufacturerTypeInstance) 346 347 } 348 349 def createDemoSuppliers() { 350 351 // Supplier 352 def supplierInstance 353 354 // Supplier #1 355 supplierInstance = new Supplier(name: "OEM Distributors", 356 supplierType: SupplierType.get(1)) 357 saveAndTest(supplierInstance) 358 359 // Supplier #2 360 supplierInstance = new Supplier(name: "Mex Holdings", 361 supplierType: SupplierType.get(2)) 362 saveAndTest(supplierInstance) 363 } 364 365 def createDemoManufacturers() { 366 367 // Manufacturer 368 def manufacturerInstance 369 370 // Manufacturer #1 371 manufacturerInstance = new Manufacturer(name: "OEM Manufacturer", 372 manufacturerType: ManufacturerType.get(1)) 373 saveAndTest(manufacturerInstance) 374 375 // Manufacturer #2 376 manufacturerInstance = new Manufacturer(name: "Laser Cutting Services Pty", 377 manufacturerType: ManufacturerType.get(2)) 378 saveAndTest(manufacturerInstance) 379 } 380 312 381 /********************* 313 382 START OF TASK … … 587 656 } 588 657 589 def createDemo StoreLocations() {590 591 // StoreLocation592 def storeLocation593 594 storeLocation = new StoreLocation(inventoryStore: InventoryStore.get(1), bin: "A1-2")595 saveAndTest( storeLocation)596 597 storeLocation = new StoreLocation(inventoryStore: InventoryStore.get(1), bin: "C55")598 saveAndTest( storeLocation)658 def createDemoInventoryLocations() { 659 660 // InventoryLocation 661 def inventoryLocation 662 663 inventoryLocation = new InventoryLocation(inventoryStore: InventoryStore.get(1), name: "A1-2") 664 saveAndTest(inventoryLocation) 665 666 inventoryLocation = new InventoryLocation(inventoryStore: InventoryStore.get(1), name: "C55") 667 saveAndTest(inventoryLocation) 599 668 } 600 669 … … 631 700 inventoryTypeInstance = new InventoryType(name: "Repairable") 632 701 saveAndTest(inventoryTypeInstance) 702 } 703 704 def createBaseInventoryMovementTypes() { 705 706 // InventoryMovementType 707 def inventoryMovementTypeInstance 708 709 // InventoryMovementType #1 710 inventoryMovementTypeInstance = new InventoryMovementType(name: "Used") 711 saveAndTest(inventoryMovementTypeInstance) 712 713 // InventoryMovementType #2 714 inventoryMovementTypeInstance = new InventoryMovementType(name: "Repaired") 715 saveAndTest(inventoryMovementTypeInstance) 716 717 // InventoryMovementType #3 718 inventoryMovementTypeInstance = new InventoryMovementType(name: "Purchased") 719 saveAndTest(inventoryMovementTypeInstance) 633 720 } 634 721 … … 642 729 inventoryType: InventoryType.get(1), 643 730 unitOfMeasure: UnitOfMeasure.get(2), 731 inventoryLocation: InventoryLocation.get(1), 644 732 name: "J-Rope", 645 733 description: "Twine wound J-Rope", 734 unitsInStock: 2, 646 735 reorderPoint: 0) 647 736 saveAndTest(inventoryItemInstance) … … 651 740 inventoryType: InventoryType.get(1), 652 741 unitOfMeasure: UnitOfMeasure.get(2), 742 inventoryLocation: InventoryLocation.get(1), 653 743 name: "L-Rope", 654 744 description: "Twine wound L-Rope", 655 745 alternateItems: InventoryItem.get(1), 746 unitsInStock: 2, 656 747 reorderPoint: 0) 657 748 saveAndTest(inventoryItemInstance) … … 661 752 inventoryType: InventoryType.get(1), 662 753 unitOfMeasure: UnitOfMeasure.get(1), 754 inventoryLocation: InventoryLocation.get(2), 663 755 name: "2305-2RS", 664 756 description: "Bearing 25x62x24mm double row self aligning ball", 757 unitsInStock: 3, 665 758 reorderPoint: 2) 666 759 saveAndTest(inventoryItemInstance) … … 670 763 inventoryType: InventoryType.get(1), 671 764 unitOfMeasure: UnitOfMeasure.get(1), 765 inventoryLocation: InventoryLocation.get(2), 672 766 name: "L1592-K10", 673 767 description: "10kW contactor", 768 unitsInStock: 4, 674 769 reorderPoint: 0) 675 770 saveAndTest(inventoryItemInstance) … … 679 774 inventoryType: InventoryType.get(1), 680 775 unitOfMeasure: UnitOfMeasure.get(1), 776 inventoryLocation: InventoryLocation.get(2), 681 777 name: "6205-ZZ", 682 778 description: "Bearing 25x52x15mm single row ball shielded", 779 unitsInStock: 5, 683 780 reorderPoint: 2) 684 781 saveAndTest(inventoryItemInstance) 685 }686 687 def createDemoStoredItems() {688 689 //StoredItem690 def storedItemInstance691 692 //StoredItem #1693 storedItemInstance = new StoredItem(inventoryItem: InventoryItem.get(1),694 storeLocation: StoreLocation.get(1),695 quantity: 8)696 saveAndTest(storedItemInstance)697 698 //StoredItem #2699 storedItemInstance = new StoredItem(inventoryItem: InventoryItem.get(1),700 storeLocation: StoreLocation.get(2),701 quantity: 4)702 saveAndTest(storedItemInstance)703 704 //StoredItem #3705 storedItemInstance = new StoredItem(inventoryItem: InventoryItem.get(2),706 storeLocation: StoreLocation.get(1),707 quantity: 2)708 saveAndTest(storedItemInstance)709 710 //StoredItem #4711 storedItemInstance = new StoredItem(inventoryItem: InventoryItem.get(3),712 storeLocation: StoreLocation.get(1),713 quantity: 2)714 saveAndTest(storedItemInstance)715 716 //StoredItem #5717 storedItemInstance = new StoredItem(inventoryItem: InventoryItem.get(4),718 storeLocation: StoreLocation.get(1),719 quantity: 30)720 saveAndTest(storedItemInstance)721 782 } 722 783
Note: See TracChangeset
for help on using the changeset viewer.