From 40ad390f91464e388b552babf8a22f37afff216b Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Mon, 31 Mar 2025 18:43:58 +0800 Subject: [PATCH] =?UTF-8?q?45843=201=20=E6=97=A0=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E8=A1=A5=E6=8A=A5=E5=B7=A5JOB=E9=92=88=E5=AF=B9=E5=A4=9A?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=89=88=E6=9C=AC=E5=9C=BA=E6=99=AF=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8SAP=20=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE0001=E8=BF=9B=E8=A1=8C=E8=A1=A5=E6=8A=A5=E5=B7=A5=202?= =?UTF-8?q?=20=E6=97=A0=E5=B7=A5=E5=8D=95=E6=8A=A5=E5=B7=A5=EF=BC=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BA=A7=E7=BA=BF=E7=89=A9=E6=96=99=E5=8F=B7?= =?UTF-8?q?=E4=B8=BA=E4=B8=80=E4=B8=AA=E4=BA=8B=E5=8A=A1=E5=8E=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=94=9F=E4=BA=A7=E7=89=88=E6=9C=AC=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java index d00ec76..e02babc 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java @@ -828,17 +828,21 @@ public class MesWorkOrderService implements IMesWorkOrderService { MesShift currentShift = shiftList.stream().filter(shift -> { String startTime = lotNo + " " + shift.getStartTime(); String endTime = lotNo + " " + shift.getEndTime(); - if (Objects.equals(shift.getShiftCode(), "20")) { - endTime = getDateTime(lotNo, 2) + " " + shift.getEndTime(); + // 如果是晚班,12点前,结束时间要加一天,如果是12点后,开始时间要减一天 + if (Objects.equals(shift.getShiftCode(),"20")) { + if (hours < 12) { + startTime = getDateTime(lotNo, 1) + " " + shift.getStartTime(); + } else { + endTime = getDateTime(lotNo, 2) + " " + shift.getEndTime(); + } } Date startDate = DateUtil.parse(startTime); Date endDate = DateUtil.parse(endTime); - return currentDate.getTime() > startDate.getTime() && currentDate.getTime() < endDate.getTime(); + return currentDate.getTime() >= startDate.getTime() && currentDate.getTime() <= endDate.getTime(); }).findFirst().orElse(null); - String orderDate = productionRecord.getLotNo(); if (currentShift.getStartTime().compareTo(currentShift.getEndTime()) > 0) { // 如果比0点大,需要找日期前一天的班次的工单号,如果是0点前,date =lotNO 如果是0点后,则找lot的前一天