人工交互,自动处理启动时缓存全核素信息用于计算mdc数据
公用包下新增核素service层方法公用调用 增加查询全核素sql,查询核素关联峰核素sql,查询关联半衰期sql
This commit is contained in:
parent
2b15cb4e67
commit
cf0325a63b
|
@ -0,0 +1,18 @@
|
|||
package org.jeecg.modules.base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
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;
|
||||
|
||||
public interface GardsNuclLibMapper extends BaseMapper<GardsNuclLib> {
|
||||
|
||||
List<String> findNuclidesAnalysis();
|
||||
|
||||
List<NuclideLine> getNuclideLines(@Param("name") String name);
|
||||
|
||||
HalfData getOneHalf(@Param("name") String name);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.base.mapper.BaseCommonMapper">
|
||||
|
||||
<select id="findNuclidesAnalysis" resultType="java.lang.String">
|
||||
select NAME from CONFIGURATION.GARDS_NUCL_LIB
|
||||
</select>
|
||||
|
||||
<select id="getNuclideLines" resultType="org.jeecg.modules.entity.vo.NuclideLine">
|
||||
SELECT FULLNAME as fullName,
|
||||
ENERGY as energy,
|
||||
ENERGY_UNCERT as energyUncert,
|
||||
YIELD as yield,
|
||||
YIELD_UNCERT as yieldUncert,
|
||||
KEY_FLAG as keyFlag
|
||||
from CONFIGURATION.GARDS_NUCL_LINES_LIB WHERE NAME = #{name} ORDER BY ENERGY
|
||||
</select>
|
||||
|
||||
<select id="getOneHalf" resultType="org.jeecg.modules.entity.vo.HalfData">
|
||||
SELECT
|
||||
NAME as name,
|
||||
HALFLIFE as half
|
||||
FROM
|
||||
CONFIGURATION.GARDS_NUCL_LIB
|
||||
WHERE NAME = #{name}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,10 @@
|
|||
package org.jeecg.modules.base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsNuclLib;
|
||||
|
||||
public interface IGardsNuclLibService extends IService<GardsNuclLib> {
|
||||
|
||||
void getNuclideMap();
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package org.jeecg.modules.base.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.base.entity.configuration.GardsNuclLib;
|
||||
import org.jeecg.modules.base.mapper.GardsNuclLibMapper;
|
||||
import org.jeecg.modules.base.service.IGardsNuclLibService;
|
||||
import org.jeecg.modules.entity.vo.HalfData;
|
||||
import org.jeecg.modules.entity.vo.NuclideLine;
|
||||
import org.jeecg.modules.entity.vo.NuclideLines;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@DS("ora")
|
||||
public class GardsNuclLibServiceImpl extends ServiceImpl<GardsNuclLibMapper, GardsNuclLib> implements IGardsNuclLibService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public void getNuclideMap() {
|
||||
List<String> nuclideLibs = this.baseMapper.findNuclidesAnalysis();
|
||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(nuclideLibs);
|
||||
redisUtil.set("AllNuclideMap", nuclideMap);
|
||||
}
|
||||
|
||||
public Map<String, NuclideLines> GetNuclideLines(List<String> nuclideList) {
|
||||
Map<String, NuclideLines> mapLines = new HashMap<>();
|
||||
if (nuclideList.size() < 1) {
|
||||
return mapLines;
|
||||
}
|
||||
for (String name : nuclideList) {
|
||||
NuclideLines nlines = new NuclideLines();
|
||||
List<NuclideLine> 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -59,6 +59,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);
|
||||
|
@ -3198,7 +3200,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<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) 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;
|
||||
|
|
|
@ -9,6 +9,4 @@ public interface IGardsNuclIdedSpectrumService extends IService<GardsNuclIded> {
|
|||
|
||||
int saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
void getNuclideMap();
|
||||
|
||||
}
|
||||
|
|
|
@ -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<GardsNuclIdedSpectrumMapper, GardsNuclIded> 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<GardsNuclIdedS
|
|||
return nuclIdedList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNuclideMap() {
|
||||
List<String> nuclideLibs = spectrumAnalysisMapper.findNuclidesAnalysis();
|
||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(nuclideLibs);
|
||||
redisUtil.set("AllNuclideMap", nuclideMap);
|
||||
}
|
||||
|
||||
public Map<String, NuclideLines> GetNuclideLines(List<String> nuclideList) {
|
||||
Map<String, NuclideLines> mapLines = new HashMap<>();
|
||||
if (nuclideList.size() < 1) {
|
||||
return mapLines;
|
||||
}
|
||||
for (String name : nuclideList) {
|
||||
NuclideLines nlines = new NuclideLines();
|
||||
List<NuclideLine> 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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.base.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())){
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.jeecg.common.cache.BetaCache;
|
||||
import org.jeecg.common.cache.LocalCache;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.base.service.IGardsNuclLibService;
|
||||
import org.jeecg.modules.service.IDataService;
|
||||
import org.jeecg.modules.service.IGammaService;
|
||||
import org.jeecg.modules.service.IGardsNuclCoincidenceSumSpectrumService;
|
||||
|
@ -36,7 +37,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
@Autowired
|
||||
private IGardsNuclCoincidenceSumSpectrumService nuclCoincidenceSumSpectrumService;
|
||||
@Autowired
|
||||
private IGardsNuclIdedSpectrumService nuclIdedSpectrumService;
|
||||
private IGardsNuclLibService nuclLibService;
|
||||
@Autowired
|
||||
private IDataService dataService;
|
||||
|
||||
|
@ -72,7 +73,7 @@ public class JeecgSpectrumAnalysisApplication extends SpringBootServletInitializ
|
|||
betaCache.initCache();
|
||||
localCache.initCache();
|
||||
gammaService.readMDCParameter();
|
||||
nuclIdedSpectrumService.getNuclideMap();
|
||||
nuclLibService.getNuclideMap();
|
||||
nuclCoincidenceSumSpectrumService.getNuclCoincidenceMap();
|
||||
dataService.viewStations();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user