查看结果数据-通道下拉列表修改

This commit is contained in:
caozehui
2025-01-21 11:08:20 +08:00
parent 1b3bc9f0f2
commit 491abdd18e

View File

@@ -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<String, List<AdBaseResult>> 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<String, String> 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<Integer> collect = list.stream().filter(obj -> obj.getResultFlag() != 4).map(AdBaseResult::getResultFlag).collect(Collectors.toSet());
map.put("label", conform(collect) + "");
chnList.add(map);
});
}