From c70dcc5562eac53fa93df5a9fbed1fb3284f961a Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Wed, 25 Jun 2025 18:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=87=91=E6=B9=BE=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E8=80=83=E5=8B=A4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rkerDailyAttendanceStatisticsV2ServiceImpl.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 { //不做跨夜结算