yao-zengchun
2026-01-08 c7ed489cee1127e3b4f96edf74e24b01c065ac2a
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/AttendanceMonthTalkServiceImpl.java
@@ -1,27 +1,23 @@
package me.zhengjie.modules.quartz.service.impl;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.attendance.domain.*;
import me.zhengjie.modules.attendance.repository.*;
import me.zhengjie.modules.attendance.service.impl.AttendanceLeaveServiceImpl;
import me.zhengjie.modules.attendance.service.impl.AttendanceServiceImpl;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.system.domain.Job;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.SysConfigHoliday;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.SysConfigHolidayRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.utils.DateUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDate;
@@ -138,7 +134,7 @@
        List<AttendanceMonth> insertData = new ArrayList<>();
        for (AttendanceMonth value : info.values()) {
            // 查询当月外出
            List<AttendanceGoOut> goOutList = attendanceGoOutRepository.findByUserAndDate(value.getUserId(), startTime, endTime);
            List<AttendanceGoOut> goOutList = attendanceGoOutRepository.findByUserAndDate(value.getUserId(), DateUtil.parseAttStartTime(startTime), DateUtil.parseAttEndTime(endTime));
            int goOutNumber = goOutList.size();
            // 外出次数
            value.setGoOutNumber(Long.valueOf(goOutNumber));
@@ -225,7 +221,7 @@
                attendanceMonthLeave.setLeaveTime(getLeaveDuration(leaves,leaveTpeList.get(i2)));
                //年假剩余时长
                if(leaveTpeList.get(i2).equals(Constant.LEAVE_TYPE_ANNUAL_LEAVE)){
                    Double yearTime = attendanceLeaveService.getYearTimeLength(insertData.get(i).getUserId());
                    Double yearTime = attendanceLeaveService.getYearTimeLength(insertData.get(i).getUserId(), null);
                    attendanceMonthLeave.setSurplusDuration(yearTime);
                } else if (leaveTpeList.get(i2).equals(Constant.LEAVE_TYPE_LACTATION_LEAVE)) {
                    Double yearTime = attendanceLeaveService.getOverTimeLength(insertData.get(i).getUserId(), LocalDateTime.now());