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()); //换行