From 555a6dd856e52e16071ca9ea636cdad017d8e5e1 Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Tue, 29 Oct 2024 16:08:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9gamma=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=20#MINIMUM=20=E9=83=A8=E5=88=86=EF=BC=8Cmdc=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=BD=8D=EF=BC=8Cmda?= =?UTF-8?q?=E6=B2=A1=E6=95=B0=E6=8D=AE=E5=88=99=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 50ac3f81..523d9c41 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2,6 +2,7 @@ package org.jeecg.common.util; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.StringPool; @@ -2813,16 +2814,28 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(System.lineSeparator()); List mdcInfos = middleData.mdcInfos; String mdcTitle = "%-15s%-18s%-15s%-15s"; - String[] mdcData = new String[]{" Nuclide", "Halflife", "MDC", "MDA(Bq)"}; - strBuffer.append(rowFormat(mdcTitle, mdcData)); - strBuffer.append(System.lineSeparator()); + + StringBuffer mdcSB = new StringBuffer(); + boolean isMda = false; for (CalMDCInfo mdcDto : mdcInfos) { mdcDto.format(); - strBuffer.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(), + mdcSB.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(), mdcDto.getHalfLifeStr(), mdcDto.getMdcStr(), mdcDto.getMdaStr())); //换行 - strBuffer.append(System.lineSeparator()); + mdcSB.append(System.lineSeparator()); + if (!isMda && StrUtil.isNotBlank(mdcDto.getMdaStr())) { + isMda = true; + } } + String[] mdcData = new String[]{" Nuclide", "Halflife", "MDC(uBq/m3)", ""}; + // 如果有 MDA 就显示标题 + if (isMda) { + mdcData = new String[]{" Nuclide", "Halflife", "MDC(uBq/m3)", "MDA(uBq)"}; + } + strBuffer.append(rowFormat(mdcTitle, mdcData)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(mdcSB); + //换行 strBuffer.append(System.lineSeparator()); //换行