From 8fc1362770748cbaef79d75415cc22ab4f6bb92a Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Fri, 20 Oct 2023 17:10:35 +0800 Subject: [PATCH] =?UTF-8?q?gamma=E5=8A=9F=E8=83=BD=E7=9A=84KorSumAnalyse?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E5=BD=93=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F=E8=B0=83=E7=94=A8=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/service/impl/GammaServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 3079408d..5d7f2de0 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -2234,9 +2234,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi throw new RuntimeException(e); } } - + //获取当前操作系统名称并转换为小写 + String os = System.getProperty("os.name").toLowerCase(); // 创建ProcessBuilder对象 - ProcessBuilder pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM.exe"); + ProcessBuilder pb = null; + //如果操作系统是windows 调用KORSUM.exe程序 + if (os.contains("win")) { + pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM.exe"); + } else { // 其他操作系统 调用KORSUM + pb = new ProcessBuilder(parameterProperties.getFilePath() + StringPool.SLASH + "KORSUM"); + } // 设置工作目录 pb.directory(new File(parameterProperties.getFilePath())); try {