Browse Source

修改日常维护统计完成判定逻辑:从status修改为流程名称为结束-ty

zhongwei
yang_shj 1 year ago
parent
commit
aad6e5bcc9
  1. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java

8
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.lang.StringUtils;
import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.RandomUtils;
import org.springblade.core.log.exception.ServiceException; 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.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -448,10 +449,11 @@ public class OperMaintenanceTaskServiceImpl extends BaseServiceImpl<OperMaintena
private VoteChartVo getVoteChartVo(List<OperMaintenanceTaskEntity> list) { private VoteChartVo getVoteChartVo(List<OperMaintenanceTaskEntity> list) {
VoteChartVo voteChartVo = new VoteChartVo(); 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> 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 -> s.getStatus() != 3).map(s -> s.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.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.setFinishNum(finishIds.size());
voteChartVo.setFinishIds(finishIds); voteChartVo.setFinishIds(finishIds);
voteChartVo.setUndoneNum(undoneIds.size()); voteChartVo.setUndoneNum(undoneIds.size());

Loading…
Cancel
Save