|
|
@@ -16,6 +16,7 @@ import java.time.LocalDate; |
|
|
|
import java.time.LocalTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeParseException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Service |
|
|
@@ -374,7 +375,19 @@ public class DkAppServiceImpl implements DkAppService { |
|
|
|
@Override |
|
|
|
public List<DkCheckInRecord> getCurrentDayRecord(AppDTO appDTO) { |
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
List<DkCheckInRecord> currentDayRecords = dkRecordMapper.getCurrentDayRecord(appDTO.getUserId(), currentDate); |
|
|
|
return currentDayRecords; |
|
|
|
// List<DkCheckInRecord> currentDayRecords = dkRecordMapper.getCurrentDayRecord(appDTO.getUserId(), currentDate); |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper1.eq(DkCheckInRecord::getSysUserId, appDTO.getUserId()); |
|
|
|
List<DkCheckInRecord> dkCheckInRecords1 = dkRecordMapper.selectList(queryWrapper1); |
|
|
|
|
|
|
|
// 判断是否已经存在打卡数据 |
|
|
|
List<DkCheckInRecord> results = new ArrayList<>(); |
|
|
|
DkCheckInRecord dkCheckInRecord = null; |
|
|
|
if(dkCheckInRecords1.size() > 0){ |
|
|
|
System.out.println("已存在打卡数据"+ LocalDate.now() ); |
|
|
|
dkCheckInRecord = dkCheckInRecords1.stream().filter(dkCheckInRecord1 -> dkCheckInRecord1.getCheckInTime().toLocalDate().equals(LocalDate.now())).findFirst().orElse(null); |
|
|
|
results.add(dkCheckInRecord); |
|
|
|
} |
|
|
|
return results; |
|
|
|
} |
|
|
|
} |