From 35ffbaaa1cd3ec8de18e3cbf30873ad64227e4d7 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Thu, 23 Nov 2023 11:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=98=89=E5=85=B4=20=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E4=BA=A7=E9=87=8F=20=E6=98=AF=E8=A6=81?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=95=BF=E5=BA=A6=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java index 6f4f14f..c725d5d 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/busi/jx/JxCenterWorkingBoardCenterOneService.java @@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -96,8 +97,11 @@ public class JxCenterWorkingBoardCenterOneService implements IJxCenterWorkingBoa } private List getUnnormalStopCenterData(List shiftProdCenterRecordList, String curTime) { - return CollectionUtils.isEmpty(shiftProdCenterRecordList) ? null : + List filterList = CollectionUtils.isEmpty(shiftProdCenterRecordList) ? null : shiftProdCenterRecordList.stream().filter(o -> (null != o && MesExtEnumUtil.SHIFT_PROD_TYPE.UNNORMAL_STOP_CENTER.getValue() == o.getProdType() && o.getStartTime().compareTo(curTime) <= 0)).collect(Collectors.toList()); + filterList = CollectionUtils.isEmpty(filterList) ? null : filterList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesShiftProdCenterRecord::getStartTime).reversed()).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(filterList) && filterList.size() > 3) filterList = filterList.subList(0, 3); + return filterList; } private List getFourMChangeData(MesWorkCenterExt workCenterExtDb, String curTime) {