1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.api.time.timeblock;
17
18 import org.joda.time.DateTime;
19 import org.joda.time.Interval;
20 import org.kuali.kpme.core.api.assignment.Assignment;
21 import org.kuali.kpme.core.api.block.CalendarBlockPermissions;
22 import org.kuali.kpme.core.api.calendar.entry.CalendarEntry;
23 import org.springframework.cache.annotation.CacheEvict;
24 import org.springframework.cache.annotation.Cacheable;
25 import org.springframework.cache.annotation.Caching;
26
27 import javax.jws.WebMethod;
28 import javax.jws.WebResult;
29 import javax.xml.bind.annotation.XmlElement;
30 import javax.xml.bind.annotation.XmlElementWrapper;
31 import java.math.BigDecimal;
32 import java.util.List;
33
34
35
36 public interface TimeBlockService {
37
38
39
40
41
42
43
44 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getTimeBlock}' + 'timeBlockId=' + #p0")
45 public TimeBlock getTimeBlock(String timeBlockId);
46
47
48
49
50
51
52 @Caching(evict = {
53 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true),
54 @CacheEvict(value={CalendarBlockPermissions.CACHE_NAME}, key="'{time}' + #p0.tkTimeBlockId")
55 })
56 public void deleteTimeBlock(TimeBlock timeBlock);
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 @WebResult(name = "timeBlocks")
78 public List<TimeBlock> buildTimeBlocks(String principalId, CalendarEntry calendarEntry, Assignment assignment, String earnCode, String documentId,
79 DateTime beginDateTime, DateTime endDateTime, BigDecimal hours, BigDecimal amount,
80 Boolean getClockLogCreated, Boolean getLunchDeleted, String userPrincipalId,
81 String clockLogBeginId, String clockLogEndId);
82
83
84
85
86
87
88
89
90
91
92 @Caching(evict = {
93 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true)
94 })
95 public List<TimeBlock> saveOrUpdateTimeBlocks(List<TimeBlock> oldTimeBlocks, List<TimeBlock> newTimeBlocks, String userPrincipalId);
96
97
98
99
100
101 @WebMethod(operationName = "saveTimeBlocks")
102 @XmlElementWrapper(name = "timeBlocks", required = true)
103 @XmlElement(name = "timeBlock", required = false)
104 @WebResult(name = "timeBlocks")
105 @Caching(evict = {
106 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true)
107 })
108 public List<TimeBlock> saveTimeBlocks(List<TimeBlock> tbList);
109
110
111
112
113
114
115
116
117
118 public List<TimeBlock> resetTimeHourDetail(List<TimeBlock> origTimeBlocks);
119
120
121
122
123
124
125
126
127
128
129 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getTimeBlocks}' + 'documentId=' + #p0")
130 public List<TimeBlock> getTimeBlocks(String documentId);
131
132 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getTimeBlocksWithMissedPunchInfo}' + 'documentId=' + #p0")
133 public List<TimeBlock> getTimeBlocksWithMissedPunchInfo(String documentId);
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154 public List<TimeBlock> buildTimeBlocksSpanDates(String principalId, CalendarEntry calendarEntry, Assignment assignment, String earnCode,
155 String documentId, DateTime beginDateTime, DateTime endDateTime, BigDecimal hours, BigDecimal amount,
156 Boolean clockLogCreated, Boolean lunchDeleted, String userPrincipalId,
157 String clockLogBeginId, String clockLogEndId);
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174 public TimeBlock createTimeBlock(String principalId, String documentId, DateTime beginDateTime, DateTime endDateTime,
175 Assignment assignment, String earnCode, BigDecimal hours, BigDecimal amount,
176 Boolean clockLogCreated, Boolean lunchDeleted, String userPrincipalId);
177
178
179 @Caching(evict = {
180 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true),
181 @CacheEvict(value={CalendarBlockPermissions.CACHE_NAME}, allEntries = true)
182 })
183 public void deleteTimeBlocksAssociatedWithDocumentId(String documentId);
184
185
186
187 public Boolean getTimeBlockEditable(TimeBlock tb);
188
189
190
191
192
193
194
195
196
197
198 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getTimeBlocksForClockLogEndId}' + 'tkClockLogId=' + #p0")
199 public List<TimeBlock> getTimeBlocksForClockLogEndId(String tkClockLogId);
200
201
202
203
204
205
206
207
208
209
210 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getTimeBlocksForClockLogBeginId}' + 'tkClockLogId=' + #p0")
211 public List<TimeBlock> getTimeBlocksForClockLogBeginId(String tkClockLogId);
212
213
214
215
216
217 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getLatestEndTimestampForEarnCode}' + 'earnCode=' + #p0")
218 public List<TimeBlock> getLatestEndTimestampForEarnCode(String earnCode);
219
220
221
222
223
224
225
226
227
228
229 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{getOvernightTimeBlocks}' + 'clockLogEndId=' + #p0")
230 public List<TimeBlock> getOvernightTimeBlocks(String clockLogEndId);
231
232
233
234 @Cacheable(value= TimeBlock.CACHE_NAME, key="'{isOvernightTimeBlock}' + 'clockLogEndId=' + #p0")
235 public boolean isOvernightTimeBlock(String clockLogEndId);
236
237
238
239 @Caching(evict = {
240 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true),
241 @CacheEvict(value={CalendarBlockPermissions.CACHE_NAME}, key="'{time}' + #p0.tkTimeBlockId")
242 })
243 public TimeBlock updateTimeBlock(TimeBlock tb);
244
245
246 @Caching(evict = {
247 @CacheEvict(value={TimeBlock.CACHE_NAME}, allEntries = true)
248 })
249 void deleteLunchDeduction(String tkTimeHourDetailId);
250
251
252
253
254
255 public List<TimeBlock> applyHolidayPremiumEarnCode(String principalId, List<Assignment> timeAssignments, List<TimeBlock> appliedTimeBlocks);
256
257
258 public List<TimeBlock> getIntersectingTimeBlocks(String principalId, DateTime startTime, DateTime endTime);
259 }