From 1acba83ff24cc364a438cf43c53218e99f9ea089 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Tue, 24 Dec 2024 15:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=99=E6=B1=9F=E6=97=A0=E7=BA=BF=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomReportServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/CustomReportServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/CustomReportServiceImpl.java index 517ae2a53..ecfaeb426 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/CustomReportServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/impl/CustomReportServiceImpl.java @@ -1360,7 +1360,11 @@ public class CustomReportServiceImpl implements CustomReportService { String key = entry.getKey(); double val = (double) entry.getValue(); String zi = key.substring(0, key.indexOf("#")); - zi = zi.substring(0,zi.lastIndexOf("_")); + String[] temStrArr = zi.split("_"); + boolean flag = isInteger(temStrArr[temStrArr.length-1]); + if(flag){ + zi = zi.substring(0,zi.lastIndexOf("_")); + } if (pqdMap.containsKey(zi)) { EleEpdPqd eleEpdPqd = pqdMap.get(zi).get(0); if(!eleEpdPqd.getPrimaryFormula().equals("*CT")){ @@ -1667,6 +1671,14 @@ public class CustomReportServiceImpl implements CustomReportService { } } + public static boolean isInteger(String str) { + try { + Integer.parseInt(str); + return true; + } catch (NumberFormatException e) { + return false; + } + } }