From 386cec88c909115051b11ae839c29202efccec4e Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Sun, 8 Oct 2023 08:48:38 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=83=A8=E5=88=86=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bcbab448..e966705b 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 @@ -218,7 +218,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { Result result = new Result(); List> resultList = new LinkedList<>(); String userName = JwtUtil.getUserNameByToken(request); - String filePath = "/test";//StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName; + String filePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName; String sampleRx = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S_(FULL_|PREL_)\\d+\\.PHD"; Pattern regexPattern = Pattern.compile(sampleRx); String sampleRx1 = "[a-zA-Z]{3}[0-9]{2}_[0-9]{3}-[0-9]{8}_[0-9]{4}_S_(FULL_|PREL_)\\d+\\.\\d+\\.PHD"; From d4d5653d026997377feaaf561b3d2c9e33fa7aaa Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Mon, 9 Oct 2023 09:39:05 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E7=AE=97=E6=B3=95=E6=89=80=E9=9C=80?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=8F=8A=E8=B0=83=E7=94=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=8F=90=E5=87=BA=E5=88=B0=E5=85=AC=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=B8=8B=20=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A8=8B=E5=BA=8F=E5=AD=98=E5=82=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9C=89=E8=AF=AF=E9=97=AE=E9=A2=98=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9EParameterProperties=E7=B1=BB=20=E6=96=B0=E5=A2=9ENumbe?= =?UTF-8?q?rFormatUtil=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/ParameterProperties.java | 24 ++ .../jeecg/common/util/NumberFormatUtil.java | 57 +++++ .../jeecg/modules/entity/vo/AnalyseData.java | 26 +- jeecg-module-auto-process/pom.xml | 2 +- .../modules/spectrum/Sample_G_Analysis.java | 9 +- .../spectrum/SpectrumServiceQuotes.java | 3 + .../pom.xml | 2 +- .../org/jeecg/common/util/GammaFileUtil.java | 82 ++----- .../org/jeecg/modules/entity/vo/PeakInfo.java | 0 .../modules/entity/vo/StructInsertInput.java | 0 .../modules/entity/vo/StructInsertOutput.java | 0 .../modules/native_jni/CalValuesHandler.java | 0 .../native_jni/EnergySpectrumHandler.java | 0 .../native_jni/struct/AllGenerate.java | 0 .../native_jni/struct/BgAnalyseResult.java | 0 .../modules/native_jni/struct/BgBoundary.java | 0 .../native_jni/struct/CalValuesOut.java | 0 .../struct/CalcBgBoundaryParam.java | 0 .../struct/EnergySpectrumStruct.java | 0 jeecg-module-spectrum-analysis/pom.xml | 2 +- .../modules/entity/vo/BgCalibratePara.java | 0 .../modules/entity/vo/SpectrumGroup.java | 2 - .../native_jni/EnergySpectrumHandler.java | 11 + .../service/impl/GammaServiceImpl.java | 232 ++++++++++++++++-- .../impl/SpectrumAnalysisServiceImpl.java | 218 +++++++++------- .../jeecg/common/CalculateStationData.java | 8 +- .../jeecg/JeecgAutoProcessApplication.java | 4 +- pom.xml | 6 +- 28 files changed, 491 insertions(+), 197 deletions(-) create mode 100644 jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/ParameterProperties.java create mode 100644 jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/pom.xml (95%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/common/util/GammaFileUtil.java (98%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/entity/vo/PeakInfo.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/entity/vo/StructInsertInput.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/entity/vo/StructInsertOutput.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/AllGenerate.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/BgAnalyseResult.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/BgBoundary.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/CalValuesOut.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/CalcBgBoundaryParam.java (100%) rename {jeecg-module-BetaGammaAnalyser => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java (100%) rename {jeecg-boot-base-core => jeecg-module-spectrum-analysis}/src/main/java/org/jeecg/modules/entity/vo/BgCalibratePara.java (100%) rename {jeecg-boot-base-core => jeecg-module-spectrum-analysis}/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java (94%) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/ParameterProperties.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/ParameterProperties.java new file mode 100644 index 00000000..a54db57d --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/properties/ParameterProperties.java @@ -0,0 +1,24 @@ +package org.jeecg.common.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +import java.io.Serializable; + +@Data +@Component +@ConfigurationProperties(prefix = "parameter") +public class ParameterProperties implements Serializable { + + /** + * 算法计算需要用到的文件存储路径 + */ + private String filePath; + + /** + * db文件存储路径 + */ + private String dbPath; + +} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java new file mode 100644 index 00000000..2909cbec --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/NumberFormatUtil.java @@ -0,0 +1,57 @@ +package org.jeecg.common.util; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.math.MathContext; + +@Component +public class NumberFormatUtil { + + public static void main(String[] args) { + double value = 8823 * 12 * 30 + 79.2 * 10000; + value = value - 2640000; + System.out.println(value); + } + + //接收参数判断是否是科学计数法 + public static String numberFormat(String number) { + String value = ""; + //判断传入的字符串是否包含e + if (StringUtils.isNotBlank(number)) { + if (number.contains("e") || number.contains("E")) { + value = scienceCal(number); + } else { + value = numberCal(number); + } + } + return value; + } + + public static String scienceCal(String number) { + String value = ""; + if (number.indexOf("e")>0) { + String calNumber = number.substring(0, number.indexOf("e")); + String numberCal = numberCal(calNumber); + value = numberCal + number.substring(number.indexOf("e")); + } else if (number.indexOf("E")>0) { + String calNumber = number.substring(0, number.indexOf("E")); + String numberCal = numberCal(calNumber); + value = numberCal + number.substring(number.indexOf("E")); + } + return value; + } + + //正常小数进行固定长度的保留小数 + public static String numberCal(String number) { + //将当前字符串的数字 + BigDecimal b = new BigDecimal(number); + BigDecimal divisor = BigDecimal.ONE; + //需要保留的长度 + MathContext mc = new MathContext(6); + return String.valueOf(b.divide(divisor, mc)); + } + + +} diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java index 09e203b7..6712cb36 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java @@ -12,26 +12,16 @@ public class AnalyseData implements Serializable { private boolean sampleData; - private boolean GasBgData; + private boolean gasBgData; - private boolean DetBgData; + private boolean detBgData; - private boolean QCData; - - private boolean gFitting; - - private boolean bFitting; + private boolean qcData; private boolean bGammaEnergyValid; private boolean bBetaEnergyValid; - private List fittingChannelEnergy; - - private CalibrationParam g_calibration_param; - - private CalibrationParam b_calibration_param; - private List dbNames; private List sampleIds; @@ -42,15 +32,15 @@ public class AnalyseData implements Serializable { private List detFileNames; + private List qcFileNames; + public AnalyseData(){ sampleData = false; - GasBgData = false; - DetBgData = false; - QCData = false; + gasBgData = false; + detBgData = false; + qcData = false; bGammaEnergyValid = false; bBetaEnergyValid = false; - g_calibration_param = new CalibrationParam(); - b_calibration_param = new CalibrationParam(); } } diff --git a/jeecg-module-auto-process/pom.xml b/jeecg-module-auto-process/pom.xml index 2d2dbd37..6724d41d 100644 --- a/jeecg-module-auto-process/pom.xml +++ b/jeecg-module-auto-process/pom.xml @@ -18,7 +18,7 @@ org.jeecgframework.boot - jeecg-module-BetaGammaAnalyser + jeecg-module-beta-gamma-analyser diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java index 9dad3679..fe6a6756 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/Sample_G_Analysis.java @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.*; import org.jeecg.common.constant.enums.SpectrumSystemType; +import org.jeecg.common.properties.ParameterProperties; import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.util.GammaFileUtil; import org.jeecg.common.util.RedisUtil; @@ -30,6 +31,7 @@ import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.ftp.FTPUtils; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecgframework.core.util.ApplicationContextUtil; +import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.TransactionStatus; import java.io.File; @@ -56,6 +58,8 @@ public class Sample_G_Analysis { // 能谱文件存储路径属性 private SpectrumPathProperties spectrumPathProperties; + private ParameterProperties parameterProperties; + private RedisUtil redisUtil; /** @@ -117,8 +121,9 @@ public class Sample_G_Analysis { Integer sampleId = sampleData.getSampleId(); GammaFileUtil gammaFileUtil = ApplicationContextUtil.getContext().getBean(GammaFileUtil.class); + parameterProperties = ApplicationContextUtil.getContext().getBean(ParameterProperties.class); PHDFile phdFile = new PHDFile(); - + phdFile.setXmlFilePath(parameterProperties.getFilePath()); // 解析PHD文件 spectrumPathProperties = ApplicationContextUtil.getContext().getBean(SpectrumPathProperties.class); String sampleFilePath = sampleData.getInputFileName(); @@ -126,7 +131,7 @@ public class Sample_G_Analysis { String fileName = sampleFilePath.substring(sampleFilePath.lastIndexOf(StringPool.SLASH)+1); boolean flag = gammaFileUtil.loadFile(pathName, fileName, phdFile, new Result()); // todo 测试阶段暂时注释掉,获取数据库 Gamma 默认参数 -// getSettingFromDB(phdFile); + getSettingFromDB(phdFile); // 文件路径 middleData.setAnalyses_save_filePath(this.sampleInputFilename); // 读取文件内容并附值 diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumServiceQuotes.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumServiceQuotes.java index e4961f44..ef7140be 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumServiceQuotes.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumServiceQuotes.java @@ -2,6 +2,7 @@ package org.jeecg.modules.spectrum; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.jeecg.common.properties.ParameterProperties; import org.jeecg.common.properties.SoftwareProperties; import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.properties.TaskProperties; @@ -36,6 +37,8 @@ public class SpectrumServiceQuotes { private final SpectrumPathProperties spectrumPathProperties; + private final ParameterProperties parameterProperties; + private final ISOHSpectrumService sohSpectrumService; private final IAlertSpectrumService alertSpectrumService; diff --git a/jeecg-module-BetaGammaAnalyser/pom.xml b/jeecg-module-beta-gamma-analyser/pom.xml similarity index 95% rename from jeecg-module-BetaGammaAnalyser/pom.xml rename to jeecg-module-beta-gamma-analyser/pom.xml index 442068a5..30e75419 100644 --- a/jeecg-module-BetaGammaAnalyser/pom.xml +++ b/jeecg-module-beta-gamma-analyser/pom.xml @@ -9,7 +9,7 @@ 3.5.1 - jeecg-module-BetaGammaAnalyser + jeecg-module-beta-gamma-analyser 8 diff --git a/jeecg-module-BetaGammaAnalyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java similarity index 98% rename from jeecg-module-BetaGammaAnalyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java rename to jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 622a2274..14d3f76f 100644 --- a/jeecg-module-BetaGammaAnalyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -11,6 +11,7 @@ import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.ejml.simple.SimpleMatrix; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.properties.ParameterProperties; import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.modules.base.entity.configuration.GardsNuclLib; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; @@ -44,8 +45,8 @@ import java.util.*; @Component public class GammaFileUtil { - @Value("${parameter.filePath}") - private String parameterFilePath; + @Autowired + private ParameterProperties parameterProperties; @Autowired private FTPUtil ftpUtil; @Autowired @@ -845,7 +846,7 @@ public class GammaFileUtil { public boolean ReadQCLimit(Map qcItems, Map vMdcInfoMap, Double ener_Be7, String systemType) { try { - String filePath = parameterFilePath+ File.separator +"SystemManager.xml"; + String filePath = parameterProperties.getFilePath()+ File.separator +"SystemManager.xml"; //创建一个文档解析器工厂 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); //创建文档解析器 @@ -1383,7 +1384,6 @@ public class GammaFileUtil { String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath()); Map parseMap = JSON.parseObject(strValue, Map.class); for (Map.Entry entry:parseMap.entrySet()) { - System.out.println(entry.getKey()); if (entry.getKey().equalsIgnoreCase("bAnalyed")) { boolean value = JSON.parseObject(JSON.toJSONString(entry.getValue()), Boolean.class); phd.setBAnalyed(value); @@ -1546,58 +1546,6 @@ public class GammaFileUtil { } } BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting()); - if(CollectionUtils.isNotEmpty(phd.getMapEnerKD())) { - String key = ""; - key = phd.getNewEner(); - phd.setUsedEner(key); - GEnergyBlock source = new GEnergyBlock(); - GEnergyBlock gEnergyBlock = phd.getMapEnerKD().get(phd.getNewEner()); - BeanUtils.copyProperties(gEnergyBlock, source); - phd.setUsedEnerKD(source); - ParameterInfo info = new ParameterInfo(); - ParameterInfo parameterInfo = phd.getMapEnerPara().get(phd.getNewEner()); - BeanUtils.copyProperties(parameterInfo, info); - phd.setUsedEnerPara(info); - } - if(CollectionUtils.isNotEmpty(phd.getMapResoKD())) { - String key = ""; - key = phd.getNewReso(); - phd.setUsedReso(key); - GResolutionBlock source = new GResolutionBlock(); - GResolutionBlock gResolutionBlock = phd.getMapResoKD().get(phd.getNewReso()); - BeanUtils.copyProperties(gResolutionBlock, source); - phd.setUsedResoKD(source); - ParameterInfo info = new ParameterInfo(); - ParameterInfo parameterInfo = phd.getMapResoPara().get(phd.getNewReso()); - BeanUtils.copyProperties(parameterInfo, info); - phd.setUsedResoPara(info); - } - if(CollectionUtils.isNotEmpty(phd.getMapEffiKD())) { - String key = ""; - key = phd.getNewEffi(); - phd.setUsedEffi(key); - GEfficiencyBlock source = new GEfficiencyBlock(); - GEfficiencyBlock gEfficiencyBlock = phd.getMapEffiKD().get(phd.getNewEffi()); - BeanUtils.copyProperties(gEfficiencyBlock, source); - phd.setUsedEffiKD(source); - ParameterInfo info = new ParameterInfo(); - ParameterInfo parameterInfo = Objects.nonNull(phd.getMapEffiPara().get(phd.getNewEffi()))?phd.getMapEffiPara().get(phd.getNewEffi()):new ParameterInfo(); - BeanUtils.copyProperties(parameterInfo, info); - phd.setUsedEffiPara(info); - } - if(CollectionUtils.isNotEmpty(phd.getMapTotEKD())) { - String key = ""; - key = phd.getNewTotE(); - phd.setUsedTotE(key); - TotaleffBlock source = new TotaleffBlock(); - TotaleffBlock totaleffBlock = phd.getMapTotEKD().get(phd.getNewTotE()); - BeanUtils.copyProperties(totaleffBlock, source); - phd.setUsedTotEKD(source); - ParameterInfo info = new ParameterInfo(); - ParameterInfo parameterInfo = Objects.nonNull(phd.getMapTotEPara().get(phd.getNewTotE()))?phd.getMapTotEPara().get(phd.getNewTotE()):new ParameterInfo(); - BeanUtils.copyProperties(parameterInfo, info); - phd.setUsedTotEPara(info); - } for (PeakInfo peak:phd.getVPeak()) { if (StringUtils.isBlank(peak.recoilBetaChan)) { @@ -1810,7 +1758,7 @@ public class GammaFileUtil { private void ReadSpecialNuclides(Map mapHalflife, List vNuclides) { try { - String fileName = parameterFilePath+"/setup/nuclide_ActMdc.txt"; + String fileName = parameterProperties.getFilePath() + StringPool.SLASH +"nuclide_ActMdc.txt"; File t_file = new File(fileName); List readLines = FileUtils.readLines(t_file, "UTF-8"); for (int i=0;i< readLines.size();i++){ @@ -2061,7 +2009,7 @@ public class GammaFileUtil { public void ReadData(List m_vEnergy, List m_vNuclide) { try { - String filePath = parameterFilePath+File.separator+"Energy_Nuclide.txt"; + String filePath = parameterProperties.getFilePath() +File.separator+"Energy_Nuclide.txt"; File file = new File(filePath); List readLines = FileUtils.readLines(file, "UTF-8"); for (int i=0; i m_vCurEnergy, ParameterInfo m_curParam) { + public String UpdateEquationEfficiency(List m_vCurEnergy, ParameterInfo m_curParam, Integer funId) { String equation = ""; if(m_curParam.getP().size() > 2) { int p_size = m_curParam.getP().size()-1; int e_size = m_vCurEnergy.size(); - int funId = m_curParam.getP().get(0).intValue(); + if (Objects.isNull(funId)) { + funId = m_curParam.getP().get(0).intValue(); + } switch(funId) { case 1: // Interpolation: y=yi+(y(i+1)-yi)*(x-xi)/(x(i+1)-xi) for xi<=x= 4) { @@ -2698,7 +2648,11 @@ public class GammaFileUtil { public List DoubleLimit(List data) { List rData = new LinkedList<>(); for(int pos=0;pos org.jeecgframework.boot - jeecg-module-BetaGammaAnalyser + jeecg-module-beta-gamma-analyser diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/BgCalibratePara.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgCalibratePara.java similarity index 100% rename from jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/BgCalibratePara.java rename to jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgCalibratePara.java diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java similarity index 94% rename from jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java rename to jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java index fbcd0dc2..4de7726c 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/SpectrumGroup.java @@ -13,8 +13,6 @@ public class SpectrumGroup implements Serializable { public List b_c2e; public List g_c2e; - public Integer sampleId; - public SpectrumGroup(){ BgCalPara = new BgCalibratePara(); b_c2e = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java index acf974c2..60364614 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java @@ -1,5 +1,6 @@ package org.jeecg.modules.native_jni; +import org.jeecg.modules.entity.vo.BgCalibratePara; import org.jeecg.modules.native_jni.struct.BgAnalyseResult; import org.jeecg.modules.native_jni.struct.BgBoundary; import org.jeecg.modules.native_jni.struct.CalcBgBoundaryParam; @@ -51,4 +52,14 @@ public class EnergySpectrumHandler { */ public static native BgAnalyseResult bgAnalyse(String sampleFile, String gasFile, String detFile); + /** + * BetaGamma 重新分析算法 + * @param sampleFile + * @param gasFile + * @param detFile + * @param BgCalPara + * @return + */ + public static native BgAnalyseResult bgReAnalyse(String sampleFile, String gasFile, String detFile, BgCalibratePara BgCalPara); + } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 6823300e..b7e2d5a9 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -21,6 +21,7 @@ import org.apache.commons.net.ftp.FTPClient; import org.jeecg.common.api.vo.Result; import org.jeecg.common.cache.LocalCache; import org.jeecg.common.constant.DateConstant; +import org.jeecg.common.properties.ParameterProperties; import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.util.*; @@ -39,6 +40,7 @@ import org.jeecg.modules.mapper.SpectrumAnalysisMapper; import org.jeecg.modules.native_jni.CalValuesHandler; import org.jeecg.modules.native_jni.struct.CalValuesOut; import org.jeecg.modules.service.*; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -89,8 +91,8 @@ public class GammaServiceImpl implements IGammaService { private FTPUtil ftpUtil; @Value("${ZeroTime}") private String ZeroTimeStr; - @Value("${parameter.filePath}") - private String parameterFilePath; + @Autowired + private ParameterProperties parameterProperties; @Autowired private IGardsAnalysesSpectrumService analysesSpectrumService; @Autowired @@ -173,7 +175,16 @@ public class GammaServiceImpl implements IGammaService { @Override public Result testFun(String fileName, HttpServletRequest request) { Result result = new Result(); + Cache phdCache = localCache.getPHDCache(); + PHDFile phd = phdCache.getIfPresent(fileName); + phd.getSetting().setBUpdateCal(false); + phd.setUserId("1"); + phd.setXmlFilePath(parameterProperties.getFilePath()); String systemType = fileName.substring(2, 3); + if (Objects.isNull(phd)){ + result.error500("请先选择解析文件!"); + return result; + } String userName = JwtUtil.getUserNameByToken(request); //查询当前用户关联的核素信息 List nuclides = new LinkedList<>(); @@ -183,8 +194,197 @@ public class GammaServiceImpl implements IGammaService { nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", systemType); } Map nuclideLinesMap = GetNuclideLines(nuclides); + //解析获取临时文件信息 + File tmpFile = gammaFileUtil.analyzeFile(StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName, fileName); + ObjectMapper mapper = new ObjectMapper(); + try { + String phdStr = mapper.writeValueAsString(phd); + String mapLines = mapper.writeValueAsString(nuclideLinesMap); + String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, tmpFile.getAbsolutePath()); + Map parseMap = JSON.parseObject(strValue, Map.class); + for (Map.Entry entry:parseMap.entrySet()) { + if (entry.getKey().equalsIgnoreCase("bAnalyed")) { + boolean value = JSON.parseObject(JSON.toJSONString(entry.getValue()), Boolean.class); + phd.setBAnalyed(value); + } + if (entry.getKey().equalsIgnoreCase("mapEnerPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapEnerPara(value); + } + if (entry.getKey().equalsIgnoreCase("mapResoPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapResoPara(value); + } + if (entry.getKey().equalsIgnoreCase("mapEffiPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapEffiPara(value); + } + if (entry.getKey().equalsIgnoreCase("mapTotEPara")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + ParameterInfo entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), ParameterInfo.class); + value.put(key, entryValue); + } + phd.setMapTotEPara(value); + } + if (entry.getKey().equalsIgnoreCase("para_stepRatio")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_stepRatio(value); + } + if (entry.getKey().equalsIgnoreCase("para_tail")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tail(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailAlpha")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailAlpha(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailRight")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailRight(value); + } + if (entry.getKey().equalsIgnoreCase("para_tailRightAlpha")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setPara_tailRightAlpha(value); + } + if (entry.getKey().equalsIgnoreCase("newEner")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setNewEner(value); + } + if (entry.getKey().equalsIgnoreCase("mapEnerKD")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + GEnergyBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GEnergyBlock.class); + value.put(key, entryValue); + } + phd.setMapEnerKD(value); + } + if (entry.getKey().equalsIgnoreCase("mapResoKD")) { + HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); + Map value = new HashMap<>(); + for (Map.Entry objectEntry:jsonMap.entrySet()) { + String key = objectEntry.getKey(); + GResolutionBlock entryValue = JSON.parseObject(JSON.toJSONString(objectEntry.getValue()), GResolutionBlock.class); + value.put(key, entryValue); + } + phd.setMapResoKD(value); + } + if (entry.getKey().equalsIgnoreCase("vEnergy")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVEnergy(value); + } + if (entry.getKey().equalsIgnoreCase("vBase")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVBase(value); + } + if (entry.getKey().equalsIgnoreCase("vLc")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVLc(value); + } + if (entry.getKey().equalsIgnoreCase("vScac")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), Double.class); + phd.setVScac(value); + } + if (entry.getKey().equalsIgnoreCase("vPeak")) { + List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), PeakInfo.class); + phd.setVPeak(value); + } + if (entry.getKey().equalsIgnoreCase("baseCtrls")) { + BaseControls value = JSON.parseObject(JSON.toJSONString(entry.getValue()), BaseControls.class); + phd.setBaseCtrls(value); + } + if (entry.getKey().equalsIgnoreCase("usedEner")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedEner(value); + } + if (entry.getKey().equalsIgnoreCase("usedEnerKD")) { + GEnergyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEnergyBlock.class); + phd.setUsedEnerKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedEnerPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedEnerPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedReso")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedReso(value); + } + if (entry.getKey().equalsIgnoreCase("usedResoKD")) { + GResolutionBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GResolutionBlock.class); + phd.setUsedResoKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedResoPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedResoPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffi")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedEffi(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffiKD")) { + GEfficiencyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEfficiencyBlock.class); + phd.setUsedEffiKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedEffiPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedEffiPara(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotE")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setUsedTotE(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotEKD")) { + TotaleffBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), TotaleffBlock.class); + phd.setUsedTotEKD(value); + } + if (entry.getKey().equalsIgnoreCase("usedTotEPara")) { + ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class); + phd.setUsedTotEPara(value); + } + } + BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting()); + + for (PeakInfo peak:phd.getVPeak()) { + if (StringUtils.isBlank(peak.recoilBetaChan)) { + peak.recoilBetaChan = "1"; + } + if (StringUtils.isBlank(peak.recoilDeltaChan)) { + peak.recoilDeltaChan = "1"; + } + } + gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap); + gammaFileUtil.RunQC(phd); + result.setResult(phd); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } finally { + if (Objects.nonNull(tmpFile)) { + tmpFile.delete(); + } + } result.setSuccess(true); - result.setResult(nuclideLinesMap); return result; } @@ -461,8 +661,8 @@ public class GammaServiceImpl implements IGammaService { phd.getMapNucActMda().get(str_key).setEfficiency(nuclLinesIdedSpectrum.getEffic()); phd.getMapNucActMda().get(str_key).setEffi_err(nuclLinesIdedSpectrum.getUnEffic()); phd.getMapNucActMda().get(str_key).setMda(nuclLinesIdedSpectrum.getMda()); - phd.getMapNucActMda().get(str_key).setMdc(Double.valueOf(nuclLinesIdedSpectrum.getMdc())); - phd.getMapNucActMda().get(str_key).setConcentration(Double.valueOf(nuclLinesIdedSpectrum.getConcentration())); + phd.getMapNucActMda().get(str_key).setMdc(nuclLinesIdedSpectrum.getMdc().equalsIgnoreCase("inf")?0.0:Double.valueOf(nuclLinesIdedSpectrum.getMdc())); + phd.getMapNucActMda().get(str_key).setConcentration(nuclLinesIdedSpectrum.getConcentration().equalsIgnoreCase("inf")?0.0:Double.valueOf(nuclLinesIdedSpectrum.getConcentration())); if(phd.getMapNucActMda().get(str_key).getActivity() > 0){ phd.getMapNucActMda().get(str_key).setBCalculateMDA(true); } @@ -729,7 +929,7 @@ public class GammaServiceImpl implements IGammaService { phd.setUserId(user.getId()); } //赋值xml文件存放路径 - phd.setXmlFilePath(parameterFilePath); + phd.setXmlFilePath(parameterProperties.getFilePath()); //获取当前角色的颜色配置 Map colorMap = sysUserColorService.initColor(userName); //查询当前用户关联的核素信息 @@ -2312,7 +2512,7 @@ public class GammaServiceImpl implements IGammaService { efficiencyDataList.add(efficiencyData); } map.put("table", efficiencyDataList); - String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam); + String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam, null); map.put("equation", equation); gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, width, map); map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low()); @@ -2370,7 +2570,7 @@ public class GammaServiceImpl implements IGammaService { String Warning = "Fit failed. Maybe:\n1. data's number are too little;\n2. %1 isn't suitable for the data."; } map.put("table", efficiencyDataList); - String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam); + String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam, funcId); map.put("equation", equation); gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, width, map); } @@ -2505,7 +2705,7 @@ public class GammaServiceImpl implements IGammaService { efficiencyDataList.add(efficiencyData); } map.put("table", efficiencyDataList); - String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam); + String equation = gammaFileUtil.UpdateEquationEfficiency(m_vCurEnergy, m_curParam, null); map.put("equation", equation); gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, width, map); map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low()); @@ -3141,7 +3341,7 @@ public class GammaServiceImpl implements IGammaService { } item.setName(name); item.setFlag(iter.getValue().isBPass() ? "PASS" : "FAIL"); - item.setValue(NumUtil.fixedMax(6 ,iter.getValue().getValue())); + item.setValue( Double.parseDouble(NumberFormatUtil.numberCal(String.valueOf(iter.getValue().getValue()))) ); String standard=""; List strList = Arrays.asList(iter.getValue().getStandard().split(StringPool.COMMA)); for (String str : strList) { @@ -3258,16 +3458,16 @@ public class GammaServiceImpl implements IGammaService { TablePeakFit tablePeak = new TablePeakFit(); tablePeak.setIndex(i + 1); PeakInfo peak = phd.getVPeak().get(i); - tablePeak.setEnergy(NumUtil.keep3Str(peak.energy)); + tablePeak.setEnergy( NumberFormatUtil.numberCal(String.valueOf(peak.energy)) ); tablePeak.setEnergyErr(energy_uncert); - tablePeak.setNetArea(NumUtil.keep4ScienceStr(peak.area)); - String area_err = peak.area > 0 ? NumUtil.keep2Str(peak.areaErr/peak.area*100) : "0"; + tablePeak.setNetArea( NumberFormatUtil.numberCal(String.valueOf(peak.area)) ); + String area_err = peak.area > 0 ? NumberFormatUtil.numberCal(String.valueOf(peak.areaErr/peak.area*100)) : "0"; tablePeak.setAreaErr(area_err); - String rate = live_time > 0 ? NumUtil.keep4ScienceStr(peak.area/live_time) : "0"; + String rate = live_time > 0 ? NumberFormatUtil.numberCal(String.valueOf(peak.area/live_time)) : "0"; tablePeak.setNetCountRate(rate); tablePeak.setNcRateErr(area_err); - tablePeak.setLc(NumUtil.keep4ScienceStr(peak.lc)); - tablePeak.setSignificance(NumUtil.keep2Str(peak.significance)); + tablePeak.setLc( NumberFormatUtil.numberCal(String.valueOf(peak.lc)) ); + tablePeak.setSignificance( NumberFormatUtil.numberCal(String.valueOf(peak.significance)) ); peakFitList.add(tablePeak); } map.put("peakFit", peakFitList); 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 e966705b..7c784b04 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 @@ -385,7 +385,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { @Override public Result getFileSpectrumChart(String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request) { Result result = new Result(); - String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + JwtUtil.getUserNameByToken(request); + String userName = JwtUtil.getUserNameByToken(request); + String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; Map resultMap = new HashMap<>(); List filePath = new LinkedList<>(); Map sampleMap = new HashMap<>(); @@ -2362,30 +2363,49 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { @Override public Result ReAnalyse(AnalyseData analyseData, HttpServletRequest request) { + Result result = new Result(); String userName = JwtUtil.getUserNameByToken(request); if ("CurrentSpectrum".equals(analyseData.getApplyType())) { List sampleIds = analyseData.getSampleIds(); if (CollectionUtils.isNotEmpty(sampleIds)){ String dbName = analyseData.getDbNames().get(0); Integer sampleId = sampleIds.get(0); - Integer analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName); + Integer analysisID = null; + if (dbName.equalsIgnoreCase("auto")){ + dbName = "RNAUTO"; + analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, "RNAUTO"); + }else if (dbName.equalsIgnoreCase("man")){ + dbName = "RNMAN"; + analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName); + } SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID); if (Objects.nonNull(dbSpectrumFilePath)) { - BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName); + BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName); + result.setSuccess(true); + result.setResult(analyseResult); } + } else { + String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + SpectrumFileRecord dbSpectrumFilePath = new SpectrumFileRecord(); + dbSpectrumFilePath.setSampleFilePath(path); + dbSpectrumFilePath.setGasBgFilePath(path); + dbSpectrumFilePath.setDetBgFilePath(path); + BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName); + result.setSuccess(true); + result.setResult(analyseResult); } - } else if ("AllSpectrum".equals(analyseData.getApplyType())) { - Map m_loadData = new HashMap<>(); - for (int i=0; i m_loadData = new HashMap<>(); +// for (int i=0; iBetaOriginalChartView->SetFittingParam(fit_analy_param.b_calibration_param.param_a_c2e_new, // fit_analy_param.b_calibration_param.param_b_c2e_new, @@ -2402,96 +2422,126 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { // fit_analy_param.g_calibration_param.param_b_c2e_new, // fit_analy_param.g_calibration_param.param_c_c2e_new); // } - - return null; + return result; } - private void BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, SpectrumFileRecord dbSpectrumFilePath, String userName){ + private BgAnalyseResult BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, SpectrumFileRecord dbSpectrumFilePath, String userName){ SpectrumGroup spectrum_group = new SpectrumGroup(); - spectrum_group.sampleId = dbSpectrumFilePath.getSampleId(); - spectrum_group.SampleSpectrumFile = dbSpectrumFilePath.getSampleFilePath(); - spectrum_group.GasBgSpectrumFile = dbSpectrumFilePath.getGasBgFilePath(); - spectrum_group.DetBgSpectrumFile = dbSpectrumFilePath.getDetBgFilePath(); - + String sampleFilePath = dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)); + String sampleFileName = dbSpectrumFilePath.getSampleFilePath().substring(dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)+1); + String gasFilePath = dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)); + String gasFileName = dbSpectrumFilePath.getGasBgFilePath().substring(dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)+1); + String detFilePath = dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)); + String detFileName = dbSpectrumFilePath.getDetBgFilePath().substring(dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)+1); + List qcFileNames = analyseData.getQcFileNames(); + String qcFileName = qcFileNames.get(0); + //从本地缓存获取beta gamma的数组 + Cache> cache = betaCache.getBetaCache(); + //根据qc文件名称-用户名-beta的方式获取beta的内容 + Map betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta"); + List betaList = new LinkedList<>(); + List betaFittingPara = new LinkedList<>(); + List betaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(betaMap)) { + betaList = (List)betaMap.get("Series"); + betaFittingPara = (List) betaMap.get("fittingPara"); + betaFittingParaToUi = (List) betaMap.get("fittingParaToUi"); + } + //根据qc文件名称-用户名-gamma的方式获取gamma的内容 + Map gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma"); + List gammaList = new LinkedList<>(); + List gammaFittingPara = new LinkedList<>(); + List gammaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(gammaMap)) { + gammaList = (List)gammaMap.get("Series"); + gammaFittingPara = (List) gammaMap.get("fittingPara"); + gammaFittingParaToUi = (List) gammaMap.get("fittingParaToUi"); + } if (analyseData.isBBetaEnergyValid()) { List beCal = new LinkedList<>(); - beCal.add(analyseData.getB_calibration_param().param_c_e2c_new); - beCal.add(analyseData.getB_calibration_param().param_b_e2c_new); - beCal.add(analyseData.getB_calibration_param().param_a_e2c_new); + beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(2))); spectrum_group.BgCalPara.b_e_cal = beCal; List bc2e = new LinkedList<>(); - bc2e.add(analyseData.getB_calibration_param().param_c_c2e_new); - bc2e.add(analyseData.getB_calibration_param().param_b_c2e_new); - bc2e.add(analyseData.getB_calibration_param().param_a_c2e_new); + bc2e.add(Double.valueOf(betaFittingPara.get(0))); + bc2e.add(Double.valueOf(betaFittingPara.get(1))); + bc2e.add(Double.valueOf(betaFittingPara.get(2))); spectrum_group.b_c2e = bc2e; } if (analyseData.isBGammaEnergyValid()) { List geCal = new LinkedList<>(); - geCal.add(analyseData.getG_calibration_param().param_c_e2c_new); - geCal.add(analyseData.getG_calibration_param().param_b_e2c_new); - geCal.add(analyseData.getG_calibration_param().param_a_e2c_new); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(2))); spectrum_group.BgCalPara.g_e_cal = geCal; List gc2e = new LinkedList<>(); - gc2e.add(analyseData.getG_calibration_param().param_c_c2e_new); - gc2e.add(analyseData.getG_calibration_param().param_b_c2e_new); - gc2e.add(analyseData.getG_calibration_param().param_a_c2e_new); + gc2e.add(Double.valueOf(gammaFittingPara.get(0))); + gc2e.add(Double.valueOf(gammaFittingPara.get(1))); + gc2e.add(Double.valueOf(gammaFittingPara.get(2))); spectrum_group.g_c2e = gc2e; } spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); - spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQCData(); - + spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); + System.loadLibrary("ReadPHDFile"); + //根据文件路径 文件名称获取对应的临时文件 + File sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName); + File gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName); + File detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName); + BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); + return analyseResult; } - private void BetaGammaAnalyzeAllProcess(Map m_loadData, AnalyseData analyseData){ - List spectrum_group_list = new LinkedList<>(); - for (Map.Entry entry: m_loadData.entrySet()){ - SpectrumGroup spectrum_group = new SpectrumGroup(); - SpectrumFileRecord spectrumFileRecord = entry.getValue(); - spectrum_group.SampleSpectrumFile = spectrumFileRecord.getSampleFilePath(); - spectrum_group.GasBgSpectrumFile = spectrumFileRecord.getGasBgFilePath(); - spectrum_group.DetBgSpectrumFile = spectrumFileRecord.getDetBgFilePath(); - - if (analyseData.isBBetaEnergyValid()) { - List beCal = new LinkedList<>(); - beCal.add(analyseData.getB_calibration_param().param_c_e2c_new); - beCal.add(analyseData.getB_calibration_param().param_b_e2c_new); - beCal.add(analyseData.getB_calibration_param().param_a_e2c_new); - spectrum_group.BgCalPara.b_e_cal = beCal; - List bc2e = new LinkedList<>(); - bc2e.add(analyseData.getB_calibration_param().param_c_c2e_new); - bc2e.add(analyseData.getB_calibration_param().param_b_c2e_new); - bc2e.add(analyseData.getB_calibration_param().param_a_c2e_new); - spectrum_group.b_c2e = bc2e; - } - if (analyseData.isBGammaEnergyValid()) { - List geCal = new LinkedList<>(); - geCal.add(analyseData.getG_calibration_param().param_c_e2c_new); - geCal.add(analyseData.getG_calibration_param().param_b_e2c_new); - geCal.add(analyseData.getG_calibration_param().param_a_e2c_new); - spectrum_group.BgCalPara.g_e_cal = geCal; - List gc2e = new LinkedList<>(); - gc2e.add(analyseData.getG_calibration_param().param_c_c2e_new); - gc2e.add(analyseData.getG_calibration_param().param_b_c2e_new); - gc2e.add(analyseData.getG_calibration_param().param_a_c2e_new); - spectrum_group.g_c2e = gc2e; - } - spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); - spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); - spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); - spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQCData(); - - spectrum_group_list.add(spectrum_group); - } - - if (CollectionUtils.isNotEmpty(spectrum_group_list)) { -// beta_gamma_analy.SetSpectrumGroupList(spectrum_group_list); -// AnalyProcessDlg analy_dlg(beta_gamma_analy); -// analy_dlg.SetProgressRange(0, spectrum_group_list.count()); -// analy_dlg.exec(); - } - } +// private void BetaGammaAnalyzeAllProcess(Map m_loadData, AnalyseData analyseData){ +// List spectrum_group_list = new LinkedList<>(); +// for (Map.Entry entry: m_loadData.entrySet()){ +// SpectrumGroup spectrum_group = new SpectrumGroup(); +// SpectrumFileRecord spectrumFileRecord = entry.getValue(); +// spectrum_group.SampleSpectrumFile = spectrumFileRecord.getSampleFilePath(); +// spectrum_group.GasBgSpectrumFile = spectrumFileRecord.getGasBgFilePath(); +// spectrum_group.DetBgSpectrumFile = spectrumFileRecord.getDetBgFilePath(); +// +// if (analyseData.isBBetaEnergyValid()) { +// List beCal = new LinkedList<>(); +// beCal.add(analyseData.getB_calibration_param().param_c_e2c_new); +// beCal.add(analyseData.getB_calibration_param().param_b_e2c_new); +// beCal.add(analyseData.getB_calibration_param().param_a_e2c_new); +// spectrum_group.BgCalPara.b_e_cal = beCal; +// List bc2e = new LinkedList<>(); +// bc2e.add(analyseData.getB_calibration_param().param_c_c2e_new); +// bc2e.add(analyseData.getB_calibration_param().param_b_c2e_new); +// bc2e.add(analyseData.getB_calibration_param().param_a_c2e_new); +// spectrum_group.b_c2e = bc2e; +// } +// if (analyseData.isBGammaEnergyValid()) { +// List geCal = new LinkedList<>(); +// geCal.add(analyseData.getG_calibration_param().param_c_e2c_new); +// geCal.add(analyseData.getG_calibration_param().param_b_e2c_new); +// geCal.add(analyseData.getG_calibration_param().param_a_e2c_new); +// spectrum_group.BgCalPara.g_e_cal = geCal; +// List gc2e = new LinkedList<>(); +// gc2e.add(analyseData.getG_calibration_param().param_c_c2e_new); +// gc2e.add(analyseData.getG_calibration_param().param_b_c2e_new); +// gc2e.add(analyseData.getG_calibration_param().param_a_c2e_new); +// spectrum_group.g_c2e = gc2e; +// } +// spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); +// spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); +// spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); +// spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); +// +// spectrum_group_list.add(spectrum_group); +// } +// +// if (CollectionUtils.isNotEmpty(spectrum_group_list)) { +//// beta_gamma_analy.SetSpectrumGroupList(spectrum_group_list); +//// AnalyProcessDlg analy_dlg(beta_gamma_analy); +//// analy_dlg.SetProgressRange(0, spectrum_group_list.count()); +//// analy_dlg.exec(); +// } +// } @Override public Result analyseCurrentSpectrum(String dbName, Integer sampleId, String sampleFileName, String gasFileName, String detFileName, HttpServletRequest request) { diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java index 90caa72a..9903f738 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateStationData.java @@ -1,7 +1,9 @@ package org.jeecg.common; import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.properties.ParameterProperties; import org.jeecg.modules.entity.data.*; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.w3c.dom.*; @@ -22,8 +24,8 @@ import java.util.concurrent.TimeUnit; @Component public class CalculateStationData { - @Value("${parameter.filePath}") - private String parameterFilePath; + @Autowired + private ParameterProperties parameterProperties; /** * 初始化配置信息 @@ -31,7 +33,7 @@ public class CalculateStationData { public RateParam initParameter() { try { //文件路径 - String filePath = parameterFilePath+ File.separator +"parameter.xml"; + String filePath = parameterProperties.getFilePath()+ File.separator +"parameter.xml"; //声明一个实体类存储参数信息 RateParam mRateParam = new RateParam(); //创建一个文档解析器工厂 diff --git a/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java b/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java index 4f477f36..2b62faeb 100644 --- a/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java +++ b/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java @@ -65,8 +65,8 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im if(EmailReceivePolicy.CURR_DATE_ORDER_RECEIVE.getPolicy().equals(taskProperties.getReceivePolicy())){ systemStartupTime = new Date(); } - autoProcessManager.start(systemStartupTime); - undealHandleManager.start(); +// autoProcessManager.start(systemStartupTime); +// undealHandleManager.start(); fileSourceHandleManager.start(); } } \ No newline at end of file diff --git a/pom.xml b/pom.xml index 371400cc..ca65834a 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ jeecg-module-abnormal-alarm jeecg-module-auto-process jeecg-module-spectrum-analysis - jeecg-module-BetaGammaAnalyser + jeecg-module-beta-gamma-analyser @@ -202,10 +202,10 @@ jeecg-module-spectrum-analysis ${jeecgboot.version} - + org.jeecgframework.boot - jeecg-module-BetaGammaAnalyser + jeecg-module-beta-gamma-analyser ${jeecgboot.version} From 398a4a498c5aba2cd470e611db85f327a9f55dd4 Mon Sep 17 00:00:00 2001 From: orgin Date: Mon, 9 Oct 2023 16:12:01 +0800 Subject: [PATCH 03/10] fix: ceshi --- .../org/jeecg/modules/native_jni/CalValuesHandler.java | 2 ++ .../src/main/java/org/jeecg/modules/native_jni/Demo.java | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java index d08cf789..d656f226 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java @@ -27,4 +27,6 @@ public class CalValuesHandler { public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath); + public static native void demo(Demo demo); + } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java new file mode 100644 index 00000000..3d71994f --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java @@ -0,0 +1,7 @@ +package org.jeecg.modules.native_jni; + +public class Demo { + public void send(String message){ + System.out.println(message); + } +} From 3c61268127c6040606194cca8c314fbb67fd966c Mon Sep 17 00:00:00 2001 From: orgin Date: Mon, 9 Oct 2023 17:21:08 +0800 Subject: [PATCH 04/10] delete: ceshi --- .../org/jeecg/modules/native_jni/CalValuesHandler.java | 2 -- .../src/main/java/org/jeecg/modules/native_jni/Demo.java | 7 ------- 2 files changed, 9 deletions(-) delete mode 100644 jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java index d656f226..d08cf789 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java @@ -27,6 +27,4 @@ public class CalValuesHandler { public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath); - public static native void demo(Demo demo); - } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java deleted file mode 100644 index 3d71994f..00000000 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/Demo.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.jeecg.modules.native_jni; - -public class Demo { - public void send(String message){ - System.out.println(message); - } -} From 94ea96b7883557bba538a77ab08b367fa9e7bbdc Mon Sep 17 00:00:00 2001 From: orgin Date: Mon, 9 Oct 2023 19:42:11 +0800 Subject: [PATCH 05/10] =?UTF-8?q?fix=EF=BC=9Agamma=E5=88=86=E6=9E=90?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0process?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/native_jni/AnalysisProcess.java | 20 +++++++++++++++++++ .../modules/native_jni/CalValuesHandler.java | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java new file mode 100644 index 00000000..926f0738 --- /dev/null +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java @@ -0,0 +1,20 @@ +package org.jeecg.modules.native_jni; + +public class AnalysisProcess { + +// @Autowired +// private RedisTemplate redisTemplate; + + public void gammaProcess(String userId, String process){ +// BaseMap params = new BaseMap(); +// params.put(GlobalConstants.HANDLER_NAME, WebSocketHandlerConst.GAMMA_ANALYSIS_HANDLER); +// params.put("userId", userId); +// // userId, fileName, process +// params.put("message", process); +// String str = ""; +// JSON.parseObject(str, PHDFile.class); +// // 通过 redis 订阅发送 websocket 消息 +// redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);; + System.out.println(userId); + } +} diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java index d08cf789..7340fd47 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java @@ -25,6 +25,6 @@ public class CalValuesHandler { public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List vCentroid, List vFwhmCh, List vTail, List vUpperTail); - public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath); + public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath, AnalysisProcess process); } From ea5093e51d56b5e956dc1677e8007221224cb36c Mon Sep 17 00:00:00 2001 From: panbaolin <123456> Date: Tue, 10 Oct 2023 09:51:29 +0800 Subject: [PATCH 06/10] =?UTF-8?q?fix:1.=E5=90=88=E5=B9=B6=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E5=8F=8Ajni=E7=B1=BB=EF=BC=8C=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BD=BF=E7=94=A8beta-gamma=E5=AD=90=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/modules/ftp/FTPUtils.java | 3 +- .../modules/native_jni/CalValuesHandler.java | 30 - .../native_jni/EnergySpectrumHandler.java | 48 -- .../org/jeecg/modules/native_jni/TestDll.java | 18 - .../native_jni/struct/BgAnalyseResult.java | 191 ------ .../native_jni/struct/CalValuesOut.java | 13 - .../struct/EnergySpectrumStruct.java | 557 ------------------ .../native_jni/EnergySpectrumHandler.java | 26 +- .../struct/AlertSpectrumStruct.java | 0 .../struct/EnergySpectrumStruct.java | 112 +--- .../native_jni/struct/MetSpectrumStruct.java | 0 .../native_jni/struct/SOHSpectrumStruct.java | 0 .../src/main/resources/application.yml | 2 +- 13 files changed, 28 insertions(+), 972 deletions(-) delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/TestDll.java delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/BgAnalyseResult.java delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/CalValuesOut.java delete mode 100644 jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java rename {jeecg-module-auto-process => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/AlertSpectrumStruct.java (100%) rename {jeecg-module-auto-process => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/MetSpectrumStruct.java (100%) rename {jeecg-module-auto-process => jeecg-module-beta-gamma-analyser}/src/main/java/org/jeecg/modules/native_jni/struct/SOHSpectrumStruct.java (100%) diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/ftp/FTPUtils.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/ftp/FTPUtils.java index 8a14d548..f1aec232 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/ftp/FTPUtils.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/ftp/FTPUtils.java @@ -38,7 +38,8 @@ public class FTPUtils { this.client.setFileType(FTPClient.BINARY_FILE_TYPE); this.client.setControlEncoding(this.encoding); this.client.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE); - +// this.client.setDataTimeout(60000); +// this.client.setConnectTimeout(); //判断是否连接成功 int reply = client.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java deleted file mode 100644 index c74161b8..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.jeecg.modules.native_jni; - -import org.jeecg.modules.eneity.vo.StructInsertInput; -import org.jeecg.modules.eneity.vo.StructInsertOutput; -import org.jeecg.modules.entity.vo.PeakInfo; -import org.jeecg.modules.native_jni.struct.CalValuesOut; - -import java.util.List; - -public class CalValuesHandler { - - public static native CalValuesOut calFcnEval(List x, List para); - - public static native CalValuesOut energyToChannel(List energy, List para); - - public static native CalValuesOut calDerivEval(List channel, List para); - - public static native double calDerivaOut(double Chan, List p); - - public static native List interp1(PeakInfo peak, List t_base, List regChan); - - public static native StructInsertOutput insertPeaks(StructInsertInput structInsertInput); - - public static native List calFitPara(String type, int funcId, List x, List y, List err); - - public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List vCentroid, List vFwhmCh, List vTail, List vUpperTail); - - public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath); - -} diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java deleted file mode 100644 index 898469b3..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.jeecg.modules.native_jni; - -import org.jeecg.modules.native_jni.struct.*; - -import java.util.List; - -/** - * 能谱处理本地类 - */ -public class EnergySpectrumHandler { - - /** - * 获取能谱原始数据 - * @param path 能谱文件路径 - * @return 能谱原始数据 - */ - public static native EnergySpectrumStruct getSourceData(String path); - - /** - * 获取健康状态谱原始数据 - * @param path 能谱文件路径 - * @return 能谱原始数据 - */ - public static native SOHSpectrumStruct getSOHSourceData(String path); - - /** - * 获取警告谱原始数据 - * @param path 能谱文件路径 - * @return 能谱原始数据 - */ - public static native AlertSpectrumStruct getAlertSourceData(String path); - - /** - * 获取气象谱原始数据 - * @param path 能谱文件路径 - * @return 能谱原始数据 - */ - public static native MetSpectrumStruct getMetSourceData(String path); - - /** - * BetaGamma 分析算法 - * @param sampleFile 样品谱文件 - * @param gasFile 气体谱文件 - * @param detFile 探测器本地谱文件 - * @return - */ - public static native BgAnalyseResult bgAnalyse(String sampleFile, String gasFile, String detFile); -} diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/TestDll.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/TestDll.java deleted file mode 100644 index e019d29c..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/TestDll.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.jeecg.modules.native_jni; - -import com.alibaba.fastjson.JSON; -import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; - -public class TestDll { - - public static void main(String[] args) throws InterruptedException { - String dllPath = "D:\\Work\\核素\\C++\\c++lib\\ReadPHDFile.dll"; - String sourcePath = "D:\\Work\\核素\\C++\\谱文件样例\\Gamma\\CNP21_001-20170116_0245_S.PHD"; - while (true){ - System.load(dllPath); - final EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sourcePath); - System.out.println(sourceData); - Thread.sleep(10000L); - } - } -} diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/BgAnalyseResult.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/BgAnalyseResult.java deleted file mode 100644 index 8f56f139..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/BgAnalyseResult.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.jeecg.modules.native_jni.struct; - -import java.util.List; - -public class BgAnalyseResult { - /************************** GARDS_XE_RESULTS START**************************/ - /************************** XE_131m **************************/ - public double Xe131m_con; - public double Xe131m_uncer; - public double MDC_Xe131m; - public double LC_Xe131m; - public int XE_131m_NID_FLAG; - - /************************** XE_133 **************************/ - public double Xe133_con; - public double Xe133_uncer; - public double MDC_Xe133; - public double LC_Xe133; - public int XE_133_NID_FLAG; - /************************** XE_133m **************************/ - public double Xe133m_con; - public double Xe133m_uncer; - public double MDC_Xe133m; - public double LC_Xe133m; - public int XE_133m_NID_FLAG; - - /************************** XE_135 **************************/ - public double Xe135_con; - public double Xe135_uncer; - public double MDC_Xe135; - public double LC_Xe135; - public int XE_135_NID_FLAG; - /************************** GARDS_XE_RESULTS end **************************/ - - /************************** GARDS_ROI_RESULTS START**************************/ - public List ROI; - public List LC; - public List s_roi_cts; - public List g_roi_cts; - public List d_roi_cts; - public List s_deduct_d_cts; - public List g_deduct_d_cts; - public List ROI_net_coutns; - public List ROI_net_coutns_err; - public List ROI_con_uncer; - public List ROI_con_uncer_err; - public List MDC; - public List dNidFlag; - public List LC_CTS; - - /************************** GARDS_ROI_RESULTS end **************************/ - - /************************** GARDS_CALIBRATION START**************************/ - public List s_b_fitting_e_c; - public int s_b_fitting_type; - public String s_b_fitting_type_def; - public List s_g_fitting_e_c; - public int s_g_fitting_type; - public String s_g_fitting_type_def; - public List s_b_fitting_c_e; - public List s_g_fitting_c_e; - - public List g_b_fitting_e_c; - public int g_b_fitting_type; - public String g_b_fitting_type_def; - public List g_g_fitting_e_c; - public int g_g_fitting_type; - public String g_g_fitting_type_def; - public List g_b_fitting_c_e; - public List g_g_fitting_c_e; - - public List d_b_fitting_e_c; - public int d_b_fitting_type; - public String d_b_fitting_type_def; - public List d_g_fitting_e_c; - public int d_g_fitting_type; - public String d_g_fitting_type_def; - public List d_b_fitting_c_e; - public List d_g_fitting_c_e; - - /************************** GARDS_CALIBRATION end **************************/ - - /************************** GARDS_ROI_CHANNELS START**************************/ - public List S_ROI; - public List S_ROI_B_Boundary_start; - public List S_ROI_B_Boundary_stop; - public List S_ROI_G_Boundary_start; - public List S_ROI_G_Boundary_stop; - public List G_ROI; - public List G_ROI_B_Boundary_start; - public List G_ROI_B_Boundary_stop; - public List G_ROI_G_Boundary_start; - public List G_ROI_G_Boundary_stop; - public List D_ROI; - public List D_ROI_B_Boundary_start; - public List D_ROI_B_Boundary_stop; - public List D_ROI_G_Boundary_start; - public List D_ROI_G_Boundary_stop; - /************************** GARDS_ROI_CHANNELS end **************************/ - - /** - * 分析结果标记,true成功,false失败 - */ - public boolean analyse_flag; - /** - * 失败原因 - */ - public String error_log; - - - @Override - public String toString() { - return "BgAnalyseResult{" + - "Xe131m_con=" + Xe131m_con + - ", Xe131m_uncer=" + Xe131m_uncer + - ", MDC_Xe131m=" + MDC_Xe131m + - ", LC_Xe131m=" + LC_Xe131m + - ", XE_131m_NID_FLAG=" + XE_131m_NID_FLAG + - ", Xe133_con=" + Xe133_con + - ", Xe133_uncer=" + Xe133_uncer + - ", MDC_Xe133=" + MDC_Xe133 + - ", LC_Xe133=" + LC_Xe133 + - ", XE_133_NID_FLAG=" + XE_133_NID_FLAG + - ", Xe133m_con=" + Xe133m_con + - ", Xe133m_uncer=" + Xe133m_uncer + - ", MDC_Xe133m=" + MDC_Xe133m + - ", LC_Xe133m=" + LC_Xe133m + - ", XE_133m_NID_FLAG=" + XE_133m_NID_FLAG + - ", Xe135_con=" + Xe135_con + - ", Xe135_uncer=" + Xe135_uncer + - ", MDC_Xe135=" + MDC_Xe135 + - ", LC_Xe135=" + LC_Xe135 + - ", XE_135_NID_FLAG=" + XE_135_NID_FLAG + - ", ROI=" + ROI + - ", LC=" + LC + - ", s_roi_cts=" + s_roi_cts + - ", g_roi_cts=" + g_roi_cts + - ", d_roi_cts=" + d_roi_cts + - ", s_deduct_d_cts=" + s_deduct_d_cts + - ", g_deduct_d_cts=" + g_deduct_d_cts + - ", ROI_net_coutns=" + ROI_net_coutns + - ", ROI_net_coutns_err=" + ROI_net_coutns_err + - ", ROI_con_uncer=" + ROI_con_uncer + - ", ROI_con_uncer_err=" + ROI_con_uncer_err + - ", MDC=" + MDC + - ", dNidFlag=" + dNidFlag + - ", LC_CTS=" + LC_CTS + - ", s_b_fitting_e_c=" + s_b_fitting_e_c + - ", s_b_fitting_type=" + s_b_fitting_type + - ", s_b_fitting_type_def='" + s_b_fitting_type_def + '\'' + - ", s_g_fitting_e_c=" + s_g_fitting_e_c + - ", s_g_fitting_type=" + s_g_fitting_type + - ", s_g_fitting_type_def='" + s_g_fitting_type_def + '\'' + - ", s_b_fitting_c_e=" + s_b_fitting_c_e + - ", s_g_fitting_c_e=" + s_g_fitting_c_e + - ", g_b_fitting_e_c=" + g_b_fitting_e_c + - ", g_b_fitting_type=" + g_b_fitting_type + - ", g_b_fitting_type_def='" + g_b_fitting_type_def + '\'' + - ", g_g_fitting_e_c=" + g_g_fitting_e_c + - ", g_g_fitting_type=" + g_g_fitting_type + - ", g_g_fitting_type_def='" + g_g_fitting_type_def + '\'' + - ", g_b_fitting_c_e=" + g_b_fitting_c_e + - ", g_g_fitting_c_e=" + g_g_fitting_c_e + - ", d_b_fitting_e_c=" + d_b_fitting_e_c + - ", d_b_fitting_type=" + d_b_fitting_type + - ", d_b_fitting_type_def='" + d_b_fitting_type_def + '\'' + - ", d_g_fitting_e_c=" + d_g_fitting_e_c + - ", d_g_fitting_type=" + d_g_fitting_type + - ", d_g_fitting_type_def='" + d_g_fitting_type_def + '\'' + - ", d_b_fitting_c_e=" + d_b_fitting_c_e + - ", d_g_fitting_c_e=" + d_g_fitting_c_e + - ", S_ROI=" + S_ROI + - ", S_ROI_B_Boundary_start=" + S_ROI_B_Boundary_start + - ", S_ROI_B_Boundary_stop=" + S_ROI_B_Boundary_stop + - ", S_ROI_G_Boundary_start=" + S_ROI_G_Boundary_start + - ", S_ROI_G_Boundary_stop=" + S_ROI_G_Boundary_stop + - ", G_ROI=" + G_ROI + - ", G_ROI_B_Boundary_start=" + G_ROI_B_Boundary_start + - ", G_ROI_B_Boundary_stop=" + G_ROI_B_Boundary_stop + - ", G_ROI_G_Boundary_start=" + G_ROI_G_Boundary_start + - ", G_ROI_G_Boundary_stop=" + G_ROI_G_Boundary_stop + - ", D_ROI=" + D_ROI + - ", D_ROI_B_Boundary_start=" + D_ROI_B_Boundary_start + - ", D_ROI_B_Boundary_stop=" + D_ROI_B_Boundary_stop + - ", D_ROI_G_Boundary_start=" + D_ROI_G_Boundary_start + - ", D_ROI_G_Boundary_stop=" + D_ROI_G_Boundary_stop + - ", analyse_flag=" + analyse_flag + - ", error_log='" + error_log + '\'' + - '}'; - } -} diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/CalValuesOut.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/CalValuesOut.java deleted file mode 100644 index 1846200f..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/CalValuesOut.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.jeecg.modules.native_jni.struct; - -import java.util.List; - -public class CalValuesOut { - - public int rowNum; - - public int colNum; - - public List counts; - -} diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java deleted file mode 100644 index c58a5f44..00000000 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java +++ /dev/null @@ -1,557 +0,0 @@ -package org.jeecg.modules.native_jni.struct; - -import lombok.Data; - -import java.util.List; -import java.util.Objects; - -/** - * 能谱结构体字段信息 - */ -@Data -public class EnergySpectrumStruct { - - /************************* Infomations ******************/ - /** - * 消息类型 - */ - public String msg_type; - /** - * 消息id - */ - public String msg_id; - /** - * 数据类型 - */ - public String data_type; - - /************************* Header Black ******************/ - /** - * designator - */ - public String designator; - /** - * site code - */ - public String site_code; - /** - * detector code - */ - public String detector_code; - /** - * system type: P for particulate; B for gas with 3-D β - γ coincidence detection; and - */ - public String system_type; - /** - * sample geometry - */ - public String sample_geometry; - /** - * spectrum qualifier: preliminary ( PREL )or full ( FULL) - */ - public String spectrum_quantity; - /** - * sample reference identification - */ - public String sample_ref_id; - /** - * measurement identification - */ - public String measurement_id; - /** - * detector background measurement identification - */ - public String detector_bk_measurement_id; - /** - * gas background measurement identification (memory effect) - */ - public String gas_bk_measurement_id; - /** - * transmit date (yyyy / mm / dd) - */ - public String transmit_date; - /** - * transmit time (hh : mm : ss . s) - */ - public String transmit_time; - - /************************* Sample ******************/ - public double dimension_1; - public double dimension_2; - - /************************* Comment ******************/ - public String comment; - - /************************* Acquisition Block ******************/ - /** - * acquisition start date (yyyy / mm / dd) - */ - public String acquisition_start_date; - /** - * acquisition start time (hh : mm : ss . s) - */ - public String acquisition_start_time; - /** - * acquisition real time (s) - */ - public double acquisition_real_time; - /** - * acquisition live time (s) - */ - public double acquisition_live_time; - - /************************* Collection Block ******************/ - - /** - * collection start date (yyyy / mm / dd) - */ - public String collection_start_date; - /** - * collection start time (hh : mm : ss . s) - */ - public String collection_start_time; - /** - * collection stop date (yyyy / mm / dd) - */ - public String collection_stop_date; - /** - * collection stop time (hh : mm : ss . s) - */ - public String collection_stop_time; - /** - * total air volume sampled (standard cubic meters [scm]) - */ - public double air_volume; - - /************************* Processing Block ******************/ - /** - * sample volume of Xe (cm 3 ) - */ - public double sample_volume_of_Xe; - /** - * uncertainty (cm 3 ) - */ - public double uncertainty_1; - /** - * Xe collection yield (Xe gas in sample/total Xe gas sampled) - */ - public double Xe_collection_yield; - /** - * uncertainty (Xe gas in sample/total Xe gas sampled) - */ - public double uncertainty_2; - /** - * archive bottle identification - */ - public String archive_bottle_id; - - /************************* Calibration Block ******************/ - /** - * date of last calibration (yyyy / mm / dd) - */ - public String date_calibration; - /** - * time of last calibration (hh : mm : ss) - */ - public String time_calibration; - - /************************* g_Energy Block ******************/ - /** - * γ -energy (keV) - */ - public List g_energy; - /** - * centroid channel - */ - public List g_centroid_channel; - /** - * uncertainty (channels) - */ - public List g_uncertainty; - - public int g_record_count; - - /************************* b_Energy Block ******************/ - /** - * electron energy (keV) - */ - public List b_electron_energy; - /** - * decay mode descriptor: B for β-particle, C for conversion electron (CE) - */ - public List b_decay_mode; - /** - * maximum channel of β-particle distribution or centroid channel of CE (channels) - */ - public List b_channel; - /** - * uncertainty (channels) - */ - public List b_uncertainty; - - public int b_record_count; - - /************************* g_Resolution Block ******************/ - /** - * γ -energy (keV) - */ - public List g_r_energy; - /** - * FWHM (keV) - */ - public List g_r_FWHM; - /** - * uncertainty (keV) - */ - public List g_r_uncertainty; - - public int g_r_record_count; - - /************************* b_Resolution Block ******************/ - /** - * electron energy (keV) - */ - public List b_r_electron_energy; - /** - * FWHM (keV) - */ - public List b_r_FWHM; - /** - * uncertainty (keV) - */ - public List b_r_uncertainty; - - public int b_r_record_count; - - /************************* g_Efficiency Block ******************/ - /** - * γ -energy (keV) - */ - public List g_e_energy; - /** - * efficiency (counts in peak/photon emitted) - */ - public List g_e_efficiency; - /** - * uncertainty (counts in peak/photon emitted) - */ - public List g_e_uncertainty; - - public int g_e_record_count; - - /************************* ROI_Limits Block ******************/ - /** - * ROI number - */ - public List ROI_number; - /** - * 2-D ROI β-range start, x 1 (keV) - */ - public List POI_B_x1; - /** - * 2-D ROI β-range stop, x 2 (keV) - */ - public List POI_B_x2; - /** - * 2-D ROI γ-range start, y 1 (keV) - */ - public List POI_G_y1; - /** - * 2-D ROI γ-range stop, y 2 (keV) - */ - public List POI_G_y2; - - public int roi_record_count; - - /************************* b-gEfficiency Block ******************/ - /** - * nuclide name - */ - public List bg_nuclide_name; - /** - * ROI number - */ - public List bg_ROI_number; - /** - * β-γ coincidence efficiency (counts in ROI/β-γ pair emitted) - */ - public List bg_efficiency; - /** - * uncertainty (counts in ROI/β-γ pair emitted) - */ - public List bg_uncertainty; - - public int bg_record_count; - - /************************* Ratios Block ******************/ - /** - * ratio identifier - */ - public List ratio_id; - /** - * ROI number for the higher γ -energy ROI - */ - public List ROI_num_highter_G_energy_ROI; - /** - * ROI number for the lower γ -energy ROI - */ - public List ROI_num_lower_G_energy_ROI; - /** - * Q_DECLARE_METATYPE(RMSSOHData::HeaderBlock)count ratio(counts in higher γ -energy ROI/counts in lower γ -energy ROI) - */ - public List count_ratio; - /** - * count ratio uncertainty (percent) - */ - public List count_ratio_uncertainty; - - public int ratio_record_count; - - /************************* g_Spectrum Block ******************/ - /** - * number of γ channels - */ - public long num_g_channel; - /** - * γ-energy span (keV) - */ - public long g_energy_span; - /** - * begin of channels - */ - public long g_begin_channel; - /** - * count at channel - */ - public List g_counts; - - /************************* b_Spectrum Block ******************/ - /** - * number of β -channels - */ - public long num_b_channel; - /** - * β -energy span (keV) - */ - public long b_energy_span; - /** - * begin of channels - */ - public long b_begin_channel; - /** - * counts at channels - */ - public List b_counts; - - /************************* Histogram Block ******************/ - /** - * β-channels - */ - public long b_channels; - /** - * γ-channels - */ - public long g_channels; - /** - * β-energy span - */ - public long b_h_energy_span; - /** - * γ-energy span - */ - public long g_h_energy_span; - /** - * counts at channels - */ - public List h_counts; - - /************************* Certificate_Block ******************/ - /** - * total source activity (Bq) - */ - public double total_source_activity; - /** - * assay date (yyyy / mm / dd) - */ - public String assay_date; - /** - * assay time (hh : mm : ss) - */ - public String assay_time; - /** - * units of activity: “B,” “b” for Bq or “[blank]”; if nothing, then “B” is assigned - */ - public String units_activity; - /** - * nuclide name - */ - public List nuclide_name; - /** - * half-life in seconds, hours, days, or years - */ - public List half_life_time; - /** - * time unit(Y, D, H, S) - */ - public List time_unit; - /** - * activity of nuclide at time of assay - */ - public List activity_nuclide_time_assay; - /** - * uncertainty (%) - */ - public List uncertainty; - /** - * γ-energy (keV) - */ - public List cer_g_energy; - /** - * γ-intensity (percent) - */ - public List g_intensity; - /** - * electron decay mode descriptor: B for β particle or C for conversion electron (CE), 0 for none (that is, γ-only source) - */ - public List electron_decay_mode; - /** - * maximum β-particle energy or CE energy (keV) - */ - public List maximum_energy; - /** - * intensity of β-particle (percent) - */ - public List intensity_b_particle; - - public int record_count; - - /************************* Totaleff Block ******************/ - /** - * γ-energy (keV) - */ - public List t_g_energy; - /** - * total efficiency (counts/photon emitted) - */ - public List total_efficiency; - /** - * uncertainty (counts/photon emitted) - */ - public List t_uncertainty; - - public int t_record_count; - - public EnergySpectrumStruct() { - super(); - } - - @Override - public String toString() { - return "EnergySpectrumStruct{" + - "msg_type='" + msg_type + '\'' + - ", msg_id='" + msg_id + '\'' + - ", data_type='" + data_type + '\'' + - ", designator='" + designator + '\'' + - ", site_code='" + site_code + '\'' + - ", detector_code='" + detector_code + '\'' + - ", system_type='" + system_type + '\'' + - ", sample_geometry='" + sample_geometry + '\'' + - ", spectrum_quantity='" + spectrum_quantity + '\'' + - ", sample_ref_id='" + sample_ref_id + '\'' + - ", measurement_id='" + measurement_id + '\'' + - ", detector_bk_measurement_id='" + detector_bk_measurement_id + '\'' + - ", gas_bk_measurement_id='" + gas_bk_measurement_id + '\'' + - ", transmit_date='" + transmit_date + '\'' + - ", transmit_time='" + transmit_time + '\'' + - ", dimension_1=" + dimension_1 + - ", dimension_2=" + dimension_2 + - ", comment='" + comment + '\'' + - ", acquisition_start_date='" + acquisition_start_date + '\'' + - ", acquisition_start_time='" + acquisition_start_time + '\'' + - ", acquisition_real_time=" + acquisition_real_time + - ", acquisition_live_time=" + acquisition_live_time + - ", collection_start_date='" + collection_start_date + '\'' + - ", collection_start_time='" + collection_start_time + '\'' + - ", collection_stop_date='" + collection_stop_date + '\'' + - ", collection_stop_time='" + collection_stop_time + '\'' + - ", air_volume=" + air_volume + - ", sample_volume_of_Xe=" + sample_volume_of_Xe + - ", uncertainty_1=" + uncertainty_1 + - ", Xe_collection_yield=" + Xe_collection_yield + - ", uncertainty_2=" + uncertainty_2 + - ", archive_bottle_id='" + archive_bottle_id + '\'' + - ", date_calibration='" + date_calibration + '\'' + - ", time_calibration='" + time_calibration + '\'' + - ", g_energy=" + g_energy + - ", g_centroid_channel=" + g_centroid_channel + - ", g_uncertainty=" + g_uncertainty + - ", g_record_count=" + g_record_count + - ", b_electron_energy=" + b_electron_energy + - ", b_decay_mode=" + b_decay_mode + - ", b_channel=" + b_channel + - ", b_uncertainty=" + b_uncertainty + - ", b_record_count=" + b_record_count + - ", g_r_energy=" + g_r_energy + - ", g_r_FWHM=" + g_r_FWHM + - ", g_r_uncertainty=" + g_r_uncertainty + - ", g_r_record_count=" + g_r_record_count + - ", b_r_electron_energy=" + b_r_electron_energy + - ", b_r_FWHM=" + b_r_FWHM + - ", b_r_uncertainty=" + b_r_uncertainty + - ", b_r_record_count=" + b_r_record_count + - ", g_e_energy=" + g_e_energy + - ", g_e_efficiency=" + g_e_efficiency + - ", g_e_uncertainty=" + g_e_uncertainty + - ", g_e_record_count=" + g_e_record_count + - ", ROI_number=" + ROI_number + - ", POI_B_x1=" + POI_B_x1 + - ", POI_B_x2=" + POI_B_x2 + - ", POI_G_y1=" + POI_G_y1 + - ", POI_G_y2=" + POI_G_y2 + - ", roi_record_count=" + roi_record_count + - ", bg_nuclide_name=" + bg_nuclide_name + - ", bg_ROI_number=" + bg_ROI_number + - ", bg_efficiency=" + bg_efficiency + - ", bg_uncertainty=" + bg_uncertainty + - ", bg_record_count=" + bg_record_count + - ", ratio_id=" + ratio_id + - ", ROI_num_highter_G_energy_ROI=" + ROI_num_highter_G_energy_ROI + - ", ROI_num_lower_G_energy_ROI=" + ROI_num_lower_G_energy_ROI + - ", count_ratio=" + count_ratio + - ", count_ratio_uncertainty=" + count_ratio_uncertainty + - ", ratio_record_count=" + ratio_record_count + - ", num_g_channel=" + num_g_channel + - ", g_energy_span=" + g_energy_span + - ", g_begin_channel=" + g_begin_channel + - ", g_counts=" + g_counts + - ", num_b_channel=" + num_b_channel + - ", b_energy_span=" + b_energy_span + - ", b_begin_channel=" + b_begin_channel + - ", b_counts=" + b_counts + - ", b_channels=" + b_channels + - ", g_channels=" + g_channels + - ", b_h_energy_span=" + b_h_energy_span + - ", g_h_energy_span=" + g_h_energy_span + - ", h_counts=" + h_counts + - ", total_source_activity=" + total_source_activity + - ", assay_date='" + assay_date + '\'' + - ", assay_time='" + assay_time + '\'' + - ", units_activity='" + units_activity + '\'' + - ", nuclide_name=" + nuclide_name + - ", half_life_time=" + half_life_time + - ", time_unit=" + time_unit + - ", activity_nuclide_time_assay=" + activity_nuclide_time_assay + - ", uncertainty=" + uncertainty + - ", cer_g_energy=" + cer_g_energy + - ", g_intensity=" + g_intensity + - ", electron_decay_mode=" + electron_decay_mode + - ", maximum_energy=" + maximum_energy + - ", intensity_b_particle=" + intensity_b_particle + - ", record_count=" + record_count + - ", t_g_energy=" + t_g_energy + - ", total_efficiency=" + total_efficiency + - ", t_uncertainty=" + t_uncertainty + - ", t_record_count=" + t_record_count + - '}'; - } -} diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java index acf974c2..672e8204 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java @@ -1,9 +1,6 @@ package org.jeecg.modules.native_jni; -import org.jeecg.modules.native_jni.struct.BgAnalyseResult; -import org.jeecg.modules.native_jni.struct.BgBoundary; -import org.jeecg.modules.native_jni.struct.CalcBgBoundaryParam; -import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; +import org.jeecg.modules.native_jni.struct.*; import java.util.List; @@ -51,4 +48,25 @@ public class EnergySpectrumHandler { */ public static native BgAnalyseResult bgAnalyse(String sampleFile, String gasFile, String detFile); + /** + * 获取健康状态谱原始数据 + * @param path 能谱文件路径 + * @return 能谱原始数据 + */ + public static native SOHSpectrumStruct getSOHSourceData(String path); + + /** + * 获取警告谱原始数据 + * @param path 能谱文件路径 + * @return 能谱原始数据 + */ + public static native AlertSpectrumStruct getAlertSourceData(String path); + + /** + * 获取气象谱原始数据 + * @param path 能谱文件路径 + * @return 能谱原始数据 + */ + public static native MetSpectrumStruct getMetSourceData(String path); + } diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/AlertSpectrumStruct.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/AlertSpectrumStruct.java similarity index 100% rename from jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/AlertSpectrumStruct.java rename to jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/AlertSpectrumStruct.java diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java index b02d240d..b546732f 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java @@ -1,10 +1,13 @@ package org.jeecg.modules.native_jni.struct; +import lombok.Data; + import java.util.List; /** * 能谱结构体字段信息 */ +@Data public class EnergySpectrumStruct { /************************* Infomations ******************/ /** @@ -440,113 +443,4 @@ public class EnergySpectrumStruct { super(); } - @Override - public String toString() { - return "EnergySpectrumStruct{" + - "msg_type='" + msg_type + '\'' + - ", msg_id='" + msg_id + '\'' + - ", data_type='" + data_type + '\'' + - ", designator='" + designator + '\'' + - ", site_code='" + site_code + '\'' + - ", detector_code='" + detector_code + '\'' + - ", system_type='" + system_type + '\'' + - ", sample_geometry='" + sample_geometry + '\'' + - ", spectrum_quantity='" + spectrum_quantity + '\'' + - ", sample_ref_id='" + sample_ref_id + '\'' + - ", measurement_id='" + measurement_id + '\'' + - ", detector_bk_measurement_id='" + detector_bk_measurement_id + '\'' + - ", gas_bk_measurement_id='" + gas_bk_measurement_id + '\'' + - ", transmit_date='" + transmit_date + '\'' + - ", transmit_time='" + transmit_time + '\'' + - ", comment='" + comment + '\'' + - ", acquisition_start_date='" + acquisition_start_date + '\'' + - ", acquisition_start_time='" + acquisition_start_time + '\'' + - ", acquisition_real_time=" + acquisition_real_time + - ", acquisition_live_time=" + acquisition_live_time + - ", collection_start_date='" + collection_start_date + '\'' + - ", collection_start_time='" + collection_start_time + '\'' + - ", collection_stop_date='" + collection_stop_date + '\'' + - ", collection_stop_time='" + collection_stop_time + '\'' + - ", air_volume=" + air_volume + - ", sample_volume_of_Xe=" + sample_volume_of_Xe + - ", uncertainty_1=" + uncertainty_1 + - ", Xe_collection_yield=" + Xe_collection_yield + - ", uncertainty_2=" + uncertainty_2 + - ", archive_bottle_id='" + archive_bottle_id + '\'' + - ", date_calibration='" + date_calibration + '\'' + - ", time_calibration='" + time_calibration + '\'' + - ", g_energy=" + g_energy + - ", g_centroid_channel=" + g_centroid_channel + - ", g_uncertainty=" + g_uncertainty + - ", g_record_count=" + g_record_count + - ", b_electron_energy=" + b_electron_energy + - ", b_decay_mode=" + b_decay_mode + - ", b_channel=" + b_channel + - ", b_uncertainty=" + b_uncertainty + - ", b_record_count=" + b_record_count + - ", g_r_energy=" + g_r_energy + - ", g_r_FWHM=" + g_r_FWHM + - ", g_r_uncertainty=" + g_r_uncertainty + - ", g_r_record_count=" + g_r_record_count + - ", b_r_electron_energy=" + b_r_electron_energy + - ", b_r_FWHM=" + b_r_FWHM + - ", b_r_uncertainty=" + b_r_uncertainty + - ", b_r_record_count=" + b_r_record_count + - ", g_e_energy=" + g_e_energy + - ", g_e_efficiency=" + g_e_efficiency + - ", g_e_uncertainty=" + g_e_uncertainty + - ", g_e_record_count=" + g_e_record_count + - ", ROI_number=" + ROI_number + - ", POI_B_x1=" + POI_B_x1 + - ", POI_B_x2=" + POI_B_x2 + - ", POI_G_y1=" + POI_G_y1 + - ", POI_G_y2=" + POI_G_y2 + - ", roi_record_count=" + roi_record_count + - ", bg_nuclide_name=" + bg_nuclide_name + - ", bg_ROI_number=" + bg_ROI_number + - ", bg_efficiency=" + bg_efficiency + - ", bg_uncertainty=" + bg_uncertainty + - ", bg_record_count=" + bg_record_count + - ", ratio_id=" + ratio_id + - ", ROI_num_highter_G_energy_ROI=" + ROI_num_highter_G_energy_ROI + - ", ROI_num_lower_G_energy_ROI=" + ROI_num_lower_G_energy_ROI + - ", count_ratio=" + count_ratio + - ", count_ratio_uncertainty=" + count_ratio_uncertainty + - ", ratio_record_count=" + ratio_record_count + - ", num_g_channel=" + num_g_channel + - ", g_energy_span=" + g_energy_span + - ", g_begin_channel=" + g_begin_channel + - ", g_counts=" + g_counts + - ", num_b_channel=" + num_b_channel + - ", b_energy_span=" + b_energy_span + - ", b_begin_channel=" + b_begin_channel + - ", b_counts=" + b_counts + - ", b_channels=" + b_channels + - ", g_channels=" + g_channels + - ", b_h_energy_span=" + b_h_energy_span + - ", g_h_energy_span=" + g_h_energy_span + - ", h_counts=" + h_counts + - ", total_source_activity=" + total_source_activity + - ", assay_date='" + assay_date + '\'' + - ", assay_time='" + assay_time + '\'' + - ", units_activity='" + units_activity + '\'' + - ", nuclide_name=" + nuclide_name + - ", half_life_time=" + half_life_time + - ", time_unit=" + time_unit + - ", activity_nuclide_time_assay=" + activity_nuclide_time_assay + - ", uncertainty=" + uncertainty + - ", cer_g_energy=" + cer_g_energy + - ", g_intensity=" + g_intensity + - ", electron_decay_mode=" + electron_decay_mode + - ", maximum_energy=" + maximum_energy + - ", intensity_b_particle=" + intensity_b_particle + - ", record_count=" + record_count + - '}'; - } - - public static void main(String[] args) { - EnergySpectrumStruct s = new EnergySpectrumStruct(); - System.out.println(s); - System.out.println(s.gas_bk_measurement_id); - } } diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/MetSpectrumStruct.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/MetSpectrumStruct.java similarity index 100% rename from jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/MetSpectrumStruct.java rename to jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/MetSpectrumStruct.java diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/SOHSpectrumStruct.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/SOHSpectrumStruct.java similarity index 100% rename from jeecg-module-auto-process/src/main/java/org/jeecg/modules/native_jni/struct/SOHSpectrumStruct.java rename to jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/SOHSpectrumStruct.java diff --git a/jeecg-server-cloud/jeecg-auto-process-start/src/main/resources/application.yml b/jeecg-server-cloud/jeecg-auto-process-start/src/main/resources/application.yml index c74f45bc..a5d0fe92 100644 --- a/jeecg-server-cloud/jeecg-auto-process-start/src/main/resources/application.yml +++ b/jeecg-server-cloud/jeecg-auto-process-start/src/main/resources/application.yml @@ -15,5 +15,5 @@ spring: config: import: - optional:nacos:jeecg.yaml - - optional:nacos:jeecg-@profile.name@.yaml + - optional:nacos:jeecg-@profile.name@-pbl.yaml From 75d5fb4c683aa29eb89085c9ccdb944c6a96cb7e Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Tue, 10 Oct 2023 09:56:50 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix=EF=BC=9A=E8=87=AA=E5=8A=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AF=B9=E8=83=BD=E8=B0=B1=20data=5Ftype=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E8=BF=9B=E8=A1=8C=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/modules/spectrum/SpectrumHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumHandler.java b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumHandler.java index 16d767fb..7d192b22 100644 --- a/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumHandler.java +++ b/jeecg-module-auto-process/src/main/java/org/jeecg/modules/spectrum/SpectrumHandler.java @@ -118,14 +118,20 @@ public abstract class SpectrumHandler extends Chain{ boolean flag = false; final DataType[] values = DataType.values(); for(DataType value : values){ - if(this.mailContent.indexOf(DATA_TYPE_PREFIX+value.getType()) != -1){ + // 判断能谱数据类型是否正确 + if(this.mailContent.contains(DATA_TYPE_PREFIX + value.getType())){ StringBuilder localPath = new StringBuilder(); localPath.append(this.spectrumServiceQuotes.getTaskProperties().getTemporaryStoragePath()); localPath.append(File.separator); localPath.append(System.currentTimeMillis()); localPath.append(value.getSuffix()); this.mailFile = FileUtil.writeString(this.mailContent, localPath.toString(), "UTF-8"); - this.currDataType = value; + // 能谱数据类型如果是 SPHDP 或者 SPHDF 统一改为 SAMPLEPHD + if (value.equals(DataType.SPHDP) || value.equals(DataType.SPHDF)) { + this.currDataType = DataType.SAMPLEPHD; + } else { + this.currDataType = value; + } flag = true; break; } From bd1bb8cf46f313375bf1d417261decff6994ac5f Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Tue, 10 Oct 2023 09:58:05 +0800 Subject: [PATCH 08/10] =?UTF-8?q?fix=EF=BC=9A=E8=87=AA=E5=8A=A8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AF=B9=E8=83=BD=E8=B0=B1=20data=5Ftype=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E8=BF=9B=E8=A1=8C=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/jeecg/modules/base/enums/DataType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/DataType.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/DataType.java index 5434e758..741a5673 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/DataType.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/DataType.java @@ -48,7 +48,9 @@ public enum DataType { /** * 气体谱 */ - GASBKPHD("GASBKPHD",".PHD"); + GASBKPHD("GASBKPHD",".PHD"), + SPHDP("SPHDP", ".PHD"), + SPHDF("SPHDF", ".PHD"); private String type; From 67c2a6b355be8e03ec5720902b2bcad64842cff2 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 10 Oct 2023 10:12:46 +0800 Subject: [PATCH 09/10] =?UTF-8?q?Gamma=E5=88=86=E6=9E=90=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=A0=E9=80=92=E5=8F=82=E6=95=B0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=20Gamma=E5=88=86=E6=9E=90=E7=AE=97=E6=B3=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=82=E6=95=B0=E6=8E=A5=E6=94=B6=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E7=A8=8B=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=B1=BB=E5=A2=9E=E5=8A=A0dll=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/entity/vo/AnalyseData.java | 8 +- .../org/jeecg/common/util/GammaFileUtil.java | 43 ++++---- .../modules/native_jni/AnalysisProcess.java | 2 +- .../org/jeecg/common/util/PHDFileUtil.java | 54 ++++------ .../modules/native_jni/CalValuesHandler.java | 2 +- .../service/impl/GammaServiceImpl.java | 98 ++++++++----------- .../org/jeecg/common/util/ReadLineUtil.java | 2 +- .../jeecg/JeecgAutoProcessApplication.java | 1 + .../JeecgSpectrumAnalysisApplication.java | 4 +- 9 files changed, 97 insertions(+), 117 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java index 6712cb36..a6b9d1bd 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/AnalyseData.java @@ -18,9 +18,9 @@ public class AnalyseData implements Serializable { private boolean qcData; - private boolean bGammaEnergyValid; + private boolean gammaEnergyValid; - private boolean bBetaEnergyValid; + private boolean betaEnergyValid; private List dbNames; @@ -39,8 +39,8 @@ public class AnalyseData implements Serializable { gasBgData = false; detBgData = false; qcData = false; - bGammaEnergyValid = false; - bBetaEnergyValid = false; + gammaEnergyValid = false; + betaEnergyValid = false; } } 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 14d3f76f..c3bf48a8 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 @@ -20,6 +20,7 @@ import org.jeecg.modules.base.enums.CalName; import org.jeecg.modules.base.enums.CalType; import org.jeecg.modules.base.enums.MiddleDataType; import org.jeecg.modules.entity.vo.*; +import org.jeecg.modules.native_jni.AnalysisProcess; import org.jeecg.modules.native_jni.CalValuesHandler; import org.jeecg.modules.native_jni.EnergySpectrumHandler; import org.jeecg.modules.native_jni.struct.CalValuesOut; @@ -66,7 +67,7 @@ public class GammaFileUtil { InputStream inputStream = null; File file = null; //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); try { //切换被动模式 ftpClient.enterLocalPassiveMode(); @@ -78,7 +79,7 @@ public class GammaFileUtil { inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)) { //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //读取文件信息 @@ -292,7 +293,7 @@ public class GammaFileUtil { inputStream = ftpClient.retrieveFileStream(lcFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //调用FileUtils的readLines方法获取文件的所有行数据 @@ -340,7 +341,7 @@ public class GammaFileUtil { inputStream = ftpClient.retrieveFileStream(scacFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //调用FileUtils的readLines方法获取文件的所有行数据 @@ -603,7 +604,7 @@ public class GammaFileUtil { public void RunQC(PHDFile phd) { //调用dll库 - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); try { //获取phdFile的 采集开始时间 Date start = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time()); @@ -748,8 +749,8 @@ public class GammaFileUtil { } public Double CalculateMDC(PHDFile phd, List vMdcInfo, Double CCF) { + //System.loadLibrary("GammaAnaly"); try { - System.loadLibrary("GammaAnaly"); //判断用于计算的数据大小是否小于3 判断集合中最后一个数值是否等于0 if(vMdcInfo.size() < 3 || vMdcInfo.get(2) == 0) { return 0.0; @@ -1233,7 +1234,7 @@ public class GammaFileUtil { } public List PeakSet(List vPeak, List vBase, String color, long m_nCount, List p, boolean bEnergy) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); List datalist = new LinkedList<>(); int peakNum = vPeak.size(); if(peakNum < 1 || vBase.size() != m_nCount){ @@ -1311,7 +1312,7 @@ public class GammaFileUtil { } public List Energy_BaseCP(PHDFile phd) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); List shapes = new LinkedList<>(); CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(phd.getBaseCtrls().getXCtrl(), phd.getUsedEnerPara().getP()); List vEner = calValuesOut.counts; @@ -1374,14 +1375,14 @@ public class GammaFileUtil { } public boolean AnalyseSpectrum(PHDFile phd, Map mapLines){ - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); //解析获取临时文件信息 File tmpFile = analyzeFile(phd.getFilepath(), phd.getFilename()); ObjectMapper mapper = new ObjectMapper(); try { String phdStr = mapper.writeValueAsString(phd); String nuclideLinesMap = mapper.writeValueAsString(mapLines); - String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath()); + String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath(), new AnalysisProcess()); Map parseMap = JSON.parseObject(strValue, Map.class); for (Map.Entry entry:parseMap.entrySet()) { if (entry.getKey().equalsIgnoreCase("bAnalyed")) { @@ -1452,6 +1453,10 @@ public class GammaFileUtil { String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); phd.setNewEner(value); } + if (entry.getKey().equalsIgnoreCase("newReso")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setNewReso(value); + } if (entry.getKey().equalsIgnoreCase("mapEnerKD")) { HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); Map value = new HashMap<>(); @@ -1625,7 +1630,7 @@ public class GammaFileUtil { for (int i=0; i vEffi = calValuesOut.counts; for (int i=0; i Differance(PHDFile phd, List vecPeak, List m_vCount, long m_nCount) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); List pointlist = new LinkedList<>(); int start =0; long end = -1; @@ -2055,7 +2060,7 @@ public class GammaFileUtil { } public void UpdateChartEnergy(List m_vCurEnergy, ParameterInfo m_curParam, List m_vCurCentroid, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); int num = m_vCurEnergy.size(); if(num < 1){ return; @@ -2120,7 +2125,7 @@ public class GammaFileUtil { } public void UpdateChartResolution(List m_vCurEnergy, ParameterInfo m_curParam, List m_vCurReso, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); int num = m_vCurEnergy.size(); if(num < 1) return; @@ -2255,7 +2260,7 @@ public class GammaFileUtil { } public void UpdateChartEfficiency(List m_vCurEnergy, ParameterInfo m_curParam, List m_vCurEffi, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); int num = m_vCurEnergy.size(); if(num < 1) return; @@ -3685,7 +3690,7 @@ public class GammaFileUtil { } public void PeaksChanged(PHDFile phd) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); List vCentroid = new LinkedList<>(); List vFwhmCh = new LinkedList<>(); List vTail = new LinkedList<>(); @@ -3881,7 +3886,7 @@ public class GammaFileUtil { InputStream inputStream = null; File file = null; //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); try { //切换被动模式 ftpClient.enterLocalPassiveMode(); @@ -3893,7 +3898,7 @@ public class GammaFileUtil { inputStream = ftpClient.retrieveFileStream(compareFileName); if (Objects.nonNull(inputStream)) { //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //读取文件信息 @@ -4014,7 +4019,7 @@ public class GammaFileUtil { ftpClient.changeWorkingDirectory(path); inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java index 926f0738..c9ae586f 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/AnalysisProcess.java @@ -15,6 +15,6 @@ public class AnalysisProcess { // JSON.parseObject(str, PHDFile.class); // // 通过 redis 订阅发送 websocket 消息 // redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);; - System.out.println(userId); + System.out.println(userId+"-----"+process); } } 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 fd97a2d7..4db56682 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 @@ -41,9 +41,9 @@ public class PHDFileUtil { @Autowired private SpectrumPathProperties spectrumPathProperties; - public Map getSourceData(String filePath, List xeDataList, Integer sampleId, String status){ + public Map getSourceData(String filePath, Integer sampleId, String status){ //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(filePath); Map map = new HashMap<>(); try { @@ -225,24 +225,6 @@ public class PHDFileUtil { betaEnergyList.add(betaEnergy); } map.put("betaEnergyData", betaEnergyList); - //Xe - if (CollectionUtils.isNotEmpty(xeDataList)){ - for (GardsXeResultsSpectrum xeData:xeDataList) { - 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); - } - } - map.put("XeData", xeDataList); - } //计算边界值 CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam(); calcBgBoundaryParam.g_e_cal = EnergySpectrumHandler.GetFileFittingPara(gEnergy, gCentroidChannel); @@ -301,7 +283,7 @@ public class PHDFileUtil { iStream=ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(iStream)) { //声明一个临时文件 - File file = File.createTempFile("tmp", null); + File file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(iStream, file); List allLines = FileUtils.readLines(file, ftpUtil.getEncoding()); @@ -466,7 +448,7 @@ public class PHDFileUtil { public Map getFileData(String filePath, String sampleFileName){ Map map = new HashMap<>(); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //连接ftp 获取ftp文件数据 FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ @@ -486,7 +468,7 @@ public class PHDFileUtil { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)) { //声明一个临时文件 - File file = File.createTempFile("tmp", null); + File file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载sampleFile内容 @@ -544,7 +526,7 @@ public class PHDFileUtil { ftpClient.changeWorkingDirectory(filePath); inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); } @@ -563,7 +545,7 @@ public class PHDFileUtil { } } //加载动态库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); String systemType = sourceData.system_type; String dataType = sourceData.data_type; @@ -614,7 +596,7 @@ public class PHDFileUtil { ftpClient.changeWorkingDirectory(filePath); inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); } @@ -633,7 +615,7 @@ public class PHDFileUtil { } } //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //计算边界值 List gCentroidChannel = struct.g_centroid_channel; @@ -698,7 +680,7 @@ public class PHDFileUtil { String fileCompare = tmpFileName.substring(0,23); for (String fileName:fileNames) { String compare = fileName.substring(0, 23); - if (compare.equals(fileCompare)) { + if (compare.equals(fileCompare) && fileName.contains("FULL")) { matchFileName = fileName; } } @@ -716,7 +698,9 @@ public class PHDFileUtil { if(qcphdDateTime>dateTime) { break; } else { - rData = fileNames.get(pos); + if (fileNames.get(pos).contains("FULL")) { + rData = fileNames.get(pos); + } } } return rData; @@ -739,7 +723,7 @@ public class PHDFileUtil { ftpClient.changeWorkingDirectory(path); inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); } @@ -762,7 +746,7 @@ public class PHDFileUtil { public BgDataAnlyseResultIn analyzeSpectrum(File sampleTmp, File gasTmp, File detTmp, Map map) { //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //调用动态库解析文件 BgAnalyseResult bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath()); BgDataAnlyseResultIn resultIn = new BgDataAnlyseResultIn(); @@ -792,7 +776,7 @@ public class PHDFileUtil { public EnergySpectrumStruct analyzeFileSourceData(String filePath, String fileName) { //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = new EnergySpectrumStruct(); FTPClient ftpClient = ftpUtil.LoginFTP(); InputStream inputStream = null; @@ -807,7 +791,7 @@ public class PHDFileUtil { inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - File file = File.createTempFile("tmp", null); + File file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); @@ -831,7 +815,7 @@ public class PHDFileUtil { public List analyzeQCResultXe(File sampleTmp, File gasTmp, File detTmp){ //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //调用动态库解析文件 BgAnalyseResult bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath()); List xeResultsSpectrumList = new LinkedList<>(); @@ -869,7 +853,7 @@ public class PHDFileUtil { public Map analyze(File sampleTmp, File gasTmp, File detTmp){ Map result = new HashMap<>(); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //调用动态库解析文件 BgAnalyseResult bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath()); /* GardsROIChannelsSpectrum集合 */ diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java index d08cf789..7340fd47 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/CalValuesHandler.java @@ -25,6 +25,6 @@ public class CalValuesHandler { public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List vCentroid, List vFwhmCh, List vTail, List vUpperTail); - public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath); + public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath, AnalysisProcess process); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index b7e2d5a9..5b15b6fa 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -37,6 +37,7 @@ import org.jeecg.modules.base.enums.RoleType; import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.entity.*; import org.jeecg.modules.mapper.SpectrumAnalysisMapper; +import org.jeecg.modules.native_jni.AnalysisProcess; import org.jeecg.modules.native_jni.CalValuesHandler; import org.jeecg.modules.native_jni.struct.CalValuesOut; import org.jeecg.modules.service.*; @@ -177,7 +178,6 @@ public class GammaServiceImpl implements IGammaService { Result result = new Result(); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); - phd.getSetting().setBUpdateCal(false); phd.setUserId("1"); phd.setXmlFilePath(parameterProperties.getFilePath()); String systemType = fileName.substring(2, 3); @@ -200,7 +200,7 @@ public class GammaServiceImpl implements IGammaService { try { String phdStr = mapper.writeValueAsString(phd); String mapLines = mapper.writeValueAsString(nuclideLinesMap); - String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, tmpFile.getAbsolutePath()); + String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, tmpFile.getAbsolutePath(), new AnalysisProcess()); Map parseMap = JSON.parseObject(strValue, Map.class); for (Map.Entry entry:parseMap.entrySet()) { if (entry.getKey().equalsIgnoreCase("bAnalyed")) { @@ -271,6 +271,10 @@ public class GammaServiceImpl implements IGammaService { String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); phd.setNewEner(value); } + if (entry.getKey().equalsIgnoreCase("newReso")) { + String value = JSON.parseObject(JSON.toJSONString(entry.getValue()), String.class); + phd.setNewReso(value); + } if (entry.getKey().equalsIgnoreCase("mapEnerKD")) { HashMap jsonMap = JSON.parseObject(JSON.toJSONString(entry.getValue()), HashMap.class); Map value = new HashMap<>(); @@ -388,22 +392,6 @@ public class GammaServiceImpl implements IGammaService { return result; } - public static void main(String[] args) { - System.loadLibrary("GammaAnaly"); - String path = "D:\\ARMD\\PHD\\Samplephd\\PHP52_001-20230908_0543_S_PREL_43188.PHD"; - ObjectMapper mapper = new ObjectMapper(); - try { - String phdStr = mapper.writeValueAsString(new PHDFile()); - String mapLines = mapper.writeValueAsString(new HashMap()); - String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, path); - Map parseMap = JSON.parseObject(strValue, Map.class); - System.out.println("parseMap:" + parseMap); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - - } - @Override public Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request) { Result result = new Result(); @@ -751,7 +739,7 @@ public class GammaServiceImpl implements IGammaService { vChan.add(c); c += 1; } - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(vChan, phd.getUsedEnerPara().getP()); phd.setVEnergy(calValuesOut.counts); phd.setBAnalyed(true); @@ -1057,7 +1045,7 @@ public class GammaServiceImpl implements IGammaService { public Result insertPeak(Integer sampleId, String fileName, Integer curChan) { Result result = new Result(); Map map = new HashMap<>(); - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -1923,7 +1911,7 @@ public class GammaServiceImpl implements IGammaService { public Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width) { Result result = new Result(); Map map = new HashMap<>(); - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -1954,8 +1942,8 @@ public class GammaServiceImpl implements IGammaService { for(int i=0; i m_vCurCentroid, List m_vCurEnergy, List m_vCurUncert, ParameterInfo m_curParam, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); if(m_vCurEnergy.size() < 1) { return; } else if(m_vCurEnergy.size() == 1) { @@ -2011,8 +1999,8 @@ public class GammaServiceImpl implements IGammaService { for(int j=0; j map = new HashMap<>(); - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -2230,8 +2218,8 @@ public class GammaServiceImpl implements IGammaService { for(int i=0; i m_vCurReso, List m_vCurEnergy, List m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width) { Result result = new Result(); Map map = new HashMap<>(); - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -2266,7 +2254,7 @@ public class GammaServiceImpl implements IGammaService { } public void DataChangeResolution(List m_vCurReso, List m_vCurEnergy, List m_vCurUncert, ParameterInfo m_curParam, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); m_curParam.setP(CalValuesHandler.calFitPara("Cal_Resolution", 4, m_vCurEnergy, m_vCurReso, m_vCurUncert)); map.put("uncert", m_vCurUncert); map.put("param", m_curParam); @@ -2277,8 +2265,8 @@ public class GammaServiceImpl implements IGammaService { for(int i=0; i phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -2505,8 +2493,8 @@ public class GammaServiceImpl implements IGammaService { for(int i=0; i m_vCurEffi, List m_vCurEnergy, List m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width) { Result result = new Result(); Map map = new HashMap<>(); - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); Cache phdCache = localCache.getPHDCache(); PHDFile phd = phdCache.getIfPresent(fileName); if (Objects.isNull(phd)){ @@ -2541,7 +2529,7 @@ public class GammaServiceImpl implements IGammaService { } public void DataChangeEfficiency(List m_vCurEffi, List m_vCurEnergy, List m_vCurUncert, ParameterInfo m_curParam, Integer funcId, PHDFile phd, Double width, Map map) { - System.loadLibrary("GammaAnaly"); + //System.loadLibrary("GammaAnaly"); m_curParam.setP(CalValuesHandler.calFitPara("Cal_Efficiency", funcId, m_vCurEnergy, m_vCurEffi, m_vCurUncert)); map.put("uncert", m_vCurUncert); map.put("param", m_curParam); @@ -2552,8 +2540,8 @@ public class GammaServiceImpl implements IGammaService { for(int i=0; i allLines = FileUtils.readLines(file, encoding); diff --git a/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java b/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java index 2b62faeb..44bb9b30 100644 --- a/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java +++ b/jeecg-server-cloud/jeecg-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java @@ -60,6 +60,7 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im public void run(String... args) throws Exception { //调用dll System.loadLibrary("ReadPHDFile"); + System.loadLibrary("GammaAnaly"); //根据配置文件配置邮件获取策略定义时间条件,默认EmailReceivePolicy.HISTORY_ORDER_RECEIVE.getPolicy() Date systemStartupTime = DateUtils.parseDate("1970-01-01 00:00:00","yyyy-MM-dd HH:mm:ss"); if(EmailReceivePolicy.CURR_DATE_ORDER_RECEIVE.getPolicy().equals(taskProperties.getReceivePolicy())){ diff --git a/jeecg-server-cloud/jeecg-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java b/jeecg-server-cloud/jeecg-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java index 886b4b1c..72f47bff 100644 --- a/jeecg-server-cloud/jeecg-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java +++ b/jeecg-server-cloud/jeecg-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java @@ -41,6 +41,8 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ @Override public void run(String... args) throws Exception { - + //加载dll工具库 + System.loadLibrary("ReadPHDFile"); + System.loadLibrary("GammaAnaly"); } } \ No newline at end of file From 557cbe19f3d7fa309a9624bae3ce6c5cc9b85fe3 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 10 Oct 2023 10:13:22 +0800 Subject: [PATCH 10/10] =?UTF-8?q?beta=E5=88=9D=E5=A7=8B=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8A=A0=E8=BD=BD=E5=86=85=E5=AE=B9=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=8F=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SpectrumAnalysisServiceImpl.java | 481 +++++++++++------- 1 file changed, 307 insertions(+), 174 deletions(-) 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 7c784b04..d1eadc03 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 @@ -300,7 +300,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { public Result getDBSpectrumChart(String dbName, Integer sampleId, HttpServletRequest request) { Result result = new Result(); String userName = JwtUtil.getUserNameByToken(request); + Cache> cache = betaCache.getBetaCache(); + Map cacheMap = new HashMap<>(); Map resultMap = new HashMap<>(); + List gammaCalibrationSpectrumList= new LinkedList<>(); + List betaCalibrationSpectrumList = new LinkedList<>(); + List roiChannelsSpectrumList = new LinkedList<>(); + List roiResultsSpectrumList = new LinkedList<>(); + List gammaCalibrationPairsList = new LinkedList<>(); + List betaCalibrationPairsList = new LinkedList<>(); List xeResultsSpectrumList = new LinkedList<>(); if (Objects.isNull(sampleId)){ result.error500("请选择一条数据"); @@ -310,15 +318,50 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { if (dbName.equalsIgnoreCase("auto")){ dbName = "RNAUTO"; analysisID = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId, "RNAUTO"); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", analysisID, sampleId); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", analysisID, sampleId); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", analysisID, sampleId); xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", analysisID, sampleId); - }else if (dbName.equalsIgnoreCase("man")){ + } else if (dbName.equalsIgnoreCase("man")){ dbName = "RNMAN"; analysisID = spectrumAnalysisMapper.getAnalysisID("RNMAN", sampleId, userName); + gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", analysisID, sampleId); + betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(analysisID, sampleId); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", analysisID, sampleId); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", analysisID, sampleId); xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNMAN", analysisID, sampleId); + cacheMap.put("gammaCalibrationPairsList", gammaCalibrationPairsList); + cacheMap.put("betaCalibrationPairsList", betaCalibrationPairsList); }else { result.error500("数据库类型不存在"); return result; } + cacheMap.put("gammaCalibrationSpectrumList", gammaCalibrationSpectrumList); + cacheMap.put("betaCalibrationSpectrumList", betaCalibrationSpectrumList); + cacheMap.put("roiChannelsSpectrumList", roiChannelsSpectrumList); + cacheMap.put("roiResultsSpectrumList", roiResultsSpectrumList); + cacheMap.put("xeResultsSpectrumList", xeResultsSpectrumList); + //Xe + 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); + } + } + resultMap.put("XeData", xeResultsSpectrumList); + } //查询数据库文件信息 SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID); List filePath = new LinkedList<>(); @@ -333,8 +376,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { GardsSampleData sample = spectrumAnalysisMapper.findSampleByFilePath(sampleFilePath); String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH)); String fileName = sampleFilePath.substring(sampleFilePath.lastIndexOf(StringPool.SLASH)+1); - sampleMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, sample.getSampleId(), sample.getStatus()); + sampleMap = this.fenxi(pathName, fileName, sample.getSampleId(), sample.getStatus()); resultMap.put("sample",sampleMap); + cache.put(fileName+"-"+userName, cacheMap); + betaCache.setBetaCache(cache); } if(StringUtils.isNotBlank(dbSpectrumFilePath.getGasBgFilePath())){ String gasBgFilePath = dbSpectrumFilePath.getGasBgFilePath(); @@ -343,7 +388,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + gasBgFilePath.substring(0, gasBgFilePath.lastIndexOf(StringPool.SLASH)); String fileName = gasBgFilePath.substring(gasBgFilePath.lastIndexOf(StringPool.SLASH)+1); if (Objects.nonNull(gasBg)) { - gasBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, gasBg.getSampleId(), gasBg.getStatus()); + gasBgMap = this.fenxi(pathName, fileName, gasBg.getSampleId(), gasBg.getStatus()); resultMap.put("gasBg",gasBgMap); } } @@ -354,7 +399,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + detBgFilePath.substring(0, detBgFilePath.lastIndexOf(StringPool.SLASH)); String fileName = detBgFilePath.substring(detBgFilePath.lastIndexOf(StringPool.SLASH)+1); if (Objects.nonNull(detBg)) { - detBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, detBg.getSampleId(), detBg.getStatus()); + detBgMap = this.fenxi(pathName, fileName, detBg.getSampleId(), detBg.getStatus()); resultMap.put("detBg",detBgMap); } } @@ -367,7 +412,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbQcFilePath.substring(0, dbQcFilePath.lastIndexOf(StringPool.SLASH)); String fileName = dbQcFilePath.substring(dbQcFilePath.lastIndexOf(StringPool.SLASH)+1); if (Objects.nonNull(qc)) { - qcMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, qc.getSampleId(), qc.getStatus()); + qcMap = this.fenxi(pathName, fileName, qc.getSampleId(), qc.getStatus()); resultMap.put("qc",qcMap); } } @@ -376,6 +421,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { resultMap.put("savedAnalysisResult", true); } else { resultMap.clear(); + cacheMap.clear(); } result.setSuccess(true); result.setResult(resultMap); @@ -396,28 +442,29 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { if(StringUtils.isNotBlank(sampleFileName)){ String sampleFilePath = path + sampleFileName; filePath.add(sampleFilePath); - sampleMap = this.fenxi(path, sampleFileName, null, null, null); - resultMap.put("sample",sampleMap); + sampleMap = this.fenxi(path, sampleFileName, null, null); + resultMap.put("sample", sampleMap); } if(StringUtils.isNotBlank(gasFileName)){ String gasBgFilePath = path + gasFileName; filePath.add(gasBgFilePath); - gasBgMap = this.fenxi(path, gasFileName, null, null, null); - resultMap.put("gasBg",gasBgMap); + gasBgMap = this.fenxi(path, gasFileName, null, null); + resultMap.put("gasBg", gasBgMap); } if(StringUtils.isNotBlank(detFileName)){ String detBgFilePath = path + detFileName; filePath.add(detBgFilePath); - detBgMap = this.fenxi(path, detFileName, null, null, null); - resultMap.put("detBg",detBgMap); + detBgMap = this.fenxi(path, detFileName, null, null); + resultMap.put("detBg", detBgMap); } if(StringUtils.isNotBlank(qcFileName)){ String dbQcFilePath = path + qcFileName; filePath.add(dbQcFilePath); - qcMap = this.fenxi(path, qcFileName, null, null, null); - resultMap.put("qc",qcMap); + qcMap = this.fenxi(path, qcFileName, null, null); + resultMap.put("qc", qcMap); } phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap); + resultMap.put("XeData", new LinkedList<>()); resultMap.put("bProcessed", false); resultMap.put("savedAnalysisResult", false); result.setSuccess(true); @@ -425,7 +472,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return result; } - private Map fenxi(String pathName, String fileName, List xeDataList, Integer sampleId, String status) { + private Map fenxi(String pathName, String fileName, Integer sampleId, String status) { Map map = new HashMap<>(); FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ @@ -444,10 +491,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); - map = phdFileUtil.getSourceData(file.getAbsolutePath(), xeDataList, sampleId, status); + map = phdFileUtil.getSourceData(file.getAbsolutePath(), sampleId, status); map.put("fileName", fileName); map.put("filePath", pathName); } @@ -526,11 +573,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); commentInfo.setSpectrumCommentInfo(struct.comment); } @@ -925,11 +972,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); String measurementID = struct.measurement_id; String bkgdMeasurementID = struct.detector_bk_measurement_id; @@ -1226,11 +1273,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); rlrDataValues.setSrid(struct.sample_ref_id); rlrDataValues.setColloct_start_date(struct.collection_start_date); @@ -1349,11 +1396,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(qcFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //读取Gamma Detector Calibration所需要的参数 long numGChannel = struct.num_g_channel; @@ -1497,11 +1544,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(qcFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //Figure of Beta Detector Calibration long numBChannel = struct.num_b_channel; @@ -1624,7 +1671,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { samplePathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH)); } //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ result.error500("ftp连接失败"); @@ -1645,7 +1692,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //ftp文件输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //读取文件信息 @@ -1775,7 +1822,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { filePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH)); } //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ result.error500("ftp连接失败"); @@ -1796,7 +1843,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(sampleFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //ftp文件输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //读取文件信息 @@ -2165,7 +2212,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { Map cacheMap = new HashMap<>(); Map map = new HashMap<>(); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); if ((CollectionUtils.isNotEmpty(tempPoints) && Objects.nonNull(count) && tempPoints.size() != count) || (Objects.isNull(paramA) || StringUtils.isBlank(String.valueOf(paramA))) || (Objects.isNull(paramB) || StringUtils.isBlank(String.valueOf(paramB))) || (Objects.isNull(paramC) || StringUtils.isBlank(String.valueOf(paramC))) ){ List xs = new LinkedList<>(); @@ -2315,11 +2362,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { inputStream = ftpClient.retrieveFileStream(qcFileName); if (Objects.nonNull(inputStream)){ //声明一个临时文件 - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //Beta-Gamma Spectrum: QC long bChannels = struct.b_channels; @@ -2366,10 +2413,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { Result result = new Result(); String userName = JwtUtil.getUserNameByToken(request); if ("CurrentSpectrum".equals(analyseData.getApplyType())) { - List sampleIds = analyseData.getSampleIds(); - if (CollectionUtils.isNotEmpty(sampleIds)){ - String dbName = analyseData.getDbNames().get(0); - Integer sampleId = sampleIds.get(0); + String dbName = analyseData.getDbNames().get(0); + Integer sampleId = analyseData.getSampleIds().get(0); + if (Objects.nonNull(sampleId)){ Integer analysisID = null; if (dbName.equalsIgnoreCase("auto")){ dbName = "RNAUTO"; @@ -2380,32 +2426,63 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID); if (Objects.nonNull(dbSpectrumFilePath)) { - BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName); + String sampleFilePath = dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)); + String gasFilePath = dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)); + String detFilePath = dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)); + BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, sampleFilePath, gasFilePath, detFilePath, userName); result.setSuccess(true); result.setResult(analyseResult); } } else { String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; - SpectrumFileRecord dbSpectrumFilePath = new SpectrumFileRecord(); - dbSpectrumFilePath.setSampleFilePath(path); - dbSpectrumFilePath.setGasBgFilePath(path); - dbSpectrumFilePath.setDetBgFilePath(path); - BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName); + BgAnalyseResult analyseResult = BetaGammaAnalyzeCurrentProcess(analyseData, path, path, path, userName); result.setSuccess(true); result.setResult(analyseResult); } + } else if ("AllSpectrum".equals(analyseData.getApplyType())) { + List> loadDataList = new LinkedList<>(); + for (int i=0; i m_loadData = new HashMap<>(); + Integer sampleId = analyseData.getSampleIds().get(i); + String dbName = analyseData.getDbNames().get(i); + String sampleFileName = analyseData.getSampleFileNames().get(i); + String gasFileName = analyseData.getGasFileNames().get(i); + String detFileName = analyseData.getDetFileNames().get(i); + String qcFileName = analyseData.getQcFileNames().get(i); + if (Objects.nonNull(sampleId)){ + Integer analysisID = null; + if (dbName.equalsIgnoreCase("auto")){ + dbName = "RNAUTO"; + analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, "RNAUTO"); + }else if (dbName.equalsIgnoreCase("man")){ + dbName = "RNMAN"; + analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName); + } + SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID); + if (Objects.nonNull(dbSpectrumFilePath)) { + String sampleFilePath = dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)); + String gasFilePath = dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)); + String detFilePath = dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)); + m_loadData.put("sampleFilePath", sampleFilePath); + m_loadData.put("gasFilePath", gasFilePath); + m_loadData.put("detFilePath", detFilePath); + } + } else { + String sampleFilePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + String gasFilePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + String detFilePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + m_loadData.put("sampleFilePath", sampleFilePath); + m_loadData.put("gasFilePath", gasFilePath); + m_loadData.put("detFilePath", detFilePath); + } + m_loadData.put("sampleFileName", sampleFileName); + m_loadData.put("gasFileName", gasFileName); + m_loadData.put("detFileName", detFileName); + m_loadData.put("qcFileName", qcFileName); + loadDataList.add(m_loadData); + } + BetaGammaAnalyzeAllProcess(loadDataList, analyseData, userName); } -// else if ("AllSpectrum".equals(analyseData.getApplyType())) { -// Map m_loadData = new HashMap<>(); -// for (int i=0; iBetaOriginalChartView->SetFittingParam(fit_analy_param.b_calibration_param.param_a_c2e_new, // fit_analy_param.b_calibration_param.param_b_c2e_new, @@ -2425,123 +2502,181 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return result; } - private BgAnalyseResult BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, SpectrumFileRecord dbSpectrumFilePath, String userName){ - SpectrumGroup spectrum_group = new SpectrumGroup(); - String sampleFilePath = dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)); - String sampleFileName = dbSpectrumFilePath.getSampleFilePath().substring(dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)+1); - String gasFilePath = dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)); - String gasFileName = dbSpectrumFilePath.getGasBgFilePath().substring(dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH)+1); - String detFilePath = dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)); - String detFileName = dbSpectrumFilePath.getDetBgFilePath().substring(dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)+1); - List qcFileNames = analyseData.getQcFileNames(); - String qcFileName = qcFileNames.get(0); - //从本地缓存获取beta gamma的数组 - Cache> cache = betaCache.getBetaCache(); - //根据qc文件名称-用户名-beta的方式获取beta的内容 - Map betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta"); - List betaList = new LinkedList<>(); - List betaFittingPara = new LinkedList<>(); - List betaFittingParaToUi = new LinkedList<>(); - if (CollectionUtils.isNotEmpty(betaMap)) { - betaList = (List)betaMap.get("Series"); - betaFittingPara = (List) betaMap.get("fittingPara"); - betaFittingParaToUi = (List) betaMap.get("fittingParaToUi"); - } - //根据qc文件名称-用户名-gamma的方式获取gamma的内容 - Map gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma"); - List gammaList = new LinkedList<>(); - List gammaFittingPara = new LinkedList<>(); - List gammaFittingParaToUi = new LinkedList<>(); - if (CollectionUtils.isNotEmpty(gammaMap)) { - gammaList = (List)gammaMap.get("Series"); - gammaFittingPara = (List) gammaMap.get("fittingPara"); - gammaFittingParaToUi = (List) gammaMap.get("fittingParaToUi"); - } - if (analyseData.isBBetaEnergyValid()) { - List beCal = new LinkedList<>(); - beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); - beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); - beCal.add(Double.valueOf(betaFittingParaToUi.get(2))); - spectrum_group.BgCalPara.b_e_cal = beCal; - List bc2e = new LinkedList<>(); - bc2e.add(Double.valueOf(betaFittingPara.get(0))); - bc2e.add(Double.valueOf(betaFittingPara.get(1))); - bc2e.add(Double.valueOf(betaFittingPara.get(2))); - spectrum_group.b_c2e = bc2e; - } - if (analyseData.isBGammaEnergyValid()) { - List geCal = new LinkedList<>(); - geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); - geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); - geCal.add(Double.valueOf(gammaFittingParaToUi.get(2))); - spectrum_group.BgCalPara.g_e_cal = geCal; - List gc2e = new LinkedList<>(); - gc2e.add(Double.valueOf(gammaFittingPara.get(0))); - gc2e.add(Double.valueOf(gammaFittingPara.get(1))); - gc2e.add(Double.valueOf(gammaFittingPara.get(2))); - spectrum_group.g_c2e = gc2e; - } - spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); - spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); - spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); - spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); - System.loadLibrary("ReadPHDFile"); + private BgAnalyseResult BetaGammaAnalyzeCurrentProcess(AnalyseData analyseData, String sampleFilePath, String gasFilePath, String detFilePath, String userName) { + //System.loadLibrary("ReadPHDFile"); //根据文件路径 文件名称获取对应的临时文件 - File sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName); - File gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName); - File detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName); - BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); + File sampleTmp = null; + File gasTmp = null; + File detTmp = null; + BgAnalyseResult analyseResult = null; + try { + List sampleFileNames = analyseData.getSampleFileNames(); + String sampleFileName = sampleFileNames.get(0); + List gasFileNames = analyseData.getGasFileNames(); + String gasFileName = gasFileNames.get(0); + List detFileNames = analyseData.getDetFileNames(); + String detFileName = detFileNames.get(0); + List qcFileNames = analyseData.getQcFileNames(); + String qcFileName = qcFileNames.get(0); + SpectrumGroup spectrum_group = new SpectrumGroup(); + //从本地缓存获取beta gamma的数组 + Cache> cache = betaCache.getBetaCache(); + //根据qc文件名称-用户名-beta的方式获取beta的内容 + Map betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta"); + List betaList = new LinkedList<>(); + List betaFittingPara = new LinkedList<>(); + List betaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(betaMap)) { + betaList = (List)betaMap.get("Series"); + betaFittingPara = (List) betaMap.get("fittingPara"); + betaFittingParaToUi = (List) betaMap.get("fittingParaToUi"); + } + //根据qc文件名称-用户名-gamma的方式获取gamma的内容 + Map gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma"); + List gammaList = new LinkedList<>(); + List gammaFittingPara = new LinkedList<>(); + List gammaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(gammaMap)) { + gammaList = (List)gammaMap.get("Series"); + gammaFittingPara = (List) gammaMap.get("fittingPara"); + gammaFittingParaToUi = (List) gammaMap.get("fittingParaToUi"); + } + if (analyseData.isBetaEnergyValid()) { + List beCal = new LinkedList<>(); + beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(2))); + spectrum_group.BgCalPara.b_e_cal = beCal; + List bc2e = new LinkedList<>(); + bc2e.add(Double.valueOf(betaFittingPara.get(0))); + bc2e.add(Double.valueOf(betaFittingPara.get(1))); + bc2e.add(Double.valueOf(betaFittingPara.get(2))); + spectrum_group.b_c2e = bc2e; + } + if (analyseData.isGammaEnergyValid()) { + List geCal = new LinkedList<>(); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(2))); + spectrum_group.BgCalPara.g_e_cal = geCal; + List gc2e = new LinkedList<>(); + gc2e.add(Double.valueOf(gammaFittingPara.get(0))); + gc2e.add(Double.valueOf(gammaFittingPara.get(1))); + gc2e.add(Double.valueOf(gammaFittingPara.get(2))); + spectrum_group.g_c2e = gc2e; + } + spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); + spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); + spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); + spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); + sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName); + gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName); + detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName); + analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (Objects.nonNull(sampleTmp)) { + sampleTmp.delete(); + } + if (Objects.nonNull(gasTmp)) { + gasTmp.delete(); + } + if (Objects.nonNull(detTmp)) { + detTmp.delete(); + } + } return analyseResult; } -// private void BetaGammaAnalyzeAllProcess(Map m_loadData, AnalyseData analyseData){ -// List spectrum_group_list = new LinkedList<>(); -// for (Map.Entry entry: m_loadData.entrySet()){ -// SpectrumGroup spectrum_group = new SpectrumGroup(); -// SpectrumFileRecord spectrumFileRecord = entry.getValue(); -// spectrum_group.SampleSpectrumFile = spectrumFileRecord.getSampleFilePath(); -// spectrum_group.GasBgSpectrumFile = spectrumFileRecord.getGasBgFilePath(); -// spectrum_group.DetBgSpectrumFile = spectrumFileRecord.getDetBgFilePath(); -// -// if (analyseData.isBBetaEnergyValid()) { -// List beCal = new LinkedList<>(); -// beCal.add(analyseData.getB_calibration_param().param_c_e2c_new); -// beCal.add(analyseData.getB_calibration_param().param_b_e2c_new); -// beCal.add(analyseData.getB_calibration_param().param_a_e2c_new); -// spectrum_group.BgCalPara.b_e_cal = beCal; -// List bc2e = new LinkedList<>(); -// bc2e.add(analyseData.getB_calibration_param().param_c_c2e_new); -// bc2e.add(analyseData.getB_calibration_param().param_b_c2e_new); -// bc2e.add(analyseData.getB_calibration_param().param_a_c2e_new); -// spectrum_group.b_c2e = bc2e; -// } -// if (analyseData.isBGammaEnergyValid()) { -// List geCal = new LinkedList<>(); -// geCal.add(analyseData.getG_calibration_param().param_c_e2c_new); -// geCal.add(analyseData.getG_calibration_param().param_b_e2c_new); -// geCal.add(analyseData.getG_calibration_param().param_a_e2c_new); -// spectrum_group.BgCalPara.g_e_cal = geCal; -// List gc2e = new LinkedList<>(); -// gc2e.add(analyseData.getG_calibration_param().param_c_c2e_new); -// gc2e.add(analyseData.getG_calibration_param().param_b_c2e_new); -// gc2e.add(analyseData.getG_calibration_param().param_a_c2e_new); -// spectrum_group.g_c2e = gc2e; -// } -// spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); -// spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); -// spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); -// spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); -// -// spectrum_group_list.add(spectrum_group); -// } -// -// if (CollectionUtils.isNotEmpty(spectrum_group_list)) { -//// beta_gamma_analy.SetSpectrumGroupList(spectrum_group_list); -//// AnalyProcessDlg analy_dlg(beta_gamma_analy); -//// analy_dlg.SetProgressRange(0, spectrum_group_list.count()); -//// analy_dlg.exec(); -// } -// } + private void BetaGammaAnalyzeAllProcess(List> loadDataList, AnalyseData analyseData, String userName){ + List analyseResultList = new LinkedList<>(); + File sampleTmp = null; + File gasTmp = null; + File detTmp = null; + try { + for (Map m_loadData: loadDataList){ + String sampleFileName = m_loadData.get("sampleFileName"); + String gasFileName = m_loadData.get("gasFileName"); + String detFileName = m_loadData.get("detFileName"); + String qcFileName = m_loadData.get("qcFileName"); + String sampleFilePath = m_loadData.get("sampleFilePath"); + String gasFilePath = m_loadData.get("gasFilePath"); + String detFilePath = m_loadData.get("detFilePath"); + SpectrumGroup spectrum_group = new SpectrumGroup(); + //从本地缓存获取beta gamma的数组 + Cache> cache = betaCache.getBetaCache(); + //根据qc文件名称-用户名-beta的方式获取beta的内容 + Map betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta"); + List betaList = new LinkedList<>(); + List betaFittingPara = new LinkedList<>(); + List betaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(betaMap)) { + betaList = (List)betaMap.get("Series"); + betaFittingPara = (List) betaMap.get("fittingPara"); + betaFittingParaToUi = (List) betaMap.get("fittingParaToUi"); + } + //根据qc文件名称-用户名-gamma的方式获取gamma的内容 + Map gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma"); + List gammaList = new LinkedList<>(); + List gammaFittingPara = new LinkedList<>(); + List gammaFittingParaToUi = new LinkedList<>(); + if (CollectionUtils.isNotEmpty(gammaMap)) { + gammaList = (List)gammaMap.get("Series"); + gammaFittingPara = (List) gammaMap.get("fittingPara"); + gammaFittingParaToUi = (List) gammaMap.get("fittingParaToUi"); + } + + if (analyseData.isBetaEnergyValid()) { + List beCal = new LinkedList<>(); + beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); + beCal.add(Double.valueOf(betaFittingParaToUi.get(2))); + spectrum_group.BgCalPara.b_e_cal = beCal; + List bc2e = new LinkedList<>(); + bc2e.add(Double.valueOf(betaFittingPara.get(0))); + bc2e.add(Double.valueOf(betaFittingPara.get(1))); + bc2e.add(Double.valueOf(betaFittingPara.get(2))); + spectrum_group.b_c2e = bc2e; + } + if (analyseData.isGammaEnergyValid()) { + List geCal = new LinkedList<>(); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); + geCal.add(Double.valueOf(gammaFittingParaToUi.get(2))); + spectrum_group.BgCalPara.g_e_cal = geCal; + List gc2e = new LinkedList<>(); + gc2e.add(Double.valueOf(gammaFittingPara.get(0))); + gc2e.add(Double.valueOf(gammaFittingPara.get(1))); + gc2e.add(Double.valueOf(gammaFittingPara.get(2))); + spectrum_group.g_c2e = gc2e; + } + spectrum_group.BgCalPara.bApplyNewCalicSample = analyseData.isSampleData(); + spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData(); + spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData(); + spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData(); + + sampleTmp = phdFileUtil.analyzeFile(sampleFilePath, sampleFileName); + gasTmp = phdFileUtil.analyzeFile(gasFilePath, gasFileName); + detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName); + BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara); + analyseResultList.add(analyseResult); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (Objects.nonNull(sampleTmp)) { + sampleTmp.delete(); + } + if (Objects.nonNull(gasTmp)) { + gasTmp.delete(); + } + if (Objects.nonNull(detTmp)) { + detTmp.delete(); + } + } + + } @Override public Result analyseCurrentSpectrum(String dbName, Integer sampleId, String sampleFileName, String gasFileName, String detFileName, HttpServletRequest request) { @@ -3357,7 +3492,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName()); gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName()); detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName()); - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //如果勾选了Energy Calibration页面下sample Data if (Objects.nonNull(sampleTmp)) { if(anlyseResultIn.isCheckSample()) { @@ -3473,7 +3608,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName()); detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName()); //加载dll工具库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //调用动态库解析文件 //Gamma Energy Calibration页面 如果点击过fitting使BGammaEnergyValid并且有勾选 //如果三个sampleData,GasData,DetData数据都是被勾选状态 则需要传递新的参数重新分析 否则不需要改变数据分析当前文件内容 @@ -3736,8 +3871,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName()); gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName()); detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName()); - //加载dll工具库 - System.loadLibrary("ReadPHDFile"); //调用动态库解析文件 //Gamma Energy Calibration页面 如果点击过fitting使BGammaEnergyValid并且有勾选 //如果三个sampleData,GasData,DetData数据都是被勾选状态 则需要传递新的参数重新分析 否则不需要改变数据分析当前文件内容 @@ -4034,7 +4167,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { try { //获取ftp文件路径下临时文件 sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName()); - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); if (Objects.nonNull(sampleTmp)){ EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath()); List poiBX1 = sourceData.POI_B_x1; @@ -4304,12 +4437,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { ftpClient.changeWorkingDirectory(filePath); inputStream = ftpClient.retrieveFileStream(fileName); if (Objects.nonNull(inputStream)){ - file = File.createTempFile("tmp", null); + file = File.createTempFile("betaGamma", null); //将ftp文件的输入流复制给临时文件 FileUtils.copyInputStreamToFile(inputStream, file); } //加载动态库 - System.loadLibrary("ReadPHDFile"); + //System.loadLibrary("ReadPHDFile"); //读取文件内容 EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //获取文件中块名信息