```fix(考勤模块): 修正考勤统计和查询逻辑错误

修正了考勤统计中的迟到和早退状态判断逻辑。之前的逻辑错误地增加了迟到次数。此外,优化了考勤组查询逻辑,
根据用户权限获取相应的考勤组,提高了查询效率。

更改了对迟到和早退状态的判断顺序,保证了正确统计迟到和早退的次数。同时,重构了获取用户所属考勤组的
方法,确保根据用户权限返回全部考勤组或指定考勤组,增强了代码的健壮性和灵活性。
```
This commit is contained in:
aikai 2024-08-19 19:25:02 +08:00
parent ded5669b21
commit 6df2a2aba1

View File

@ -680,10 +680,10 @@ public class AttendanceServiceImpl implements AttendanceService {
if (AttendanceOnTheDayDTO.PUNCH_STATUS_MISS.equals(attendancePunchRecordDO.getStatus())) {
punchStatusMissNum++;
}
if (AttendanceOnTheDayDTO.PUNCH_STATUS_LEAVE_EARLY.equals(attendancePunchRecordDO.getStatus())) {
if (AttendanceOnTheDayDTO.PUNCH_STATUS_LATE.equals(attendancePunchRecordDO.getStatus())) {
lateNum++;
}
if (AttendanceOnTheDayDTO.PUNCH_STATUS_LATE.equals(attendancePunchRecordDO.getStatus())) {
if (AttendanceOnTheDayDTO.PUNCH_STATUS_LEAVE_EARLY.equals(attendancePunchRecordDO.getStatus())) {
leaveEarlyNum++;
}
if (Constants.TRUE.equals(attendancePunchRecordDO.getFieldServiceFlag())) {
@ -868,7 +868,12 @@ public class AttendanceServiceImpl implements AttendanceService {
public List<AttendanceGroupSystemVO> getTheAttendanceGroupToWhichTheCurrentlyLoggedInUserBelongsAndWhetherTheyHaveAdministratorRights(Boolean allFlag) {
Long userId = getLoginUserId();
List<AttendanceGroupSystemVO> attendanceGroupSystemVOS = new ArrayList<>();
List<AttendanceGroupDO> attendanceGroupDOS = attendanceGroupSystemService.getGroupSystemByUserId(userId);
List<AttendanceGroupDO> attendanceGroupDOS = new ArrayList<>();
if (allFlag) {
attendanceGroupDOS = attendanceGroupMapper.selectList();
} else {
attendanceGroupDOS = attendanceGroupSystemService.getGroupSystemByUserId(userId);
}
if (CollectionUtil.isEmpty(attendanceGroupDOS)) {
return attendanceGroupSystemVOS;
}