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());