huminmin
21 小时以前 569483bbc66ad0b141fe946b2c19c0de83bccba4
src/main/java/com/ruoyi/staff/service/impl/PersonalAttendanceRecordsServiceImpl.java
@@ -71,6 +71,7 @@
        /*查询员工信息*/
        QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>();
        staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername());
        staffQueryWrapper.eq("staff_state", 1);//在职
        StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper);
        if (staffOnJob == null) {
            throw new BaseException("当前用户没有对应的员工信息");
@@ -107,8 +108,8 @@
        int actualHour = currentDateTime.getHour();
        int actualMinute = currentDateTime.getMinute();
        // 判断打卡时间是否晚于当前时间
        if (actualHour > standardHour || (actualHour == standardHour && actualMinute > standardMinute)) {
            throw new BaseException(String.format("打卡失败:打卡时间不能晚于下班时间(%02d:%02d)", standardHour, standardMinute));
        if (actualHour < standardHour || (actualHour == standardHour && actualMinute < standardMinute)) {
            throw new BaseException(String.format("打卡失败:打卡时间不能早于下班时间(%02d:%02d)", standardHour, standardMinute));
        }
        // 根据员工ID和当前日期查询打卡记录
        QueryWrapper<PersonalAttendanceRecords> attendanceQueryWrapper = new QueryWrapper<>();
@@ -194,6 +195,7 @@
        if (!admin) {
            QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>();
            staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername());
            staffQueryWrapper.eq("staff_state", 1);//在职
            StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper);
            if (staffOnJob == null) {
                return new Page<>(page.getCurrent(), page.getSize(), 0);
@@ -212,6 +214,7 @@
        // 首先根据用户ID查询员工信息
        QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>();
        staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername());
        staffQueryWrapper.eq("staff_state", 1);//在职
        StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper);
        if (staffOnJob == null) {
@@ -255,6 +258,7 @@
        if (!admin) {
            QueryWrapper<StaffOnJob> staffQueryWrapper = new QueryWrapper<>();
            staffQueryWrapper.eq("staff_no", SecurityUtils.getUsername());
            staffQueryWrapper.eq("staff_state", 1);//在职
            StaffOnJob staffOnJob = staffOnJobMapper.selectOne(staffQueryWrapper);
            if (staffOnJob == null) {
                throw new ServiceException("没有员工信息,无法导出考勤记录");