지각 / 조기퇴근 체크
This commit is contained in:
parent
fbcec14177
commit
aa5915b4e7
@ -53,6 +53,10 @@ public class CommuteVO implements Serializable {
|
||||
private String firstActivityTime;
|
||||
private String lastActivityTime;
|
||||
|
||||
private String firstActivityTimeMemo;
|
||||
private String lastActivityTimeMemo;
|
||||
|
||||
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
|
||||
|
||||
@ -73,8 +73,14 @@ public class CommuteServiceImpl implements CommuteService {
|
||||
}
|
||||
|
||||
commuteList.stream().forEach(t->{
|
||||
System.out.println(t.getFirstActivityTime());
|
||||
|
||||
|
||||
t.setFirstActivityTimeMemo(this.getLateChk(t.getFirstActivityTime()));
|
||||
t.setLastActivityTimeMemo(this.getLeaveWorkEarly(t.getLastActivityTime()));
|
||||
|
||||
|
||||
if(StringUtils.isNotEmpty(t.getUsrid())){
|
||||
System.out.println("t.getUsrid() :: "+ t.getUsrid());
|
||||
try {
|
||||
t.setUsrid(UserEnum.valueOfLabel(t.getUsrid()).userName());
|
||||
}catch (Exception e){
|
||||
@ -90,4 +96,40 @@ public class CommuteServiceImpl implements CommuteService {
|
||||
return map;
|
||||
}
|
||||
|
||||
private String getLeaveWorkEarly(String p_lastActivityTime) {
|
||||
// DateTimeFormatter를 사용하여 String을 LocalDateTime으로 파싱
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime firstActivityTime = LocalDateTime.parse(p_lastActivityTime, formatter);
|
||||
|
||||
// 체크하고자 하는 시간 설정 (09:30)
|
||||
LocalTime checkTime = LocalTime.of(18, 30);
|
||||
|
||||
// firstActivityTime의 시간 부분만 추출
|
||||
LocalTime activityTime = firstActivityTime.toLocalTime();
|
||||
|
||||
// activityTime이 checkTime보다 이후인지 확인
|
||||
if (activityTime.isBefore(checkTime)) {
|
||||
return "조기퇴근";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private static String getLateChk(String p_firstActivityTime) {
|
||||
// DateTimeFormatter를 사용하여 String을 LocalDateTime으로 파싱
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime firstActivityTime = LocalDateTime.parse(p_firstActivityTime, formatter);
|
||||
|
||||
// 체크하고자 하는 시간 설정 (09:30)
|
||||
LocalTime checkTime = LocalTime.of(9, 30);
|
||||
|
||||
// firstActivityTime의 시간 부분만 추출
|
||||
LocalTime activityTime = firstActivityTime.toLocalTime();
|
||||
|
||||
// activityTime이 checkTime보다 이후인지 확인
|
||||
if (activityTime.isAfter(checkTime)) {
|
||||
return "지각";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -104,7 +104,9 @@
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>출근</th>
|
||||
<th>비고</th>
|
||||
<th>퇴근</th>
|
||||
<th>비고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -112,7 +114,9 @@
|
||||
<td th:text="${stat.count}"></td>
|
||||
<td th:text="${row.usrid}"></td>
|
||||
<td th:text="${row.firstActivityTime}"></td>
|
||||
<td th:text="${row.firstActivityTimeMemo}"></td>
|
||||
<td th:text="${row.lastActivityTime}"></td>
|
||||
<td th:text="${row.LastActivityTimeMemo}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
@ -120,7 +124,9 @@
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>출근</th>
|
||||
<th>비고</th>
|
||||
<th>퇴근</th>
|
||||
<th>비고</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user