From 58fbc30eb395bf16a48dcc6c2096cc473dda9d99 Mon Sep 17 00:00:00 2001 From: xiaoguangbin Date: Tue, 21 Nov 2023 09:12:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20nucl=5Fided=5FNucidename=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF=EF=BC=8C=E6=94=B9=E4=B8=BAnucl=5Fid?= =?UTF-8?q?ed=5FNuclidename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/spectrum/Sample_G_Analysis.java | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) 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 84fa7800..2115ffde 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 @@ -765,22 +765,36 @@ public class Sample_G_Analysis { public Map fieldMap(){ Map fieldMap = new HashMap<>(); // Gards_Nucl_Lines_Ided - fieldMap.put("nuclideFullname","nuclidefullname");fieldMap.put("Energy","energy"); - fieldMap.put("Abundance","abundance");fieldMap.put("Activity","activity"); - fieldMap.put("Effic","effic");fieldMap.put("uncEffic","unEffic"); - fieldMap.put("Mda","mda");fieldMap.put("key_flag","keyFlag"); - fieldMap.put("csc_ratio","cscRatio");fieldMap.put("csc_ratio_err","cscRatioErr"); - fieldMap.put("csc_mod_flag","cscModFlag");fieldMap.put("MDC","mdc"); + fieldMap.put("nuclideFullname","nuclidefullname"); + fieldMap.put("Energy","energy"); + fieldMap.put("Abundance","abundance"); + fieldMap.put("Activity","activity"); + fieldMap.put("Effic","effic"); + fieldMap.put("uncEffic","unEffic"); + fieldMap.put("Mda","mda"); + fieldMap.put("key_flag","keyFlag"); + fieldMap.put("csc_ratio","cscRatio"); + fieldMap.put("csc_ratio_err","cscRatioErr"); + fieldMap.put("csc_mod_flag","cscModFlag"); + fieldMap.put("MDC","mdc"); fieldMap.put("Concentration","concentration"); // Gards_Nucl_Ided - fieldMap.put("nucl_ided_Nucidename","nuclideName");fieldMap.put("nucl_ided_Type","type"); - fieldMap.put("nucl_ided_Halflife","halflife");fieldMap.put("nucl_ided_ave_activ","aveActiv"); - fieldMap.put("nucl_ided_ave_activ_err","aveActivErr");fieldMap.put("nucl_ided_activ_key","activKey"); - fieldMap.put("nucl_ided_activ_key_err","activKeyErr");fieldMap.put("nucl_ided_mda","mda"); - fieldMap.put("nucl_ided_mda_err","mdaErr");fieldMap.put("nucl_ided_nid_flag","nidFlag"); - fieldMap.put("nucl_ided_csc_ratio","cscRatio");fieldMap.put("nucl_ided_csc_ratio_err","cscRatioErr"); - fieldMap.put("nucl_ided_csc_mod_flag","cscModFlag");fieldMap.put("nucl_ided_MDC","mdc"); - fieldMap.put("nucl_ided_Concentration","concentration");fieldMap.put("nucl_ided_Key_Energy","keyEnergy"); + fieldMap.put("nucl_ided_Nuclidename","nuclideName"); + fieldMap.put("nucl_ided_Type","type"); + fieldMap.put("nucl_ided_Halflife","halflife"); + fieldMap.put("nucl_ided_ave_activ","aveActiv"); + fieldMap.put("nucl_ided_ave_activ_err","aveActivErr"); + fieldMap.put("nucl_ided_activ_key","activKey"); + fieldMap.put("nucl_ided_activ_key_err","activKeyErr"); + fieldMap.put("nucl_ided_mda","mda"); + fieldMap.put("nucl_ided_mda_err","mdaErr"); + fieldMap.put("nucl_ided_nid_flag","nidFlag"); + fieldMap.put("nucl_ided_csc_ratio","cscRatio"); + fieldMap.put("nucl_ided_csc_ratio_err","cscRatioErr"); + fieldMap.put("nucl_ided_csc_mod_flag","cscModFlag"); + fieldMap.put("nucl_ided_MDC","mdc"); + fieldMap.put("nucl_ided_Concentration","concentration"); + fieldMap.put("nucl_ided_Key_Energy","keyEnergy"); fieldMap.put("nucl_ided_Key_Yield","keyYield"); // Gards_Qc_Check fieldMap.put("QC_CHECK_QC_NAME","qcName"); From 39ef3f14c02897ff87ea8bdc940c254ff6f04b8d Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 21 Nov 2023 11:43:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=97=A5=E5=BF=97=E4=BB=A3=E7=A0=81=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/modules/spectrum/Sample_G_Analysis.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 2115ffde..967d2663 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 @@ -253,19 +253,19 @@ public class Sample_G_Analysis { // Reading gamma Efficiency pairs(sampleID: %1) writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleEfficiencyChannel.replace("%1", sampleId))); - + data.clear(); item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3)); data.add(item); - item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3)); + item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_yValue(), 3)); data.add(item); - item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3)); + item = new AttributeItemVo("Error", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_uncYValue(), 3)); data.add(item); writes.addAll(MyLogFormatUtil.getBlockContext(data)); // Reading gamma Resolution pairs(sampleID: %1) writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleResolutionChannel.replace("%1", sampleId))); - - item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_EF_xValue(), 3)); + data.clear(); + item = new AttributeItemVo("Channel", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_R_xValue(), 3)); data.add(item); item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_R_yValue(),3)); data.add(item); @@ -275,6 +275,7 @@ public class Sample_G_Analysis { // Reading gamma TotalEfficiency pairs(sampleID: %1) writes.add(MyLogFormatUtil.getHeaderFormat(MyLogFormatUtil.GSetSampleTotalEfficiencyChannel.replace("%1", sampleId))); + data.clear(); item = new AttributeItemVo("Channel", middleData.getCalibration_pairs_S_T_xValue()); data.add(item); item = new AttributeItemVo("Energy", MyLogFormatUtil.getValuePoint(middleData.getCalibration_pairs_S_T_yValue(), 3)); From b3f9c7d3fb1cbacd3d71a4b5a156745235d4f5f7 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Tue, 21 Nov 2023 16:14:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=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=8Fgamma=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B3=B0=E5=AF=B9=E5=BA=94=E6=A0=B8=E7=B4=A0=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E7=A8=8B=E5=BA=8Fgamma?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=90=AF=E5=8A=A8=E6=97=B6=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=A0=B8=E7=B4=A0=E4=BF=A1=E6=81=AF=E6=A0=BC=E5=BC=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=94=B9=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=A4=84=E7=90=86=E7=A8=8B=E5=BA=8Fgamma=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=AD=98=E5=82=A8=E5=B3=B0=E5=AF=B9=E5=BA=94=E6=A0=B8?= =?UTF-8?q?=E7=B4=A0=E4=BF=A1=E6=81=AF=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/spectrum/Sample_G_Analysis.java | 9 ++- .../org/jeecg/common/util/GammaFileUtil.java | 2 +- .../mapper/GardsNuclLinesLibMapper.java | 2 + .../mapper/xml/GardsNuclLinesLibMapper.xml | 10 +++ .../service/ISysDefaultNuclideService.java | 3 +- .../impl/GardsNuclLinesLibServiceImpl.java | 68 +++++++++---------- .../impl/SysDefaultNuclideServiceImpl.java | 8 +-- 7 files changed, 55 insertions(+), 47 deletions(-) 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 967d2663..459dc5b5 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 @@ -130,12 +130,12 @@ public class Sample_G_Analysis { sampleFilePath.substring(0, sampleFilePath.lastIndexOf(StringPool.SLASH)); String fileName = sampleFilePath.substring(sampleFilePath.lastIndexOf(StringPool.SLASH)+1); - // 解析能谱文件 - boolean flag = gammaFileUtil.loadFile(pathName, fileName, phdFile, new Result()); - // 获取数据库 Gamma 默认参数 getSettingFromDB(phdFile); + // 解析能谱文件 + boolean flag = gammaFileUtil.loadFile(pathName, fileName, phdFile, new Result()); + // 文件路径 middleData.setAnalyses_save_filePath(this.sampleInputFilename); // 读取文件内容并附值 @@ -699,8 +699,7 @@ public class Sample_G_Analysis { String nuclideName = entry.getKey(); GStoreMiddleProcessDataNuclLinesIded nuclLinesIded = entry.getValue(); GardsNuclLinesIded gardsNuclLinesIded = new GardsNuclLinesIded(); - List gardsNuclLinesIdeds = - mapFields(nuclLinesIded, gardsNuclLinesIded, base_IdPeak, fieldMap); + List gardsNuclLinesIdeds = mapFields(nuclLinesIded, gardsNuclLinesIded, base_IdPeak, fieldMap); if (CollUtil.isNotEmpty(gardsNuclLinesIdeds)){ for (GardsNuclLinesIded ided : gardsNuclLinesIdeds) { ided.setSampleId(sampleId); 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 af22bced..f38f81f7 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 @@ -3476,8 +3476,8 @@ public class GammaFileUtil extends AbstractLogOrReport { middleData.peaks_Nuclide_name = dvctNuclide_name; } // gards_ nucl_lines_ided数据表 - GStoreMiddleProcessDataNuclLinesIded nucl_lines_ided_data = new GStoreMiddleProcessDataNuclLinesIded(); for(Map.Entry itor:fileAnlyse.getMapNucActMda().entrySet()) { + GStoreMiddleProcessDataNuclLinesIded nucl_lines_ided_data = new GStoreMiddleProcessDataNuclLinesIded(); List svctNUCLIDEFULLNAME = new LinkedList<>(); List dvctIDPEAK = new LinkedList<>(); List dvctENERGY = new LinkedList<>(); diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLinesLibMapper.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLinesLibMapper.java index 4af0db5e..185dd97c 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLinesLibMapper.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/GardsNuclLinesLibMapper.java @@ -4,8 +4,10 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; +import org.jeecg.modules.entity.vo.NuclideLine; public interface GardsNuclLinesLibMapper extends BaseMapper { + List getNuclideLines(@Param(value = "name") String name); } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLinesLibMapper.xml b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLinesLibMapper.xml index 58820841..a589fbca 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLinesLibMapper.xml +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/mapper/xml/GardsNuclLinesLibMapper.xml @@ -2,4 +2,14 @@ + + \ No newline at end of file diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/ISysDefaultNuclideService.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/ISysDefaultNuclideService.java index 481d075c..4a5c246d 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/ISysDefaultNuclideService.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/ISysDefaultNuclideService.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; import org.jeecg.modules.base.entity.postgre.SysDefaultNuclide; +import org.jeecg.modules.entity.vo.NuclideLines; import java.util.List; import java.util.Map; @@ -21,7 +22,7 @@ public interface ISysDefaultNuclideService extends IService { Result add(List nuclideNames,String nuclideType,Integer useType); - Map> mapLines(String nuclideType); + Map mapLines(String nuclideType); void mapLines2Redis(); } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesLibServiceImpl.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesLibServiceImpl.java index c8d33bbf..c06c2dd2 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesLibServiceImpl.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesLibServiceImpl.java @@ -7,6 +7,8 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; +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.GardsNuclLinesLibMapper; import org.jeecg.modules.service.IGardsNuclLibService; @@ -16,9 +18,7 @@ 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.*; import java.util.stream.Collectors; @Service @@ -60,41 +60,37 @@ public class GardsNuclLinesLibServiceImpl extends ServiceImpl defaultLines(List nuclideNames) { - Map result = new HashMap<>(); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(GardsNuclLinesLib::getName, nuclideNames); - // 获取GardsNuclLinesLib核素数据 - List allNuclide = list(wrapper); - Map halfLife = nuclLibService.halfLife(nuclideNames); - - // 按照 QT源代码 处理数据 - for (int i = 0; i < allNuclide.size(); i++) { - NuclideLines nuclideLines; - GardsNuclLinesLib lib = allNuclide.get(i); - nuclideLines = result.containsKey(lib.getName()) ? result.get(lib.getName()) : new NuclideLines(); - - nuclideLines.getFullNames().add(lib.getFullName()); - nuclideLines.getVenergy().add(lib.getEnergy()); - nuclideLines.getVuncertE().add(lib.getEnergyUncert()); - nuclideLines.getVyield().add(lib.getYield() / 100); - nuclideLines.getVuncertY().add(lib.getYieldUncert()); - - int keyFlag = lib.getKeyFlag(); - if (keyFlag > 0){ - int index = nuclideNames.indexOf(lib.getName()); - nuclideLines.setKey_flag(index); - nuclideLines.setMaxYeildIdx(index); - } - - String name = lib.getName(); - Double day = halfLife.get(name); - if (ObjectUtil.isNotNull(day)) - nuclideLines.setHalflife(day * 86400); - - result.put(lib.getName(), nuclideLines); + Map mapLines = new HashMap<>(); + if (nuclideNames.size() < 1) { + return mapLines; } - return result; + Map halfLife = nuclLibService.halfLife(nuclideNames); + for (String name : nuclideNames) { + 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; + } + } + Double half = halfLife.get(name); + if (Objects.isNull(half)) { + half = 0.0; + } else { + half = half * 86400; + } + nlines.setHalflife(half); + mapLines.put(name, nlines); + } + return mapLines; } } diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/SysDefaultNuclideServiceImpl.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/SysDefaultNuclideServiceImpl.java index db1a581e..b4ca9734 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/SysDefaultNuclideServiceImpl.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/service/impl/SysDefaultNuclideServiceImpl.java @@ -80,14 +80,14 @@ public class SysDefaultNuclideServiceImpl extends ServiceImpl> mapLines(String nuclideType) { + public Map mapLines(String nuclideType) { List nuclideTypes = ListUtil.toList("G","P"); - Map> mapLines = MapUtil.newHashMap(); + Map mapLines = MapUtil.newHashMap(); if (!nuclideTypes.contains(nuclideType)) return mapLines; String key = RedisConstant.NUCLIDE_LINES_LIB + nuclideType; if (redisUtil.hasKey(key)) - return (Map>)redisUtil.get(key); + return (Map)redisUtil.get(key); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(SysDefaultNuclide::getUseType,1); wrapper.eq(SysDefaultNuclide::getNuclideType,nuclideType); @@ -96,7 +96,7 @@ public class SysDefaultNuclideServiceImpl extends ServiceImpl