diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java index 03ab32c53..fd0033cd4 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/service/impl/WorkerDailyAttendanceStatisticsV2ServiceImpl.java @@ -206,24 +206,22 @@ public class WorkerDailyAttendanceStatisticsV2ServiceImpl extends ServiceImpl 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 { //不做跨夜结算