From a61ab0de3f1f9b25a263ea5b4dee2a398ab4cc71 Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Wed, 17 May 2023 14:13:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=99list.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/service/impl/DataSetServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dataset/service/impl/DataSetServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dataset/service/impl/DataSetServiceImpl.java index b5ca265f..d53474e8 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dataset/service/impl/DataSetServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dataset/service/impl/DataSetServiceImpl.java @@ -33,11 +33,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -330,6 +328,10 @@ public class DataSetServiceImpl implements DataSetService { List data = dataSourceService.execute(dataSourceDto); //5.数据转换 List transform = dataSetTransformService.transform(dto.getDataSetTransformDtoList(), data); + //测试结果只保留list(0) + if (!CollectionUtils.isEmpty(transform) && transform.size() > 1) { + transform = Collections.singletonList(transform.get(0)); + } originalDataDto.setData(transform); return originalDataDto; }