[143] | 1 | class TaskSearchService { |
---|
| 2 | |
---|
| 3 | boolean transactional = false |
---|
| 4 | |
---|
| 5 | def dateUtilService |
---|
| 6 | def authenticateService |
---|
| 7 | |
---|
| 8 | def getTodays(params) { |
---|
| 9 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 10 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 11 | params.sort = params?.sort ?: "id" |
---|
| 12 | params.order = params?.order ?: "desc" |
---|
| 13 | |
---|
| 14 | def taskInstanceList = Task.createCriteria().list( |
---|
| 15 | max: params.max, |
---|
| 16 | offset: params.offset, |
---|
| 17 | sort: params.sort, |
---|
| 18 | order: params.order) { |
---|
[219] | 19 | ge("targetStartDate", dateUtilService.today) |
---|
[143] | 20 | lt("targetStartDate", dateUtilService.getTomorrow()) |
---|
[181] | 21 | eq("trash", false) |
---|
[143] | 22 | } |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | def getMyTodays(params) { |
---|
| 26 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 27 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 28 | params.sort = params?.sort ?: "id" |
---|
| 29 | params.order = params?.order ?: "desc" |
---|
| 30 | |
---|
| 31 | def taskInstanceList = Task.createCriteria().list( |
---|
| 32 | max: params.max, |
---|
| 33 | offset: params.offset, |
---|
| 34 | sort: params.sort, |
---|
| 35 | order: params.order) { |
---|
| 36 | eq("leadPerson", Person.get(authenticateService.userDomain().id)) |
---|
[219] | 37 | ge("targetStartDate", dateUtilService.today) |
---|
[143] | 38 | lt("targetStartDate", dateUtilService.getTomorrow()) |
---|
[181] | 39 | eq("trash", false) |
---|
[143] | 40 | } |
---|
| 41 | } |
---|
[144] | 42 | |
---|
| 43 | def getInTheLastWeek(params) { |
---|
| 44 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 45 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 46 | params.sort = params?.sort ?: "id" |
---|
| 47 | params.order = params?.order ?: "desc" |
---|
| 48 | |
---|
| 49 | def taskInstanceList = Task.createCriteria().list( |
---|
| 50 | max: params.max, |
---|
| 51 | offset: params.offset, |
---|
| 52 | sort: params.sort, |
---|
| 53 | order: params.order) { |
---|
[219] | 54 | ge("targetStartDate", dateUtilService.oneWeekAgo) |
---|
[144] | 55 | lt("targetStartDate", dateUtilService.getTomorrow()) |
---|
[181] | 56 | eq("trash", false) |
---|
[144] | 57 | } |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | def getMyInTheLastWeek(params) { |
---|
| 61 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 62 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 63 | params.sort = params?.sort ?: "id" |
---|
| 64 | params.order = params?.order ?: "desc" |
---|
| 65 | |
---|
| 66 | def taskInstanceList = Task.createCriteria().list( |
---|
| 67 | max: params.max, |
---|
| 68 | offset: params.offset, |
---|
| 69 | sort: params.sort, |
---|
| 70 | order: params.order) { |
---|
| 71 | eq("leadPerson", Person.get(authenticateService.userDomain().id)) |
---|
[219] | 72 | ge("targetStartDate", dateUtilService.oneWeekAgo) |
---|
[144] | 73 | lt("targetStartDate", dateUtilService.getTomorrow()) |
---|
[181] | 74 | eq("trash", false) |
---|
[144] | 75 | } |
---|
| 76 | } |
---|
[165] | 77 | |
---|
| 78 | def getBudgetPlanned(params) { |
---|
| 79 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 80 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 81 | params.sort = params?.sort ?: "id" |
---|
| 82 | params.order = params?.order ?: "desc" |
---|
| 83 | |
---|
| 84 | def taskInstanceList = Task.createCriteria().list( |
---|
| 85 | max: params.max, |
---|
| 86 | offset: params.offset, |
---|
| 87 | sort: params.sort, |
---|
| 88 | order: params.order) { |
---|
[252] | 89 | eq("taskBudgetStatus", TaskBudgetStatus.get(2)) |
---|
[219] | 90 | ge("targetStartDate", dateUtilService.oneWeekAgo) |
---|
[252] | 91 | lt("targetStartDate", dateUtilService.tomorrow) |
---|
[181] | 92 | eq("trash", false) |
---|
[165] | 93 | } |
---|
| 94 | } |
---|
| 95 | |
---|
| 96 | def getBudgetUnplanned(params) { |
---|
| 97 | params.max = Math.min(params?.max?.toInteger() ?: 10, 100) |
---|
| 98 | params.offset = params?.offset?.toInteger() ?: 0 |
---|
| 99 | params.sort = params?.sort ?: "id" |
---|
| 100 | params.order = params?.order ?: "desc" |
---|
| 101 | |
---|
| 102 | def taskInstanceList = Task.createCriteria().list( |
---|
| 103 | max: params.max, |
---|
| 104 | offset: params.offset, |
---|
| 105 | sort: params.sort, |
---|
| 106 | order: params.order) { |
---|
[252] | 107 | eq("taskBudgetStatus", TaskBudgetStatus.get(1)) |
---|
[219] | 108 | ge("targetStartDate", dateUtilService.oneWeekAgo) |
---|
[165] | 109 | lt("targetStartDate", dateUtilService.getTomorrow()) |
---|
[181] | 110 | eq("trash", false) |
---|
[165] | 111 | } |
---|
| 112 | } |
---|
[143] | 113 | } |
---|