From cc3f664855cd6f142fc15bb339f2400c8386d060 Mon Sep 17 00:00:00 2001 From: zhouyl <583641232@qq.com> Date: Tue, 8 Oct 2024 15:23:41 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=8A=A5=E5=91=8A=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TestReportServiceImpl.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tp-functional/src/main/java/com/inscloudtech/functional/service/impl/TestReportServiceImpl.java b/tp-functional/src/main/java/com/inscloudtech/functional/service/impl/TestReportServiceImpl.java index d9ae864..ca80267 100644 --- a/tp-functional/src/main/java/com/inscloudtech/functional/service/impl/TestReportServiceImpl.java +++ b/tp-functional/src/main/java/com/inscloudtech/functional/service/impl/TestReportServiceImpl.java @@ -222,8 +222,36 @@ public class TestReportServiceImpl extends ServiceImpl> groupByType = sysDictDataList.stream().collect(Collectors.groupingBy(SysDictData::getDictType)); for (String option : groupByType.keySet()) { + String substring = option.substring(option.length() - 1); + //反射 + String reportOptionVal = ""; + switch (substring){ + case "1": + reportOptionVal = vo.getReportOption1(); + break; + case "2": + reportOptionVal = vo.getReportOption2(); + break; + case "3": + reportOptionVal = vo.getReportOption3(); + break; + case "4": + reportOptionVal = vo.getReportOption4(); + break; + case "5": + reportOptionVal = vo.getReportOption5(); + break; + case "6": + reportOptionVal = vo.getReportOption6(); + break; + case "7": + reportOptionVal = vo.getReportOption7(); + break; + } + List report_option_1 = groupByType.get(option); - Optional first = report_option_1.stream().filter(item -> item.getDictValue().equals(vo.getReportOption1())).findFirst(); + String finalReportOptionVal = reportOptionVal; + Optional first = report_option_1.stream().filter(item -> item.getDictValue().equals(finalReportOptionVal)).findFirst(); if (!first.isPresent()) { continue;