新金湾,新考勤bug修复

This commit is contained in:
guoshengxiong 2025-06-25 18:26:09 +08:00
parent 10d2b693b2
commit c70dcc5562

View File

@ -206,24 +206,22 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl<Wo
Optional<CalAttendanceBo> nextDayMin = allAttendances.stream().filter(o -> DateUtil.isSameDay(DateUtil.offsetDay(date, 1), o.getDate())).min(Comparator.comparing(CalAttendanceBo::getDate));
if (Objects.equals(hourOvernightType, 1)) {
//跨夜工时按零点结算到前后两天
if (beforeDayMax.isPresent() && dayMin.isPresent() && beforeDayMax.get().getPassType() == 1 && beforeDayMax.get().getPassType() == 2) {
if (beforeDayMax.isPresent() && dayMin.isPresent() && beforeDayMax.get().getPassType() == 1 && dayMin.get().getPassType() == 2) {
//补date零点进
attendances.add(new CalAttendanceBo(personSn, DateUtil.beginOfDay(date), 1));
}
attendances.addAll(allAttendances.stream().filter(o -> DateUtil.isSameDay(date, o.getDate())).collect(Collectors.toList()));
if (dayMax.isPresent() && nextDayMin.isPresent() && dayMax.get().getPassType() == 2 && nextDayMin.get().getPassType() == 1) {
if (dayMax.isPresent() && nextDayMin.isPresent() && dayMax.get().getPassType() == 1 && nextDayMin.get().getPassType() == 2) {
//补date最后出
attendances.add(new CalAttendanceBo(personSn, DateUtil.endOfDay(date), 2));
}
} else if (Objects.equals(hourOvernightType, 2)) {
//跨夜工时结算到前一天
attendances.addAll(allAttendances.stream().filter(o -> DateUtil.isSameDay(date, o.getDate())).collect(Collectors.toList()));
if (dayMax.isPresent() && nextDayMin.isPresent()) {
if (dayMax.get().getPassType() == 1 && nextDayMin.get().getPassType() == 2) {
attendances.add(new CalAttendanceBo(personSn, DateUtil.endOfDay(date), 2));
attendances.add(new CalAttendanceBo(personSn, DateUtil.beginOfDay(DateUtil.offsetDay(date, 1)), 1));
attendances.add(new CalAttendanceBo(personSn, nextDayMin.get().getDate(), 2));
}
if (dayMax.isPresent() && nextDayMin.isPresent() && dayMax.get().getPassType() == 1 && nextDayMin.get().getPassType() == 2) {
attendances.add(new CalAttendanceBo(personSn, DateUtil.endOfDay(date), 2));
attendances.add(new CalAttendanceBo(personSn, DateUtil.beginOfDay(DateUtil.offsetDay(date, 1)), 1));
attendances.add(new CalAttendanceBo(personSn, nextDayMin.get().getDate(), 2));
}
} else {
//不做跨夜结算