yaozc2021
2024-11-22 0799f543beca64dd1c6007e18cb8d8388b2fc391
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java
@@ -133,7 +133,7 @@
            LeaEndTime = LeaEndTime.substring(0,10) + " " + user.getSysRostering().getWorkEndTime().toString() + ":00";
        }
        // 查询其他状态的表是否有重复
        repeatValidation(LeaStartTime, LeaEndTime, resources.getUserId());
//        repeatValidation(LeaStartTime, LeaEndTime, resources.getUserId());
        // 验证请假时间是否冲突
        List<AttendanceLeave> attendanceLeaveList = attendanceLeaveRepository.checkCreateLeaveTime(LeaStartTime,LeaEndTime, resources.getUserId());
        if(attendanceLeaveList.size() > 0){
@@ -281,7 +281,7 @@
            LeaEndTime = LeaEndTime.substring(0,10) + " " + user.getSysRostering().getWorkEndTime().toString() + ":00";
        }
        // 查询其他状态的表是否有重复
        repeatValidation(LeaStartTime, LeaEndTime, resources.getUserId());
//        repeatValidation(LeaStartTime, LeaEndTime, resources.getUserId());
        // 验证是否存在时间冲突的请假记录
        Set<Long> ids = new HashSet<>();
        ids.add(attendanceLeave.getId());
@@ -458,10 +458,10 @@
        //获取年假剩余(新)
        Double surplusYearTime = new Double(0.00);
        List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserId(userId);
        List<AttendanceOvertime> attendanceOvertimeList = attendanceOvertimeRepository.findByUserIdAndApprovalStatus(userId, Constant.OVERTIME_PASS);
        if (attendanceOvertimeList.size() > 0) {
            surplusYearTime = attendanceOvertimeList.stream()
                    .filter(attendanceOvertime -> attendanceOvertime.getApprovalStatus().equals(Constant.OVERTIME_PASS))
                    .filter(attendanceOvertime -> !attendanceOvertime.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS))
                    .map(attendanceOvertime -> attendanceOvertime.getOvertimeDuration()).reduce(0.0, (o1, o2) -> o1 + o2);
            Double usedTime = attendanceLeaveRepository.sumLeaveDurationByUserIdAndLeaveType(userId, Constant.LEAVE_TYPE_REPLACE);
            if (usedTime != null) {