From 8faa97d8f1031e2ca47b8b8aa21a318b6b90934e Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Thu, 11 Jan 2024 09:00:48 +0800 Subject: [PATCH] =?UTF-8?q?gamma=E5=88=86=E6=9E=90=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=8A=A5=E5=91=8A=E5=86=85=E5=AE=B9=E4=B8=AD?= =?UTF-8?q?=E5=85=B3=E4=BA=8Eversion=E6=8F=8F=E8=BF=B0=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E9=A2=97=E7=B2=92=E7=89=A9=E5=92=8C=E6=B0=94=E4=BD=93=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=85=A8=E6=A0=B8=E7=B4=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E5=8A=A0=E8=BD=BD=E5=85=A8=E6=A0=B8=E7=B4=A0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=B1=BB=E6=96=B9=E6=B3=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 13 ++++- .../modules/mapper/GardsNuclLibMapper.java | 10 ++++ .../modules/mapper/xml/GardsNuclLibMapper.xml | 23 ++++++++ .../modules/service/IGardsNuclLibService.java | 3 + .../service/impl/GardsNuclLibServiceImpl.java | 43 ++++++++++++++ .../IGardsNuclIdedSpectrumService.java | 2 - .../GardsNuclIdedSpectrumServiceImpl.java | 58 ------------------- .../jeecg/JeecgAutoProcessApplication.java | 3 + .../JeecgSpectrumAnalysisApplication.java | 6 +- 9 files changed, 96 insertions(+), 65 deletions(-) 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 3e30373b..8c106d13 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 @@ -21,6 +21,7 @@ import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; 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.base.enums.SystemType; import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.native_jni.AnalysisProcess; import org.jeecg.modules.native_jni.CalValuesHandler; @@ -59,6 +60,8 @@ public class GammaFileUtil extends AbstractLogOrReport { private NameStandUtil nameStandUtil; @Autowired private AnalysisProcess analysisProcess; + @Autowired + private RedisUtil redisUtil; public boolean loadFile(String pathName, String fileName, PHDFile phd, String sysSource, Result result) { phd.setFilepath(pathName); @@ -2668,7 +2671,11 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(" "+middleData.analyses_type+" RADIONUCLIDE REPORT"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(" (Noble Gas Version) "); + if (middleData.sample_Type.equals(SystemType.PARTICULATE.getType())) { + strBuffer.append(" (Particulates Version) "); + } else if (middleData.sample_Type.equals(SystemType.GAMMA.getType())) { + strBuffer.append(" (Noble Gas Version) "); + } //换行 strBuffer.append(System.lineSeparator()); strBuffer.append(" Creation Date "+DateUtils.formatDate(new Date(), "yyyy/MM/dd-HH:mm:ss")); @@ -3198,7 +3205,9 @@ public class GammaFileUtil extends AbstractLogOrReport { fileAnlyse.setEfficiencyParam(fileAnlyse.getUsedEffiPara().getP()); fileAnlyse.setEfficiencyEnergy(fileAnlyse.getUsedEffiKD().getG_energy()); fileAnlyse.setEfficiencyCurRow(0); - getNuclideMDCValue(fileAnlyse, fileAnlyse.getMdcInfoMap(), nucline); + //缓存中获取计算mdc使用的核素信息 + Map nuclideLinesMDCMap = (Map) redisUtil.get("AllNuclideMap"); + getNuclideMDCValue(fileAnlyse, fileAnlyse.getMdcInfoMap(), nuclideLinesMDCMap); anylseEnd = DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"); middleData.analyses_analysisBegin = anylseBegin; middleData.analyses_analysisEnd = anylseEnd; diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLibMapper.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLibMapper.java index e75ed8fd..1ef29b1f 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLibMapper.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLibMapper.java @@ -2,8 +2,11 @@ package org.jeecg.modules.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; import org.jeecg.modules.base.dto.GardsNuclLibDto; import org.jeecg.modules.base.entity.configuration.GardsNuclLib; +import org.jeecg.modules.entity.vo.HalfData; +import org.jeecg.modules.entity.vo.NuclideLine; import java.util.List; @@ -14,4 +17,11 @@ public interface GardsNuclLibMapper extends BaseMapper { List allName(); List getNucliLib(); + + List findNuclidesAnalysis(); + + List getNuclideLines(@Param("name") String name); + + HalfData getOneHalf(@Param("name") String name); + } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLibMapper.xml b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLibMapper.xml index e59a0426..72513b3f 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLibMapper.xml +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLibMapper.xml @@ -26,4 +26,27 @@ select a.NAME, a.num_lines, a.halflife, a.halflife_err from CONFIGURATION.GARDS_NUCL_LIB a + + + + + + \ No newline at end of file diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/IGardsNuclLibService.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/IGardsNuclLibService.java index 4472e165..c93423f2 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/IGardsNuclLibService.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/IGardsNuclLibService.java @@ -13,4 +13,7 @@ public interface IGardsNuclLibService extends IService { List allName(); void getNucliLib(); + + void getNuclideMap(); + } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLibServiceImpl.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLibServiceImpl.java index 1881b7a1..2acbff31 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLibServiceImpl.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLibServiceImpl.java @@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.util.RedisUtil; import org.jeecg.modules.base.dto.GardsNuclLibDto; import org.jeecg.modules.base.entity.configuration.GardsNuclLib; +import org.jeecg.modules.entity.vo.HalfData; +import org.jeecg.modules.entity.vo.NuclideLine; +import org.jeecg.modules.entity.vo.NuclideLines; import org.jeecg.modules.mapper.GardsNuclLibMapper; import org.jeecg.modules.service.IGardsNuclLibService; import org.springframework.beans.factory.annotation.Autowired; @@ -16,8 +19,10 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import java.util.stream.Collectors; @@ -52,4 +57,42 @@ public class GardsNuclLibServiceImpl extends ServiceImpl nuclLibMap = gardsNuclLibs.stream().collect(Collectors.toMap(GardsNuclLib::getName, Function.identity())); redisUtil.set("nuclLibs", nuclLibMap); } + + @Override + public void getNuclideMap() { + List nuclideLibs = this.baseMapper.findNuclidesAnalysis(); + Map nuclideMap = GetNuclideLines(nuclideLibs); + redisUtil.set("AllNuclideMap", nuclideMap); + } + + public Map GetNuclideLines(List nuclideList) { + Map mapLines = new HashMap<>(); + if (nuclideList.size() < 1) { + return mapLines; + } + for (String name : nuclideList) { + NuclideLines nlines = new NuclideLines(); + List nuclideLineList = this.baseMapper.getNuclideLines(name); + for (int j = 0; j < nuclideLineList.size(); j++) { + nlines.getFullNames().add(nuclideLineList.get(j).getFullName()); + nlines.getVenergy().add(nuclideLineList.get(j).getEnergy()); + nlines.getVuncertE().add(nuclideLineList.get(j).getEnergyUncert()); + nlines.getVyield().add(nuclideLineList.get(j).getYield() / 100); + nlines.getVuncertY().add(nuclideLineList.get(j).getYieldUncert()); + if (Objects.nonNull(nuclideLineList.get(j).getKeyFlag()) && nuclideLineList.get(j).getKeyFlag().intValue() > 0) { + nlines.key_flag = j; + nlines.maxYeildIdx = j; + } + } + mapLines.put(name, nlines); + } + for (String name:nuclideList) { + HalfData half = this.baseMapper.getOneHalf(name); + NuclideLines nuclideLines = mapLines.get(half.getName()); + nuclideLines.setHalflife(half.getHalf() == null ? 0 : half.getHalf() * 86400);// 将天转换成秒 + mapLines.put(half.getName(), nuclideLines); + } + return mapLines; + } + } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsNuclIdedSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsNuclIdedSpectrumService.java index 93aeb9cf..fe63c6ef 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsNuclIdedSpectrumService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsNuclIdedSpectrumService.java @@ -9,6 +9,4 @@ public interface IGardsNuclIdedSpectrumService extends IService { int saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis); - void getNuclideMap(); - } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java index f230d55e..af7ffd10 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java @@ -2,40 +2,20 @@ package org.jeecg.modules.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; -import com.baomidou.mybatisplus.core.toolkit.StringPool; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.jeecg.common.constant.RedisConstant; -import org.jeecg.common.util.RedisUtil; import org.jeecg.modules.base.entity.rnman.GardsNuclIded; -import org.jeecg.modules.base.enums.SystemType; import org.jeecg.modules.entity.vo.GStoreMiddleProcessData; -import org.jeecg.modules.entity.vo.HalfData; -import org.jeecg.modules.entity.vo.NuclideLine; -import org.jeecg.modules.entity.vo.NuclideLines; import org.jeecg.modules.mapper.GardsNuclIdedSpectrumMapper; -import org.jeecg.modules.mapper.SpectrumAnalysisMapper; -import org.jeecg.modules.mapper.SysDefaultNuclideSpectrumMapper; import org.jeecg.modules.service.IGardsNuclIdedSpectrumService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; import java.util.*; -import java.util.stream.Collectors; @Service("gardsNuclIdedSpectrumService") @DS("ora") public class GardsNuclIdedSpectrumServiceImpl extends ServiceImpl implements IGardsNuclIdedSpectrumService { - @Autowired - private SpectrumAnalysisMapper spectrumAnalysisMapper; - @Autowired - private RedisUtil redisUtil; - @Override @Transactional public int saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) { @@ -72,42 +52,4 @@ public class GardsNuclIdedSpectrumServiceImpl extends ServiceImpl nuclideLibs = spectrumAnalysisMapper.findNuclidesAnalysis(); - Map nuclideMap = GetNuclideLines(nuclideLibs); - redisUtil.set("AllNuclideMap", nuclideMap); - } - - public Map GetNuclideLines(List nuclideList) { - Map mapLines = new HashMap<>(); - if (nuclideList.size() < 1) { - return mapLines; - } - for (String name : nuclideList) { - NuclideLines nlines = new NuclideLines(); - List nuclideLineList = spectrumAnalysisMapper.getNuclideLines(name); - for (int j = 0; j < nuclideLineList.size(); j++) { - nlines.getFullNames().add(nuclideLineList.get(j).getFullName()); - nlines.getVenergy().add(nuclideLineList.get(j).getEnergy()); - nlines.getVuncertE().add(nuclideLineList.get(j).getEnergyUncert()); - nlines.getVyield().add(nuclideLineList.get(j).getYield() / 100); - nlines.getVuncertY().add(nuclideLineList.get(j).getYieldUncert()); - if (Objects.nonNull(nuclideLineList.get(j).getKeyFlag()) && nuclideLineList.get(j).getKeyFlag().intValue() > 0) { - nlines.key_flag = j; - nlines.maxYeildIdx = j; - } - } - mapLines.put(name, nlines); - } - for (String name:nuclideList) { - HalfData half = spectrumAnalysisMapper.getOneHalf(name); - NuclideLines nuclideLines = mapLines.get(half.getName()); - nuclideLines.setHalflife(half.getHalf() == null ? 0 : half.getHalf() * 86400);// 将天转换成秒 - mapLines.put(half.getName(), nuclideLines); - } - return mapLines; - } - - } diff --git a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java index e42df08b..ab22ec69 100644 --- a/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java +++ b/jeecg-server-cloud/armd-auto-process-start/src/main/java/org/jeecg/JeecgAutoProcessApplication.java @@ -9,6 +9,7 @@ import org.jeecg.common.properties.SpectrumPathProperties; import org.jeecg.common.properties.TaskProperties; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.*; +import org.jeecg.modules.service.IGardsNuclLibService; import org.jeecg.modules.email.EmailReceivePolicy; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; @@ -44,6 +45,7 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im private final FileSourceHandleManager fileSourceHandleManager; private final DelFileManager delFileManager; private final StatReportManager statReportManager; + private final IGardsNuclLibService nuclLibService; @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { @@ -69,6 +71,7 @@ public class JeecgAutoProcessApplication extends SpringBootServletInitializer im //调用dll System.loadLibrary("ReadPHDFile"); System.loadLibrary("GammaAnaly"); + nuclLibService.getNuclideMap(); //根据配置文件配置邮件获取策略定义时间条件,默认EmailReceivePolicy.HISTORY_ORDER_RECEIVE.getPolicy() Date systemStartupTime = null; if(EmailReceivePolicy.CURR_DATE_ORDER_RECEIVE.getPolicy().equals(taskProperties.getReceivePolicy())){ diff --git a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java index 9296d3f4..c208a8ae 100644 --- a/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java +++ b/jeecg-server-cloud/armd-spectrum-analysis-start/src/main/java/org/jeecg/JeecgSpectrumAnalysisApplication.java @@ -5,10 +5,10 @@ import org.jeecg.common.cache.BetaCache; import org.jeecg.common.cache.LocalCache; import org.jeecg.common.cache.SelfCache; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.service.IGardsNuclLibService; import org.jeecg.modules.service.IDataService; import org.jeecg.modules.service.IGammaService; import org.jeecg.modules.service.IGardsNuclCoincidenceSumSpectrumService; -import org.jeecg.modules.service.IGardsNuclIdedSpectrumService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; @@ -39,7 +39,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ @Autowired private IGardsNuclCoincidenceSumSpectrumService nuclCoincidenceSumSpectrumService; @Autowired - private IGardsNuclIdedSpectrumService nuclIdedSpectrumService; + private IGardsNuclLibService nuclLibService; @Autowired private IDataService dataService; @@ -76,7 +76,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ localCache.initCache(); selfCache.initCache(); gammaService.readMDCParameter(); - nuclIdedSpectrumService.getNuclideMap(); + nuclLibService.getNuclideMap(); nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap(); dataService.viewStations(); }