diff --git a/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java b/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java index d1536bde..dffde8cd 100644 --- a/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/result/service/impl/ResultServiceImpl.java @@ -1,6 +1,5 @@ package com.njcn.gather.result.service.impl; -import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; @@ -8,7 +7,6 @@ import cn.hutool.core.util.StrUtil; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.exception.BusinessException; -import com.njcn.gather.device.device.pojo.vo.CNDevExcel; import com.njcn.gather.device.device.service.IPqDevService; import com.njcn.gather.device.script.mapper.PqScriptMapper; import com.njcn.gather.device.script.pojo.po.PqScriptCheckData; @@ -100,6 +98,7 @@ public class ResultServiceImpl implements IResultService { allResultList.addAll(adNonHarmonicService.get(scriptId, null, queryParam.getDeviceId(), queryParam.getChnNum(), plan.getCode())); } + if (ObjectUtil.isNotEmpty(allResultList)) { Map> chnMap = allResultList.stream().collect( Collectors.groupingBy(obj -> obj.getMonitorId().substring(obj.getMonitorId().lastIndexOf("_") + 1)) @@ -107,8 +106,9 @@ public class ResultServiceImpl implements IResultService { chnMap.forEach((chn, list) -> { Map map = new HashMap<>(); map.put("value", chn); - long count = list.stream().filter(obj -> obj.getResultFlag() == 0).count(); - map.put("label", count > 0 ? "0" : "1"); + Set collect = list.stream().filter(obj -> obj.getResultFlag() != 4).map(AdBaseResult::getResultFlag).collect(Collectors.toSet()); + map.put("label", conform(collect) + ""); + chnList.add(map); }); }