|
|
|
@ -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<OperMaintena
|
|
|
|
|
|
|
|
|
|
private VoteChartVo getVoteChartVo(List<OperMaintenanceTaskEntity> list) { |
|
|
|
|
VoteChartVo voteChartVo = new VoteChartVo(); |
|
|
|
|
List<Long> finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() == 3).map(s -> s.getId()).collect(Collectors.toList()); |
|
|
|
|
List<Long> undoneIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> s.getStatus() != 3).map(s -> s.getId()).collect(Collectors.toList()); |
|
|
|
|
List<Long> finishIds = Optional.ofNullable(list).orElse(new ArrayList<>()).stream().filter(s -> StringUtil.isNotBlank(s.getFlowTaskName())&&"结束".equals(s.getFlowTaskName())).map(BaseEntity::getId).collect(Collectors.toList()); |
|
|
|
|
//没有流程名称或者流程名称不等于结束,都算未完成
|
|
|
|
|
List<Long> 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()); |
|
|
|
|