From 0526434f1677f3903902a944113812b88fc99503 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Fri, 18 Apr 2025 19:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E9=9B=B6=E4=BB=B6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1Sheet=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java index 18b3171..8d85665 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesShiftServiceImpl.java @@ -159,8 +159,6 @@ public class MesShiftServiceImpl implements IMesShiftService { String today = nowTime.substring(0, 10); String time = nowTime.substring(11); - Optional shiftOptional = shiftList.stream().filter(o -> (null != o - && !StringUtils.isEmpty(o.getStartTime()) && !StringUtils.isEmpty(o.getEndTime()) && o.getStartTime().compareTo(time) <= 0 && o.getEndTime().compareTo(time) >= 0)).findFirst(); MesShift shiftOp = null; for (MesShift shift : shiftList) { if (null == shift || StringUtils.isEmpty(shift.getStartTime()) || StringUtils.isEmpty(shift.getEndTime())) continue; @@ -178,10 +176,10 @@ public class MesShiftServiceImpl implements IMesShiftService { //实际开班时间 比 当天早班的开始时间 小的情况下, 代表的是前一天的班次 if (nowTime.compareTo(todayStartTime) < 0) { String yesterday = calcDay(today, -1); - return calcShiftTime(shiftOptional.get().getStartTime(), shiftOptional.get().getEndTime(), yesterday); + return calcShiftTime(shiftOp.getStartTime(), shiftOp.getEndTime(), yesterday); } else { //当天的班次 - return calcShiftTime(shiftOptional.get().getStartTime(), shiftOptional.get().getEndTime(), today); + return calcShiftTime(shiftOp.getStartTime(), shiftOp.getEndTime(), today); } }