1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.workschedule.service;
17
18 import java.sql.Date;
19 import java.util.List;
20
21 import org.kuali.hr.time.workschedule.WorkScheduleAssignment;
22 import org.kuali.hr.time.workschedule.dao.WorkScheduleAssignmentDao;
23
24 public class WorkScheduleAssignmentServiceImpl implements WorkScheduleAssignmentService {
25
26 private WorkScheduleAssignmentDao workScheduleAssignmentDao;
27
28 @Override
29 public void saveOrUpdate(WorkScheduleAssignment wsa) {
30 workScheduleAssignmentDao.saveOrUpdate(wsa);
31 }
32
33 @Override
34 public List<WorkScheduleAssignment> getWorkScheduleAssignments(String principalId, String department, Long workArea, Date asOfDate) {
35 List<WorkScheduleAssignment> list = null;
36
37
38
39 list = workScheduleAssignmentDao.getWorkScheduleAssignments(principalId, department, workArea, asOfDate);
40
41
42 if (list.isEmpty())
43 list = workScheduleAssignmentDao.getWorkScheduleAssignments(principalId, department, -1L, asOfDate);
44
45
46 if (list.isEmpty())
47 list = workScheduleAssignmentDao.getWorkScheduleAssignments(principalId, "%", workArea, asOfDate);
48
49
50 if (list.isEmpty())
51 list = workScheduleAssignmentDao.getWorkScheduleAssignments(principalId, "%", -1L, asOfDate);
52
53
54 if (list.isEmpty())
55 list = workScheduleAssignmentDao.getWorkScheduleAssignments("%", department, workArea, asOfDate);
56
57
58 if (list.isEmpty())
59 list = workScheduleAssignmentDao.getWorkScheduleAssignments("%", department, -1L, asOfDate);
60
61
62 if (list.isEmpty())
63 list = workScheduleAssignmentDao.getWorkScheduleAssignments("%", "%", workArea, asOfDate);
64
65
66 if (list.isEmpty())
67 list = workScheduleAssignmentDao.getWorkScheduleAssignments("%", "%", -1L, asOfDate);
68
69 return list;
70 }
71
72 public void setWorkScheduleAssignmentDao(WorkScheduleAssignmentDao workScheduleAssignmentDao) {
73 this.workScheduleAssignmentDao = workScheduleAssignmentDao;
74 }
75 }