feat:RRR报告增加块

This commit is contained in:
nieziyan 2024-08-15 18:48:43 +08:00
parent a2980c0289
commit 6824b1e2d8
8 changed files with 574 additions and 1 deletions

View File

@ -55,6 +55,15 @@ public class NumUtil {
return result;
}
public static String keep6ScienceStr(Double value){
if (ObjectUtil.isNull(value))
return null;
String result = NumberUtil.decimalFormat("0.######E00", value);
if (!StrUtil.contains(result, "E-"))
return StrUtil.replace(result, "E", "E+");
return result;
}
public static Double keep(Double value, int scale){
if (ObjectUtil.isNull(value))
return null;

View File

@ -0,0 +1,62 @@
package org.jeecg.modules.base.dto;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import org.jeecg.common.util.NumUtil;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Objects;
@Data
public class MdcDto {
private String nuclideName;
private Double halfLife;
private Double mdc;
private Double mda;
private String halfLifeStr;
private String mdcStr;
private String mdaStr;
public MdcDto(){
halfLifeStr = "";
mdcStr = "";
mdaStr = "";
}
public void format(){
if (ObjectUtil.isNotNull(halfLife))
halfLifeStr = halfLifeStr(halfLife);
if (ObjectUtil.isNotNull(mdc))
mdcStr = NumUtil.keep6ScienceStr(mdc);
if (ObjectUtil.isNotNull(mda))
mdaStr = NumUtil.keep6ScienceStr(mda);
}
private String halfLifeStr(Double halflife){
String units = "D";
if (halflife >= 1000) {
halflife = halflife / 365.25;
units = "A";
} else if (halflife < 0.1 && halflife >= 1.0 / 1440.0) {
halflife = halflife * 1440.0;
units = "M";
} else if (halflife <= 1.0 / 1440.0 && halflife > 0.0) {
halflife = halflife * 86400.0;
units = "S";
}
if (halflife < 1000)
return String.format("%.3f", halflife) + units;
NumberFormat numberFormat = new DecimalFormat("0.###E0");
return numberFormat.format(halflife) + units;
}
}

View File

@ -17,6 +17,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.common.properties.SpectrumPathProperties;
import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
import org.jeecg.modules.base.dto.MdcDto;
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
import org.jeecg.modules.base.enums.CalName;
import org.jeecg.modules.base.enums.CalType;
@ -2313,6 +2314,16 @@ public class GammaFileUtil extends AbstractLogOrReport {
}
}
public String GetReportContent(PHDFile phd, String userName, boolean bLog, String flag, List<MdcDto> mdcDtos) {
GStoreMiddleProcessData middleData = new GStoreMiddleProcessData();
GetInterMiddlData(phd, userName, middleData, flag);
if(bLog) {
return GetLogContent(middleData);
} else {
return GetReportContent(middleData, mdcDtos);
}
}
public boolean GetInterMiddlData(PHDFile phd, String userName, GStoreMiddleProcessData middleData, String flag) {
boolean bRet = true;
Map<String, NuclideLines> temp = new HashMap<>();
@ -2809,6 +2820,462 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#MINIMUM DETECTABLE CONCENTRATION FOR KEY NUCLIDES");
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#PEAK SEARCH RESULTS");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(StringPool.SPACE+middleData.peaks_idPeak.size()+" peaks reported:");
//换行
strBuffer.append(System.lineSeparator());
double peaksUsed = 0;
for(int m=0;m<middleData.peaks_Nuclide_name.size();m++) {
if(StringUtils.isNotBlank(middleData.peaks_Nuclide_name.get(m))) {
peaksUsed++;
}
}
strBuffer.append(StringPool.SPACE+peaksUsed+" peaks with ID ("+NumberFormatUtil.numberSixLen(String.valueOf(peaksUsed/middleData.peaks_idPeak.size()*100))+"%):");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(StringPool.SPACE+(middleData.peaks_idPeak.size()-peaksUsed)+" peaks without ID("+NumberFormatUtil.numberSixLen(String.valueOf(Double.valueOf(middleData.peaks_idPeak.size()-peaksUsed)/middleData.peaks_idPeak.size()*100))+"%):");
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
String peakTitle = "%-10s%-15s%-15s%-14s%-15s%-21s%-15s%-11s%-28s";
String[] peakData = new String[]{" PeakID", "Energy[kev]", "Centroid", "FWHM[kev]", "NetArea", "NAErr%", "Signif", "Sensit", "Nuclide"};
strBuffer.append(rowFormat(peakTitle, peakData));
strBuffer.append(System.lineSeparator());
for (int i=0; i<middleData.peaks_idPeak.size(); i++){
strBuffer.append(rowFormat(peakTitle, StringPool.SPACE+middleData.peaks_idPeak.get(i), String.format("%.3f", Double.valueOf(middleData.peaks_Energy.get(i))),
String.format("%.3f", Double.valueOf(middleData.peaks_peakCentroid.get(i))), String.format("%.3f", Double.valueOf(middleData.peaks_Fwhm.get(i))),
String.format("%.3f", Double.valueOf(middleData.peaks_Area.get(i))),
String.format("%.3f", (Double.valueOf(middleData.peaks_areaErr.get(i))/Double.valueOf(middleData.peaks_Area.get(i))*100)),
String.format("%.3f", Double.valueOf(middleData.peaks_Significance.get(i))), String.format("%.3f", Double.valueOf(middleData.peaks_Sensitivity.get(i))),
StringUtils.join(middleData.peaks_Nuclide_name.get(i), StringPool.SEMICOLON)));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#PROCESSING PARAMETERS");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sECutAnalysis_Low:%-19s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sECutAnalysis_High:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sEnergyTolerance:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sBaseImprovePSS:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sPSS_low:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sk_back:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sk_alpha:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sk_beta:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sRiskLevelK:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK())));
//换行
strBuffer.append(System.lineSeparator());
Date refTimeAct = middleData.setting_specSetup.getRefTime_act();
strBuffer.append(rowFormat("%srefTime_act:%-24s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss"));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%srefTime_conc:%-23s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss")));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#CALIBRATION PARAMETERS");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCalibrationPSS_low:%-17s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCalibrationPSS_high:%-16s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sbUpdateCal:%-25s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0")));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-13s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0")));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
if(middleData.calibration_pairs_E_idCalPoint.size()>0) {
strBuffer.append("#Calibration");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(" Energy Calibration ["+middleData.calibration_pairs_E_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE4 = new String[]{" E"};
String[] datasE4 = new String[]{middleData.calibration_E_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE4 = GetReportFixedWidth(cellsE4, datasE4, 30);
List<String> titleE4 = reportMapE4.get("title");
List<String> contentE4 = reportMapE4.get("content");
for (int i=0; i< titleE4.size(); i++) {
String title = titleE4.get(i);
String content = contentE4.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
String[] cells4 = new String[]{" P"};
String[] datas4 = new String[]{middleData.calibration_E_coeff_string};
//根据固定宽度切割数据
Map<String, List<String>> reportMap4 = GetReportFixedWidth(cells4, datas4, 30);
List<String> title4 = reportMap4.get("title");
List<String> content4 = reportMap4.get("content");
for (int i=0; i< title4.size(); i++) {
String title = title4.get(i);
String content = content4.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
}
if(middleData.calibration_pairs_R_idCalPoint.size()>0) {
strBuffer.append(" Resolution Calibration ["+middleData.calibration_pairs_R_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE5 = new String[]{" E"};
String[] datasE5 = new String[]{middleData.calibration_R_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE5 = GetReportFixedWidth(cellsE5, datasE5, 30);
List<String> titleE5 = reportMapE5.get("title");
List<String> contentE5 = reportMapE5.get("content");
for (int i=0; i< titleE5.size(); i++) {
String title = titleE5.get(i);
String content = contentE5.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
String[] cells5 = new String[]{" P"};
String[] datas5 = new String[]{middleData.calibration_R_coeff_string};
//根据固定宽度切割数据
Map<String, List<String>> reportMap5 = GetReportFixedWidth(cells5, datas5, 30);
List<String> title5 = reportMap5.get("title");
List<String> content5 = reportMap5.get("content");
for (int i=0; i< title5.size(); i++) {
String title = title5.get(i);
String content = content5.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
}
if(middleData.calibration_pairs_EF_idCalPoint.size()>0) {
strBuffer.append(" Efficiency Calibration ["+middleData.calibration_pairs_EF_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE6 = new String[]{" E"};
String[] datasE6 = new String[]{middleData.calibration_EF_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE6 = GetReportFixedWidth(cellsE6, datasE6, 30);
List<String> titleE6 = reportMapE6.get("title");
List<String> contentE6 = reportMapE6.get("content");
for (int i=0; i< titleE6.size(); i++) {
String title = titleE6.get(i);
String content = contentE6.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
String[] cells6 = new String[]{" P"};
String[] datas6 = new String[]{middleData.calibration_EF_coeff_string};
//根据固定宽度切割数据
Map<String, List<String>> reportMap6 = GetReportFixedWidth(cells6, datas6, 30);
List<String> title6 = reportMap6.get("title");
List<String> content6 = reportMap6.get("content");
for (int i=0; i< title6.size(); i++) {
String title = title6.get(i);
String content = content6.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
}
if(middleData.calibration_pairs_T_idCalPoint.size()>0) {
strBuffer.append(" Tot_efficiency Calibration ["+middleData.calibration_pairs_T_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE7 = new String[]{" E"};
String[] datasE7 = new String[]{middleData.calibration_T_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE7 = GetReportFixedWidth(cellsE7, datasE7, 30);
List<String> titleE7 = reportMapE7.get("title");
List<String> contentE7 = reportMapE7.get("content");
for (int i=0; i< titleE7.size(); i++) {
String title = titleE7.get(i);
String content = contentE7.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
String[] cells7 = new String[]{" P"};
String[] datas7 = new String[]{middleData.calibration_T_coeff_string};
//根据固定宽度切割数据
Map<String, List<String>> reportMap7 = GetReportFixedWidth(cells7, datas7, 30);
List<String> title7 = reportMap7.get("title");
List<String> content7 = reportMap7.get("content");
for (int i=0; i< title7.size(); i++) {
String title = title7.get(i);
String content = content7.get(i);
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#DATA QUALITY FLAGS");
//换行
strBuffer.append(System.lineSeparator());
String qualityTitle = "%-15s%-15s%-15s%-15s";
strBuffer.append(rowFormat(qualityTitle, " Name", "Pass/Fail", "Value", "Test"));
//换行
strBuffer.append(System.lineSeparator());
for (int i=0;i<middleData.QC_CHECK_QC_NAME.size(); i++){
strBuffer.append(rowFormat(qualityTitle, StringPool.SPACE+middleData.QC_CHECK_QC_NAME.get(i), (Double.valueOf(middleData.QC_CHECK_QC_RESULT.get(i)) < 1?"Fail":"Pass"), StringUtils.isNotBlank(middleData.QC_CHECK_QC_VALUE.get(i))?String.format("%.3f", Double.valueOf(middleData.QC_CHECK_QC_VALUE.get(i))):"null", middleData.QC_CHECK_QC_STANDARD.get(i)));
//换行
strBuffer.append(System.lineSeparator());
}
return strBuffer.toString();
} catch (Exception e) {
log.error("错误文件名称:"+ middleData.analyses_save_filePath+" 错误内容:"+e.getMessage());
}
return "";
}
public String GetReportContent(GStoreMiddleProcessData middleData, List<MdcDto> mdcDtos) {
try {
StringBuffer strBuffer = new StringBuffer();
strBuffer.append(" CNL06 GENERATED REPORT");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(" "+middleData.analyses_type+" RADIONUCLIDE REPORT");
//换行
strBuffer.append(System.lineSeparator());
if (middleData.sample_Type.equals(SystemType.PARTICULATE.getType())) {
strBuffer.append(" (Particulates Version) ");
} else if (middleData.sample_Type.equals(SystemType.GAMMA.getType())) {
strBuffer.append(" (Noble Gas Version) ");
}
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(" Creation Date "+DateUtils.formatDate(new Date(), "yyyy/MM/dd-HH:mm:ss"));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#SAMPLE INFORMATION");
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
//报告内容第一部分数据
strBuffer.append(rowFormat("%sStation ID:%-25s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_stationID));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sDetector ID:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_detectID));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sSample ID:%-26s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_id));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sSample Geometry:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Geometry));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sSample Quantity[m3]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_quantity));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sSample Type:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Type));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCollection Start:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_start));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCollection Stop:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_stop));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sSampling Time[h]:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_time));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sDecay Time[h]:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_decay_time));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sAcquisition Start:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquisiton_start));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sAcquisition Stop:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_stop));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sAcquisition Time[s]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_time));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sAvg Flow Rate[m3/h]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Avg_Flow_Rate));
strBuffer.append(System.lineSeparator());
String[] cells1 = new String[]{" Collection Station Comments"};
String[] datas1 = new String[]{middleData.Collection_Station_Comments};
//根据固定宽度切割数据
Map<String, List<String>> reportMap1 = GetReportFixedWidth(cells1, datas1, 30);
List<String> title1 = reportMap1.get("title");
List<String> content1 = reportMap1.get("content");
for (int i=0; i< title1.size(); i++) {
String title = title1.get(i);
String content = content1.get(i);
strBuffer.append(String.format("%s:%-8s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
//报告内容第二部分数据
String[] cell2 = new String[]{" Analysis General Comments"};
String[] datas2 = new String[]{middleData.NDC_Analysis_General_Comments};
//根据固定宽度切割数据
Map<String, List<String>> reportMap2 = GetReportFixedWidth(cell2, datas2, 30);
List<String> title2 = reportMap2.get("title");
List<String> content2 = reportMap2.get("content");
for (int i=0; i< title2.size(); i++) {
String title = title2.get(i);
String content = content2.get(i);
strBuffer.append(String.format("%s:%-10s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
//获取核素信息
String qsNuclidesName = "";
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++) {
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.get(m) + ";";
}
if(middleData.nucl_ided_Nuclidename.size()>1) {
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.get(middleData.nucl_ided_Nuclidename.size()-1);
}
strBuffer.append("#ACTIVITY SUMMARY");
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
//报告内容第三部分数据
String[] cells3 = new String[]{" Nuclides Identified"};
String[] datas3 = new String[]{qsNuclidesName};
//根据固定宽度切割数据
Map<String, List<String>> reportMap3 = GetReportFixedWidth(cells3, datas3, 30);
List<String> title3 = reportMap3.get("title");
List<String> content3 = reportMap3.get("content");
for (int i=0; i< title3.size(); i++) {
String title = title3.get(i);
String content = content3.get(i);
strBuffer.append(String.format("%s:%-16s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(String.format("%s:%-4s%s", " Keyline Activities for Nuclides", StringPool.SPACE, ""));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-8s%s", " with defined Reference Line", StringPool.SPACE, ""));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-12s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-7s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start));
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
String nuclideTitle = "%-15s%-18s%-15s%-15s%-15s%-21s%-15s";
String[] nuclideData = new String[]{" Nuclide", "Halflife(s)", "Activity(Bq)", "RelErr%", "MDA(Bq)", "Conc(uBq/m^3)", "MDC"};
strBuffer.append(rowFormat(nuclideTitle, nuclideData));
strBuffer.append(System.lineSeparator());
for (int i=0; i<middleData.nucl_ided_Nuclidename.size(); i++) {
strBuffer.append(rowFormat(nuclideTitle, StringPool.SPACE + middleData.nucl_ided_Nuclidename.get(i), middleData.nucl_ided_Halflife.get(i), String.format("%.3f", Double.valueOf(middleData.nucl_ided_activ_key.get(i))),
String.format("%.3f", Double.valueOf(middleData.nucl_ided_activ_key_err.get(i))/Double.valueOf(middleData.nucl_ided_activ_key.get(i))*100), middleData.nucl_ided_mda.get(i),
middleData.nucl_ided_Concentration.get(i), middleData.nucl_ided_MDC.get(i)));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#MINIMUM DETECTABLE CONCENTRATION FOR KEY NUCLIDES");
//换行
strBuffer.append(System.lineSeparator());
String mdcTitle = "%-15s%-18s%-15s%-15s";
String[] mdcData = new String[]{" Nuclide", "Halflife", "MDC", "MDA(Bq)"};
strBuffer.append(rowFormat(mdcTitle, mdcData));
strBuffer.append(System.lineSeparator());
for (MdcDto mdcDto : mdcDtos) {
mdcDto.format();
strBuffer.append(rowFormat(mdcTitle, StringPool.SPACE + mdcDto.getNuclideName(),
mdcDto.getHalfLifeStr(), mdcDto.getMdcStr(), mdcDto.getMdaStr()));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append("#PEAK SEARCH RESULTS");
//换行
strBuffer.append(System.lineSeparator());

View File

@ -1,7 +1,12 @@
package org.jeecg.modules.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.base.dto.MdcDto;
import org.jeecg.modules.base.entity.rnman.GardsMDC;
import java.util.List;
public interface GardsMDCSpectrumMapper extends BaseMapper<GardsMDC> {
List<MdcDto> mdcDtos(Integer idAnalysis);
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.mapper.GardsMDCSpectrumMapper">
<select id="mdcDtos" resultType="org.jeecg.modules.base.dto.MdcDto">
SELECT
mdc.NUCLIDENAME AS nuclideName,
mdc.MDC,
lib.HALFLIFE AS halfLife
FROM
RNMAN.GARDS_MDC mdc
INNER JOIN CONFIGURATION.GARDS_NUCL_LIB lib ON mdc.NUCLIDENAME = lib.NAME
WHERE
mdc.IDANALYSIS = #{idAnalysis}
</select>
</mapper>

View File

@ -1,11 +1,15 @@
package org.jeecg.modules.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.base.dto.MdcDto;
import org.jeecg.modules.base.entity.rnman.GardsMDC;
import org.jeecg.modules.entity.vo.PHDFile;
import java.util.List;
public interface IGardsMDCSpectrumService extends IService<GardsMDC> {
int saveMDCGamma(PHDFile phd, String idAnalysis);
List<MdcDto> mdcDtos(Integer idAnalysis);
}

View File

@ -35,6 +35,7 @@ import org.jeecg.common.util.*;
import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
import org.jeecg.modules.base.bizVo.GammaRLR;
import org.jeecg.modules.base.dto.Info;
import org.jeecg.modules.base.dto.MdcDto;
import org.jeecg.modules.base.dto.NuclideActMdaDto;
import org.jeecg.modules.base.dto.PeakInfoDto;
import org.jeecg.modules.base.entity.configuration.GardsNuclLib;
@ -4028,8 +4029,13 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
result.error500("Please select the parse file first");
return result;
}
List<MdcDto> mdcDtos = new ArrayList<>();
String idAnalysis = phd.getId_analysis();
Integer analysisId = StrUtil.isNotBlank(idAnalysis) ? Integer.valueOf(idAnalysis) : null;
if (ObjectUtil.isNotNull(analysisId))
mdcDtos = mdcSpectrumService.mdcDtos(analysisId);
//生成对应报告内容
String reportContent = gammaFileUtil.GetReportContent(phd, userName, false, "log");
String reportContent = gammaFileUtil.GetReportContent(phd, userName, false, "log", mdcDtos);
result.setSuccess(true);
result.setResult(reportContent);
return result;

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.base.dto.MdcDto;
import org.jeecg.modules.base.entity.rnman.GardsMDC;
import org.jeecg.modules.entity.vo.CalMDCInfo;
import org.jeecg.modules.entity.vo.PHDFile;
@ -47,4 +48,8 @@ public class GardsMDCSpectrumServiceImpl extends ServiceImpl<GardsMDCSpectrumMap
return mdcList.size();
}
@Override
public List<MdcDto> mdcDtos(Integer idAnalysis) {
return baseMapper.mdcDtos(idAnalysis);
}
}