From 56322ae688ac5149f3196143ca7122cb6d327f4a Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Mon, 6 Nov 2023 14:49:53 +0800 Subject: [PATCH] =?UTF-8?q?beta=E5=8A=9F=E8=83=BD=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9=20beta=E5=8A=9F=E8=83=BDQC?= =?UTF-8?q?=20Result=E6=8E=A5=E5=8F=A3=E6=97=A0=E6=B3=95=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=88=A4=E6=96=AD=E5=86=85=E5=AE=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/common/util/FTPUtil.java | 32 + .../org/jeecg/common/util/PHDFileUtil.java | 229 ++++-- .../jeecg/modules/entity/vo/BetaDataFile.java | 16 +- .../impl/SpectrumAnalysisServiceImpl.java | 772 ++++++++++-------- 4 files changed, 636 insertions(+), 413 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java index 6520c1ec..6a13e013 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java @@ -93,6 +93,38 @@ public class FTPUtil { } } + public static void main(String[] args) throws IOException { + long l = System.currentTimeMillis(); + String path = "/rn/datatest/savefile/"; + String fromPath = "Spectrum/Particulates/Samplephd/2015/11/AUP09_004-20151119_0421_S_PREL_42710.PHD"; + String fromPath2 = "Spectrum/Particulates/Samplephd/2015/11/NZP46_002-20151119_0021_S_PREL_57588.PHD"; + FTPClient ftpClient = new FTPClient(); + //连接 + ftpClient.connect("172.21.70.87", 21); + //登录 + ftpClient.login("rmsops", "cnndc66367220"); + System.out.println("login>>>"+(System.currentTimeMillis()-l)); + // 切换为本地被动模式,可以解决FTP上传后文件为空的问题,但需要服务器将FTP服务添加至防火墙白名单 + ftpClient.enterLocalPassiveMode(); + //判断是否连接成功 + int reply = ftpClient.getReplyCode(); + ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE); + // 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项 + ftpClient.setControlEncoding("UTF-8"); + ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE); + InputStream inputStream = ftpClient.retrieveFileStream(path+fromPath); + File file = new File("D:\\test1.txt"); + FileUtils.copyInputStreamToFile(inputStream, file); + System.out.println(null == inputStream); + System.out.println(ftpClient.printWorkingDirectory()); + ftpClient.completePendingCommand(); + InputStream inputStream2 = ftpClient.retrieveFileStream(path+fromPath2); + File file2 = new File("D:\\test2.txt"); + FileUtils.copyInputStreamToFile(inputStream2, file2); + System.out.println(null == inputStream2); + System.out.println(System.currentTimeMillis() - l); + } + public void downloadFTPFile(String localPath, String fileName, HttpServletResponse response) { InputStream in = null; ServletOutputStream out = null; diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java index 6eab419a..86e46a13 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java @@ -625,9 +625,13 @@ public class PHDFileUtil extends AbstractLogOrReport { bRet = false; return bRet; } else { + //处理分析后的结果并存储 + calAnalyzeData(analyseResult, betaDataFile); + //获取sample,gas,det的文件分析结果 EnergySpectrumStruct sample = betaDataFile.getSampleStruct(); EnergySpectrumStruct gas = betaDataFile.getGasStruct(); EnergySpectrumStruct det = betaDataFile.getDetStruct(); + //获取sample文件名称,并生成对应的日志内容 String sampleFileName = betaDataFile.getSampleFileName(); String logName = sampleFileName.replace("PHD", "log"); OutPutRnLog(analyseResult, sample, gas, det, logName); @@ -678,7 +682,6 @@ public class PHDFileUtil extends AbstractLogOrReport { boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i)); boundaryList.add(boundary); } - betaDataFile.setSampleBoundary(boundaryList); map.put("SampleBoundary", boundaryList); } if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) { @@ -691,7 +694,6 @@ public class PHDFileUtil extends AbstractLogOrReport { boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i)); boundaryList.add(boundary); } - betaDataFile.setGasBoundary(boundaryList); map.put("GasBoundary", boundaryList); } if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) { @@ -704,7 +706,6 @@ public class PHDFileUtil extends AbstractLogOrReport { boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i)); boundaryList.add(boundary); } - betaDataFile.setDetBoundary(boundaryList); map.put("DetBoundary", boundaryList); } return bRet; @@ -782,50 +783,145 @@ public class PHDFileUtil extends AbstractLogOrReport { return struct; } - - public List analyzeQCResultXe(File sampleTmp, File gasTmp, File detTmp) { - //调用动态库解析文件 - BgAnalyseResult bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath()); - List xeResultsSpectrumList = new LinkedList<>(); - GardsXeResultsSpectrum Xe131m = new GardsXeResultsSpectrum(); - Xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); - Xe131m.setMdc(bgAnalyseResult.MDC_Xe131m); - Xe131m.setConc(bgAnalyseResult.Xe131m_con); - Xe131m.setConcErr(bgAnalyseResult.Xe131m_uncer); - Xe131m.setLc(bgAnalyseResult.LC_Xe131m); - xeResultsSpectrumList.add(Xe131m); - GardsXeResultsSpectrum Xe133 = new GardsXeResultsSpectrum(); - Xe133.setNuclideName(XeNuclideName.XE_133.getType()); - Xe133.setMdc(bgAnalyseResult.MDC_Xe133); - Xe133.setConc(bgAnalyseResult.Xe133_con); - Xe133.setConcErr(bgAnalyseResult.Xe133_uncer); - Xe133.setLc(bgAnalyseResult.LC_Xe133); - xeResultsSpectrumList.add(Xe133); - GardsXeResultsSpectrum Xe133m = new GardsXeResultsSpectrum(); - Xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); - Xe133m.setMdc(bgAnalyseResult.MDC_Xe133m); - Xe133m.setConc(bgAnalyseResult.Xe133m_con); - Xe133m.setConcErr(bgAnalyseResult.Xe133m_uncer); - Xe133m.setLc(bgAnalyseResult.LC_Xe133m); - xeResultsSpectrumList.add(Xe133m); - GardsXeResultsSpectrum Xe135 = new GardsXeResultsSpectrum(); - Xe135.setNuclideName(XeNuclideName.XE_135.getType()); - Xe135.setMdc(bgAnalyseResult.MDC_Xe135); - Xe135.setConc(bgAnalyseResult.Xe135_con); - Xe135.setConcErr(bgAnalyseResult.Xe135_uncer); - Xe135.setLc(bgAnalyseResult.LC_Xe135); - xeResultsSpectrumList.add(Xe135); - return xeResultsSpectrumList; - } - - public Map analyze(File sampleTmp, File gasTmp, File detTmp) { - Map result = new HashMap<>(); - //调用动态库解析文件 - BgAnalyseResult bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath()); - /* GardsROIChannelsSpectrum集合 */ + public void calAnalyzeData(BgAnalyseResult bgAnalyseResult, BetaDataFile betaDataFile) { + //处理XeData的数据 + List xeResultsSpectrumList = new LinkedList<>(); + GardsXeResults xe131m = new GardsXeResults(); + xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); + xe131m.setConc(bgAnalyseResult.Xe131m_con); + xe131m.setConcErr(bgAnalyseResult.Xe131m_uncer); + xe131m.setLc(bgAnalyseResult.LC_Xe131m); + xe131m.setMdc(bgAnalyseResult.MDC_Xe131m); + xe131m.setNidFlag(bgAnalyseResult.XE_131m_NID_FLAG); + xeResultsSpectrumList.add(xe131m); + GardsXeResults xe133 = new GardsXeResults(); + xe133.setNuclideName(XeNuclideName.XE_133.getType()); + xe133.setConc(bgAnalyseResult.Xe133_con); + xe133.setConcErr(bgAnalyseResult.Xe133_uncer); + xe133.setLc(bgAnalyseResult.LC_Xe133); + xe133.setMdc(bgAnalyseResult.MDC_Xe133); + xe133.setNidFlag(bgAnalyseResult.XE_133_NID_FLAG); + xeResultsSpectrumList.add(xe133); + GardsXeResults xe133m = new GardsXeResults(); + xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); + xe133m.setConc(bgAnalyseResult.Xe133m_con); + xe133m.setConcErr(bgAnalyseResult.Xe133m_uncer); + xe133m.setLc(bgAnalyseResult.LC_Xe133m); + xe133m.setMdc(bgAnalyseResult.MDC_Xe133m); + xe133m.setNidFlag(bgAnalyseResult.XE_133m_NID_FLAG); + xeResultsSpectrumList.add(xe133m); + GardsXeResults xe135 = new GardsXeResults(); + xe135.setNuclideName(XeNuclideName.XE_135.getType()); + xe135.setConc(bgAnalyseResult.Xe135_con); + xe135.setConcErr(bgAnalyseResult.Xe135_uncer); + xe135.setLc(bgAnalyseResult.LC_Xe135); + xe135.setMdc(bgAnalyseResult.MDC_Xe135); + xe135.setNidFlag(bgAnalyseResult.XE_135_NID_FLAG); + xeResultsSpectrumList.add(xe135); + betaDataFile.setXeDataList(xeResultsSpectrumList); + //处理GammaCalibration的数据 + List gammaCalibrationSpectrumList = new LinkedList<>(); + List gammaFittingPara = betaDataFile.getGammaFittingPara(); + if (betaDataFile.isBGammaEnergyValidSample()) { + GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum(); + gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + gammaCalibrationS.setCoeff1(Double.valueOf(gammaFittingPara.get(0))); + gammaCalibrationS.setCoeff2(Double.valueOf(gammaFittingPara.get(1))); + gammaCalibrationS.setCoeff3(Double.valueOf(gammaFittingPara.get(2))); + gammaCalibrationSpectrumList.add(gammaCalibrationS); + } else { + GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum(); + gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + gammaCalibrationS.setCoeff1(bgAnalyseResult.s_g_fitting_c_e.get(0)); + gammaCalibrationS.setCoeff2(bgAnalyseResult.s_g_fitting_c_e.get(1)); + gammaCalibrationS.setCoeff3(bgAnalyseResult.s_g_fitting_c_e.get(2)); + gammaCalibrationSpectrumList.add(gammaCalibrationS); + } + if (betaDataFile.isBGammaEnergyValidGas()) { + GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum(); + gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingPara.get(0))); + gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingPara.get(1))); + gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingPara.get(2))); + gammaCalibrationSpectrumList.add(gammaCalibrationG); + } else { + GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum(); + gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + gammaCalibrationG.setCoeff1(bgAnalyseResult.g_g_fitting_c_e.get(0)); + gammaCalibrationG.setCoeff2(bgAnalyseResult.g_g_fitting_c_e.get(1)); + gammaCalibrationG.setCoeff3(bgAnalyseResult.g_g_fitting_c_e.get(2)); + gammaCalibrationSpectrumList.add(gammaCalibrationG); + } + if (betaDataFile.isBGammaEnergyValidDet()) { + GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum(); + gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingPara.get(0))); + gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingPara.get(1))); + gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingPara.get(2))); + gammaCalibrationSpectrumList.add(gammaCalibrationD); + } else { + GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum(); + gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + gammaCalibrationD.setCoeff1(bgAnalyseResult.d_g_fitting_c_e.get(0)); + gammaCalibrationD.setCoeff2(bgAnalyseResult.d_g_fitting_c_e.get(1)); + gammaCalibrationD.setCoeff3(bgAnalyseResult.d_g_fitting_c_e.get(2)); + gammaCalibrationSpectrumList.add(gammaCalibrationD); + } + betaDataFile.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList); + //处理BetaCalibration数据 + List betaCalibrationSpectrumList = new LinkedList<>(); + List betaFittingPara = betaDataFile.getBetaFittingPara(); + if (betaDataFile.isBBetaEnergyValidSample()) { + GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum(); + betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + betaCalibrationS.setCoeff1(Double.valueOf(betaFittingPara.get(0))); + betaCalibrationS.setCoeff2(Double.valueOf(betaFittingPara.get(1))); + betaCalibrationS.setCoeff3(Double.valueOf(betaFittingPara.get(2))); + betaCalibrationSpectrumList.add(betaCalibrationS); + } else { + GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum(); + betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType()); + betaCalibrationS.setCoeff1(bgAnalyseResult.s_b_fitting_c_e.get(0)); + betaCalibrationS.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1)); + betaCalibrationS.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2)); + betaCalibrationSpectrumList.add(betaCalibrationS); + } + if (betaDataFile.isBBetaEnergyValidGas()) { + GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum(); + betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + betaCalibrationG.setCoeff1(Double.valueOf(betaFittingPara.get(0))); + betaCalibrationG.setCoeff2(Double.valueOf(betaFittingPara.get(1))); + betaCalibrationG.setCoeff3(Double.valueOf(betaFittingPara.get(2))); + betaCalibrationSpectrumList.add(betaCalibrationG); + } else { + GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum(); + betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType()); + betaCalibrationG.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0)); + betaCalibrationG.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1)); + betaCalibrationG.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2)); + betaCalibrationSpectrumList.add(betaCalibrationG); + } + if (betaDataFile.isBBetaEnergyValidDet()) { + GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum(); + betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + betaCalibrationD.setCoeff1(Double.valueOf(betaFittingPara.get(0))); + betaCalibrationD.setCoeff2(Double.valueOf(betaFittingPara.get(1))); + betaCalibrationD.setCoeff3(Double.valueOf(betaFittingPara.get(2))); + betaCalibrationSpectrumList.add(betaCalibrationD); + } else { + GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum(); + betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType()); + betaCalibrationD.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0)); + betaCalibrationD.setCoeff2(bgAnalyseResult.d_b_fitting_c_e.get(1)); + betaCalibrationD.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2)); + betaCalibrationSpectrumList.add(betaCalibrationD); + } + betaDataFile.setBetaCalibrationSpectrumList(betaCalibrationSpectrumList); + //存储roiChannel数据 List roiChannelsSpectrumList = new LinkedList<>(); for (int i=0; i roiResultsSpectrumList = new LinkedList<>(); for (int i=0; ibgAnalyseResult.MDC.get(i)) { roiResults.setNidFlag(1); @@ -876,40 +975,7 @@ public class PHDFileUtil extends AbstractLogOrReport { } roiResultsSpectrumList.add(roiResults); } - /* GardsXeResultsSpectrum集合 */ - List xeResultsSpectrumList = new LinkedList<>(); - GardsXeResultsSpectrum Xe131m = new GardsXeResultsSpectrum(); - Xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); - Xe131m.setMdc(bgAnalyseResult.MDC_Xe131m); - Xe131m.setConc(bgAnalyseResult.Xe131m_con); - Xe131m.setConcErr(bgAnalyseResult.Xe131m_uncer); - Xe131m.setLc(bgAnalyseResult.LC_Xe131m); - xeResultsSpectrumList.add(Xe131m); - GardsXeResultsSpectrum Xe133 = new GardsXeResultsSpectrum(); - Xe133.setNuclideName(XeNuclideName.XE_133.getType()); - Xe133.setMdc(bgAnalyseResult.MDC_Xe133); - Xe133.setConc(bgAnalyseResult.Xe133_con); - Xe133.setConcErr(bgAnalyseResult.Xe133_uncer); - Xe133.setLc(bgAnalyseResult.LC_Xe133); - xeResultsSpectrumList.add(Xe133); - GardsXeResultsSpectrum Xe133m = new GardsXeResultsSpectrum(); - Xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); - Xe133m.setMdc(bgAnalyseResult.MDC_Xe133m); - Xe133m.setConc(bgAnalyseResult.Xe133m_con); - Xe133m.setConcErr(bgAnalyseResult.Xe133m_uncer); - Xe133m.setLc(bgAnalyseResult.LC_Xe133m); - xeResultsSpectrumList.add(Xe133m); - GardsXeResultsSpectrum Xe135 = new GardsXeResultsSpectrum(); - Xe135.setNuclideName(XeNuclideName.XE_135.getType()); - Xe135.setMdc(bgAnalyseResult.MDC_Xe135); - Xe135.setConc(bgAnalyseResult.Xe135_con); - Xe135.setConcErr(bgAnalyseResult.Xe135_uncer); - Xe135.setLc(bgAnalyseResult.LC_Xe135); - xeResultsSpectrumList.add(Xe135); - result.put("roiChannels", roiChannelsSpectrumList); - result.put("roiResults", roiResultsSpectrumList); - result.put("xeResults", xeResultsSpectrumList); - return result; + betaDataFile.setRoiResultsSpectrumList(roiResultsSpectrumList); } public List StringToDouble(List datas) { @@ -964,7 +1030,6 @@ public class PHDFileUtil extends AbstractLogOrReport { boundary.setMaxY(roiGBoundaryStop.get(i)); boundaryList.add(boundary); } - betaDataFile.setQcBoundary(boundaryList); map.put("QCBoundary", boundaryList); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java index 6d2ec376..39bc0113 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java @@ -1,6 +1,10 @@ package org.jeecg.modules.entity.vo; import lombok.Data; +import org.jeecg.modules.base.entity.rnman.GardsXeResults; +import org.jeecg.modules.entity.GardsCalibrationSpectrum; +import org.jeecg.modules.entity.GardsROIChannelsSpectrum; +import org.jeecg.modules.entity.GardsROIResultsSpectrum; import org.jeecg.modules.entity.GardsXeResultsSpectrum; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; @@ -89,7 +93,7 @@ public class BetaDataFile implements Serializable { private boolean bBetaEnergyValidDet; - //存储结果用到的数组信息 + //存储页面所需要用到的结果信息 private List xeResultsSpectrumList; private List sampleBoundary; @@ -108,6 +112,16 @@ public class BetaDataFile implements Serializable { private SpectrumData qcSpectrumData; + //存储分析结果信息 + private List xeDataList; + private List gammaCalibrationSpectrumList; + + private List betaCalibrationSpectrumList; + + private List roiChannelsSpectrumList; + + private List roiResultsSpectrumList; + public BetaDataFile() { sampleFilePathName = ""; sampleFileName = ""; diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index 54a747e7..4f5705be 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -387,7 +387,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { betaDataFile = new BetaDataFile(); //给公用变量赋值sampleId betaDataFile.setSampleId(String.valueOf(sampleId)); - + //用于记录文件路径信息 + List filePaths = new LinkedList<>(); + //判断sample信息是否存在 if (Objects.nonNull(sample)) { betaDataFile.setSampleFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getSampleFilePath()); betaDataFile.setSampleFileName(sampleFileName); @@ -399,6 +401,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { resultMap.put("sample",sampleMap); } } + //判断gas信息是否存在 if (Objects.nonNull(gasBg)) { betaDataFile.setGasFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getGasBgFilePath()); betaDataFile.setGasFileName(gasFileName); @@ -410,6 +413,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { resultMap.put("gasBg",gasBgMap); } } + //判断det信息是否存在 if (Objects.nonNull(detBg)) { betaDataFile.setDetFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbSpectrumFilePath.getDetBgFilePath()); betaDataFile.setDetFileName(detFileName); @@ -421,6 +425,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { resultMap.put("detBg",detBgMap); } } + //判断qc信息是否存在 if (Objects.nonNull(qc)) { betaDataFile.setQcFilePathName(StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH +dbQcFilePath); betaDataFile.setQcFileName(qcFileName); @@ -838,124 +843,124 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { if (Objects.nonNull(detSourceData)) { information.setDet_measid_name(detSourceData.measurement_id); } + strBuffer.append("CNL06 GENERATED REPORT").append("\n"); + strBuffer.append("REVIEWED RADIONUCLIDE REPORT").append("\n"); + strBuffer.append("(Noble Gas Version)").append("\n"); + strBuffer.append("Creation Date "+DateUtils.formatDate(new Date(), "yyyy/MM/dd-HH:mm:ss")).append("\n"); + strBuffer.append("\n"); + strBuffer.append("#FILE INFORMATION").append("\n"); + strBuffer.append(" SampleMeasID: ").append(information.getMeasurementID()).append("\n"); + strBuffer.append(" GASBKMeasID: ").append(information.getGasBkgdMeasurementID()).append("\n"); + strBuffer.append(" SRID: ").append(information.getSampleRefId()).append("\n"); + strBuffer.append(" Detector Type: ").append("3D b-g").append("\n"); + strBuffer.append("\n"); + strBuffer.append("#COLLECTION INFORMATION").append("\n"); + strBuffer.append(" Station CODE: ").append(information.getSit_det_code()).append("\n"); + strBuffer.append(" Detector CODE: ").append(information.getDetect_code()).append("\n"); + strBuffer.append(" Collection Start: ").append(DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss")).append("\n"); + strBuffer.append(" Collection Stop: ").append(DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss")).append("\n"); + strBuffer.append(" Collection TIME(h): ").append((information.getCollect_stop().getTime()/1000-information.getCollect_start().getTime()/1000)/3600).append("\n"); + strBuffer.append(" Air Volume[cm3]: ").append(information.getS_xe_stable_volume()).append("\n"); + strBuffer.append(" Xe Volume[cm3]: ").append(information.getS_volume_of_Xe()).append("\n"); + strBuffer.append("\n"); + strBuffer.append("#ACQUISITION INFORMATION").append("\n"); + strBuffer.append(" Acquisition Start: ").append(DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss")).append("\n"); + strBuffer.append(" Acq Real Time(s): ").append(information.getAcquisition_real_sec()).append("\n"); + strBuffer.append(" Acq Live Time: ").append(information.getAcquisition_live_sec()).append("\n"); + strBuffer.append("\n"); + strBuffer.append("#SOFTWARE").append("\n"); + strBuffer.append(" version: ").append("1.0.1").append("\n"); + strBuffer.append("\n"); + strBuffer.append("#SAMPLE Old CALIBRATION").append("\n"); + strBuffer.append(" Old Beta Old Gamma ").append("\n"); + if (rrrLogInfo.isSampleData()){ + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + }else { + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#SAMPLE New CALIBRATION").append("\n"); + strBuffer.append(" New Beta New Gamma ").append("\n"); + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = ("+betaCalibrationParamS.getCoeff1()+")+("+betaCalibrationParamS.getCoeff2()+")*x+("+betaCalibrationParamS.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamS.getCoeff1()+")+("+gammaCalibrationParamS.getCoeff2()+")*x+("+gammaCalibrationParamS.getCoeff3()+")x*x").append("\n"); + strBuffer.append("\n"); + strBuffer.append("#SAMPLE: LIMITS PER ROI").append("\n"); + strBuffer.append(" Roi Beta Gamma ").append("\n"); + for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { + strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#DET Old CALIBRATION").append("\n"); + strBuffer.append(" Old Beta Old Gamma ").append("\n"); + if (rrrLogInfo.isDetBgData()){ + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + }else { + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#DET New CALIBRATION").append("\n"); + strBuffer.append(" New Beta New Gamma ").append("\n"); + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = ("+gammaCalibrationParamD.getCoeff1()+")+("+gammaCalibrationParamD.getCoeff2()+")*x+("+gammaCalibrationParamD.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamD.getCoeff1()+")+("+gammaCalibrationParamD.getCoeff2()+")*x+("+gammaCalibrationParamD.getCoeff3()+")x*x").append("\n"); + strBuffer.append("\n"); + strBuffer.append("#DET: LIMITS PER ROI").append("\n"); + strBuffer.append(" Roi Beta Gamma ").append("\n"); + for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { + strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#GAS Old CALIBRATION").append("\n"); + strBuffer.append(" Old Beta Old Gamma ").append("\n"); + if (rrrLogInfo.isGasBgData()){ + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + }else { + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#GAS New CALIBRATION").append("\n"); + strBuffer.append(" New Beta New Gamma ").append("\n"); + strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); + strBuffer.append(" E(x) = ("+betaCalibrationParamG.getCoeff1()+")+("+betaCalibrationParamG.getCoeff2()+")*x+("+betaCalibrationParamG.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamG.getCoeff1()+")+("+gammaCalibrationParamG.getCoeff2()+")*x+("+gammaCalibrationParamG.getCoeff3()+")x*x").append("\n"); + strBuffer.append("\n"); + strBuffer.append("#GAS: LIMITS PER ROI").append("\n"); + strBuffer.append(" Roi Beta Gamma ").append("\n"); + for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { + strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#GROSS COUNTS PER ROI").append("\n"); + strBuffer.append(" Roi Sample GasBkgnd DetBkgnd ").append("\n"); + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums) { + strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getSGross()+" "+resultsSpectrum.getGGross()+" "+resultsSpectrum.getBGross()+"").append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#NET COUNTS AND LC PER ROI").append("\n"); + strBuffer.append(" Roi Net count ").append("\n"); + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getNet()+" +/- "+Math.sqrt(resultsSpectrum.getNetErr())).append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#CONCENTRATION AND LC PER ROI").append("\n"); + strBuffer.append(" Roi Conc(mBq/m3) LC(mBq/m3) MDC(mBq/m3): "); + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getConcErr()+" +/- "+resultsSpectrum.getConcErr()+" "+resultsSpectrum.getLc()+" "+resultsSpectrum.getMdc()).append("\n"); + } + strBuffer.append("\n"); + strBuffer.append("#RESULT SUMMARY").append("\n"); + strBuffer.append(" Nuclide Name Conc LC MDC NID Flag ").append("\n"); + for (GardsXeResultsSpectrum xeResultsSpectrum:xeResultsSpectrums) { + strBuffer.append(StringPool.SPACE+xeResultsSpectrum.getNuclideName()+" "+xeResultsSpectrum.getConc()+" +/- "+xeResultsSpectrum.getConcErr()+" "+xeResultsSpectrum.getLc()+" "+xeResultsSpectrum.getMdc()+" "+xeResultsSpectrum.getNidFlag()).append("\n"); + } + strBuffer.append("\n"); } catch (ParseException e) { throw new RuntimeException(e); } - strBuffer.append("CNL06 GENERATED REPORT").append("\n"); - strBuffer.append("REVIEWED RADIONUCLIDE REPORT").append("\n"); - strBuffer.append("(Noble Gas Version)").append("\n"); - strBuffer.append("Creation Date "+DateUtils.formatDate(new Date(), "yyyy/MM/dd-HH:mm:ss")).append("\n"); - strBuffer.append("\n"); - strBuffer.append("#FILE INFORMATION").append("\n"); - strBuffer.append(" SampleMeasID: ").append(information.getMeasurementID()).append("\n"); - strBuffer.append(" GASBKMeasID: ").append(information.getGasBkgdMeasurementID()).append("\n"); - strBuffer.append(" SRID: ").append(information.getSampleRefId()).append("\n"); - strBuffer.append(" Detector Type: ").append("3D b-g").append("\n"); - strBuffer.append("\n"); - strBuffer.append("#COLLECTION INFORMATION").append("\n"); - strBuffer.append(" Station CODE: ").append(information.getSit_det_code()).append("\n"); - strBuffer.append(" Detector CODE: ").append(information.getDetect_code()).append("\n"); - strBuffer.append(" Collection Start: ").append(DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss")).append("\n"); - strBuffer.append(" Collection Stop: ").append(DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss")).append("\n"); - strBuffer.append(" Collection TIME(h): ").append((information.getCollect_stop().getTime()/1000-information.getCollect_start().getTime()/1000)/3600).append("\n"); - strBuffer.append(" Air Volume[cm3]: ").append(information.getS_xe_stable_volume()).append("\n"); - strBuffer.append(" Xe Volume[cm3]: ").append(information.getS_volume_of_Xe()).append("\n"); - strBuffer.append("\n"); - strBuffer.append("#ACQUISITION INFORMATION").append("\n"); - strBuffer.append(" Acquisition Start: ").append(DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss")).append("\n"); - strBuffer.append(" Acq Real Time(s): ").append(information.getAcquisition_real_sec()).append("\n"); - strBuffer.append(" Acq Live Time: ").append(information.getAcquisition_live_sec()).append("\n"); - strBuffer.append("\n"); - strBuffer.append("#SOFTWARE").append("\n"); - strBuffer.append(" version: ").append("1.0.1").append("\n"); - strBuffer.append("\n"); - strBuffer.append("#SAMPLE Old CALIBRATION").append("\n"); - strBuffer.append(" Old Beta Old Gamma ").append("\n"); - if (rrrLogInfo.isSampleData()){ - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - }else { - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#SAMPLE New CALIBRATION").append("\n"); - strBuffer.append(" New Beta New Gamma ").append("\n"); - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = ("+betaCalibrationParamS.getCoeff1()+")+("+betaCalibrationParamS.getCoeff2()+")*x+("+betaCalibrationParamS.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamS.getCoeff1()+")+("+gammaCalibrationParamS.getCoeff2()+")*x+("+gammaCalibrationParamS.getCoeff3()+")x*x").append("\n"); - strBuffer.append("\n"); - strBuffer.append("#SAMPLE: LIMITS PER ROI").append("\n"); - strBuffer.append(" Roi Beta Gamma ").append("\n"); - for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { - strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#DET Old CALIBRATION").append("\n"); - strBuffer.append(" Old Beta Old Gamma ").append("\n"); - if (rrrLogInfo.isDetBgData()){ - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - }else { - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#DET New CALIBRATION").append("\n"); - strBuffer.append(" New Beta New Gamma ").append("\n"); - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = ("+gammaCalibrationParamD.getCoeff1()+")+("+gammaCalibrationParamD.getCoeff2()+")*x+("+gammaCalibrationParamD.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamD.getCoeff1()+")+("+gammaCalibrationParamD.getCoeff2()+")*x+("+gammaCalibrationParamD.getCoeff3()+")x*x").append("\n"); - strBuffer.append("\n"); - strBuffer.append("#DET: LIMITS PER ROI").append("\n"); - strBuffer.append(" Roi Beta Gamma ").append("\n"); - for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { - strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#GAS Old CALIBRATION").append("\n"); - strBuffer.append(" Old Beta Old Gamma ").append("\n"); - if (rrrLogInfo.isGasBgData()){ - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - }else { - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = (?1)+(?2)*x+(?3)x*x ").append(" E(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#GAS New CALIBRATION").append("\n"); - strBuffer.append(" New Beta New Gamma ").append("\n"); - strBuffer.append(" CH(x) = (?1)+(?2)*x+(?3)x*x ").append(" CH(x) = (?1)+(?2)*x+(?3)x*x").append("\n"); - strBuffer.append(" E(x) = ("+betaCalibrationParamG.getCoeff1()+")+("+betaCalibrationParamG.getCoeff2()+")*x+("+betaCalibrationParamG.getCoeff3()+")x*x ").append(" E(x) = ("+gammaCalibrationParamG.getCoeff1()+")+("+gammaCalibrationParamG.getCoeff2()+")*x+("+gammaCalibrationParamG.getCoeff3()+")x*x").append("\n"); - strBuffer.append("\n"); - strBuffer.append("#GAS: LIMITS PER ROI").append("\n"); - strBuffer.append(" Roi Beta Gamma ").append("\n"); - for (GardsROIChannelsSpectrum channelsSpectrum:channelsSpectrums) { - strBuffer.append(StringPool.SPACE+channelsSpectrum.getRoi()+" "+channelsSpectrum.getBChanStart()+"to"+channelsSpectrum.getBChanStop()+" "+channelsSpectrum.getGChanStart()+"to"+channelsSpectrum.getGChanStop()).append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#GROSS COUNTS PER ROI").append("\n"); - strBuffer.append(" Roi Sample GasBkgnd DetBkgnd ").append("\n"); - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums) { - strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getSGross()+" "+resultsSpectrum.getGGross()+" "+resultsSpectrum.getBGross()+"").append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#NET COUNTS AND LC PER ROI").append("\n"); - strBuffer.append(" Roi Net count ").append("\n"); - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getNet()+" +/- "+Math.sqrt(resultsSpectrum.getNetErr())).append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#CONCENTRATION AND LC PER ROI").append("\n"); - strBuffer.append(" Roi Conc(mBq/m3) LC(mBq/m3) MDC(mBq/m3): "); - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(StringPool.SPACE+resultsSpectrum.getRoi()+" "+resultsSpectrum.getConcErr()+" +/- "+resultsSpectrum.getConcErr()+" "+resultsSpectrum.getLc()+" "+resultsSpectrum.getMdc()).append("\n"); - } - strBuffer.append("\n"); - strBuffer.append("#RESULT SUMMARY").append("\n"); - strBuffer.append(" Nuclide Name Conc LC MDC NID Flag ").append("\n"); - for (GardsXeResultsSpectrum xeResultsSpectrum:xeResultsSpectrums) { - strBuffer.append(StringPool.SPACE+xeResultsSpectrum.getNuclideName()+" "+xeResultsSpectrum.getConc()+" +/- "+xeResultsSpectrum.getConcErr()+" "+xeResultsSpectrum.getLc()+" "+xeResultsSpectrum.getMdc()+" "+xeResultsSpectrum.getNidFlag()).append("\n"); - } - strBuffer.append("\n"); } result.setSuccess(true); result.setResult(strBuffer.toString()); @@ -1351,7 +1356,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { gardsXeResults = xeDataList.get(0); } //解析sample,gas,det文件并判断数据状态 - if (StringUtils.isNotBlank(sampleFileName) && StringUtils.isNotBlank(gasFileName) && StringUtils.isNotBlank(detFileName)) { + if (Objects.nonNull(betaDataFile)) { EnergySpectrumStruct sampleSourceData = betaDataFile.getSampleStruct(); EnergySpectrumStruct gasSourceData = betaDataFile.getGasStruct(); EnergySpectrumStruct detSourceData = betaDataFile.getDetStruct(); @@ -2643,30 +2648,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { result.error500("请先加载文件基础信息!"); return result; } - List analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, betaDataFile); - if (CollectionUtils.isNotEmpty(analyseResult)){ - for (GardsXeResultsSpectrum xeData:analyseResult) { - Double conc = xeData.getConc(); - Double mdc = xeData.getMdc(); - if (conc < 0){ - xeData.setColor("red"); - xeData.setNidFlag(0); - } else if (0 mdc) { - xeData.setColor("green"); - xeData.setNidFlag(1); - } - xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc()))); - xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc()))); - xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr()))); - } - betaDataFile.setXeResultsSpectrumList(analyseResult); - betaDataFile.setBProcessed(true); - betaDataFile.setSaveAnalysisResult(true); - } - map.put("XeData", analyseResult); + map = BetaGammaAnalyzeCurrentProcess(analyseData, betaDataFile); map.put("bProcessed", true); map.put("savedAnalysisResult", true); result.setSuccess(true); @@ -2675,9 +2657,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { //获取当前选中的文件名称 String currentFileName = analyseData.getCurrentFileName(); String currentQCFileName = analyseData.getCurrentQCFileName(); - List analyseResultList = BetaGammaAnalyzeAllProcess(analyseData, userName, currentFileName, currentQCFileName); - if (CollectionUtils.isNotEmpty(analyseResultList)) { - map.put("XeData", analyseResultList); + map = BetaGammaAnalyzeAllProcess(analyseData, userName, currentFileName, currentQCFileName); + if (CollectionUtils.isNotEmpty(map)) { map.put("bProcessed", true); map.put("savedAnalysisResult", true); } @@ -2687,20 +2668,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return result; } - private List BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, BetaDataFile betaDataFile) { + private Map BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, BetaDataFile betaDataFile) { //根据文件路径 文件名称获取对应的临时文件 File sampleTmp = null; File gasTmp = null; File detTmp = null; - //需要返回到前端的XeData数据 - List xeResultsSpectrumList = new LinkedList<>(); + //声明一个map 缓存xeData计算后的结果 + Map xeMap = new HashMap<>(); try { //存储重新分析字段的实体类 SpectrumGroup spectrum_group = new SpectrumGroup(); - //声明一个map 缓存重新分析用到的数据 - Map map = new HashMap<>(); - //声明一个map 缓存xeData计算后的结果 - Map xeMap = new HashMap<>(); //获取计算参数 List betaList = new LinkedList<>(); List betaFittingPara = new LinkedList<>(); @@ -2775,92 +2752,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { gasTmp = ftpUtil.downloadFile(betaDataFile.getGasFilePathName(), "betaGamma"); //获取det文件 detTmp = ftpUtil.downloadFile(betaDataFile.getDetFilePathName(), "betaGamma"); + if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) { - //调用重新分析算法 获取算法结果 - BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); - if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) { - return Collections.EMPTY_LIST; - } else { - //生成分析操作日志 - EnergySpectrumStruct sample = betaDataFile.getSampleStruct(); - EnergySpectrumStruct gas = betaDataFile.getGasStruct(); - EnergySpectrumStruct det = betaDataFile.getDetStruct(); - String logName = betaDataFile.getSampleFileName().replace("PHD", "log"); - phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName); - //存入计算后得到的xeData数据 - GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); - xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); - xe131m.setConc(analyseResult.Xe131m_con); - xe131m.setConcErr(analyseResult.Xe131m_uncer); - xe131m.setLc(analyseResult.LC_Xe131m); - xe131m.setMdc(analyseResult.MDC_Xe131m); - xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG); - xeResultsSpectrumList.add(xe131m); - GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum(); - xe133.setNuclideName(XeNuclideName.XE_133.getType()); - xe133.setConc(analyseResult.Xe133_con); - xe133.setConcErr(analyseResult.Xe133_uncer); - xe133.setLc(analyseResult.LC_Xe133); - xe133.setMdc(analyseResult.MDC_Xe133); - xe133.setNidFlag(analyseResult.XE_133_NID_FLAG); - xeResultsSpectrumList.add(xe133); - GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum(); - xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); - xe133m.setConc(analyseResult.Xe133m_con); - xe133m.setConcErr(analyseResult.Xe133m_uncer); - xe133m.setLc(analyseResult.LC_Xe133m); - xe133m.setMdc(analyseResult.MDC_Xe133m); - xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG); - xeResultsSpectrumList.add(xe133m); - GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum(); - xe135.setNuclideName(XeNuclideName.XE_135.getType()); - xe135.setConc(analyseResult.Xe135_con); - xe135.setConcErr(analyseResult.Xe135_uncer); - xe135.setLc(analyseResult.LC_Xe135); - xe135.setMdc(analyseResult.MDC_Xe135); - xe135.setNidFlag(analyseResult.XE_135_NID_FLAG); - xeResultsSpectrumList.add(xe135); - xeMap.put("XeData", xeResultsSpectrumList); - //新计算得到的边界值 - if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) { - List boundaryList = new LinkedList<>(); - for (int i=0; i boundaryList = new LinkedList<>(); - for (int i=0; i boundaryList = new LinkedList<>(); - for (int i=0; i sampleBoundary = (List) xeMap.get("SampleBoundary"); + if(CollectionUtils.isNotEmpty(sampleBoundary)) { + betaDataFile.setSampleBoundary(sampleBoundary); + } + List gasBoundary = (List) xeMap.get("GasBoundary"); + if(CollectionUtils.isNotEmpty(gasBoundary)) { + betaDataFile.setGasBoundary(gasBoundary); + } + List detBoundary = (List) xeMap.get("DetBoundary"); + if(CollectionUtils.isNotEmpty(detBoundary)) { + betaDataFile.setDetBoundary(detBoundary); + } + List qcBoundary = (List) xeMap.get("QCBoundary"); + if(CollectionUtils.isNotEmpty(qcBoundary)) { + betaDataFile.setQcBoundary(qcBoundary); + } + List xeResultsSpectrumList = (List) xeMap.get("XeData"); + if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)){ + for (GardsXeResultsSpectrum xeData: xeResultsSpectrumList) { + Double conc = xeData.getConc(); + Double mdc = xeData.getMdc(); + if (conc < 0){ + xeData.setColor("red"); + xeData.setNidFlag(0); + } else if (0 mdc) { + xeData.setColor("green"); + xeData.setNidFlag(1); + } + xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc()))); + xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc()))); + xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr()))); + } + betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList); + betaDataFile.setBProcessed(true); + betaDataFile.setSaveAnalysisResult(true); + } + } else { + xeMap.put("XeData", Collections.EMPTY_LIST); } +// if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) { +// return Collections.EMPTY_LIST; +// } else { +// //生成分析操作日志 +// EnergySpectrumStruct sample = betaDataFile.getSampleStruct(); +// EnergySpectrumStruct gas = betaDataFile.getGasStruct(); +// EnergySpectrumStruct det = betaDataFile.getDetStruct(); +// String logName = betaDataFile.getSampleFileName().replace("PHD", "log"); +// phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName); +// //存入计算后得到的xeData数据 +// GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); +// xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); +// xe131m.setConc(analyseResult.Xe131m_con); +// xe131m.setConcErr(analyseResult.Xe131m_uncer); +// xe131m.setLc(analyseResult.LC_Xe131m); +// xe131m.setMdc(analyseResult.MDC_Xe131m); +// xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG); +// xeResultsSpectrumList.add(xe131m); +// GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum(); +// xe133.setNuclideName(XeNuclideName.XE_133.getType()); +// xe133.setConc(analyseResult.Xe133_con); +// xe133.setConcErr(analyseResult.Xe133_uncer); +// xe133.setLc(analyseResult.LC_Xe133); +// xe133.setMdc(analyseResult.MDC_Xe133); +// xe133.setNidFlag(analyseResult.XE_133_NID_FLAG); +// xeResultsSpectrumList.add(xe133); +// GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum(); +// xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); +// xe133m.setConc(analyseResult.Xe133m_con); +// xe133m.setConcErr(analyseResult.Xe133m_uncer); +// xe133m.setLc(analyseResult.LC_Xe133m); +// xe133m.setMdc(analyseResult.MDC_Xe133m); +// xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG); +// xeResultsSpectrumList.add(xe133m); +// GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum(); +// xe135.setNuclideName(XeNuclideName.XE_135.getType()); +// xe135.setConc(analyseResult.Xe135_con); +// xe135.setConcErr(analyseResult.Xe135_uncer); +// xe135.setLc(analyseResult.LC_Xe135); +// xe135.setMdc(analyseResult.MDC_Xe135); +// xe135.setNidFlag(analyseResult.XE_135_NID_FLAG); +// xeResultsSpectrumList.add(xe135); +// xeMap.put("XeData", xeResultsSpectrumList); +// //新计算得到的边界值 +// if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) { +// List boundaryList = new LinkedList<>(); +// for (int i=0; i boundaryList = new LinkedList<>(); +// for (int i=0; i boundaryList = new LinkedList<>(); +// for (int i=0; i BetaGammaAnalyzeAllProcess(AnalyseData analyseData, String userName, String currentFileName, String currentQCFileName){ + private Map BetaGammaAnalyzeAllProcess(AnalyseData analyseData, String userName, String currentFileName, String currentQCFileName){ //从本地缓存获取beta gamma的数组 Cache cache = betaCache.getBetaCache(); //返回最终结果用的map - Map> analyseResultMap = new HashMap<>(); + Map> analyseResultMap = new HashMap<>(); File sampleTmp = null; File gasTmp = null; File detTmp = null; @@ -2926,8 +2955,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { sampleBetaData.setGammaFittingParaToUi(gammaFittingParaToUi); //存储重新分析字段的实体类 SpectrumGroup spectrum_group = new SpectrumGroup(); - //声明一个map 缓存重新分析用到的数据 - Map map = new HashMap<>(); //声明一个map 缓存xeData计算后的结果 Map xeMap = new HashMap<>(); if (analyseData.isBetaEnergyValid()) { @@ -2981,91 +3008,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { gasTmp = ftpUtil.downloadFile(sampleBetaData.getGasFilePathName(), "betaGamma"); detTmp = ftpUtil.downloadFile(sampleBetaData.getDetFilePathName(), "betaGamma"); if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) { - BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); - if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) { - analyseResultMap.put(sampleFileName, Collections.EMPTY_LIST); - } else { - //生成分析操作日志 - EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp); - EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp); - EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp); - String logName = sampleFileName.replace("PHD", "log"); - phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName); - //存入xeData数据 - List xeResultsSpectrumList = new LinkedList<>(); - GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); - xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); - xe131m.setConc(analyseResult.Xe131m_con); - xe131m.setConcErr(analyseResult.Xe131m_uncer); - xe131m.setLc(analyseResult.LC_Xe131m); - xe131m.setMdc(analyseResult.MDC_Xe131m); - xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG); - xeResultsSpectrumList.add(xe131m); - GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum(); - xe133.setNuclideName(XeNuclideName.XE_133.getType()); - xe133.setConc(analyseResult.Xe133_con); - xe133.setConcErr(analyseResult.Xe133_uncer); - xe133.setLc(analyseResult.LC_Xe133); - xe133.setMdc(analyseResult.MDC_Xe133); - xe133.setNidFlag(analyseResult.XE_133_NID_FLAG); - xeResultsSpectrumList.add(xe133); - GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum(); - xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); - xe133m.setConc(analyseResult.Xe133m_con); - xe133m.setConcErr(analyseResult.Xe133m_uncer); - xe133m.setLc(analyseResult.LC_Xe133m); - xe133m.setMdc(analyseResult.MDC_Xe133m); - xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG); - xeResultsSpectrumList.add(xe133m); - GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum(); - xe135.setNuclideName(XeNuclideName.XE_135.getType()); - xe135.setConc(analyseResult.Xe135_con); - xe135.setConcErr(analyseResult.Xe135_uncer); - xe135.setLc(analyseResult.LC_Xe135); - xe135.setMdc(analyseResult.MDC_Xe135); - xe135.setNidFlag(analyseResult.XE_135_NID_FLAG); - xeResultsSpectrumList.add(xe135); - xeMap.put("XeData", xeResultsSpectrumList); - //新计算得到的边界值 - if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) { - List boundaryList = new LinkedList<>(); - for (int i=0; i boundaryList = new LinkedList<>(); - for (int i=0; i boundaryList = new LinkedList<>(); - for (int i=0; i sampleBoundary = (List) xeMap.get("SampleBoundary"); + if(CollectionUtils.isNotEmpty(sampleBoundary)) { + betaDataFile.setSampleBoundary(sampleBoundary); + } + List gasBoundary = (List) xeMap.get("GasBoundary"); + if(CollectionUtils.isNotEmpty(gasBoundary)) { + betaDataFile.setGasBoundary(gasBoundary); + } + List detBoundary = (List) xeMap.get("DetBoundary"); + if(CollectionUtils.isNotEmpty(detBoundary)) { + betaDataFile.setDetBoundary(detBoundary); + } + List qcBoundary = (List) xeMap.get("QCBoundary"); + if(CollectionUtils.isNotEmpty(qcBoundary)) { + betaDataFile.setQcBoundary(qcBoundary); + } + List xeResultsSpectrumList = (List) xeMap.get("XeData"); if (CollectionUtils.isNotEmpty(xeResultsSpectrumList)){ for (GardsXeResultsSpectrum xeData:xeResultsSpectrumList) { Double conc = xeData.getConc(); @@ -3096,8 +3058,129 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { sampleBetaData.setBProcessed(true); sampleBetaData.setSaveAnalysisResult(true); } - analyseResultMap.put(sampleFileName, xeResultsSpectrumList); + analyseResultMap.put(sampleFileName, xeMap); + } else { + xeMap.clear(); + xeMap.put("XeData", Collections.EMPTY_LIST); + analyseResultMap.put(sampleFileName, xeMap); } +// BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); +// if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) { +// analyseResultMap.put(sampleFileName, Collections.EMPTY_LIST); +// } else { +// //生成分析操作日志 +// EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp); +// EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp); +// EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp); +// String logName = sampleFileName.replace("PHD", "log"); +// phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName); +// //存入xeData数据 +// List xeResultsSpectrumList = new LinkedList<>(); +// GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); +// xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); +// xe131m.setConc(analyseResult.Xe131m_con); +// xe131m.setConcErr(analyseResult.Xe131m_uncer); +// xe131m.setLc(analyseResult.LC_Xe131m); +// xe131m.setMdc(analyseResult.MDC_Xe131m); +// xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG); +// xeResultsSpectrumList.add(xe131m); +// GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum(); +// xe133.setNuclideName(XeNuclideName.XE_133.getType()); +// xe133.setConc(analyseResult.Xe133_con); +// xe133.setConcErr(analyseResult.Xe133_uncer); +// xe133.setLc(analyseResult.LC_Xe133); +// xe133.setMdc(analyseResult.MDC_Xe133); +// xe133.setNidFlag(analyseResult.XE_133_NID_FLAG); +// xeResultsSpectrumList.add(xe133); +// GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum(); +// xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); +// xe133m.setConc(analyseResult.Xe133m_con); +// xe133m.setConcErr(analyseResult.Xe133m_uncer); +// xe133m.setLc(analyseResult.LC_Xe133m); +// xe133m.setMdc(analyseResult.MDC_Xe133m); +// xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG); +// xeResultsSpectrumList.add(xe133m); +// GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum(); +// xe135.setNuclideName(XeNuclideName.XE_135.getType()); +// xe135.setConc(analyseResult.Xe135_con); +// xe135.setConcErr(analyseResult.Xe135_uncer); +// xe135.setLc(analyseResult.LC_Xe135); +// xe135.setMdc(analyseResult.MDC_Xe135); +// xe135.setNidFlag(analyseResult.XE_135_NID_FLAG); +// xeResultsSpectrumList.add(xe135); +// xeMap.put("XeData", xeResultsSpectrumList); +// //新计算得到的边界值 +// if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) { +// List boundaryList = new LinkedList<>(); +// for (int i=0; i boundaryList = new LinkedList<>(); +// for (int i=0; i boundaryList = new LinkedList<>(); +// for (int i=0; i mdc) { +// xeData.setColor("green"); +// xeData.setNidFlag(1); +// } +// xeData.setMdc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getMdc())).substring(0, String.valueOf(Math.abs(xeData.getMdc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getMdc()))); +// xeData.setConc(Double.valueOf(String.format("%."+(6 - String.valueOf(Math.abs(xeData.getConc())).substring(0, String.valueOf(Math.abs(xeData.getConc())).lastIndexOf(StringPool.DOT)).length())+"f", xeData.getConc()))); +// xeData.setConcErr(Double.valueOf(String.format("%."+((6 - String.valueOf(Math.abs(xeData.getConcErr())).substring(0, String.valueOf(Math.abs(xeData.getConcErr())).lastIndexOf(StringPool.DOT)).length()))+"f", xeData.getConcErr()))); +// } +// sampleBetaData.setXeResultsSpectrumList(xeResultsSpectrumList); +// sampleBetaData.setBProcessed(true); +// sampleBetaData.setSaveAnalysisResult(true); +// } +// analyseResultMap.put(sampleFileName, xeResultsSpectrumList); +// } } } } catch (Exception e) { @@ -3165,6 +3248,22 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, map, betaDataFile); } } + List sampleBoundary = (List) map.get("SampleBoundary"); + if(CollectionUtils.isNotEmpty(sampleBoundary)) { + betaDataFile.setSampleBoundary(sampleBoundary); + } + List gasBoundary = (List) map.get("GasBoundary"); + if(CollectionUtils.isNotEmpty(gasBoundary)) { + betaDataFile.setGasBoundary(gasBoundary); + } + List detBoundary = (List) map.get("DetBoundary"); + if(CollectionUtils.isNotEmpty(detBoundary)) { + betaDataFile.setDetBoundary(detBoundary); + } + List qcBoundary = (List) map.get("QCBoundary"); + if(CollectionUtils.isNotEmpty(qcBoundary)) { + betaDataFile.setQcBoundary(qcBoundary); + } if (CollectionUtils.isNotEmpty(map)) { List xeDataList = (List) map.get("XeData"); if (CollectionUtils.isNotEmpty(xeDataList)){ @@ -3229,9 +3328,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { if (CollectionUtils.isNotEmpty(sampleFileNames)) { for (int i=0; i map = new HashMap<>(); //获取缓存数据 @@ -3263,6 +3359,22 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, map, betaDataFile); } } + List sampleBoundary = (List) map.get("SampleBoundary"); + if(CollectionUtils.isNotEmpty(sampleBoundary)) { + betaDataFile.setSampleBoundary(sampleBoundary); + } + List gasBoundary = (List) map.get("GasBoundary"); + if(CollectionUtils.isNotEmpty(gasBoundary)) { + betaDataFile.setGasBoundary(gasBoundary); + } + List detBoundary = (List) map.get("DetBoundary"); + if(CollectionUtils.isNotEmpty(detBoundary)) { + betaDataFile.setDetBoundary(detBoundary); + } + List qcBoundary = (List) map.get("QCBoundary"); + if(CollectionUtils.isNotEmpty(qcBoundary)) { + betaDataFile.setQcBoundary(qcBoundary); + } List xeDataList = (List) map.get("XeData"); if (CollectionUtils.isNotEmpty(xeDataList)){ for (GardsXeResultsSpectrum xeData:xeDataList) {