Merge remote-tracking branch 'xiaoguangbin/station' into station
# Conflicts: # jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/GammaFileUtil.java
This commit is contained in:
commit
03954a4d2a
|
@ -47,6 +47,12 @@ public class AlarmLog implements Serializable {
|
|||
@TableField(value = "alarm_value")
|
||||
private String alarmValue;
|
||||
|
||||
/**
|
||||
* 当前的规则信息
|
||||
*/
|
||||
@TableField(value = "operator")
|
||||
private String operator;
|
||||
|
||||
public AlarmLog() {
|
||||
this.alarmStartDate = LocalDateTime.now();
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -117,12 +117,12 @@
|
|||
<td width="453" height="40">New Gamma</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="453" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="463" height="40"> CH(x) = ([[${betaCalibrationSEC.coeff1}]])+([[${betaCalibrationSEC.coeff2}]])*x+([[${betaCalibrationSEC.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> CH(x) = ([[${gammaCalibrationSEC.coeff1}]])+([[${gammaCalibrationSEC.coeff2}]])*x+([[${gammaCalibrationSEC.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> E(x) = (-3.33443)+(0.398048)*x+(-0.000124)x*x</td>
|
||||
<td width="453" height="40"> E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x</td>
|
||||
<td width="463" height="40"> E(x) = ([[${betaCalibrationSCE.coeff1}]])+([[${betaCalibrationSCE.coeff2}]])*x+([[${betaCalibrationSCE.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> E(x) = ([[${gammaCalibrationSCE.coeff1}]])+([[${gammaCalibrationSCE.coeff2}]])*x+([[${gammaCalibrationSCE.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" height="40"> </td>
|
||||
|
@ -169,12 +169,12 @@
|
|||
<td width="453" height="40">New Gamma</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="453" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="463" height="40"> CH(x) = ([[${betaCalibrationDEC.coeff1}]])+([[${betaCalibrationDEC.coeff2}]])*x+([[${betaCalibrationDEC.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> CH(x) = ([[${gammaCalibrationDEC.coeff1}]])+([[${gammaCalibrationDEC.coeff2}]])*x+([[${gammaCalibrationDEC.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x</td>
|
||||
<td width="453" height="40"> E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x</td>
|
||||
<td width="463" height="40"> E(x) = ([[${betaCalibrationDCE.coeff1}]])+([[${betaCalibrationDCE.coeff2}]])*x+([[${betaCalibrationDCE.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> E(x) = ([[${gammaCalibrationDCE.coeff1}]])+([[${gammaCalibrationDCE.coeff2}]])*x+([[${gammaCalibrationDCE.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" height="40"> </td>
|
||||
|
@ -222,12 +222,12 @@
|
|||
<td width="453" height="40">New Gamma</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="453" height="40"> CH(x) = (?1)+(?2)*x+(?3)x*x</td>
|
||||
<td width="463" height="40"> CH(x) = ([[${betaCalibrationGEC.coeff1}]])+([[${betaCalibrationGEC.coeff2}]])*x+([[${betaCalibrationGEC.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> CH(x) = ([[${gammaCalibrationGEC.coeff1}]])+([[${gammaCalibrationGEC.coeff2}]])*x+([[${gammaCalibrationGEC.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="463" height="40"> E(x) = (-3.33443)+(0.398048)*x+(-0.000124)x*x</td>
|
||||
<td width="453" height="40"> E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x</td>
|
||||
<td width="463" height="40"> E(x) = ([[${betaCalibrationGCE.coeff1}]])+([[${betaCalibrationGCE.coeff2}]])*x+([[${betaCalibrationGCE.coeff3}]])x*x</td>
|
||||
<td width="453" height="40"> E(x) = ([[${gammaCalibrationGCE.coeff1}]])+([[${gammaCalibrationGCE.coeff2}]])*x+([[${gammaCalibrationGCE.coeff3}]])x*x</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" height="40"> </td>
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
#SAMPLE New CALIBRATION
|
||||
New Beta New Gamma
|
||||
CH(x) = (?1)+(?2)*x+(?3)x*x CH(x) = (?1)+(?2)*x+(?3)x*x
|
||||
E(x) = (-3.33443)+(0.398048)*x+(-0.000124)x*x E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x
|
||||
${sampleNewCalibration}
|
||||
|
||||
#SAMPLE: LIMITS PER ROI
|
||||
Roi Beta Gamma
|
||||
|
@ -47,8 +46,7 @@ ${sampleRoi}
|
|||
|
||||
#DET New CALIBRATION
|
||||
New Beta New Gamma
|
||||
CH(x) = (?1)+(?2)*x+(?3)x*x CH(x) = (?1)+(?2)*x+(?3)x*x
|
||||
E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x
|
||||
${detNewCalibration}
|
||||
|
||||
#DET: LIMITS PER ROI
|
||||
Roi Beta Gamma
|
||||
|
@ -61,8 +59,7 @@ ${detRoi}
|
|||
|
||||
#GAS New CALIBRATION
|
||||
New Beta New Gamma
|
||||
CH(x) = (?1)+(?2)*x+(?3)x*x CH(x) = (?1)+(?2)*x+(?3)x*x
|
||||
E(x) = (-3.33443)+(0.398048)*x+(-0.000124)x*x E(x) = (0.879727)+(0.365551)*x+(-2.8e-05)x*x
|
||||
${gasNewCalibration}
|
||||
|
||||
#GAS: LIMITS PER ROI
|
||||
Roi Beta Gamma
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
l.alarm_start_date,
|
||||
l.alarm_info,
|
||||
l.alarm_value,
|
||||
r.OPERATOR,
|
||||
l.OPERATOR,
|
||||
r.source_type,
|
||||
CASE
|
||||
r.source_type
|
||||
|
|
|
@ -2710,10 +2710,11 @@ public class GammaFileUtil {
|
|||
}
|
||||
|
||||
public List<String> DoubleLimit(List data){
|
||||
List<String> rData = new LinkedList<>();
|
||||
for(int pos=0;pos<data.size();pos++) {
|
||||
data.set(pos, String.format("%.3f", Double.valueOf(String.valueOf(data.get(pos)))));
|
||||
rData.add(String.format("%.3f", Double.valueOf(String.valueOf(data.get(pos)))));
|
||||
}
|
||||
return data;
|
||||
return rData;
|
||||
}
|
||||
|
||||
List<String> DoubleLimit_G(List<Double> _data) {
|
||||
|
|
|
@ -31,7 +31,9 @@ import org.xml.sax.SAXException;
|
|||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
|
@ -74,15 +76,8 @@ public class GammaFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (ftpFiles.size() == 0) {
|
||||
result.error500("ftp获取文件数据失败");
|
||||
return false;
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)) {
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -268,7 +263,7 @@ public class GammaFileUtil {
|
|||
return true;
|
||||
}
|
||||
|
||||
public void SetBaseInfo(PHDFile phd){
|
||||
public void SetBaseInfo(PHDFile phd) {
|
||||
String pathName = phd.getFilepath();
|
||||
String fileName = phd.getFilename();
|
||||
//文件名称需要加上自动处理的前缀以及修改不同的文件后缀名
|
||||
|
@ -279,6 +274,7 @@ public class GammaFileUtil {
|
|||
if (Objects.isNull(ftpClient)){
|
||||
String warning = "ftp连接失败";
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -287,27 +283,27 @@ public class GammaFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
String lcFileName = "RNAUTO_"+subFileName + ".lc";
|
||||
List<FTPFile> lcFiles = ftpFiles.stream().filter(item -> item.getName().equals(lcFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(lcFiles)){
|
||||
FTPFile lcFile = lcFiles.get(0);
|
||||
if (Objects.nonNull(lcFile)){
|
||||
InputStream inputStream = ftpClient.retrieveFileStream(lcFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
List<Double> vData = ReadLcScacInfo(readLines);
|
||||
phd.setVLc(vData);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(lcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
List<Double> vData = ReadLcScacInfo(readLines);
|
||||
phd.setVLc(vData);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
ftpClient.disconnect();
|
||||
if (Objects.nonNull(ftpClient)) {
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -319,6 +315,7 @@ public class GammaFileUtil {
|
|||
if (Objects.isNull(ftpClient)){
|
||||
String warning = "ftp连接失败";
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -327,27 +324,27 @@ public class GammaFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
String scacFileName = "RNAUTO_"+subFileName + ".scac";
|
||||
List<FTPFile> scacFiles = ftpFiles.stream().filter(item -> item.getName().equals(scacFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(scacFiles)){
|
||||
FTPFile scacFile = scacFiles.get(0);
|
||||
if (Objects.nonNull(scacFile)){
|
||||
InputStream inputStream = ftpClient.retrieveFileStream(scacFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
List<Double> vData = ReadLcScacInfo(readLines);
|
||||
phd.setVScac(vData);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(scacFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
List<Double> vData = ReadLcScacInfo(readLines);
|
||||
phd.setVScac(vData);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
ftpClient.disconnect();
|
||||
if (Objects.nonNull(ftpClient)) {
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -359,6 +356,7 @@ public class GammaFileUtil {
|
|||
if (Objects.isNull(ftpClient)){
|
||||
String warning = "ftp连接失败";
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -367,27 +365,27 @@ public class GammaFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
String baselineFileName = "RNAUTO_"+subFileName + ".baseline";
|
||||
List<FTPFile> baselineFiles = ftpFiles.stream().filter(item -> item.getName().equals(baselineFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(baselineFiles)){
|
||||
FTPFile baselineFile = baselineFiles.get(0);
|
||||
if (Objects.nonNull(baselineFile)){
|
||||
InputStream inputStream = ftpClient.retrieveFileStream(baselineFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
ReadBaseCtrlInfo(phd,readLines);
|
||||
phd.setVBase(phd.getBaseCtrls().getBaseline());
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(baselineFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
List<String> readLines = FileUtils.readLines(file, "UTF-8");
|
||||
ReadBaseCtrlInfo(phd,readLines);
|
||||
phd.setVBase(phd.getBaseCtrls().getBaseline());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
ftpClient.disconnect();
|
||||
if (Objects.nonNull(ftpClient)) {
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -395,7 +393,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public List<Double> ReadLcScacInfo(List<String> readLines){
|
||||
public List<Double> ReadLcScacInfo(List<String> readLines) {
|
||||
List<Double> vData = new LinkedList<>();
|
||||
for (int i=0; i< readLines.size(); i++){
|
||||
String line = readLines.get(i);
|
||||
|
@ -430,7 +428,7 @@ public class GammaFileUtil {
|
|||
return vData;
|
||||
}
|
||||
|
||||
public void ReadBaseCtrlInfo(PHDFile phd, List<String> readLines){
|
||||
public void ReadBaseCtrlInfo(PHDFile phd, List<String> readLines) {
|
||||
for (int i=0; i< readLines.size(); i++){
|
||||
String line = readLines.get(i);
|
||||
if (line.contains("#")){
|
||||
|
@ -484,59 +482,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public void ReadBaseCtrlInfo(PHDFile phd, InputStream in){
|
||||
try {
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||
String line ;
|
||||
String block_name = null;
|
||||
HashMap<String, List<Double>> map = new HashMap<>();
|
||||
while (null != (line = reader.readLine())) {
|
||||
if (line.contains("#")) {
|
||||
block_name = line.trim();
|
||||
map.put(block_name, new LinkedList<>());
|
||||
continue;
|
||||
}
|
||||
List<Double> data = map.get(block_name);
|
||||
String[] split = line.split("\\s+");
|
||||
for(String str : split) {
|
||||
if (StringUtils.isNotBlank(str) && !str.equalsIgnoreCase("nan")){
|
||||
double d = Double.parseDouble(str);
|
||||
data.add(d);
|
||||
} else if (StringUtils.isNotBlank(str) && str.equalsIgnoreCase("nan")) {
|
||||
data.add(0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(map.containsKey("#AnalyseRange")) {
|
||||
List<Double> vTemp = map.get("#AnalyseRange");
|
||||
if(vTemp.size() == 2) {
|
||||
phd.getBaseCtrls().setRg_low(vTemp.get(0).intValue());
|
||||
phd.getBaseCtrls().setRg_high(vTemp.get(1).intValue());
|
||||
}
|
||||
} else if(map.containsKey("#XCtrl")) {
|
||||
List<Double> vTemp = map.get("#XCtrl");
|
||||
phd.getBaseCtrls().setXCtrl(vTemp);
|
||||
} else if(map.containsKey("#YCtrl")) {
|
||||
List<Double> vTemp = map.get("#YCtrl");
|
||||
phd.getBaseCtrls().setYCtrl(vTemp);
|
||||
} else if(map.containsKey("#YSlope")) {
|
||||
List<Double> vTemp = map.get("#YSlope");
|
||||
phd.getBaseCtrls().setYSlope(vTemp);
|
||||
} else if(map.containsKey("#Baseline")) {
|
||||
List<Double> vTemp = map.get("#Baseline");
|
||||
List<Double> list = vTemp.subList(1, vTemp.size());
|
||||
phd.getBaseCtrls().setBaseline(list);
|
||||
} else if(map.containsKey("#StepCounts")) {
|
||||
List<Double> vTemp = map.get("#StepCounts");
|
||||
List<Double> list = vTemp.subList(1, vTemp.size());
|
||||
phd.getBaseCtrls().setStepCounts(list);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getResultFromDB(String dbName, Integer sampleId, PHDFile phd, Result result){
|
||||
public boolean getResultFromDB(String dbName, String userName, Integer sampleId, PHDFile phd, Result result) {
|
||||
//判断连接的数据库
|
||||
String T_analy, T_calib, T_peaks, T_param, T_nuc_line, T_nuc_act, T_qc, T_setting;
|
||||
if (dbName.equals("auto")){
|
||||
|
@ -547,6 +493,7 @@ public class GammaFileUtil {
|
|||
T_nuc_line = "RNAUTO.GARDS_NUCL_LINES_IDED";
|
||||
T_nuc_act = "RNAUTO.GARDS_NUCL_IDED";
|
||||
T_qc = "RNAUTO.GARDS_QC_CHECK";
|
||||
userName = "RNAUTO";
|
||||
}else {
|
||||
T_analy = "RNMAN.GARDS_ANALYSES";
|
||||
T_calib = "RNMAN.GARDS_CALIBRATION_PAIRS";
|
||||
|
@ -569,7 +516,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
|
||||
// 获取 ananlysis_id、BaseLine、Lc、Scac、峰数量、Category、谱注释等信息
|
||||
GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis(T_analy, sampleId);
|
||||
GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis(T_analy, sampleId, userName);
|
||||
int peakNum = 0;
|
||||
if (Objects.nonNull(analysis)){
|
||||
phd.setId_analysis(analysis.getIdAnalysis().toString());
|
||||
|
@ -830,7 +777,7 @@ public class GammaFileUtil {
|
|||
return true;
|
||||
}
|
||||
|
||||
public List<String> Qcstate(PHDFile phd){
|
||||
public List<String> Qcstate(PHDFile phd) {
|
||||
// Collection Time、 Acq Time、 Decay Time、 SampVol、 Be7-FWHM、 Ba140-MDC、 Xe133-MDC
|
||||
List<String> qcState = new LinkedList<>();
|
||||
for (int i=0;i<7; i++){
|
||||
|
@ -859,7 +806,7 @@ public class GammaFileUtil {
|
|||
return qcState;
|
||||
}
|
||||
|
||||
public void RunQC(PHDFile phd){
|
||||
public void RunQC(PHDFile phd) {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
try {
|
||||
Date start = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time());
|
||||
|
@ -961,7 +908,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public Double CalculateMDC(PHDFile phd, List<Double> vMdcInfo, Double CCF){
|
||||
public Double CalculateMDC(PHDFile phd, List<Double> vMdcInfo, Double CCF) {
|
||||
try {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
if(vMdcInfo.size() < 3 || vMdcInfo.get(2) == 0) {
|
||||
|
@ -1038,7 +985,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean ReadQCLimit(Map<String, QcCheckItem> qcItems, Map<String, Double> vMdcInfoMap, Double ener_Be7, String systemType){
|
||||
public boolean ReadQCLimit(Map<String, QcCheckItem> qcItems, Map<String, Double> vMdcInfoMap, Double ener_Be7, String systemType) {
|
||||
try {
|
||||
String filePath = parameterFilePath+ File.separator +"SystemManager.xml";
|
||||
//创建一个文档解析器工厂
|
||||
|
@ -1225,7 +1172,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateChart(PHDFile phd, Map<String, Object> map, Map<String, String> colorMap){
|
||||
public void UpdateChart(PHDFile phd, Map<String, Object> map, Map<String, String> colorMap) {
|
||||
List<Long> m_vCount = new LinkedList<>();
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||
|
@ -1253,7 +1200,7 @@ public class GammaFileUtil {
|
|||
map.put("shapeChannelData", shapeChannelData);
|
||||
}
|
||||
|
||||
public ChartData Energy_Count(PHDFile phd, List<Long> m_vCount, long m_nCount, String color){
|
||||
public ChartData Energy_Count(PHDFile phd, List<Long> m_vCount, long m_nCount, String color) {
|
||||
int start = 0;
|
||||
long end = -1;
|
||||
//Energy
|
||||
|
@ -1278,7 +1225,7 @@ public class GammaFileUtil {
|
|||
return data1;
|
||||
}
|
||||
|
||||
public ChartData Channel_Count(List<Long> m_vCount, long m_nCount, String color){
|
||||
public ChartData Channel_Count(List<Long> m_vCount, long m_nCount, String color) {
|
||||
int start = 1;
|
||||
long end = -1;
|
||||
ChartData data1 = new ChartData();
|
||||
|
@ -1302,7 +1249,7 @@ public class GammaFileUtil {
|
|||
return data1;
|
||||
}
|
||||
|
||||
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, long m_nCount, Map<String, String> colorMap){
|
||||
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, long m_nCount, Map<String, String> colorMap) {
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
int start = 0;
|
||||
long end = -1;
|
||||
|
@ -1392,15 +1339,15 @@ public class GammaFileUtil {
|
|||
return datalist;
|
||||
}
|
||||
|
||||
public List<ChartData> Channel_Peak(PHDFile phd, long m_nCount, String color){
|
||||
public List<ChartData> Channel_Peak(PHDFile phd, long m_nCount, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, null, false);
|
||||
}
|
||||
|
||||
public List<ChartData> Energy_Peak(PHDFile phd, long m_nCount, String color){
|
||||
public List<ChartData> Energy_Peak(PHDFile phd, long m_nCount, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, phd.getUsedEnerPara().getP(), true);
|
||||
}
|
||||
|
||||
public List<ChartData> PeakSet(List<PeakInfo> vPeak, List<Double> vBase, String color, long m_nCount, List<Double> p, boolean bEnergy){
|
||||
public List<ChartData> PeakSet(List<PeakInfo> vPeak, List<Double> vBase, String color, long m_nCount, List<Double> p, boolean bEnergy) {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
int peakNum = vPeak.size();
|
||||
|
@ -1478,7 +1425,7 @@ public class GammaFileUtil {
|
|||
return datalist;
|
||||
}
|
||||
|
||||
public List<ShapeData> Energy_BaseCP(PHDFile phd){
|
||||
public List<ShapeData> Energy_BaseCP(PHDFile phd) {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
List<ShapeData> shapes = new LinkedList<>();
|
||||
CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(phd.getBaseCtrls().getXCtrl(), phd.getUsedEnerPara().getP());
|
||||
|
@ -1497,7 +1444,7 @@ public class GammaFileUtil {
|
|||
return shapes;
|
||||
}
|
||||
|
||||
public List<ShapeData> Channel_BaseCP(PHDFile phd){
|
||||
public List<ShapeData> Channel_BaseCP(PHDFile phd) {
|
||||
List<ShapeData> shapes = new LinkedList<>();
|
||||
int num = phd.getBaseCtrls().getXCtrl().size();
|
||||
if(num == phd.getBaseCtrls().getYCtrl().size()) {
|
||||
|
@ -1514,7 +1461,7 @@ public class GammaFileUtil {
|
|||
return shapes;
|
||||
}
|
||||
|
||||
public List<ChartData> AllData(boolean showLc, PHDFile phd, List<Long> m_vCount, long m_nCount, Map<String, String> colorMap){
|
||||
public List<ChartData> AllData(boolean showLc, PHDFile phd, List<Long> m_vCount, long m_nCount, Map<String, String> colorMap) {
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
datalist.add(Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||
datalist.add(Energy_Count(phd, m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||
|
@ -1524,7 +1471,7 @@ public class GammaFileUtil {
|
|||
return datalist;
|
||||
}
|
||||
|
||||
public boolean AnalyseData(PHDFile phd, ConfigureData configureData, List<String> nuclides, boolean bSingle){
|
||||
public boolean AnalyseData(PHDFile phd, ConfigureData configureData, List<String> nuclides, boolean bSingle) {
|
||||
//调用方法判断是否修改了参数
|
||||
if (Objects.nonNull(configureData)){
|
||||
SpecSetup phdSetting = phd.getSetting();
|
||||
|
@ -1633,7 +1580,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public void NuclidesIdent(PHDFile phd, Map<String, NuclideLines> map){
|
||||
public void NuclidesIdent(PHDFile phd, Map<String, NuclideLines> map) {
|
||||
// 当重新分析时先清除上一次的分析结果
|
||||
phd.getMapNucActMda().clear();
|
||||
for(int i=0; i<phd.getVPeak().size(); ++i){
|
||||
|
@ -1823,7 +1770,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean CalculateMDCs(PHDFile phd, NuclideActMda nucActMda, int mainPeakIdx, double lambda, double keyLineYield, double CCF){
|
||||
private boolean CalculateMDCs(PHDFile phd, NuclideActMda nucActMda, int mainPeakIdx, double lambda, double keyLineYield, double CCF) {
|
||||
// 计算衰变校正因子——DCF
|
||||
try {
|
||||
Date collectStart = DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time().substring(0, phd.getCollect().getCollection_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss");
|
||||
|
@ -1940,7 +1887,7 @@ public class GammaFileUtil {
|
|||
return cData;
|
||||
}
|
||||
|
||||
public List<SeriseData> Differance(PHDFile phd, List<PeakInfo> vecPeak, List<Long> m_vCount, long m_nCount){
|
||||
public List<SeriseData> Differance(PHDFile phd, List<PeakInfo> vecPeak, List<Long> m_vCount, long m_nCount) {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
List<SeriseData> pointlist = new LinkedList<>();
|
||||
int start =0;
|
||||
|
@ -2031,7 +1978,7 @@ public class GammaFileUtil {
|
|||
return pointlist;
|
||||
}
|
||||
|
||||
public void ReadData(List<Double> m_vEnergy, List<String> m_vNuclide){
|
||||
public void ReadData(List<Double> m_vEnergy, List<String> m_vNuclide) {
|
||||
try {
|
||||
String filePath = parameterFilePath+File.separator+"Energy_Nuclide.txt";
|
||||
File file = new File(filePath);
|
||||
|
@ -2439,7 +2386,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean GetInterMiddlData(PHDFile phd, String userName, GStoreMiddleProcessData middleData){
|
||||
public boolean GetInterMiddlData(PHDFile phd, String userName, GStoreMiddleProcessData middleData) {
|
||||
boolean bRet = true;
|
||||
Map<String, NuclideLines> temp = new HashMap<>();
|
||||
try {
|
||||
|
@ -2451,7 +2398,7 @@ public class GammaFileUtil {
|
|||
return bRet;
|
||||
}
|
||||
|
||||
public String GetLogContent(GStoreMiddleProcessData middleData){
|
||||
public String GetLogContent(GStoreMiddleProcessData middleData) {
|
||||
StringBuffer strBuffer = new StringBuffer();
|
||||
strBuffer.append("-------------------------- Sample Analyse Beginning at "+DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss")+" ---------------------------\n");
|
||||
strBuffer.append("\n");
|
||||
|
@ -2622,7 +2569,7 @@ public class GammaFileUtil {
|
|||
return strBuffer.toString();
|
||||
}
|
||||
|
||||
public String GetReportContent(GStoreMiddleProcessData middleData){
|
||||
public String GetReportContent(GStoreMiddleProcessData middleData) {
|
||||
StringBuffer strBuffer = new StringBuffer();
|
||||
strBuffer.append("CNL06 GENERATED REPORT\n");
|
||||
strBuffer.append(middleData.analyses_type+" RADIONUCLIDE REPORT\n");
|
||||
|
@ -2764,11 +2711,12 @@ public class GammaFileUtil {
|
|||
return strBuffer.toString();
|
||||
}
|
||||
|
||||
public List<String> DoubleLimit(List data){
|
||||
public List<String> DoubleLimit(List data) {
|
||||
List<String> rData = new LinkedList<>();
|
||||
for(int pos=0;pos<data.size();pos++) {
|
||||
data.set(pos, String.format("%.3f", Double.valueOf(String.valueOf(data.get(pos)))));
|
||||
rData.add(String.format("%.3f", Double.valueOf(String.valueOf(data.get(pos)))));
|
||||
}
|
||||
return data;
|
||||
return rData;
|
||||
}
|
||||
|
||||
public List<String> DoubleLimit_I(List<Double> _data) {
|
||||
|
@ -2937,13 +2885,13 @@ public class GammaFileUtil {
|
|||
for(int pos=0;pos<fileAnlyse.getUsedEnerKD().getG_energy().size();pos++) {
|
||||
temp.add(String.valueOf(pos));
|
||||
}
|
||||
middleData.calibration_pairs_E_idCalPoint = DoubleLimit(temp);
|
||||
middleData.calibration_pairs_E_idCalPoint = temp;
|
||||
middleData.calibration_pairs_E_xValue = DoubleLimit(fileAnlyse.getUsedEnerKD().getCentroid_channel());
|
||||
middleData.calibration_pairs_E_yValue = DoubleLimit(fileAnlyse.getUsedEnerKD().getG_energy());
|
||||
middleData.calibration_pairs_E_uncYValue =DoubleLimit(fileAnlyse.getUsedEnerKD().getUncertainty());
|
||||
|
||||
if(Objects.nonNull(fileAnlyse.getMapEnerKD().get(CalName.CalPHD.getType()))) {
|
||||
middleData.calibration_pairs_S_E_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_S_E_idCalPoint =temp;
|
||||
middleData.calibration_pairs_S_E_xValue =DoubleLimit(fileAnlyse.getMapEnerKD().get(CalName.CalPHD.getType()).getCentroid_channel());
|
||||
middleData.calibration_pairs_S_E_yValue =DoubleLimit(fileAnlyse.getMapEnerKD().get(CalName.CalPHD.getType()).getG_energy());
|
||||
middleData.calibration_pairs_S_E_uncYValue =DoubleLimit(fileAnlyse.getMapEnerKD().get(CalName.CalPHD.getType()).getUncertainty());
|
||||
|
@ -2962,13 +2910,13 @@ public class GammaFileUtil {
|
|||
{
|
||||
temp.add(String.valueOf(pos));
|
||||
}
|
||||
middleData.calibration_pairs_EF_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_EF_idCalPoint =temp;
|
||||
middleData.calibration_pairs_EF_xValue =DoubleLimit(fileAnlyse.getUsedEffiKD().getG_energy());
|
||||
middleData.calibration_pairs_EF_yValue =DoubleLimit(fileAnlyse.getUsedEffiKD().getEfficiency());
|
||||
middleData.calibration_pairs_EF_uncYValue=DoubleLimit(fileAnlyse.getUsedEffiKD().getUncertainty());
|
||||
|
||||
if(Objects.nonNull(fileAnlyse.getMapEffiKD().get(CalName.CalPHD.getType()))) {
|
||||
middleData.calibration_pairs_S_EF_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_S_EF_idCalPoint =temp;
|
||||
middleData.calibration_pairs_S_EF_xValue =DoubleLimit(fileAnlyse.getMapEffiKD().get(CalName.CalPHD.getType()).getG_energy());
|
||||
middleData.calibration_pairs_S_EF_yValue =DoubleLimit(fileAnlyse.getMapEffiKD().get(CalName.CalPHD.getType()).getEfficiency());
|
||||
middleData.calibration_pairs_S_EF_uncYValue=DoubleLimit(fileAnlyse.getMapEffiKD().get(CalName.CalPHD.getType()).getUncertainty());
|
||||
|
@ -2986,13 +2934,13 @@ public class GammaFileUtil {
|
|||
for(int pos=0;pos<fileAnlyse.getUsedResoKD().getFWHM().size();pos++) {
|
||||
temp.add(String.valueOf(pos));
|
||||
}
|
||||
middleData.calibration_pairs_R_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_R_idCalPoint =temp;
|
||||
middleData.calibration_pairs_R_xValue =DoubleLimit(fileAnlyse.getUsedResoKD().getG_energy());
|
||||
middleData.calibration_pairs_R_yValue =DoubleLimit(fileAnlyse.getUsedResoKD().getFWHM());
|
||||
middleData.calibration_pairs_R_uncYValue =DoubleLimit(fileAnlyse.getUsedResoKD().getUncertainty());
|
||||
|
||||
if(Objects.nonNull(fileAnlyse.getMapResoKD().get(CalName.CalPHD.getType()))) {
|
||||
middleData.calibration_pairs_S_R_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_S_R_idCalPoint =temp;
|
||||
middleData.calibration_pairs_S_R_xValue =DoubleLimit(fileAnlyse.getMapResoKD().get(CalName.CalPHD.getType()).getG_energy());
|
||||
middleData.calibration_pairs_S_R_yValue =DoubleLimit(fileAnlyse.getMapResoKD().get(CalName.CalPHD.getType()).getFWHM());
|
||||
middleData.calibration_pairs_S_R_uncYValue =DoubleLimit(fileAnlyse.getMapResoKD().get(CalName.CalPHD.getType()).getUncertainty());
|
||||
|
@ -3010,12 +2958,12 @@ public class GammaFileUtil {
|
|||
temp.add(String.valueOf(pos));
|
||||
}
|
||||
|
||||
middleData.calibration_pairs_T_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_T_idCalPoint =temp;
|
||||
middleData.calibration_pairs_T_xValue =DoubleLimit(fileAnlyse.getUsedTotEKD().getG_energy());
|
||||
middleData.calibration_pairs_T_yValue =DoubleLimit(fileAnlyse.getUsedTotEKD().getTotal_efficiency());
|
||||
middleData.calibration_pairs_T_uncYValue =DoubleLimit(fileAnlyse.getUsedTotEKD().getUncertainty());
|
||||
if(Objects.nonNull(fileAnlyse.getMapTotEKD().get(CalName.CalPHD.getType()))) {
|
||||
middleData.calibration_pairs_S_T_idCalPoint =DoubleLimit(temp);
|
||||
middleData.calibration_pairs_S_T_idCalPoint =temp;
|
||||
middleData.calibration_pairs_S_T_xValue =DoubleLimit(fileAnlyse.getMapTotEKD().get(CalName.CalPHD.getType()).getG_energy());
|
||||
middleData.calibration_pairs_S_T_yValue =DoubleLimit(fileAnlyse.getMapTotEKD().get(CalName.CalPHD.getType()).getTotal_efficiency());
|
||||
middleData.calibration_pairs_S_T_uncYValue =DoubleLimit(fileAnlyse.getMapTotEKD().get(CalName.CalPHD.getType()).getUncertainty());
|
||||
|
@ -3161,7 +3109,7 @@ public class GammaFileUtil {
|
|||
//gards_ peaks数据表
|
||||
|
||||
if(fileAnlyse.getVPeak().size() != 0) {
|
||||
List<Double> dvctIDPEAK = new LinkedList<>();
|
||||
List<String> dvctIDPEAK = new LinkedList<>();
|
||||
List<Double> dvctCENTROIDCHANNEL = new LinkedList<>();
|
||||
List<Double> dvctUNCCENTROIDCHANNEL = new LinkedList<>();
|
||||
List<Double> dvctENERGY = new LinkedList<>();
|
||||
|
@ -3194,7 +3142,7 @@ public class GammaFileUtil {
|
|||
List<String> dvctNuclide_name = new LinkedList<>();
|
||||
List<String> dvctComments = new LinkedList<>();
|
||||
for(int m=0; m<fileAnlyse.getVPeak().size(); m++) {
|
||||
dvctIDPEAK.add(Double.valueOf(m+1));
|
||||
dvctIDPEAK.add(String.valueOf(m+1));
|
||||
dvctCENTROIDCHANNEL.add(fileAnlyse.getVPeak().get(m).peakCentroid);
|
||||
dvctENERGY.add(fileAnlyse.getVPeak().get(m).energy);
|
||||
dvctAREA.add(fileAnlyse.getVPeak().get(m).area);
|
||||
|
@ -3228,7 +3176,7 @@ public class GammaFileUtil {
|
|||
dvctComments.add(t_comment);
|
||||
dvctNuclide_name.add(StringUtils.join(fileAnlyse.getVPeak().get(m).nuclides, ";"));
|
||||
}
|
||||
middleData.peaks_idPeak =DoubleLimit_I(dvctIDPEAK);
|
||||
middleData.peaks_idPeak =dvctIDPEAK;
|
||||
middleData.peaks_peakCentroid =DoubleLimit_G(dvctCENTROIDCHANNEL);
|
||||
middleData.peaks_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL);
|
||||
middleData.peaks_Energy =DoubleLimit_G(dvctENERGY);
|
||||
|
@ -3263,7 +3211,7 @@ public class GammaFileUtil {
|
|||
GStoreMiddleProcessDataNuclLinesIded nucl_lines_ided_data = new GStoreMiddleProcessDataNuclLinesIded();
|
||||
for(Map.Entry<String, NuclideActMda> itor:fileAnlyse.getMapNucActMda().entrySet()) {
|
||||
List<String> svctNUCLIDEFULLNAME = new LinkedList<>();
|
||||
List<Double> dvctIDPEAK = new LinkedList<>();
|
||||
List<String> dvctIDPEAK = new LinkedList<>();
|
||||
List<Double> dvctENERGY = new LinkedList<>();
|
||||
List<Double> dvctUNCENERGY = new LinkedList<>();
|
||||
List<Double> dvctABUNDANCE = new LinkedList<>();
|
||||
|
@ -3292,7 +3240,7 @@ public class GammaFileUtil {
|
|||
first = first<second?first:second;
|
||||
for(int m=0;m<first;m++) {
|
||||
svctNUCLIDEFULLNAME.add( itor.getValue().getFullNames().get(m).replace("\'", "\'\'") );
|
||||
dvctIDPEAK.add(itor.getValue().getVPeakIdx().get(m).doubleValue());
|
||||
dvctIDPEAK.add(itor.getValue().getVPeakIdx().get(m).toString());
|
||||
dvctENERGY.add(itor.getValue().getVEnergy().get(m));
|
||||
dvctUNCENERGY.add(itor.getValue().getVUncertE().get(m));
|
||||
dvctABUNDANCE.add(itor.getValue().getVYield().get(m));
|
||||
|
@ -3315,7 +3263,7 @@ public class GammaFileUtil {
|
|||
dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration()));
|
||||
}
|
||||
nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME;
|
||||
nucl_lines_ided_data.idPeak =DoubleLimit_I(dvctIDPEAK);
|
||||
nucl_lines_ided_data.idPeak =dvctIDPEAK;
|
||||
nucl_lines_ided_data.Energy =DoubleLimit_G(dvctENERGY);
|
||||
nucl_lines_ided_data.uncEnergy =DoubleLimit_G(dvctUNCENERGY);
|
||||
nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE);
|
||||
|
@ -3669,7 +3617,7 @@ public class GammaFileUtil {
|
|||
return spectrum.toString();
|
||||
}
|
||||
|
||||
public double GetEnergyByFloatChan(PHDFile phd, int channel){
|
||||
public double GetEnergyByFloatChan(PHDFile phd, int channel) {
|
||||
// 算法描述:取指定点附近的两点,根据 y=ax+b 方程求指定点处的能量
|
||||
double y = 0.0;
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
|
@ -3684,7 +3632,7 @@ public class GammaFileUtil {
|
|||
return y;
|
||||
}
|
||||
|
||||
public List<String> InitList(double energy, double tolerance, List<String> nuclides){
|
||||
public List<String> InitList(double energy, double tolerance, List<String> nuclides) {
|
||||
if(nuclides.size() < 1){
|
||||
return new LinkedList<>();
|
||||
}
|
||||
|
@ -3694,7 +3642,7 @@ public class GammaFileUtil {
|
|||
return nuclideList;
|
||||
}
|
||||
|
||||
public void InitTable(String name, Map<String, Object> map, PHDFile phd, Map<String, String> colorMap){
|
||||
public void InitTable(String name, Map<String, Object> map, PHDFile phd, Map<String, String> colorMap) {
|
||||
InitNuclideInfo(name, map);
|
||||
long span = phd.getSpec().getG_energy_span();
|
||||
List<GardsNuclLinesLib> nuclideTableList = spectrumAnalysisMapper.getNuclideTable(name, span);
|
||||
|
@ -3704,7 +3652,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public void InitNuclideInfo(String name, Map<String, Object> map){
|
||||
public void InitNuclideInfo(String name, Map<String, Object> map) {
|
||||
map.put("name", name);
|
||||
|
||||
GardsNuclLib nuclideInfo = spectrumAnalysisMapper.getNuclideInfo(name);
|
||||
|
@ -3736,7 +3684,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public void InitChart(List<GardsNuclLinesLib> nuclideTableList, PHDFile phd, Map<String, Object> map, Map<String, String> colorMap){
|
||||
public void InitChart(List<GardsNuclLinesLib> nuclideTableList, PHDFile phd, Map<String, Object> map, Map<String, String> colorMap) {
|
||||
List<Map<String, Object>> chartList = new LinkedList<>();
|
||||
for (int i=0; i < nuclideTableList.size(); i++){
|
||||
Map<String, Object> chartMap = new HashMap<>();
|
||||
|
@ -3838,7 +3786,7 @@ public class GammaFileUtil {
|
|||
return channel;
|
||||
}
|
||||
|
||||
public void InitPara(PHDFile phd){
|
||||
public void InitPara(PHDFile phd) {
|
||||
List<Double> Acal_tail_para = new LinkedList<>();
|
||||
Acal_tail_para.add(99.0);
|
||||
Acal_tail_para.add(0.0);
|
||||
|
@ -3913,7 +3861,7 @@ public class GammaFileUtil {
|
|||
return i;
|
||||
}
|
||||
|
||||
public List<TablePeaks> FitPeakBaseLine(PHDFile phd, List<Integer> vIdx){
|
||||
public List<TablePeaks> FitPeakBaseLine(PHDFile phd, List<Integer> vIdx) {
|
||||
List<TablePeaks> tablePeaksList = new LinkedList<>();
|
||||
int peakNum = vIdx.size();
|
||||
for (int i=0; i<peakNum; ++i) {
|
||||
|
@ -4102,15 +4050,8 @@ public class GammaFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(compareFilePath);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles = ftpFiles.stream().filter(item -> item.getName().equals(compareFileName)).collect(Collectors.toList());
|
||||
if (ftpFiles.size() == 0) {
|
||||
result.error500("ftp获取文件数据失败");
|
||||
return m_vecCompare;
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)) {
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(compareFileName);
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -4145,7 +4086,7 @@ public class GammaFileUtil {
|
|||
return m_vecCompare;
|
||||
}
|
||||
|
||||
public List<ChartData> CompareData(List<Long> m_vecCompare, long m_nCount, Map<String, String> colorMap, List<Double> vEnergy){
|
||||
public List<ChartData> CompareData(List<Long> m_vecCompare, long m_nCount, Map<String, String> colorMap, List<Double> vEnergy) {
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
int size = m_vecCompare.size();
|
||||
if(size == m_nCount) {
|
||||
|
|
|
@ -278,6 +278,8 @@ public class PHDFileUtil {
|
|||
}
|
||||
|
||||
public List<String> readLine(String filePath){
|
||||
String parameterFilePath = filePath.substring(0, filePath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = filePath.substring(filePath.lastIndexOf(StringPool.SLASH) + 1);
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
//判断ftp是否连接成功
|
||||
|
@ -286,32 +288,24 @@ public class PHDFileUtil {
|
|||
}
|
||||
InputStream iStream= null;
|
||||
try {
|
||||
//被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
String fileName = filePath.substring(filePath.lastIndexOf(StringPool.SLASH) + 1);
|
||||
String parameterFilePath = filePath.substring(0, filePath.lastIndexOf(StringPool.SLASH));
|
||||
//判断文件路径是否为空
|
||||
if (StringUtils.isNotBlank(parameterFilePath)){
|
||||
//在当前工作路径下读取文件
|
||||
ftpClient.changeWorkingDirectory(parameterFilePath);
|
||||
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
|
||||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding(ftpUtil.getEncoding());
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
for (FTPFile ftpFile:ftpFiles) {
|
||||
if (ftpFile.getName().equals(fileName)){
|
||||
//读取ftp文件的输入流
|
||||
iStream=ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(iStream, file);
|
||||
List<String> allLines = FileUtils.readLines(file, ftpUtil.getEncoding());
|
||||
return allLines;
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置文件类型--二进制文件
|
||||
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
|
||||
//
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//在当前工作路径下读取文件
|
||||
ftpClient.changeWorkingDirectory(parameterFilePath);
|
||||
//读取ftp文件的输入流
|
||||
iStream=ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(iStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(iStream, file);
|
||||
List<String> allLines = FileUtils.readLines(file, ftpUtil.getEncoding());
|
||||
return allLines;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -488,38 +482,31 @@ public class PHDFileUtil {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换工作路径
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
//获取路径下所有的ftp文件信息
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)) {
|
||||
//获取sampleFileName
|
||||
ftpFiles = ftpFiles.stream().filter(item -> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)) {
|
||||
FTPFile sampleFile = ftpFiles.get(0);
|
||||
//解析sampleFile
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载sampleFile内容
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
//获取所需要的数据
|
||||
String dataType = struct.data_type;
|
||||
String systemType = struct.system_type;
|
||||
String spectrumQuantity = struct.spectrum_quantity;
|
||||
double acquisitionLiveTime = struct.acquisition_live_time;
|
||||
String measurementId = struct.measurement_id;
|
||||
String gasBkMeasurementId = struct.gas_bk_measurement_id;
|
||||
String detectorBkMeasurementId = struct.detector_bk_measurement_id;
|
||||
//格式化文件名称
|
||||
String fileSuffix = nameStandUtil.GetSuffix(dataType, systemType, spectrumQuantity, String.valueOf(acquisitionLiveTime));
|
||||
String measurementName = nameStandUtil.GetFileNameFromDateTime(measurementId, fileSuffix);
|
||||
String gasFileName = nameStandUtil.GetFileNameFromDateTime(gasBkMeasurementId, "_G.PHD");
|
||||
String detaFileName = nameStandUtil.GetFileNameFromDateTime(detectorBkMeasurementId, "_D.PHD");
|
||||
map.put("gasFileName", gasFileName);
|
||||
map.put("detaFileName", detaFileName);
|
||||
map.put("sampleSystemType", systemType);
|
||||
}
|
||||
//解析sampleFile
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载sampleFile内容
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
//获取所需要的数据
|
||||
String dataType = struct.data_type;
|
||||
String systemType = struct.system_type;
|
||||
String spectrumQuantity = struct.spectrum_quantity;
|
||||
double acquisitionLiveTime = struct.acquisition_live_time;
|
||||
String measurementId = struct.measurement_id;
|
||||
String gasBkMeasurementId = struct.gas_bk_measurement_id;
|
||||
String detectorBkMeasurementId = struct.detector_bk_measurement_id;
|
||||
//格式化文件名称
|
||||
String fileSuffix = nameStandUtil.GetSuffix(dataType, systemType, spectrumQuantity, String.valueOf(acquisitionLiveTime));
|
||||
String measurementName = nameStandUtil.GetFileNameFromDateTime(measurementId, fileSuffix);
|
||||
String gasFileName = nameStandUtil.GetFileNameFromDateTime(gasBkMeasurementId, "_G.PHD");
|
||||
String detaFileName = nameStandUtil.GetFileNameFromDateTime(detectorBkMeasurementId, "_D.PHD");
|
||||
map.put("gasFileName", gasFileName);
|
||||
map.put("detaFileName", detaFileName);
|
||||
map.put("sampleSystemType", systemType);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -554,18 +541,11 @@ public class PHDFileUtil {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换文件路径
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
//获取路径下所有文件信息
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
//根据文件名称 分别获取 sample gas det文件
|
||||
List<FTPFile> files = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(files)){
|
||||
FTPFile ftpFile = files.get(0);
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -631,18 +611,11 @@ public class PHDFileUtil {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换文件路径
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
//获取路径下所有文件信息
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
//根据文件名称 分别获取 sample gas det文件
|
||||
List<FTPFile> files = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(files)){
|
||||
FTPFile ftpFile = files.get(0);
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -763,18 +736,11 @@ public class PHDFileUtil {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换文件路径
|
||||
ftpClient.changeWorkingDirectory(path);
|
||||
//获取路径下所有文件信息
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
//根据文件名称 分别获取 sample gas det文件
|
||||
List<FTPFile> files = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(files)){
|
||||
FTPFile ftpFile = files.get(0);
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -837,18 +803,13 @@ public class PHDFileUtil {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
@ -24,8 +24,8 @@ public class GammaController {
|
|||
|
||||
@GetMapping("initValue")
|
||||
@ApiOperation(value = "初始化gamma数据", notes = "初始化gamma数据")
|
||||
public Result initValue(Integer sampleId, String dbName) {
|
||||
return gammaService.initValue(sampleId, dbName);
|
||||
public Result initValue(Integer sampleId, String dbName, HttpServletRequest request) {
|
||||
return gammaService.initValue(sampleId, dbName, request);
|
||||
}
|
||||
|
||||
@GetMapping("gammaByDB")
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package org.jeecg.modules.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sse")
|
||||
public class SSEController {
|
||||
private static Map<String, SseEmitter> sseCache = new ConcurrentHashMap<>();
|
||||
|
||||
@GetMapping("subscribe")
|
||||
public SseEmitter subscribe(String id) {
|
||||
// 超时时间设置为1小时
|
||||
SseEmitter sseEmitter = new SseEmitter(3600_000L);
|
||||
sseCache.put(id, sseEmitter);
|
||||
sseEmitter.onTimeout(() -> sseCache.remove(id));
|
||||
sseEmitter.onCompletion(() -> System.out.println("完成!!!"));
|
||||
return sseEmitter;
|
||||
}
|
||||
|
||||
@GetMapping("push")
|
||||
public String push(String id, String content) throws IOException {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.send(content);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
@GetMapping("over")
|
||||
public String over(String id) {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.complete();
|
||||
sseCache.remove(id);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
}
|
|
@ -46,11 +46,6 @@ public class SpectrumAnalysesController {
|
|||
return spectrumAnalysisService.getDBSpectrumList(queryRequest, gardsSampleData, dbName, menuTypes, AllUsers, CollectStopB, AcqStartB, startDate, endDate, request);
|
||||
}
|
||||
|
||||
@GetMapping("getSpectrumFiles")
|
||||
public Result getSpectrumFiles(HttpServletRequest request) {
|
||||
return spectrumAnalysisService.getSpectrumFiles(request);
|
||||
}
|
||||
|
||||
@GetMapping("getFilesBySampleFile")
|
||||
@ApiOperation(value = "根据sampleFile查询出关联的文件信息", notes = "根据sampleFile查询出关联的文件信息")
|
||||
public Result getFilesBySampleFile(String fileName, HttpServletRequest request) {
|
||||
|
@ -59,8 +54,8 @@ public class SpectrumAnalysesController {
|
|||
|
||||
@GetMapping("getDBSpectrumChart")
|
||||
@ApiOperation(value = "查询折线图相关信息接口", notes = "查询折线图相关信息接口")
|
||||
public Result getDBSpectrumChart(String dbName, Integer sampleId) {
|
||||
return spectrumAnalysisService.getDBSpectrumChart(dbName, sampleId);
|
||||
public Result getDBSpectrumChart(String dbName, Integer sampleId, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.getDBSpectrumChart(dbName, sampleId, request);
|
||||
}
|
||||
|
||||
@GetMapping("getFileSpectrumChart")
|
||||
|
|
|
@ -231,8 +231,32 @@ public class BgDataAnlyseResultIn implements Serializable {
|
|||
|
||||
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationSCE;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationSEC;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationGCE;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationGEC;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationDCE;
|
||||
|
||||
GardsCalibrationSpectrum gammaCalibrationDEC;
|
||||
|
||||
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationSCE;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationSEC;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationGCE;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationGEC;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationDCE;
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationDEC;
|
||||
|
||||
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList;
|
||||
|
||||
List<GardsROIResultsSpectrum> roiResultsSpectrumList;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsAnalyses;
|
||||
import org.jeecg.modules.entity.GardsAnalysesSpectrum;
|
||||
|
||||
public interface GardsAnalysesManMapper extends BaseMapper<GardsAnalyses> {
|
||||
|
||||
void updateEntity(GardsAnalysesSpectrum analyses);
|
||||
void updateEntity(@Param(value = "analyses") GardsAnalysesSpectrum analyses);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
package org.jeecg.modules.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsCalibration;
|
||||
|
||||
public interface GardsCalibrationSpectrumMapper extends BaseMapper<GardsCalibration> {
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
void insertCalibrationGamma(@Param(value = "calibration") GardsCalibration calibration);
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public interface SpectrumAnalysisMapper {
|
|||
|
||||
Page<GardsSampleDataSpectrum> getDBSpectrumList(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers);
|
||||
|
||||
SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId);
|
||||
SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID);
|
||||
|
||||
List<GardsXeResultsSpectrum> getXeDataList(Integer sampleId);
|
||||
|
||||
|
@ -56,7 +56,7 @@ public interface SpectrumAnalysisMapper {
|
|||
|
||||
String getStatus(@Param(value = "sampleId") Integer sampleId);
|
||||
|
||||
GardsAnalysesSpectrum getAnalysis(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId);
|
||||
GardsAnalysesSpectrum getAnalysis(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId, @Param(value = "userName") String userName);
|
||||
|
||||
List<GardsPeaksSpectrum> getPeaks(@Param(value = "dbName") String dbName, @Param(value = "idAnalysis") Integer idAnalysis);
|
||||
|
||||
|
@ -78,7 +78,7 @@ public interface SpectrumAnalysisMapper {
|
|||
|
||||
List<String> UserNuclide(@Param(value = "systemType") String systemType, @Param(value = "userName") String userName);
|
||||
|
||||
Integer getAnalysisID(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId);
|
||||
Integer getAnalysisID(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId, @Param(value = "userName") String userName);
|
||||
|
||||
List<GardsCalibrationPairsSpectrum> ReadGammaFitChannelEnergy(@Param(value = "idAnalysis") Integer idAnalysis, @Param(value = "sampleId") Integer sampleId);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<update id="updateEntity">
|
||||
UPDATE
|
||||
RNMAN.GARDS_ANALYSES
|
||||
SET ANALYSISBEGIN = to_date(#{analyses.analysisBeginStr},'yyyy/MM/dd HH:mm:ss'),
|
||||
ANALYSISEND = to_date(#{analyses.analysisEndStr},'yyyy/MM/dd HH:mm:ss'),
|
||||
SET ANALYSISBEGIN = to_date(#{analyses.analysisBeginStr},'yyyy/MM/dd HH:mi:ss'),
|
||||
ANALYSISEND = to_date(#{analyses.analysisEndStr},'yyyy/MM/dd HH:mi:ss'),
|
||||
SOFTWARE = #{analyses.software},
|
||||
SWVERSION = #{analyses.swVersion},
|
||||
COMMENTS = #{analyses.comments},
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<?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.mapper.GardsCalibrationSpectrumMapper">
|
||||
|
||||
<insert id="insertCalibrationGamma">
|
||||
INSERT INTO
|
||||
RNMAN.GARDS_CALIBRATION(
|
||||
SAMPLE_ID,
|
||||
IDANALYSIS,
|
||||
SAMPLE_TYPE,
|
||||
CALTYPE,
|
||||
FUNCTION,
|
||||
FUNCTIONDEF,
|
||||
STARTOFRANGE,
|
||||
ENDOFRANGE,
|
||||
COEFF_STRING)
|
||||
VALUES(#{calibration.sampleId},
|
||||
#{calibration.idAnalysis},
|
||||
#{calibration.sampleType},
|
||||
#{calibration.calType},
|
||||
#{calibration.function},
|
||||
#{calibration.functionDef},
|
||||
#{calibration.startOfRange},
|
||||
#{calibration.endOfRange},
|
||||
#{calibration.coeffString})
|
||||
|
||||
</insert>
|
||||
|
||||
</mapper>
|
|
@ -123,6 +123,7 @@
|
|||
${dbName}.GARDS_ANALYSES analyses
|
||||
<where>
|
||||
analyses.SAMPLE_ID = #{sampleId}
|
||||
AND analyses.IDANALYSIS = #{analysisID}
|
||||
AND org_sample.SAMPLE_ID=analyses.SAMPLE_ID
|
||||
</where>
|
||||
</select>
|
||||
|
@ -379,6 +380,7 @@
|
|||
FROM
|
||||
${dbName}
|
||||
WHERE SAMPLE_ID = #{sampleId}
|
||||
and ANALYST = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="getPeaks" resultType="org.jeecg.modules.entity.GardsPeaksSpectrum">
|
||||
|
@ -492,7 +494,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getAnalysisID" resultType="java.lang.Integer">
|
||||
SELECT ANALYSIS_DB.IDANALYSIS FROM ${dbName}.GARDS_ANALYSES ANALYSIS_DB WHERE ANALYSIS_DB.SAMPLE_ID = #{sampleId}
|
||||
SELECT ANALYSIS_DB.IDANALYSIS FROM ${dbName}.GARDS_ANALYSES ANALYSIS_DB WHERE ANALYSIS_DB.SAMPLE_ID = #{sampleId} and ANALYST = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="ReadGammaFitChannelEnergy" resultType="org.jeecg.modules.entity.GardsCalibrationPairsSpectrum">
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
|
||||
public interface IGammaService{
|
||||
|
||||
Result initValue(Integer sampleId, String dbName);
|
||||
Result initValue(Integer sampleId, String dbName, HttpServletRequest request);
|
||||
|
||||
Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request);
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ import org.jeecg.modules.entity.vo.PHDFile;
|
|||
|
||||
public interface IGardsAnalySettingSpectrumService extends IService<GardsAnalySetting> {
|
||||
|
||||
boolean saveAnalySettingGamma(PHDFile phd, String idAnalysis);
|
||||
int saveAnalySettingGamma(PHDFile phd, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@ public interface IGardsCalibrationPairsSpectrumService extends IService<GardsCal
|
|||
|
||||
int saveGardsCalibrationPairs(List<GardsCalibrationPairs> calibrationPairsList);
|
||||
|
||||
boolean saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
int saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@ public interface IGardsCalibrationSpectrumService extends IService<GardsCalibrat
|
|||
|
||||
int saveGardsCalibration(List<GardsCalibration> calibrationPairsList);
|
||||
|
||||
boolean saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
int saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessData;
|
|||
|
||||
public interface IGardsNuclIdedSpectrumService extends IService<GardsNuclIded> {
|
||||
|
||||
boolean saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
int saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessData;
|
|||
|
||||
public interface IGardsNuclLinesIdedSpectrumService extends IService<GardsNuclLinesIded> {
|
||||
|
||||
boolean saveNuclLinesIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
int saveNuclLinesIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessData;
|
|||
|
||||
public interface IGardsPeaksSpectrumService extends IService<GardsPeaks> {
|
||||
|
||||
boolean savePeaksGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
int savePeaksGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ import org.jeecg.modules.entity.vo.PHDFile;
|
|||
|
||||
public interface IGardsQcCheckSpectrumService extends IService<GardsQcCheck> {
|
||||
|
||||
boolean saveQcCheckGamma(GStoreMiddleProcessData middleData, PHDFile phd, String idAnalysis);
|
||||
int saveQcCheckGamma(GStoreMiddleProcessData middleData, PHDFile phd, String idAnalysis);
|
||||
|
||||
}
|
||||
|
|
|
@ -18,11 +18,9 @@ public interface ISpectrumAnalysisService {
|
|||
|
||||
Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleDataSpectrum gardsSampleData, String dbName, String[] menuTypes, boolean AllUsers, boolean CollectStopB, boolean AcqStartB, Date startDate, Date endDate, HttpServletRequest request);
|
||||
|
||||
Result getSpectrumFiles(HttpServletRequest request);
|
||||
|
||||
Result getFilesBySampleFile(String fileName, HttpServletRequest request);
|
||||
|
||||
Result getDBSpectrumChart(String dbName, Integer sampleId);
|
||||
Result getDBSpectrumChart(String dbName, Integer sampleId, HttpServletRequest request);
|
||||
|
||||
Result getFileSpectrumChart(String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request);
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.apache.commons.io.FileUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.google.common.cache.Cache;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.apache.commons.net.ftp.FTPFile;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.cache.LocalCache;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
|
@ -30,7 +29,6 @@ import org.jeecg.modules.entity.vo.*;
|
|||
import org.jeecg.modules.entity.*;
|
||||
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.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -77,8 +75,6 @@ public class GammaServiceImpl implements IGammaService {
|
|||
private SpectrumPathProperties spectrumPathProperties;
|
||||
@Autowired
|
||||
private FTPUtil ftpUtil;
|
||||
@Autowired
|
||||
private SSEUtil sseUtil;
|
||||
@Value("${ZeroTime}")
|
||||
private String ZeroTimeStr;
|
||||
@Autowired
|
||||
|
@ -115,8 +111,9 @@ public class GammaServiceImpl implements IGammaService {
|
|||
private IGardsAnalySettingSpectrumService analySettingSpectrumService;
|
||||
|
||||
@Override
|
||||
public Result initValue(Integer sampleId, String dbName) {
|
||||
public Result initValue(Integer sampleId, String dbName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||
PHDFile phd = new PHDFile();
|
||||
//读取文件内容
|
||||
|
@ -135,7 +132,7 @@ public class GammaServiceImpl implements IGammaService {
|
|||
//声明基础数组信息
|
||||
gammaFileUtil.SetBaseInfo(phd);
|
||||
//从数据库中读取相关信息
|
||||
boolean bRet = gammaFileUtil.getResultFromDB(dbName, sampleId, phd, result);
|
||||
boolean bRet = gammaFileUtil.getResultFromDB(dbName, userName, sampleId, phd, result);
|
||||
if (!bRet){
|
||||
return result;
|
||||
}
|
||||
|
@ -169,7 +166,7 @@ public class GammaServiceImpl implements IGammaService {
|
|||
//声明基础数组信息
|
||||
gammaFileUtil.SetBaseInfo(phd);
|
||||
//从数据库中读取相关信息
|
||||
boolean bRet = gammaFileUtil.getResultFromDB(dbName, sampleId, phd, result);
|
||||
boolean bRet = gammaFileUtil.getResultFromDB(dbName, userName, sampleId, phd, result);
|
||||
if (!bRet){
|
||||
return result;
|
||||
}
|
||||
|
@ -205,7 +202,10 @@ public class GammaServiceImpl implements IGammaService {
|
|||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||
PHDFile phd = new PHDFile();
|
||||
//加载文件内容
|
||||
gammaFileUtil.loadFile(path, fileName, phd, result);
|
||||
boolean bRet = gammaFileUtil.loadFile(path, fileName, phd, result);
|
||||
if (!bRet) {
|
||||
return result;
|
||||
}
|
||||
//获取当前角色的颜色配置
|
||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||
// 更新 ‘QC Flags’ 状态
|
||||
|
@ -2113,7 +2113,7 @@ public class GammaServiceImpl implements IGammaService {
|
|||
if(StringUtils.isBlank(reportPath.trim())) {
|
||||
String waring = "The file isn't existed.";
|
||||
}
|
||||
String pathName = reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt";
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
|
@ -2129,16 +2129,9 @@ public class GammaServiceImpl implements IGammaService {
|
|||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
pathName=StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + pathName;
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
throw new RuntimeException("ftp下对应的报告文件不存在");
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
|
@ -2176,7 +2169,7 @@ public class GammaServiceImpl implements IGammaService {
|
|||
if(StringUtils.isBlank(reportPath.trim())) {
|
||||
String waring = "The file isn't existed.";
|
||||
}
|
||||
String pathName = reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt";
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
|
@ -2192,16 +2185,9 @@ public class GammaServiceImpl implements IGammaService {
|
|||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
pathName=StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + pathName;
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
throw new RuntimeException("ftp下对应的报告文件不存在");
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//设置响应类型
|
||||
response.setContentType("application/octet-stream");
|
||||
//解决中文不能生成文件
|
||||
|
@ -2721,7 +2707,7 @@ public class GammaServiceImpl implements IGammaService {
|
|||
if (StringUtils.isBlank(logPath)){
|
||||
String waring = "The file isn't existed.";
|
||||
}
|
||||
String pathName = logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH));
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1);
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
|
@ -2737,16 +2723,9 @@ public class GammaServiceImpl implements IGammaService {
|
|||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
pathName=StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + pathName;
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
throw new RuntimeException("ftp下对应的报告文件不存在");
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
|
@ -2919,42 +2898,18 @@ public class GammaServiceImpl implements IGammaService {
|
|||
spectrumAnalysisMapper.deleteAnalySetting(Integer.valueOf(idAnalysis));
|
||||
}
|
||||
// 向 RNMAN.GARDS_CALIBRATION_PAIRS 表写入 Energy 刻度数据对
|
||||
bRet = calibrationPairsSpectrumService.saveGardsCalibrationPairsGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
bRet = calibrationSpectrumService.saveCalibrationGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
calibrationPairsSpectrumService.saveGardsCalibrationPairsGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
calibrationSpectrumService.saveCalibrationGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
// 向 RNMAN.GARDS_PEAKS 表写入峰信息
|
||||
bRet = peaksSpectrumService.savePeaksGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
peaksSpectrumService.savePeaksGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
// 向 RNMAN.GARDS_NUCL_LINES_IDED 表写入被识别核素的射线信息
|
||||
bRet = nuclLinesIdedSpectrumService.saveNuclLinesIdedGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
nuclLinesIdedSpectrumService.saveNuclLinesIdedGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
// 向 RNMAN.GARDS_NUCL_IDED 表写入被识别核素的活度浓度信息
|
||||
bRet = nuclIdedSpectrumService.saveNuclIdedGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
nuclIdedSpectrumService.saveNuclIdedGamma(middleData, Integer.valueOf(phd.getId_sample()), idAnalysis);
|
||||
// 向 RNMAN.GARDS_QC_CHECK 表写入 QC 检查结果
|
||||
bRet = qcCheckSpectrumService.saveQcCheckGamma(middleData, phd, idAnalysis);
|
||||
if (!bRet) {
|
||||
result.error500("Save analysis results to DB failed.");
|
||||
return result;
|
||||
}
|
||||
qcCheckSpectrumService.saveQcCheckGamma(middleData, phd, idAnalysis);
|
||||
// 向 RNMAN.GARDS_ANALY_SETTING 表写入 SpecSetup 分析参数设置
|
||||
bRet = analySettingSpectrumService.saveAnalySettingGamma(phd, idAnalysis);
|
||||
analySettingSpectrumService.saveAnalySettingGamma(phd, idAnalysis);
|
||||
if(bRet) {
|
||||
phd.setStatus("R");
|
||||
List<String> paths=new LinkedList<>();
|
||||
|
|
|
@ -15,8 +15,7 @@ public class GardsAnalySettingSpectrumServiceImpl extends ServiceImpl<GardsAnaly
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveAnalySettingGamma(PHDFile phd, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
public int saveAnalySettingGamma(PHDFile phd, String idAnalysis) {
|
||||
GardsAnalySetting analySetting = new GardsAnalySetting();
|
||||
analySetting.setIdanalysis(Integer.valueOf(idAnalysis));
|
||||
analySetting.setSampleId(Integer.valueOf(phd.getId_sample()));
|
||||
|
@ -36,10 +35,7 @@ public class GardsAnalySettingSpectrumServiceImpl extends ServiceImpl<GardsAnaly
|
|||
analySetting.setReftimeAct(phd.getUsedSetting().getRefTime_act());
|
||||
analySetting.setReftimeConc(phd.getUsedSetting().getRefTime_conc());
|
||||
int insert = this.baseMapper.insert(analySetting);
|
||||
if (insert>0){
|
||||
bRet = true;
|
||||
}
|
||||
return bRet;
|
||||
return insert;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ public class GardsCalibrationPairsSpectrumServiceImpl extends ServiceImpl<GardsC
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
public int saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
List<GardsCalibrationPairs> calibrationPairsList = new LinkedList<>();
|
||||
// 向 RNMAN.GARDS_CALIBRATION_PAIRS 表写入 Energy 刻度数据对
|
||||
int t_size = middleData.calibration_pairs_E_idCalPoint.size();
|
||||
|
@ -108,8 +107,8 @@ public class GardsCalibrationPairsSpectrumServiceImpl extends ServiceImpl<GardsC
|
|||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(calibrationPairsList)) {
|
||||
bRet = this.saveBatch(calibrationPairsList);
|
||||
this.saveBatch(calibrationPairsList);
|
||||
}
|
||||
return bRet;
|
||||
return calibrationPairsList.size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ public class GardsCalibrationSpectrumServiceImpl extends ServiceImpl<GardsCalibr
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
public int saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
List<GardsCalibration> calibrationList = new LinkedList<>();
|
||||
int t_size = middleData.calibration_pairs_E_idCalPoint.size();
|
||||
if (t_size>0){
|
||||
|
@ -96,8 +95,10 @@ public class GardsCalibrationSpectrumServiceImpl extends ServiceImpl<GardsCalibr
|
|||
calibrationList.add(calibration);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(calibrationList)) {
|
||||
bRet = this.saveBatch(calibrationList);
|
||||
for (GardsCalibration calibration:calibrationList) {
|
||||
this.baseMapper.insertCalibrationGamma(calibration);
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
return calibrationList.size();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,7 @@ public class GardsNuclIdedSpectrumServiceImpl extends ServiceImpl<GardsNuclIdedS
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
public int saveNuclIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
List<GardsNuclIded> nuclIdedList = new LinkedList<>();
|
||||
int t_size = middleData.nucl_ided_Nuclidename.size();
|
||||
if(t_size > 0){
|
||||
|
@ -51,9 +50,9 @@ public class GardsNuclIdedSpectrumServiceImpl extends ServiceImpl<GardsNuclIdedS
|
|||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(nuclIdedList)) {
|
||||
bRet = this.saveBatch(nuclIdedList);
|
||||
this.saveBatch(nuclIdedList);
|
||||
}
|
||||
return bRet;
|
||||
return nuclIdedList.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,8 +21,7 @@ public class GardsNuclLinesIdedSpectrumServiceImpl extends ServiceImpl<GardsNucl
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveNuclLinesIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
public int saveNuclLinesIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
Map<String, GStoreMiddleProcessDataNuclLinesIded> map = middleData.nucl_lines_ided_data;
|
||||
List<GardsNuclLinesIded> nuclLinesIdedList = new LinkedList<>();
|
||||
for(String key: map.keySet()){
|
||||
|
@ -55,7 +54,7 @@ public class GardsNuclLinesIdedSpectrumServiceImpl extends ServiceImpl<GardsNucl
|
|||
if (CollectionUtils.isNotEmpty(nuclLinesIdedList)) {
|
||||
this.saveBatch(nuclLinesIdedList);
|
||||
}
|
||||
return bRet;
|
||||
return nuclLinesIdedList.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl<GardsPeaksSpectru
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean savePeaksGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
public int savePeaksGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) {
|
||||
List<GardsPeaks> peaksList = new LinkedList<>();
|
||||
int t_size = middleData.peaks_idPeak.size();
|
||||
if(t_size > 0){
|
||||
|
@ -30,13 +30,13 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl<GardsPeaksSpectru
|
|||
peaks.setIdAnalysis(Integer.valueOf(idAnalysis));
|
||||
peaks.setIdPeak(Integer.valueOf(middleData.peaks_idPeak.get(i)));
|
||||
peaks.setCentroidChannel(Double.valueOf(middleData.peaks_peakCentroid.get(i)));
|
||||
peaks.setUncCentroidChannel(Double.valueOf(middleData.peaks_uncpeakCentroid.get(i)));
|
||||
peaks.setUncCentroidChannel(null);
|
||||
peaks.setEnergy(Double.valueOf(middleData.peaks_Energy.get(i)));
|
||||
peaks.setUncEnergy(Double.valueOf(middleData.peaks_uncEnergy.get(i)));
|
||||
peaks.setUncEnergy(null);
|
||||
peaks.setArea(Double.valueOf(middleData.peaks_Area.get(i)));
|
||||
peaks.setUncArea(Double.valueOf(middleData.peaks_areaErr.get(i)));
|
||||
peaks.setEfficiency(Double.valueOf(middleData.peaks_Efficiency.get(i)));
|
||||
peaks.setUncefficiency(Double.valueOf(middleData.peaks_Uncefficiency.get(i)));
|
||||
peaks.setUncefficiency(null);
|
||||
peaks.setFwhm(Double.valueOf(middleData.peaks_Fwhm.get(i)));
|
||||
peaks.setFwtm(Double.valueOf(middleData.peaks_Fwhmc.get(i)));
|
||||
peaks.setSignificance(Double.valueOf(middleData.peaks_Significance.get(i)));
|
||||
|
@ -65,7 +65,7 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl<GardsPeaksSpectru
|
|||
if (CollectionUtils.isNotEmpty(peaksList)) {
|
||||
this.saveBatch(peaksList);
|
||||
}
|
||||
return false;
|
||||
return peaksList.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsQcCheck;
|
||||
import org.jeecg.modules.entity.vo.GStoreMiddleProcessData;
|
||||
|
@ -21,25 +22,25 @@ public class GardsQcCheckSpectrumServiceImpl extends ServiceImpl<GardsQcCheckSpe
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveQcCheckGamma(GStoreMiddleProcessData middleData, PHDFile phd, String idAnalysis) {
|
||||
boolean bRet = false;
|
||||
|
||||
public int saveQcCheckGamma(GStoreMiddleProcessData middleData, PHDFile phd, String idAnalysis) {
|
||||
int t_size = phd.getQcItems().size();
|
||||
if(t_size > 0){
|
||||
List<GardsQcCheckSpectrum> qcCheckList = new LinkedList<>();
|
||||
List<GardsQcCheck> qcCheckList = new LinkedList<>();
|
||||
if(t_size > 0) {
|
||||
for (int i=0; i<t_size; i++){
|
||||
GardsQcCheckSpectrum qcCheck = new GardsQcCheckSpectrum();
|
||||
GardsQcCheck qcCheck = new GardsQcCheck();
|
||||
qcCheck.setSampleId(Integer.valueOf(phd.getId_sample()));
|
||||
qcCheck.setIdanalysis(Integer.valueOf(idAnalysis));
|
||||
qcCheck.setQcName(middleData.QC_CHECK_QC_NAME.get(i));
|
||||
qcCheck.setQcValue(Double.valueOf(middleData.QC_CHECK_QC_VALUE.get(i)));
|
||||
qcCheck.setQcStandard(middleData.QC_CHECK_QC_STANDARD.get(i));
|
||||
qcCheck.setQcResult(Integer.valueOf(middleData.QC_CHECK_QC_RESULT.get(i)));
|
||||
qcCheck.setQcResult(Double.valueOf(middleData.QC_CHECK_QC_RESULT.get(i)).intValue());
|
||||
qcCheckList.add(qcCheck);
|
||||
}
|
||||
}
|
||||
|
||||
return bRet;
|
||||
if (CollectionUtils.isNotEmpty(qcCheckList)) {
|
||||
this.saveBatch(qcCheckList);
|
||||
}
|
||||
return qcCheckList.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ public class GardsSampleAuxSpectrumServiceImpl extends ServiceImpl<GardsSampleAu
|
|||
sampleAux.setGasBkgdMeasurementId(phd.getHeader().getGas_bk_measurement_id());
|
||||
sampleAux.setSampleHeight(phd.getSampleBlock().getDimension_2());
|
||||
sampleAux.setSampleDiameter(phd.getSampleBlock().getDimension_1());
|
||||
sampleAux.setCalibrationDtg(DateUtils.parseDate(calibTime));
|
||||
sampleAux.setCalibrationDtg(StringUtils.isNotBlank(calibTime)?DateUtils.parseDate(calibTime):null);
|
||||
sampleAux.setMsgId(phd.getMsgInfo().getMsg_id());
|
||||
sampleAux.setArchiveBottleId(phd.getProcess().getArchive_bottle_id());
|
||||
sampleAux.setXeVolume(phd.getProcess().getSample_volume_of_Xe());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleCert;
|
||||
|
@ -44,7 +45,7 @@ public class GardsSampleCertSpectrumServiceImpl extends ServiceImpl<GardsSampleC
|
|||
GardsSampleCert sampleCert = new GardsSampleCert();
|
||||
sampleCert.setSampleId(sampleId);
|
||||
sampleCert.setQuantity(phd.getCertificate().getTotal_source_activity());
|
||||
sampleCert.setAssayDate(DateUtils.parseDate(assay_date));
|
||||
sampleCert.setAssayDate(StringUtils.isNotBlank(assay_date)?DateUtils.parseDate(assay_date):null);
|
||||
sampleCert.setUnit(phd.getCertificate().getUnits_activity());
|
||||
insert = this.baseMapper.insert(sampleCert);
|
||||
} catch (ParseException e) {
|
||||
|
|
|
@ -213,42 +213,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getSpectrumFiles(HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
String filePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName;
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
if (Objects.isNull(ftpClient)){
|
||||
result.error500("ftp连接失败");
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
|
||||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换工作路径
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
result.setSuccess(true);
|
||||
result.setResult(ftpFiles);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (Objects.nonNull(ftpClient)) {
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getFilesBySampleFile(String fileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
|
@ -333,28 +297,31 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result getDBSpectrumChart(String dbName, Integer sampleId) {
|
||||
public Result getDBSpectrumChart(String dbName, Integer sampleId, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
if (Objects.isNull(sampleId)){
|
||||
result.error500("请选择一条数据");
|
||||
return result;
|
||||
}
|
||||
Integer analysisID = null;
|
||||
if (dbName.equalsIgnoreCase("auto")){
|
||||
dbName = "RNAUTO";
|
||||
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId);
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", idAnalysis, sampleId);
|
||||
userName = "RNAUTO";
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId, "RNAUTO");
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", analysisID, sampleId);
|
||||
}else if (dbName.equalsIgnoreCase("man")){
|
||||
dbName = "RNMAN";
|
||||
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNMAN", sampleId);
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNMAN", idAnalysis, sampleId);
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID("RNMAN", sampleId, userName);
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNMAN", analysisID, sampleId);
|
||||
}else {
|
||||
result.error500("数据库类型不存在");
|
||||
return result;
|
||||
}
|
||||
//查询数据库文件信息
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID);
|
||||
List<String> filePath = new LinkedList<>();
|
||||
if (Objects.nonNull(dbSpectrumFilePath)) {
|
||||
Map<String, Object> sampleMap = new HashMap<>();
|
||||
|
@ -376,8 +343,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
GardsSampleData gasBg = spectrumAnalysisMapper.findSampleByFilePath(gasBgFilePath);
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + gasBgFilePath.substring(0, gasBgFilePath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = gasBgFilePath.substring(gasBgFilePath.lastIndexOf(StringPool.SLASH)+1);
|
||||
gasBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, gasBg.getSampleId(), gasBg.getStatus());
|
||||
resultMap.put("gasBg",gasBgMap);
|
||||
if (Objects.nonNull(gasBg)) {
|
||||
gasBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, gasBg.getSampleId(), gasBg.getStatus());
|
||||
resultMap.put("gasBg",gasBgMap);
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(dbSpectrumFilePath.getDetBgFilePath())){
|
||||
String detBgFilePath = dbSpectrumFilePath.getDetBgFilePath();
|
||||
|
@ -385,8 +354,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
GardsSampleData detBg = spectrumAnalysisMapper.findSampleByFilePath(detBgFilePath);
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + detBgFilePath.substring(0, detBgFilePath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = detBgFilePath.substring(detBgFilePath.lastIndexOf(StringPool.SLASH)+1);
|
||||
detBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, detBg.getSampleId(), detBg.getStatus());
|
||||
resultMap.put("detBg",detBgMap);
|
||||
if (Objects.nonNull(detBg)) {
|
||||
detBgMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, detBg.getSampleId(), detBg.getStatus());
|
||||
resultMap.put("detBg",detBgMap);
|
||||
}
|
||||
}
|
||||
String collectStartStr = DateUtils.formatDate(dbSpectrumFilePath.getCollectStart(), "yyyy/MM/dd HH:mm:ss");
|
||||
String dbQcFilePath = spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr);
|
||||
|
@ -396,8 +367,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
GardsSampleData qc = spectrumAnalysisMapper.findSampleByFilePath(dbQcFilePath);
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbQcFilePath.substring(0, dbQcFilePath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = dbQcFilePath.substring(dbQcFilePath.lastIndexOf(StringPool.SLASH)+1);
|
||||
qcMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, qc.getSampleId(), qc.getStatus());
|
||||
resultMap.put("qc",qcMap);
|
||||
if (Objects.nonNull(qc)) {
|
||||
qcMap = this.fenxi(pathName, fileName, xeResultsSpectrumList, qc.getSampleId(), qc.getStatus());
|
||||
resultMap.put("qc",qcMap);
|
||||
}
|
||||
}
|
||||
phdFileUtil.getLightColor(sampleMap,gasBgMap,detBgMap,qcMap);
|
||||
resultMap.put("bProcessed", false);
|
||||
|
@ -467,14 +440,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
throw new RuntimeException("ftp查询文件内容失败");
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -551,15 +518,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
result.error500("ftp下对应文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -595,7 +555,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (StringUtils.isBlank(reportPath)){
|
||||
throw new RuntimeException("自动处理程序生成报告不存在!");
|
||||
}
|
||||
String pathName = reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String pathName = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
|
||||
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt";
|
||||
//连接ftp
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
|
@ -611,16 +571,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
// 设置编码,当文件中存在中文且上传后文件乱码时可使用此配置项
|
||||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
pathName=StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + pathName;
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
throw new RuntimeException("ftp下对应的报告文件不存在");
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
|
@ -665,14 +618,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (StringUtils.isNotBlank(rrrLogInfo.getDbName()) && Objects.nonNull(rrrLogInfo.getSampleId())) {
|
||||
String dbName = rrrLogInfo.getDbName();
|
||||
Integer sampleId = rrrLogInfo.getSampleId();
|
||||
Integer analysisID = null;
|
||||
//GetAnalysisID sample_id
|
||||
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);
|
||||
}
|
||||
Integer analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID);
|
||||
if (Objects.nonNull(dbSpectrumFilePath)){
|
||||
sampleFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH));
|
||||
gasFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH));
|
||||
|
@ -886,12 +841,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
Map<String, List<String>> map = new HashMap<>();
|
||||
SpectrumFileRecord dbSpectrumFilePath = new SpectrumFileRecord();
|
||||
if (Objects.nonNull(sampleId) && StringUtils.isNotBlank(dbName)) {
|
||||
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);
|
||||
}
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID);
|
||||
}
|
||||
if(StringUtils.isNotBlank(sampleFileName)) {
|
||||
String sampleFilePath = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName + StringPool.SLASH + sampleFileName;
|
||||
|
@ -955,15 +913,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(pathName);
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
ftpFiles=ftpFiles.stream().filter(item -> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(ftpFiles)){
|
||||
result.error500("ftp下对应的文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile ftpFile = ftpFiles.get(0);
|
||||
if (Objects.nonNull(ftpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -1012,9 +963,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
strBuffer.append(" Acq Real Time: "+acquisition_real_sec+"\n");
|
||||
strBuffer.append(" Acq Live Time: "+acquisition_live_sec+"\n");
|
||||
strBuffer.append("\n");
|
||||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(strBuffer.toString());
|
||||
}
|
||||
|
@ -1090,12 +1038,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
List<GardsXeResultsSpectrum> xeDataList = new LinkedList<>();
|
||||
//判断是否有sampleId和dbName 如果有则说明数据来源DB
|
||||
if (Objects.nonNull(sampleId) && StringUtils.isNotBlank(dbName)) {
|
||||
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);
|
||||
}
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID);
|
||||
sampleFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH));
|
||||
gasFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH));
|
||||
detFilePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH));
|
||||
|
@ -1239,15 +1190,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
if (StringUtils.isNotBlank(sampleFilePath)){
|
||||
ftpClient.changeWorkingDirectory(sampleFilePath);
|
||||
List<FTPFile> sampleFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
sampleFtpFiles=sampleFtpFiles.stream().filter(item -> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(sampleFtpFiles)){
|
||||
result.error500("ftp下对应的SAMPLE文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile sampleFtpFile = sampleFtpFiles.get(0);
|
||||
if (Objects.nonNull(sampleFtpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFtpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -1356,15 +1300,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(qcPath);
|
||||
List<FTPFile> qcFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
qcFtpFiles=qcFtpFiles.stream().filter(item -> item.getName().equals(qcFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(qcFtpFiles)){
|
||||
result.error500("ftp下对应的QC文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile qcFtpFile = qcFtpFiles.get(0);
|
||||
if (Objects.nonNull(qcFtpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(qcFtpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -1452,6 +1389,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
|
||||
cacheMap.put("Series", oldScatterSeries);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-gamma", cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
|
@ -1506,15 +1444,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(qcPath);
|
||||
List<FTPFile> qcFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
qcFtpFiles=qcFtpFiles.stream().filter(item -> item.getName().equals(qcFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(qcFtpFiles)){
|
||||
result.error500("ftp下对应的QC文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile qcFtpFile = qcFtpFiles.get(0);
|
||||
if (Objects.nonNull(qcFtpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(qcFtpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -1605,6 +1536,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
|
||||
cacheMap.put("Series", oldScatterSeries);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-beta", cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
|
@ -1655,16 +1587,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(samplePathName);
|
||||
List<FTPFile> sampleFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
sampleFtpFiles = sampleFtpFiles.stream().filter(item-> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(sampleFtpFiles)){
|
||||
result.error500("ftp下对应的SAMPLE文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile sampleFtpFile = sampleFtpFiles.get(0);
|
||||
if (Objects.nonNull(sampleFtpFile)){
|
||||
//获取ftp文件的输入流
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFtpFile.getName());
|
||||
//获取ftp文件的输入流
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//ftp文件输入流复制给临时文件
|
||||
|
@ -1809,16 +1734,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
List<FTPFile> sampleFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
sampleFtpFiles = sampleFtpFiles.stream().filter(item-> item.getName().equals(sampleFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(sampleFtpFiles)){
|
||||
result.error500("ftp下对应的SAMPLE文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile sampleFtpFile = sampleFtpFiles.get(0);
|
||||
if (Objects.nonNull(sampleFtpFile)){
|
||||
//获取ftp文件的输入流
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFtpFile.getName());
|
||||
//获取ftp文件的输入流
|
||||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//ftp文件输入流复制给临时文件
|
||||
|
@ -2226,6 +2144,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
|
||||
cacheMap.put("Series", tempPoints);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
} else {
|
||||
|
@ -2283,6 +2202,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
|
||||
cacheMap.put("Series", seriseDataList);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
|
@ -2330,15 +2250,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setControlEncoding("UTF-8");
|
||||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
ftpClient.changeWorkingDirectory(qcPathName);
|
||||
List<FTPFile> qcFtpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
qcFtpFiles=qcFtpFiles.stream().filter(item -> item.getName().equals(qcFileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(qcFtpFiles)){
|
||||
result.error500("ftp下对应的QC文件不存在");
|
||||
return result;
|
||||
}
|
||||
FTPFile qcFtpFile = qcFtpFiles.get(0);
|
||||
if (Objects.nonNull(qcFtpFile)){
|
||||
inputStream = ftpClient.retrieveFileStream(qcFtpFile.getName());
|
||||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
|
@ -2391,7 +2304,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (CollectionUtils.isNotEmpty(sampleIds)){
|
||||
String dbName = analyseData.getDbNames().get(0);
|
||||
Integer sampleId = sampleIds.get(0);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
Integer analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID);
|
||||
if (Objects.nonNull(dbSpectrumFilePath)) {
|
||||
BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName);
|
||||
}
|
||||
|
@ -2401,7 +2315,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
for (int i=0; i<analyseData.getSampleIds().size(); i++) {
|
||||
Integer sampleId = analyseData.getSampleIds().get(i);
|
||||
String dbName = analyseData.getDbNames().get(i);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
Integer analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, userName);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID);
|
||||
m_loadData.put(String.valueOf(sampleId), dbSpectrumFilePath);
|
||||
}
|
||||
BetaGammaAnalyzeAllProcess(m_loadData, analyseData);
|
||||
|
@ -2517,9 +2432,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
@Override
|
||||
public Result analyseCurrentSpectrum(String dbName, Integer sampleId, String sampleFileName, String gasFileName, String detFileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//拼接ftp上传临时文件路径
|
||||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + JwtUtil.getUserNameByToken(request);
|
||||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||
//声明一个实体类获取数据库中文件路径
|
||||
SpectrumFileRecord dbSpectrumFilePath = new SpectrumFileRecord();
|
||||
Integer analysisID = null;
|
||||
|
@ -2530,11 +2446,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(sampleId) && StringUtils.isNotBlank(dbName)){
|
||||
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);
|
||||
}
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId, analysisID);
|
||||
samplePath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH));
|
||||
gasPath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getGasBgFilePath().substring(0, dbSpectrumFilePath.getGasBgFilePath().lastIndexOf(StringPool.SLASH));
|
||||
detPath = StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getDetBgFilePath().substring(0, dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH));
|
||||
|
@ -2585,6 +2502,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
@Override
|
||||
public Result analyseAllSpectrum(List<String> dbNames, List<Integer> sampleIds, List<String> sampleFileNames, List<String> gasFileNames, List<String> detFileNames, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
List<Map<String, Object>> mapList = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(sampleFileNames)) {
|
||||
for (int i=0; i<sampleFileNames.size(); i++) {
|
||||
|
@ -2601,17 +2519,18 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(sampleId) && StringUtils.isNotBlank(dbName)){
|
||||
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);
|
||||
}
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
|
||||
dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId,analysisID);
|
||||
} else if ( (Objects.isNull(sampleId) && StringUtils.isNotBlank(dbName)) || (Objects.nonNull(sampleId) && StringUtils.isBlank(dbName)) ){
|
||||
result.error500("Data load From DB need to pass in sampleId and dbName");
|
||||
return result;
|
||||
}
|
||||
//拼接ftp上传临时文件路径
|
||||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +JwtUtil.getUserNameByToken(request);
|
||||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH +userName;
|
||||
//判断数据库文件路径是否为空 如果为空 就指向ftp上传文件临时路径
|
||||
String samplePath = path;
|
||||
if (StringUtils.isNotBlank(dbSpectrumFilePath.getSampleFilePath())){
|
||||
|
@ -2700,14 +2619,17 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
// getROILimit(anlyseResultIn);
|
||||
//根据sample文件名称模糊查询sampleId
|
||||
if (StringUtils.isNotBlank(anlyseResultIn.getDbName())) {
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
||||
Integer analysisID = null;
|
||||
if (anlyseResultIn.getDbName().equals("auto")) {
|
||||
anlyseResultIn.setDbName("RNAUTO");
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(anlyseResultIn.getDbName(), sampleId, "RNAUTO");
|
||||
} else if (anlyseResultIn.getDbName().equals("man")) {
|
||||
anlyseResultIn.setDbName("RNMAN");
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(anlyseResultIn.getDbName(), sampleId, userName);
|
||||
}
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
||||
if (Objects.nonNull(sampleId)) {
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(anlyseResultIn.getDbName(), sampleId);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(anlyseResultIn.getDbName(), sampleId, analysisID);
|
||||
if (StringUtils.isNotBlank(dbSpectrumFilePath.getSampleFilePath())){
|
||||
anlyseResultIn.setSampleFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)));
|
||||
}
|
||||
|
@ -2719,7 +2641,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
if ( Objects.nonNull(dbSpectrumFilePath.getCollectStart()) && StringUtils.isNotBlank(dbSpectrumFilePath.getSiteDetCode()) ) {
|
||||
String collectStartStr = DateUtils.formatDate(dbSpectrumFilePath.getCollectStart(), "yyyy/MM/dd HH:mm:ss");
|
||||
anlyseResultIn.setQcFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr));
|
||||
String qcFilePath = spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr);
|
||||
anlyseResultIn.setQcFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + qcFilePath.substring(0, qcFilePath.lastIndexOf(StringPool.SLASH)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -2784,7 +2707,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
spectrumAnalysisMapper.insertGardsAnalyses(gardsAnalyses);
|
||||
}
|
||||
//查询analysisId根据sampleId 分析员名称--GARDS_ANALYSES
|
||||
GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis("RNMAN.GARDS_ANALYSES", sampleId);
|
||||
GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis("RNMAN.GARDS_ANALYSES", sampleId, userName);
|
||||
Integer idAnalysis = analysis.getIdAnalysis();
|
||||
//获取sample,gas,det三个文件分别对应的beta,gamma数据集合
|
||||
List<GardsCalibrationPairs> calibrationPairsList = getCalibrationPairs(anlyseResultIn, sampleId, gasId, detId, idAnalysis);
|
||||
|
@ -2897,28 +2820,35 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
Map<String, Object> betaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingPara = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(betaMap)) {
|
||||
betaList = (List<SeriseData>)betaMap.get("Series");
|
||||
betaFittingPara = (List<String>) betaMap.get("fittingPara");
|
||||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(gammaMap)) {
|
||||
gammaList = (List<SeriseData>)gammaMap.get("Series");
|
||||
gammaFittingPara = (List<String>) gammaMap.get("fittingPara");
|
||||
gammaFittingParaToUi = (List<String>) gammaMap.get("fittingParaToUi");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(anlyseResultIn.getDbName())) {
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
||||
Integer analysisID = null;
|
||||
if (anlyseResultIn.getDbName().equals("auto")) {
|
||||
anlyseResultIn.setDbName("RNAUTO");
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(anlyseResultIn.getDbName(), sampleId, "RNAUTO");
|
||||
} else if (anlyseResultIn.getDbName().equals("man")) {
|
||||
anlyseResultIn.setDbName("RNMAN");
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID(anlyseResultIn.getDbName(), sampleId, userName);
|
||||
}
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleIdLikeFileName(anlyseResultIn.getSampleFileName());
|
||||
if (Objects.nonNull(sampleId)) {
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(anlyseResultIn.getDbName(), sampleId);
|
||||
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(anlyseResultIn.getDbName(), sampleId, analysisID);
|
||||
if (StringUtils.isNotBlank(dbSpectrumFilePath.getSampleFilePath())){
|
||||
anlyseResultIn.setSampleFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + dbSpectrumFilePath.getSampleFilePath().substring(0, dbSpectrumFilePath.getSampleFilePath().lastIndexOf(StringPool.SLASH)));
|
||||
}
|
||||
|
@ -2930,7 +2860,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
if ( Objects.nonNull(dbSpectrumFilePath.getCollectStart()) && StringUtils.isNotBlank(dbSpectrumFilePath.getSiteDetCode()) ) {
|
||||
String collectStartStr = DateUtils.formatDate(dbSpectrumFilePath.getCollectStart(), "yyyy/MM/dd HH:mm:ss");
|
||||
anlyseResultIn.setQcFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr));
|
||||
String qcFilePath = spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr);
|
||||
anlyseResultIn.setQcFilePath(StringPool.SLASH + spectrumPathProperties.getRootPath() + StringPool.SLASH + qcFilePath.substring(0, qcFilePath.lastIndexOf(StringPool.SLASH)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -2942,7 +2873,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//处理数据 获取对应的channel/energy值
|
||||
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
||||
//分析文件内容
|
||||
analyzePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara);
|
||||
analyzeSavePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara, betaFittingParaToUi, gammaFittingParaToUi);
|
||||
|
||||
// 返回需要Save的数据
|
||||
return anlyseResultIn;
|
||||
|
@ -3002,6 +2933,18 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
xeResultsDtos.add(xeResultsDto);
|
||||
}
|
||||
|
||||
result.put("gammaCalibrationSCE", anlyseResultIn.getGammaCalibrationSCE());
|
||||
result.put("gammaCalibrationSEC", anlyseResultIn.getGammaCalibrationSEC());
|
||||
result.put("gammaCalibrationGCE", anlyseResultIn.getGammaCalibrationGCE());
|
||||
result.put("gammaCalibrationGEC", anlyseResultIn.getGammaCalibrationGEC());
|
||||
result.put("gammaCalibrationDCE", anlyseResultIn.getGammaCalibrationDCE());
|
||||
result.put("gammaCalibrationDEC", anlyseResultIn.getGammaCalibrationDEC());
|
||||
result.put("betaCalibrationSCE", anlyseResultIn.getBetaCalibrationSCE());
|
||||
result.put("betaCalibrationSEC", anlyseResultIn.getBetaCalibrationSEC());
|
||||
result.put("betaCalibrationGCE", anlyseResultIn.getBetaCalibrationGCE());
|
||||
result.put("betaCalibrationGEC", anlyseResultIn.getBetaCalibrationGEC());
|
||||
result.put("betaCalibrationDCE", anlyseResultIn.getBetaCalibrationDCE());
|
||||
result.put("betaCalibrationDEC", anlyseResultIn.getBetaCalibrationDEC());
|
||||
result.put("roiChannelsS", roiChannelsDtosS);
|
||||
result.put("roiChannelsD", roiChannelsDtosD);
|
||||
result.put("roiChannelsG", roiChannelsDtosG);
|
||||
|
@ -3032,8 +2975,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
// 解析文件,生成导出数据
|
||||
Map<String, Object> analyze = shiftSaveData(getSaveData(anlyseResultIn));
|
||||
// 转换能谱结构数据
|
||||
//EnergySpectrumStruct energySpectrumStruct = phdFileUtil.analyzeFileSourceData(null, null);
|
||||
EnergySpectrumStruct energySpectrumStruct = new EnergySpectrumStruct();
|
||||
EnergySpectrumStruct energySpectrumStruct = phdFileUtil.analyzeFileSourceData(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
ESStructDto esStructDto = new ESStructDto();
|
||||
ClassUtil.copyProperties(energySpectrumStruct, esStructDto);
|
||||
analyze.putAll(BeanUtil.beanToMap(esStructDto));
|
||||
|
@ -3047,7 +2989,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
public void saveToHTML(BgDataAnlyseResultIn anlyseResultIn, HttpServletResponse response) {
|
||||
// 解析文件,生成导出数据
|
||||
Map<String, Object> analyze = exportData(anlyseResultIn);
|
||||
|
||||
// 解析生成Html字符串并导出为Html文件
|
||||
String result = parseHtml(analyze);
|
||||
PrintWriter writer = null;
|
||||
|
@ -3086,6 +3027,23 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
List<ROIChannelsDto> roiChannelsDtosG = (List<ROIChannelsDto>) analyze.get("roiChannelsG");
|
||||
List<ROIResultsDto> roiResultsDtos = (List<ROIResultsDto>) analyze.get("roiResults");
|
||||
List<XeResultsDto> xeResultsDtos = (List<XeResultsDto>) analyze.get("xeResults");
|
||||
GardsCalibrationSpectrum gammaCalibrationSCE = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationSCE");
|
||||
GardsCalibrationSpectrum gammaCalibrationSEC = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationSEC");
|
||||
GardsCalibrationSpectrum gammaCalibrationGCE = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationGCE");
|
||||
GardsCalibrationSpectrum gammaCalibrationGEC = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationGEC");
|
||||
GardsCalibrationSpectrum gammaCalibrationDCE = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationDCE");
|
||||
GardsCalibrationSpectrum gammaCalibrationDEC = (GardsCalibrationSpectrum) analyze.get("gammaCalibrationDEC");
|
||||
|
||||
GardsCalibrationSpectrum betaCalibrationSCE = (GardsCalibrationSpectrum) analyze.get("betaCalibrationSCE");
|
||||
GardsCalibrationSpectrum betaCalibrationSEC = (GardsCalibrationSpectrum) analyze.get("betaCalibrationSEC");
|
||||
GardsCalibrationSpectrum betaCalibrationGCE = (GardsCalibrationSpectrum) analyze.get("betaCalibrationGCE");
|
||||
GardsCalibrationSpectrum betaCalibrationGEC = (GardsCalibrationSpectrum) analyze.get("betaCalibrationGEC");
|
||||
GardsCalibrationSpectrum betaCalibrationDCE = (GardsCalibrationSpectrum) analyze.get("betaCalibrationDCE");
|
||||
GardsCalibrationSpectrum betaCalibrationDEC = (GardsCalibrationSpectrum) analyze.get("betaCalibrationDEC");
|
||||
|
||||
analyze.put("sampleNewCalibration", calibrations(gammaCalibrationSCE, gammaCalibrationSEC, betaCalibrationSCE, betaCalibrationSEC));
|
||||
analyze.put("gasNewCalibration", calibrations(gammaCalibrationGCE, gammaCalibrationGEC, betaCalibrationGCE, betaCalibrationGEC));
|
||||
analyze.put("detNewCalibration", calibrations(gammaCalibrationDCE, gammaCalibrationDEC, betaCalibrationDCE, betaCalibrationDEC));
|
||||
analyze.put("sampleRoi", roiChannels(roiChannelsDtosS));
|
||||
analyze.put("detRoi", roiChannels(roiChannelsDtosD));
|
||||
analyze.put("gasRoi", roiChannels(roiChannelsDtosG));
|
||||
|
@ -3099,9 +3057,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
// 正则表达式,匹配${}中的内容
|
||||
String regex = "\\$\\{([^}]+)}";
|
||||
List<String> newLines = new ArrayList<>();
|
||||
List<String> list = ListUtil.toList("sampleRoi", "detRoi", "gasRoi","grossRoi",
|
||||
List<String> list = ListUtil.toList("sampleNewCalibration","sampleRoi", "detNewCalibration", "detRoi", "gasNewCalibration", "gasRoi","grossRoi",
|
||||
"netRoi", "concRoi", "resultSummary");
|
||||
List<String> skip = ListUtil.toList("${sampleRoi}", "${detRoi}", "${gasRoi}",
|
||||
List<String> skip = ListUtil.toList("${sampleNewCalibration}","${sampleRoi}", "${detNewCalibration}", "${detRoi}", "${gasNewCalibration}", "${gasRoi}",
|
||||
"${grossRoi}", "${netRoi}", "${concRoi}", "${resultSummary}");
|
||||
for (String line : lines) {
|
||||
List<String> fieldNames = ReUtil.findAllGroup1(regex, line);
|
||||
|
@ -3138,6 +3096,21 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
}
|
||||
|
||||
private List<String> calibrations(GardsCalibrationSpectrum gammaCalibrationCE,GardsCalibrationSpectrum gammaCalibrationEC, GardsCalibrationSpectrum betaCalibrationCE, GardsCalibrationSpectrum betaCalibrationEC) {
|
||||
int min = 79;
|
||||
String space = StrUtil.SPACE;
|
||||
List<String> calibrationStrs = new ArrayList<>();
|
||||
String betaCH = " CH(x) = ("+betaCalibrationEC.getCoeff1()+")+("+betaCalibrationEC.getCoeff2()+")*x+("+betaCalibrationEC.getCoeff3()+")x*x";
|
||||
String gammaCH = " CH(x) = ("+gammaCalibrationEC.getCoeff1()+")+("+gammaCalibrationEC.getCoeff2()+")*x+("+gammaCalibrationEC.getCoeff3()+")x*x";
|
||||
String betaE = " E(x) = ("+betaCalibrationCE.getCoeff1()+")+("+betaCalibrationCE.getCoeff2()+")*x+("+betaCalibrationCE.getCoeff3()+")x*x";
|
||||
String gammaE = " E(x) = ("+gammaCalibrationCE.getCoeff1()+")+("+gammaCalibrationCE.getCoeff2()+")*x+("+gammaCalibrationCE.getCoeff3()+")x*x";
|
||||
String calibrationCHStr = StrUtil.padAfter(betaCH, min, space) + StrUtil.padAfter(gammaCH, min, space);
|
||||
String calibrationEStr = StrUtil.padAfter(betaE, min, space) + StrUtil.padAfter(gammaE, min, space);
|
||||
calibrationStrs.add(calibrationCHStr);
|
||||
calibrationStrs.add(calibrationEStr);
|
||||
return calibrationStrs;
|
||||
}
|
||||
|
||||
private List<String> roiChannels(List<ROIChannelsDto> roiChannels){
|
||||
int min = 49;
|
||||
String space = StrUtil.SPACE;
|
||||
|
@ -3323,6 +3296,257 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
}
|
||||
|
||||
public void analyzeSavePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara,List<String> betaFittingParaToUi, List<String> gammaFittingParaToUi) {
|
||||
//根据文件路径 文件名称获取对应的临时文件
|
||||
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
File gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||
File detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||
//加载dll工具库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
//调用动态库解析文件
|
||||
|
||||
//Gamma Energy Calibration页面 如果点击过fitting使BGammaEnergyValid并且有勾选
|
||||
//如果三个sampleData,GasData,DetData数据都是被勾选状态 则需要传递新的参数重新分析 否则不需要改变数据分析当前文件内容
|
||||
BgAnalyseResult bgAnalyseResult = null;
|
||||
if (anlyseResultIn.isCheckSample() && anlyseResultIn.isCheckGas() && anlyseResultIn.isCheckDet()) {
|
||||
bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath());
|
||||
} else {
|
||||
bgAnalyseResult = EnergySpectrumHandler.bgAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath());
|
||||
}
|
||||
List<GardsXeResults> xeResultsSpectrumList = new LinkedList<>();
|
||||
GardsXeResults xe131m = new GardsXeResults();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(bgAnalyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(bgAnalyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(bgAnalyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(bgAnalyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(anlyseResultIn.getXe131mFlag());
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResults xe133 = new GardsXeResults();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(bgAnalyseResult.Xe133_con);
|
||||
xe133.setConcErr(bgAnalyseResult.Xe133_uncer);
|
||||
xe133.setLc(bgAnalyseResult.LC_Xe133);
|
||||
xe133.setMdc(bgAnalyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(anlyseResultIn.getXe133Flag());
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResults xe133m = new GardsXeResults();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(bgAnalyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(bgAnalyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(bgAnalyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(bgAnalyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(anlyseResultIn.getXe133mFlag());
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResults xe135 = new GardsXeResults();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(bgAnalyseResult.Xe135_con);
|
||||
xe135.setConcErr(bgAnalyseResult.Xe135_uncer);
|
||||
xe135.setLc(bgAnalyseResult.LC_Xe135);
|
||||
xe135.setMdc(bgAnalyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(anlyseResultIn.getXe135Flag());
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
anlyseResultIn.setXeData(xeResultsSpectrumList);
|
||||
|
||||
if (anlyseResultIn.isBGammaEnergyValidSample()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationSCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationSCE.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationSCE.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationSCE.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum gammaCalibrationSEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationSEC.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0)));
|
||||
gammaCalibrationSEC.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1)));
|
||||
gammaCalibrationSEC.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setGammaCalibrationSCE(gammaCalibrationSCE);
|
||||
anlyseResultIn.setGammaCalibrationSEC(gammaCalibrationSEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationSCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationSCE.setCoeff1(bgAnalyseResult.s_g_fitting_c_e.get(0));
|
||||
gammaCalibrationSCE.setCoeff2(bgAnalyseResult.s_g_fitting_c_e.get(1));
|
||||
gammaCalibrationSCE.setCoeff3(bgAnalyseResult.s_g_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum gammaCalibrationSEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationSEC.setCoeff1(bgAnalyseResult.s_g_fitting_e_c.get(0));
|
||||
gammaCalibrationSEC.setCoeff2(bgAnalyseResult.s_g_fitting_e_c.get(1));
|
||||
gammaCalibrationSEC.setCoeff3(bgAnalyseResult.s_g_fitting_e_c.get(2));
|
||||
anlyseResultIn.setGammaCalibrationSCE(gammaCalibrationSCE);
|
||||
anlyseResultIn.setGammaCalibrationSEC(gammaCalibrationSEC);
|
||||
}
|
||||
if (anlyseResultIn.isBGammaEnergyValidGas()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationGCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationGCE.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationGCE.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationGCE.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum gammaCalibrationGEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationGEC.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0)));
|
||||
gammaCalibrationGEC.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1)));
|
||||
gammaCalibrationGEC.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setGammaCalibrationGCE(gammaCalibrationGCE);
|
||||
anlyseResultIn.setGammaCalibrationGEC(gammaCalibrationGEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationGCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationGCE.setCoeff1(bgAnalyseResult.g_g_fitting_c_e.get(0));
|
||||
gammaCalibrationGCE.setCoeff2(bgAnalyseResult.g_g_fitting_c_e.get(1));
|
||||
gammaCalibrationGCE.setCoeff3(bgAnalyseResult.g_g_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum gammaCalibrationGEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationGEC.setCoeff1(bgAnalyseResult.g_g_fitting_e_c.get(0));
|
||||
gammaCalibrationGEC.setCoeff2(bgAnalyseResult.g_g_fitting_e_c.get(1));
|
||||
gammaCalibrationGEC.setCoeff3(bgAnalyseResult.g_g_fitting_e_c.get(2));
|
||||
anlyseResultIn.setGammaCalibrationGCE(gammaCalibrationGCE);
|
||||
anlyseResultIn.setGammaCalibrationGEC(gammaCalibrationGEC);
|
||||
}
|
||||
if (anlyseResultIn.isBGammaEnergyValidDet()) {
|
||||
GardsCalibrationSpectrum gammaCalibrationDCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationDCE.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
|
||||
gammaCalibrationDCE.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
|
||||
gammaCalibrationDCE.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum gammaCalibrationDEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationDEC.setCoeff1(Double.valueOf(gammaFittingParaToUi.get(0)));
|
||||
gammaCalibrationDEC.setCoeff2(Double.valueOf(gammaFittingParaToUi.get(1)));
|
||||
gammaCalibrationDEC.setCoeff3(Double.valueOf(gammaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setGammaCalibrationDCE(gammaCalibrationDCE);
|
||||
anlyseResultIn.setGammaCalibrationDEC(gammaCalibrationDEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum gammaCalibrationDCE = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationDCE.setCoeff1(bgAnalyseResult.d_g_fitting_c_e.get(0));
|
||||
gammaCalibrationDCE.setCoeff2(bgAnalyseResult.d_g_fitting_c_e.get(1));
|
||||
gammaCalibrationDCE.setCoeff3(bgAnalyseResult.d_g_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum gammaCalibrationDEC = new GardsCalibrationSpectrum();
|
||||
gammaCalibrationDEC.setCoeff1(bgAnalyseResult.d_g_fitting_e_c.get(0));
|
||||
gammaCalibrationDEC.setCoeff2(bgAnalyseResult.d_g_fitting_e_c.get(1));
|
||||
gammaCalibrationDEC.setCoeff3(bgAnalyseResult.d_g_fitting_e_c.get(2));
|
||||
anlyseResultIn.setGammaCalibrationDCE(gammaCalibrationDCE);
|
||||
anlyseResultIn.setGammaCalibrationDEC(gammaCalibrationDEC);
|
||||
}
|
||||
|
||||
if (anlyseResultIn.isBBetaEnergyValidSample()) {
|
||||
GardsCalibrationSpectrum betaCalibrationSCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationSCE.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationSCE.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationSCE.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum betaCalibrationSEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationSEC.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0)));
|
||||
betaCalibrationSEC.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1)));
|
||||
betaCalibrationSEC.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setBetaCalibrationSCE(betaCalibrationSCE);
|
||||
anlyseResultIn.setBetaCalibrationSEC(betaCalibrationSEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationSCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationSCE.setCoeff1(bgAnalyseResult.s_b_fitting_c_e.get(0));
|
||||
betaCalibrationSCE.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1));
|
||||
betaCalibrationSCE.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum betaCalibrationSEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationSEC.setCoeff1(bgAnalyseResult.s_b_fitting_e_c.get(0));
|
||||
betaCalibrationSEC.setCoeff2(bgAnalyseResult.s_b_fitting_e_c.get(1));
|
||||
betaCalibrationSEC.setCoeff3(bgAnalyseResult.s_b_fitting_e_c.get(2));
|
||||
anlyseResultIn.setBetaCalibrationSCE(betaCalibrationSCE);
|
||||
anlyseResultIn.setBetaCalibrationSEC(betaCalibrationSEC);
|
||||
}
|
||||
if (anlyseResultIn.isBBetaEnergyValidGas()) {
|
||||
GardsCalibrationSpectrum betaCalibrationGCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationGCE.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationGCE.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationGCE.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum betaCalibrationGEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationGEC.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0)));
|
||||
betaCalibrationGEC.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1)));
|
||||
betaCalibrationGEC.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setBetaCalibrationGCE(betaCalibrationGCE);
|
||||
anlyseResultIn.setBetaCalibrationGEC(betaCalibrationGEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationGCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationGCE.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0));
|
||||
betaCalibrationGCE.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1));
|
||||
betaCalibrationGCE.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum betaCalibrationGEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationGEC.setCoeff1(bgAnalyseResult.g_b_fitting_e_c.get(0));
|
||||
betaCalibrationGEC.setCoeff2(bgAnalyseResult.g_b_fitting_e_c.get(1));
|
||||
betaCalibrationGEC.setCoeff3(bgAnalyseResult.g_b_fitting_e_c.get(2));
|
||||
anlyseResultIn.setBetaCalibrationGCE(betaCalibrationGCE);
|
||||
anlyseResultIn.setBetaCalibrationGEC(betaCalibrationGEC);
|
||||
}
|
||||
if (anlyseResultIn.isBBetaEnergyValidDet()) {
|
||||
GardsCalibrationSpectrum betaCalibrationDCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationDCE.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
|
||||
betaCalibrationDCE.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
|
||||
betaCalibrationDCE.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
|
||||
GardsCalibrationSpectrum betaCalibrationDEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationDEC.setCoeff1(Double.valueOf(betaFittingParaToUi.get(0)));
|
||||
betaCalibrationDEC.setCoeff2(Double.valueOf(betaFittingParaToUi.get(1)));
|
||||
betaCalibrationDEC.setCoeff3(Double.valueOf(betaFittingParaToUi.get(2)));
|
||||
anlyseResultIn.setBetaCalibrationDCE(betaCalibrationDCE);
|
||||
anlyseResultIn.setBetaCalibrationDEC(betaCalibrationDEC);
|
||||
} else {
|
||||
GardsCalibrationSpectrum betaCalibrationDCE = new GardsCalibrationSpectrum();
|
||||
betaCalibrationDCE.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0));
|
||||
betaCalibrationDCE.setCoeff2(bgAnalyseResult.d_b_fitting_c_e.get(1));
|
||||
betaCalibrationDCE.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2));
|
||||
GardsCalibrationSpectrum betaCalibrationDEC = new GardsCalibrationSpectrum();
|
||||
betaCalibrationDEC.setCoeff1(bgAnalyseResult.d_b_fitting_e_c.get(0));
|
||||
betaCalibrationDEC.setCoeff2(bgAnalyseResult.d_b_fitting_e_c.get(1));
|
||||
betaCalibrationDEC.setCoeff3(bgAnalyseResult.d_b_fitting_e_c.get(2));
|
||||
anlyseResultIn.setBetaCalibrationDCE(betaCalibrationDCE);
|
||||
anlyseResultIn.setBetaCalibrationDEC(betaCalibrationDEC);
|
||||
}
|
||||
|
||||
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
|
||||
for (int i=0; i<bgAnalyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
for (int i=0; i<bgAnalyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setDataType(DataTypeAbbr.GASBKPHD.getType());
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
for (int i=0; i<bgAnalyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
GardsROIChannelsSpectrum roiChannels = new GardsROIChannelsSpectrum();
|
||||
roiChannels.setDataType(DataTypeAbbr.DETBKPHD.getType());
|
||||
roiChannels.setRoi(i+1);
|
||||
roiChannels.setBChanStart(bgAnalyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
roiChannels.setBChanStop(bgAnalyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
roiChannels.setGChanStart(bgAnalyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
roiChannels.setGChanStop(bgAnalyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
roiChannelsSpectrumList.add(roiChannels);
|
||||
}
|
||||
anlyseResultIn.setRoiChannelsSpectrumList(roiChannelsSpectrumList);
|
||||
bgAnalyseResult.LC.add(0, 0.0);
|
||||
bgAnalyseResult.MDC.add(0, 0.0);
|
||||
List<GardsROIResultsSpectrum> roiResultsSpectrumList = new LinkedList<>();
|
||||
for (int i=0; i<bgAnalyseResult.s_roi_cts.size(); i++) {
|
||||
GardsROIResultsSpectrum roiResults = new GardsROIResultsSpectrum();
|
||||
roiResults.setRoi(i+1);
|
||||
roiResults.setLc(bgAnalyseResult.LC.get(i));
|
||||
roiResults.setSGross(bgAnalyseResult.s_roi_cts.get(i));
|
||||
roiResults.setGGross(bgAnalyseResult.g_roi_cts.get(i));
|
||||
roiResults.setBGross(bgAnalyseResult.d_roi_cts.get(i));
|
||||
roiResults.setSNet(bgAnalyseResult.s_deduct_d_cts.get((i+1)*3));
|
||||
roiResults.setGNet(bgAnalyseResult.g_deduct_d_cts.get((i+1)*3));
|
||||
roiResults.setNet(bgAnalyseResult.ROI_net_coutns.get(i));
|
||||
roiResults.setNetErr(bgAnalyseResult.ROI_net_coutns_err.get(i));
|
||||
roiResults.setConc(bgAnalyseResult.ROI_con_uncer.get(i));
|
||||
roiResults.setConcErr(bgAnalyseResult.ROI_con_uncer_err.get(i));
|
||||
roiResults.setMdc(bgAnalyseResult.MDC.get(i));
|
||||
if(bgAnalyseResult.ROI_con_uncer.get(i)>bgAnalyseResult.MDC.get(i)) {
|
||||
roiResults.setNidFlag(1);
|
||||
} else {
|
||||
roiResults.setNidFlag(0);
|
||||
}
|
||||
roiResultsSpectrumList.add(roiResults);
|
||||
}
|
||||
anlyseResultIn.setRoiResultsSpectrumList(roiResultsSpectrumList);
|
||||
}
|
||||
|
||||
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara) {
|
||||
//根据文件路径 文件名称获取对应的临时文件
|
||||
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
|
@ -3850,6 +4074,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return xeResultsList;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean OriginalDataStore(String filePath, String fileName, String filePathName, String userName) {
|
||||
//根据新的文件路径名称查询数据是否存在
|
||||
GardsSampleData isExist = spectrumAnalysisMapper.findSampleByFile(filePathName);
|
||||
|
@ -3873,18 +4098,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||
//切换文件路径
|
||||
ftpClient.changeWorkingDirectory(filePath);
|
||||
//获取路径下所有文件信息
|
||||
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||
//根据文件名称 分别获取 sample gas det文件
|
||||
List<FTPFile> files = ftpFiles.stream().filter(item -> item.getName().equals(fileName)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(files)){
|
||||
FTPFile ftpFile = files.get(0);
|
||||
inputStream = ftpClient.retrieveFileStream(ftpFile.getName());
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -3893,7 +4111,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(ftpClient)){
|
||||
ftpClient.disconnect();
|
||||
}
|
||||
if (inputStream != null){
|
||||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -100,6 +100,7 @@ public class SysInfoJob implements Job {
|
|||
// 记录报警日志
|
||||
AlarmLog alarmLog = new AlarmLog();
|
||||
alarmLog.setRuleId(ruleId);
|
||||
alarmLog.setOperator(operator);
|
||||
alarmLog.setAlarmValue(StrUtil.toString(current));
|
||||
String ruleName = alarmRule.getName();
|
||||
Double threshold = rule.getThreshold();
|
||||
|
|
Loading…
Reference in New Issue
Block a user