From aad6e5bcc90ab9b8480849f3b846624526c091a7 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 1 Dec 2023 15:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=B8=B8=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E7=BB=9F=E8=AE=A1=E5=AE=8C=E6=88=90=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=9A=E4=BB=8Estatus=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=B5=81=E7=A8=8B=E5=90=8D=E7=A7=B0=E4=B8=BA=E7=BB=93?= =?UTF-8?q?=E6=9D=9F-ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/service/impl/OperMaintenanceTaskServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java index dab8118..6f8aa43 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java @@ -32,6 +32,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.RandomUtils; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -448,10 +449,11 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl list) { VoteChartVo voteChartVo = new VoteChartVo(); - List finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() == 3).map(s -> s.getId()).collect(Collectors.toList()); - List undoneIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() != 3).map(s -> s.getId()).collect(Collectors.toList()); + List finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> StringUtil.isNotBlank(s.getFlowTaskName())&&"结束".equals(s.getFlowTaskName())).map(BaseEntity::getId).collect(Collectors.toList()); + //没有流程名称或者流程名称不等于结束,都算未完成 + List undoneIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> StringUtil.isBlank(s.getFlowTaskName())||!"结束".equals(s.getFlowTaskName())).map(BaseEntity::getId).collect(Collectors.toList()); voteChartVo.setSumNum(list.size()); - voteChartVo.setSumIds(list.stream().map(s -> s.getId()).collect(Collectors.toList())); + voteChartVo.setSumIds(list.stream().map(BaseEntity::getId).collect(Collectors.toList())); voteChartVo.setFinishNum(finishIds.size()); voteChartVo.setFinishIds(finishIds); voteChartVo.setUndoneNum(undoneIds.size());