fix:修改gamma报告 #MINIMUM 部分,mdc标题增加单位,mda没数据则不显示

This commit is contained in:
xiaoguangbin 2024-10-29 16:08:52 +08:00
parent 7227b70fa8
commit 555a6dd856

View File

@ -2,6 +2,7 @@ package org.jeecg.common.util;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.core.toolkit.StringPool;
@ -2813,16 +2814,28 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(System.lineSeparator()); strBuffer.append(System.lineSeparator());
List<CalMDCInfo> mdcInfos = middleData.mdcInfos; List<CalMDCInfo> mdcInfos = middleData.mdcInfos;
String mdcTitle = "%-15s%-18s%-15s%-15s"; String mdcTitle = "%-15s%-18s%-15s%-15s";
String[] mdcData = new String[]{" Nuclide", "Halflife", "MDC", "MDA(Bq)"};
strBuffer.append(rowFormat(mdcTitle, mdcData)); StringBuffer mdcSB = new StringBuffer();
strBuffer.append(System.lineSeparator()); boolean isMda = false;
for (CalMDCInfo mdcDto : mdcInfos) { for (CalMDCInfo mdcDto : mdcInfos) {
mdcDto.format(); mdcDto.format();
strBuffer.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(), mdcSB.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(),
mdcDto.getHalfLifeStr(), mdcDto.getMdcStr(), mdcDto.getMdaStr())); 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()); strBuffer.append(System.lineSeparator());
//换行 //换行