|
|
@@ -55,7 +55,7 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
@Override |
|
|
|
public TableDataInfo<DkCheckInRecordDTO> queryPageList(DkCheckInRecordDTO dkCheckInRecordDTO, PageQuery pageQuery) { |
|
|
|
LoginUser loginUser = LoginHelper.getLoginUser(); |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO, null); |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO); |
|
|
|
if (dkCheckInRecordDTO.getFlag().equals("my")){ |
|
|
|
if (loginUser == null) { |
|
|
|
return TableDataInfo.build(); |
|
|
@@ -76,7 +76,7 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
return TableDataInfo.build(result); |
|
|
|
} |
|
|
|
|
|
|
|
private LambdaQueryWrapper<DkCheckInRecord> buildQueryWrapper(DkCheckInRecordDTO dkCheckInRecordDTO, String flag) { |
|
|
|
private LambdaQueryWrapper<DkCheckInRecord> buildQueryWrapper(DkCheckInRecordDTO dkCheckInRecordDTO) { |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = Wrappers.lambdaQuery(); |
|
|
|
|
|
|
|
queryWrapper.eq(null != dkCheckInRecordDTO.getSysUserId() ,DkCheckInRecord::getSysUserId, dkCheckInRecordDTO.getSysUserId()); |
|
|
@@ -97,13 +97,9 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
queryWrapper.between(DkCheckInRecord::getCheckInTime, TimeUtils.getFirstDayOfMonth(dkCheckInRecordDTO.getStrMonth()), |
|
|
|
TimeUtils.getLastDayOfMonth(dkCheckInRecordDTO.getStrMonth())); |
|
|
|
} |
|
|
|
if(flag != null){ |
|
|
|
queryWrapper.select(DkCheckInRecord::getSysUserName, DkCheckInRecord::getSysUserId, DkCheckInRecord::getNickName); |
|
|
|
queryWrapper.in(null != dkCheckInRecordDTO.getAttendanceGroupIds() ,DkCheckInRecord::getAttendanceGroupId, dkCheckInRecordDTO.getAttendanceGroupIds()); |
|
|
|
queryWrapper.groupBy(DkCheckInRecord::getSysUserName).groupBy(DkCheckInRecord::getSysUserId).groupBy(DkCheckInRecord::getNickName); |
|
|
|
}else{ |
|
|
|
queryWrapper.orderByDesc(DkCheckInRecord::getSysUserName).orderByDesc(DkCheckInRecord::getCheckInTime); |
|
|
|
} |
|
|
|
|
|
|
|
queryWrapper.orderByDesc(DkCheckInRecord::getSysUserName).orderByDesc(DkCheckInRecord::getCheckInTime); |
|
|
|
|
|
|
|
return queryWrapper; |
|
|
|
} |
|
|
|
|
|
|
@@ -113,7 +109,7 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<DkCheckInRecordDTO> queryList(DkCheckInRecordDTO dkCheckInRecordDTO) { |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO, null); |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO); |
|
|
|
List<DkCheckInRecordDTO> dkCheckInRecordDTOS = dkMapper.selectVoList(queryWrapper); |
|
|
|
dkCheckInRecordDTOS.forEach(dk -> { |
|
|
|
if("0".equals(dk.getCheckInStatus())){ |
|
|
@@ -146,8 +142,10 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
if (inputMonth.isAfter(currentMonth)) { |
|
|
|
return ; |
|
|
|
} |
|
|
|
// 查询出考勤组所有人员 |
|
|
|
List<DkAttendanceGroupAndUser> users = dkAttendanceGroupAndUserMapper.selectList(); |
|
|
|
// 查询出选择的考勤组下面的所有人员 |
|
|
|
QueryWrapper<DkAttendanceGroupAndUser> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.in("attendance_team_id",dkCheckInRecordDTO.getAttendanceGroupIds()); |
|
|
|
List<DkAttendanceGroupAndUser> users = dkAttendanceGroupAndUserMapper.selectList(queryWrapper); |
|
|
|
if (users==null||users.size()==0) { |
|
|
|
return; |
|
|
|
} |
|
|
@@ -273,8 +271,8 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
|
|
|
|
// 定义集合,用于存储每天打卡记录 |
|
|
|
List<DayRecord> dayRecords = new ArrayList<>(); |
|
|
|
// 根据用户的ID查询该用户所有的打卡记录 |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO, null); |
|
|
|
// 根据用户的ID 和月份查询该用户所有的打卡记录 |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO); |
|
|
|
List<DkCheckInRecordDTO> dkCheckInRecordDTOS = dkMapper.selectVoList(queryWrapper); |
|
|
|
if (dkCheckInRecordDTOS == null && dkCheckInRecordDTOS.isEmpty()){ |
|
|
|
return data; |
|
|
@@ -531,8 +529,8 @@ public class DkRecordServiceImpl implements DkRecordService { |
|
|
|
// 定义集合,用于存储每天打卡记录 |
|
|
|
List<DayRecord> dayRecords = new ArrayList<>(); |
|
|
|
|
|
|
|
// 根据用户的ID查询该用户所有的打卡记录 |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO, null); |
|
|
|
// 根据用户的ID 和月份查询该用户所有的打卡记录 |
|
|
|
LambdaQueryWrapper<DkCheckInRecord> queryWrapper = buildQueryWrapper(dkCheckInRecordDTO); |
|
|
|
List<DkCheckInRecordDTO> dkCheckInRecordDTOS = dkMapper.selectVoList(queryWrapper); |
|
|
|
// 构造excel数据 |
|
|
|
for(DkCheckInRecordDTO dk : dkCheckInRecordDTOS){ |