1 | class Task { |
---|
2 | |
---|
3 | TaskGroup taskGroup |
---|
4 | TaskStatus taskStatus |
---|
5 | TaskPriority taskPriority |
---|
6 | TaskBudgetStatus taskBudgetStatus |
---|
7 | TaskType taskType |
---|
8 | Task parentTask |
---|
9 | Person leadPerson |
---|
10 | Site site |
---|
11 | Section section |
---|
12 | Asset primaryAsset |
---|
13 | AssetSubItem assetSubItem |
---|
14 | TaskRecurringSchedule taskRecurringSchedule |
---|
15 | TaskProcedure taskProcedure |
---|
16 | |
---|
17 | String description |
---|
18 | String comment = "" |
---|
19 | Date targetStartDate = new Date() |
---|
20 | Date targetCompletionDate = new Date() |
---|
21 | boolean approved = false |
---|
22 | boolean trash = false |
---|
23 | boolean attentionFlag = false |
---|
24 | boolean safetyRequirement = false |
---|
25 | boolean regulatoryRequirement = false |
---|
26 | boolean mandatoryRequirement = false |
---|
27 | boolean positiveFault = false |
---|
28 | |
---|
29 | static hasMany = [entries: Entry, |
---|
30 | taskModifications: TaskModification, |
---|
31 | assignedGroups: AssignedGroup, |
---|
32 | assignedPersons: AssignedPerson, |
---|
33 | subTasks: Task, |
---|
34 | associatedAssets: Asset, |
---|
35 | inventoryMovements: InventoryMovement] |
---|
36 | |
---|
37 | static mappedBy = [taskRecurringSchedule:"task"] |
---|
38 | |
---|
39 | static mapping = { |
---|
40 | primaryAsset lazy:false |
---|
41 | } |
---|
42 | |
---|
43 | static belongsTo = [TaskGroup, TaskStatus, Task, Person] |
---|
44 | |
---|
45 | static constraints = { |
---|
46 | description(blank:false,maxSize:75) |
---|
47 | comment(maxSize:1000) |
---|
48 | targetStartDate() |
---|
49 | targetCompletionDate(validator: {val, obj -> |
---|
50 | if(val.before(obj.targetStartDate)) |
---|
51 | return 'before.targetStartDate' |
---|
52 | }) |
---|
53 | leadPerson() |
---|
54 | taskPriority() |
---|
55 | taskBudgetStatus() |
---|
56 | taskStatus() |
---|
57 | parentTask(nullable:true) |
---|
58 | site(nullable:true) |
---|
59 | section(nullable:true) |
---|
60 | primaryAsset(nullable:true) |
---|
61 | assetSubItem(nullable:true) |
---|
62 | taskRecurringSchedule(nullable:true) |
---|
63 | taskProcedure(nullable:true) |
---|
64 | |
---|
65 | } |
---|
66 | |
---|
67 | String toString() { |
---|
68 | def s = "#${this.id} - " |
---|
69 | if(this.primaryAsset) |
---|
70 | s += "${primaryAsset.name}: " |
---|
71 | s += "${this.description}" |
---|
72 | } |
---|
73 | |
---|
74 | } |
---|