beta修改数据获取方式,将数据进行缓存
新增beta的缓存实体类BetaDataFile gamma功能新增数据后重新查询idAnalysis
This commit is contained in:
parent
e50f2f494f
commit
477931999c
|
@ -2,6 +2,7 @@ package org.jeecg.common.cache;
|
|||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import org.jeecg.modules.entity.vo.BetaDataFile;
|
||||
import org.jeecg.modules.entity.vo.PHDFile;
|
||||
import org.jeecg.modules.entity.vo.SeriseData;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -12,7 +13,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
@Component
|
||||
public class BetaCache {
|
||||
private Cache<String, Map<String, Object>> betaCache = CacheBuilder.newBuilder()
|
||||
private Cache<String, BetaDataFile> betaCache = CacheBuilder.newBuilder()
|
||||
//设置缓存初始大小,应该合理设置,后续会扩容
|
||||
.initialCapacity(10)
|
||||
//最大值
|
||||
|
@ -25,11 +26,11 @@ public class BetaCache {
|
|||
.recordStats()
|
||||
.build();
|
||||
|
||||
public Cache<String, Map<String, Object>> getBetaCache() {
|
||||
public Cache<String, BetaDataFile> getBetaCache() {
|
||||
return betaCache;
|
||||
}
|
||||
|
||||
public void setBetaCache(Cache<String, Map<String, Object>> betaCache) {
|
||||
public void setBetaCache(Cache<String, BetaDataFile> betaCache) {
|
||||
this.betaCache = betaCache;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
@Autowired
|
||||
private ParameterProperties parameterProperties;
|
||||
|
||||
public Map<String, Object> getSourceData(String filePath, Integer sampleId, String status) {
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(filePath);
|
||||
public Map<String, Object> getSourceData(EnergySpectrumStruct struct, Integer sampleId, String status, String type, BetaDataFile betaDataFile) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
try {
|
||||
SpectrumData spectrumData = new SpectrumData();
|
||||
|
@ -253,7 +252,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
boundaryList.add(boundary);
|
||||
}
|
||||
map.put("Boundary", boundaryList);
|
||||
|
||||
if (type.equalsIgnoreCase("sample")) {
|
||||
betaDataFile.setSampleSpectrumData(spectrumData);
|
||||
betaDataFile.setSampleBoundary(boundaryList);
|
||||
} else if (type.equalsIgnoreCase("gas")) {
|
||||
betaDataFile.setGasSpectrumData(spectrumData);
|
||||
betaDataFile.setGasBoundary(boundaryList);
|
||||
} else if (type.equalsIgnoreCase("det")) {
|
||||
betaDataFile.setDetSpectrumData(spectrumData);
|
||||
betaDataFile.setDetBoundary(boundaryList);
|
||||
} else if (type.equalsIgnoreCase("qc")) {
|
||||
betaDataFile.setQcSpectrumData(spectrumData);
|
||||
betaDataFile.setQcBoundary(boundaryList);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -261,9 +272,6 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
|
||||
public List<String> readLine(String filePath) {
|
||||
String parameterFilePath = filePath.substring(0, filePath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = filePath.substring(filePath.lastIndexOf(StringPool.SLASH) + 1);
|
||||
|
||||
File file = null;
|
||||
List<String> allLines = new ArrayList<>();
|
||||
try {
|
||||
|
@ -456,8 +464,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
StringBuffer path = new StringBuffer();
|
||||
File file = null;
|
||||
try {
|
||||
String fromPath = ftpUtil.getFtpRootPath() + filePath +
|
||||
StringPool.SLASH + fileName;
|
||||
String fromPath = filePath + StringPool.SLASH + fileName;
|
||||
file = ftpUtil.downloadFile(fromPath, "betaGamma");
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
String systemType = sourceData.system_type;
|
||||
|
@ -605,7 +612,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
return file;
|
||||
}
|
||||
|
||||
public boolean analyzeSpectrum(File sampleTmp, File gasTmp, File detTmp, BgCalibratePara BgCalPara, Map<String, Object> map) {
|
||||
public boolean analyzeSpectrum(File sampleTmp, File gasTmp, File detTmp, BgCalibratePara BgCalPara, Map<String, Object> map, BetaDataFile betaDataFile) {
|
||||
boolean bRet = true;
|
||||
//调用动态库解析文件
|
||||
BgAnalyseResult analyseResult = null;
|
||||
|
@ -618,10 +625,10 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
bRet = false;
|
||||
return bRet;
|
||||
} else {
|
||||
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
||||
String sampleFileName = (String) map.get("sampleFileName");
|
||||
EnergySpectrumStruct sample = betaDataFile.getSampleStruct();
|
||||
EnergySpectrumStruct gas = betaDataFile.getGasStruct();
|
||||
EnergySpectrumStruct det = betaDataFile.getDetStruct();
|
||||
String sampleFileName = betaDataFile.getSampleFileName();
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//需要返回到前端的XeData数据
|
||||
|
@ -671,6 +678,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
betaDataFile.setSampleBoundary(boundaryList);
|
||||
map.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
|
@ -683,6 +691,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
betaDataFile.setGasBoundary(boundaryList);
|
||||
map.put("GasBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
|
@ -695,6 +704,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
betaDataFile.setDetBoundary(boundaryList);
|
||||
map.put("DetBoundary", boundaryList);
|
||||
}
|
||||
return bRet;
|
||||
|
@ -910,7 +920,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void CalQCBoundary(List<SeriseData> betaList, List<SeriseData> gammaList, List<String> betaFittingParaToUi, List<String> gammaFittingParaToUi, EnergySpectrumStruct struct, Map<String, Object> map) {
|
||||
public void CalQCBoundary(List<SeriseData> betaList, List<SeriseData> gammaList, List<String> betaFittingParaToUi, List<String> gammaFittingParaToUi, EnergySpectrumStruct struct, Map<String, Object> map, BetaDataFile betaDataFile) {
|
||||
//计算边界值
|
||||
CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam();
|
||||
if (CollectionUtils.isNotEmpty(betaList) && CollectionUtils.isNotEmpty(gammaList) && CollectionUtils.isNotEmpty(betaFittingParaToUi) && CollectionUtils.isNotEmpty(gammaFittingParaToUi)) {
|
||||
|
@ -954,6 +964,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
boundary.setMaxY(roiGBoundaryStop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
betaDataFile.setQcBoundary(boundaryList);
|
||||
map.put("QCBoundary", boundaryList);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,8 +181,8 @@ public class SpectrumAnalysesController {
|
|||
|
||||
@GetMapping("getGammaGated")
|
||||
@ApiOperation(value = "获取gamma对应count数据", notes = "获取gamma对应count数据")
|
||||
public Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.getGammaGated(chartHeight, channelWidth, gammaChannel, sampleId, qcFileName, request);
|
||||
public Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, String sampleFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.getGammaGated(chartHeight, channelWidth, gammaChannel, sampleId, qcFileName, sampleFileName, request);
|
||||
}
|
||||
|
||||
@PostMapping("ReAnalyse")
|
||||
|
|
|
@ -0,0 +1,148 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.modules.entity.GardsXeResultsSpectrum;
|
||||
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BetaDataFile implements Serializable {
|
||||
|
||||
//基本数据信息
|
||||
private String sampleFilePathName;
|
||||
|
||||
private String sampleFileName;
|
||||
|
||||
private String gasFilePathName;
|
||||
|
||||
private String gasFileName;
|
||||
|
||||
private String detFilePathName;
|
||||
|
||||
private String detFileName;
|
||||
|
||||
private String qcFilePathName;
|
||||
|
||||
private String qcFileName;
|
||||
|
||||
private String sampleId;
|
||||
|
||||
private boolean bProcessed;
|
||||
|
||||
private boolean saveAnalysisResult;
|
||||
|
||||
//文件分析结果
|
||||
private EnergySpectrumStruct sampleStruct;
|
||||
|
||||
private EnergySpectrumStruct gasStruct;
|
||||
|
||||
private EnergySpectrumStruct detStruct;
|
||||
|
||||
private EnergySpectrumStruct qcStruct;
|
||||
|
||||
//分析用到的信息
|
||||
private BgCalibratePara bgPara;
|
||||
|
||||
private List<SeriseData> betaList;
|
||||
|
||||
private List<String> betaFittingPara;
|
||||
|
||||
private List<String> betaFittingParaToUi;
|
||||
|
||||
private List<SeriseData> gammaList;
|
||||
|
||||
private List<String> gammaFittingPara;
|
||||
|
||||
private List<String> gammaFittingParaToUi;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValidSample;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValidSample;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValidGas;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValidGas;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bGammaEnergyValidDet;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
|
||||
*/
|
||||
private boolean bBetaEnergyValidDet;
|
||||
|
||||
|
||||
//存储结果用到的数组信息
|
||||
private List<GardsXeResultsSpectrum> xeResultsSpectrumList;
|
||||
|
||||
private List<Boundary> sampleBoundary;
|
||||
|
||||
private List<Boundary> gasBoundary;
|
||||
|
||||
private List<Boundary> detBoundary;
|
||||
|
||||
private List<Boundary> qcBoundary;
|
||||
|
||||
private SpectrumData sampleSpectrumData;
|
||||
|
||||
private SpectrumData gasSpectrumData;
|
||||
|
||||
private SpectrumData detSpectrumData;
|
||||
|
||||
private SpectrumData qcSpectrumData;
|
||||
|
||||
public BetaDataFile() {
|
||||
sampleFilePathName = "";
|
||||
sampleFileName = "";
|
||||
gasFilePathName = "";
|
||||
gasFileName = "";
|
||||
detFilePathName = "";
|
||||
detFileName = "";
|
||||
qcFilePathName = "";
|
||||
qcFileName = "";
|
||||
sampleId = "";
|
||||
bProcessed = false;
|
||||
saveAnalysisResult = false;
|
||||
|
||||
betaList = new LinkedList<>();
|
||||
betaFittingPara = new LinkedList<>();
|
||||
betaFittingParaToUi = new LinkedList<>();
|
||||
gammaList = new LinkedList<>();
|
||||
gammaFittingPara = new LinkedList<>();
|
||||
gammaFittingParaToUi = new LinkedList<>();
|
||||
bGammaEnergyValidSample = false;
|
||||
bBetaEnergyValidSample = false;
|
||||
bGammaEnergyValidGas = false;
|
||||
bBetaEnergyValidGas = false;
|
||||
bGammaEnergyValidDet = false;
|
||||
bBetaEnergyValidDet = false;
|
||||
|
||||
xeResultsSpectrumList = new LinkedList<>();
|
||||
sampleBoundary = new LinkedList<>();
|
||||
gasBoundary = new LinkedList<>();
|
||||
detBoundary = new LinkedList<>();
|
||||
qcBoundary = new LinkedList<>();
|
||||
sampleSpectrumData = new SpectrumData();
|
||||
gasSpectrumData = new SpectrumData();
|
||||
detSpectrumData = new SpectrumData();
|
||||
qcSpectrumData = new SpectrumData();
|
||||
}
|
||||
|
||||
}
|
|
@ -66,7 +66,7 @@ public interface ISpectrumAnalysisService {
|
|||
|
||||
Result fitting(Double paramA, Double paramB, Double paramC, List<SeriseData> tempPointsArray, Integer count, String sampleFileName, String tabName, HttpServletRequest request);
|
||||
|
||||
Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, HttpServletRequest request);
|
||||
Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, String sampleFileName, HttpServletRequest request);
|
||||
|
||||
Result ReAnalyse(AnalyseData analyseData, HttpServletRequest request);
|
||||
|
||||
|
|
|
@ -4440,6 +4440,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (StringUtils.isBlank(idAnalysis)) {
|
||||
// 向 RNMAN.GARDS_ANALYSES 表插入数据
|
||||
analysesSpectrumService.insertEntity(middleData, phd, userName, comments);
|
||||
//插入后重新查询出idAnalysis
|
||||
idAnalysis = spectrumAnalysisMapper.getIdAnalysisByIdAnalyst(phd.getId_sample(), userName);
|
||||
// 修改sample_data状态
|
||||
spectrumAnalysisMapper.updateAnalysesStatus(middleData.analyses_save_filePath);
|
||||
} else {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user