質問編集履歴

1

2016/02/27 07:50

投稿

snakeriver
snakeriver

スコア76

test CHANGED
File without changes
test CHANGED
@@ -19,65 +19,3 @@
19
19
 
20
20
 
21
21
  A,B,Cは社員IDとします。
22
-
23
- 現在以下のようなソースを書いています。
24
-
25
- public class MonthlyKintaiServiceImpl implements MonthlyKintaiService {
26
-
27
-
28
-
29
- //datepickerで月のボタンを押した結果yearとmonthがしてされて月ごとにデータ表示される
30
-
31
- private MonthlyDto keisanMonthlyDto(EmployeeDto employee, List<MonthlyDto> monthlyDtoList, Integer year, Integer month){
32
-
33
- //社員リスト
34
-
35
- List<EmployeeDto> employeeDtoList = new ArrayList<EmployeeDto>();
36
-
37
- //勤務時間、残業時間などが入ったリスト
38
-
39
- List<MonthlyDto> monthlyDtoList = new ArrayList<MonthlyDto>();
40
-
41
- HashMap<EmployeeDto, List<MonthlyDto>> map = new HashMap<EmployeeDto, List<MonthlyDto>>();
42
-
43
-
44
-
45
- //Mapの社員IDリストを追加
46
-
47
- for(MonthlyDto monthlyDtofor : monthlyDtoList){
48
-
49
- if(!employeeDtoList.contains(EmployeeDto.getId())){
50
-
51
- map.put(monthlyDtofor, new List<MonthlyDto>());
52
-
53
- }
54
-
55
- }
56
-
57
- Double totalWorktime = Double.valueOf(0);
58
-
59
- //勤怠リストを回す
60
-
61
- for(MonthlyDto monthlyDtofor : monthlyDtoList){
62
-
63
- MonthlyDto monthlyDto = new MonthlyDto();
64
-
65
- //Mapに入れたIDとmonthlyDtoにある社員IDが一致すれば、勤務時間数を足していく。
66
-
67
- if(EmployeeDto.getId().equals(monthlyDto.getId()){
68
-
69
- totalWorktime +=worktime;
70
-
71
- }
72
-
73
- }
74
-
75
- monthlyDto.setWorktime(totalWorktime);
76
-
77
- return //何を戻せばいいのでしょうかMap?monthlyDto?
78
-
79
-
80
-
81
- }
82
-
83
- }