Compare commits
No commits in common. "03d92b7889f75ebeddeba772d50a148fd1e0065d" and "277485ddda87aa0ff54344ea26afd89cdfadbe3f" have entirely different histories.
03d92b7889
...
277485ddda
|
@ -891,44 +891,39 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
||||||
List<String> fileNames = new LinkedList<>();
|
List<String> fileNames = new LinkedList<>();
|
||||||
String station = sampleFileName.substring(0, 9);
|
String station = sampleFileName.substring(0, 9);
|
||||||
//连接ftp
|
//连接ftp
|
||||||
// FTPClient ftpClient = ftpUtil.LoginFTP();
|
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||||
// if (Objects.isNull(ftpClient)){
|
if (Objects.isNull(ftpClient)){
|
||||||
// return fileNames;
|
return fileNames;
|
||||||
// }
|
}
|
||||||
try {
|
try {
|
||||||
//被动模式
|
//被动模式
|
||||||
// ftpClient.enterLocalPassiveMode();
|
ftpClient.enterLocalPassiveMode();
|
||||||
// //设置文件类型--二进制文件
|
//设置文件类型--二进制文件
|
||||||
// ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
|
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
|
||||||
// //
|
//
|
||||||
// ftpClient.setControlEncoding("UTF-8");
|
ftpClient.setControlEncoding("UTF-8");
|
||||||
// ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE);
|
||||||
// //切换文件路径
|
//切换文件路径
|
||||||
// ftpClient.changeWorkingDirectory(filePath);
|
ftpClient.changeWorkingDirectory(filePath);
|
||||||
// //获取路径下所有文件信息
|
//获取路径下所有文件信息
|
||||||
// List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
List<FTPFile> ftpFiles = Arrays.asList(ftpClient.listFiles());
|
||||||
File file = new File(filePath);
|
|
||||||
List<File> ftpFiles = Arrays.asList(file.listFiles());
|
|
||||||
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
if (CollectionUtils.isNotEmpty(ftpFiles)){
|
||||||
fileNames = ftpFiles.stream().filter(item-> item.getName().contains(station)).map(File::getName).collect(Collectors.toList());
|
fileNames = ftpFiles.stream().filter(item-> item.getName().contains(station)).map(FTPFile::getName).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
} finally {
|
} finally {
|
||||||
// try {
|
try {
|
||||||
// ftpClient.disconnect();
|
ftpClient.disconnect();
|
||||||
// } catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
return fileNames;
|
return fileNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String GetMatchFile(String tmpFileName, List<String> fileNames, String type) {
|
public String GetMatchFile(String tmpFileName, List<String> fileNames, String type) {
|
||||||
String matchFileName = "";
|
String matchFileName = "";
|
||||||
if (StringUtils.isBlank(tmpFileName)) {
|
|
||||||
return matchFileName;
|
|
||||||
}
|
|
||||||
fileNames = fileNames.stream().filter(item-> item.contains(type)).sorted().collect(Collectors.toList());
|
fileNames = fileNames.stream().filter(item-> item.contains(type)).sorted().collect(Collectors.toList());
|
||||||
//用于比较的字符串
|
//用于比较的字符串
|
||||||
String fileCompare = tmpFileName.substring(0,23);
|
String fileCompare = tmpFileName.substring(0,23);
|
||||||
|
|
|
@ -40,10 +40,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
struct = selfStationData.getSampleStruct();
|
struct = selfStationData.getSampleStruct();
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
struct = selfStationData.getDetStruct();
|
struct = selfStationData.getDetStruct();
|
||||||
} else if (systemType.equals("qc")) {
|
|
||||||
struct = selfStationData.getQcStruct();
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
//存储页面操作数据
|
//存储页面操作数据
|
||||||
SelfStationVueData selfStationVueData = new SelfStationVueData();
|
SelfStationVueData selfStationVueData = new SelfStationVueData();
|
||||||
|
@ -147,7 +143,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
selfStationData.getDetVueData().setROIOneBetaStart(startChannel);
|
selfStationData.getDetVueData().setROIOneBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIOneBetaStop(endChannel);
|
selfStationData.getDetVueData().setROIOneBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIOneList(seriseDataList);
|
selfStationData.getDetVueData().setROIOneList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)oneMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROIOneStart", roiBBoundaryStart.get(0));
|
map.put("ROIOneStart", roiBBoundaryStart.get(0));
|
||||||
map.put("ROIOneStop", roiBBoundaryStop.get(0));
|
map.put("ROIOneStop", roiBBoundaryStop.get(0));
|
||||||
|
@ -163,12 +158,10 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
selfStationData.getSampleVueData().setROITwoBetaStart(startChannel);
|
selfStationData.getSampleVueData().setROITwoBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROITwoBetaStop(endChannel);
|
selfStationData.getSampleVueData().setROITwoBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROITwoList(seriseDataList);
|
selfStationData.getSampleVueData().setROITwoList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
|
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROITwoBetaStart(startChannel);
|
selfStationData.getDetVueData().setROITwoBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROITwoBetaStop(endChannel);
|
selfStationData.getDetVueData().setROITwoBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROITwoList(seriseDataList);
|
selfStationData.getDetVueData().setROITwoList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROITwoStart", roiBBoundaryStart.get(1));
|
map.put("ROITwoStart", roiBBoundaryStart.get(1));
|
||||||
map.put("ROITwoStop", roiBBoundaryStop.get(1));
|
map.put("ROITwoStop", roiBBoundaryStop.get(1));
|
||||||
|
@ -184,12 +177,11 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel);
|
selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel);
|
selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROIThreeList(seriseDataList);
|
selfStationData.getSampleVueData().setROIThreeList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
|
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROIThreeBetaStart(startChannel);
|
selfStationData.getDetVueData().setROIThreeBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIThreeBetaStop(endChannel);
|
selfStationData.getDetVueData().setROIThreeBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIThreeList(seriseDataList);
|
selfStationData.getDetVueData().setROIThreeList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
|
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)threeMap.get("counts"));
|
||||||
}
|
}
|
||||||
map.put("ROIThreeStart", roiBBoundaryStart.get(2));
|
map.put("ROIThreeStart", roiBBoundaryStart.get(2));
|
||||||
map.put("ROIThreeStop", roiBBoundaryStop.get(2));
|
map.put("ROIThreeStop", roiBBoundaryStop.get(2));
|
||||||
|
@ -205,12 +197,10 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
selfStationData.getSampleVueData().setROIFourBetaStart(startChannel);
|
selfStationData.getSampleVueData().setROIFourBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROIFourBetaStop(endChannel);
|
selfStationData.getSampleVueData().setROIFourBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROIFourList(seriseDataList);
|
selfStationData.getSampleVueData().setROIFourList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
|
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROIFourBetaStart(startChannel);
|
selfStationData.getDetVueData().setROIFourBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIFourBetaStop(endChannel);
|
selfStationData.getDetVueData().setROIFourBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIFourList(seriseDataList);
|
selfStationData.getDetVueData().setROIFourList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROIFourStart", roiBBoundaryStart.get(3));
|
map.put("ROIFourStart", roiBBoundaryStart.get(3));
|
||||||
map.put("ROIFourStop", roiBBoundaryStop.get(3));
|
map.put("ROIFourStop", roiBBoundaryStop.get(3));
|
||||||
|
@ -482,8 +472,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
return equation;
|
return equation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateChartResolution(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurReso,
|
public void UpdateChartResolution(List<Double> m_vCurEnergy, ParameterInfo m_curParam, List<Double> m_vCurReso, SelfStationData selfStationData, Double width, Map<String, Object> map) {
|
||||||
SelfStationData selfStationData, Double width, Map<String, Object> map) {
|
|
||||||
int num = m_vCurEnergy.size();
|
int num = m_vCurEnergy.size();
|
||||||
if(num < 1) return;
|
if(num < 1) return;
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,8 @@ public class SelfStationController {
|
||||||
|
|
||||||
@GetMapping("initValue")
|
@GetMapping("initValue")
|
||||||
@ApiOperation(value = "预加载谱文件数据", notes = "预加载谱文件数据")
|
@ApiOperation(value = "预加载谱文件数据", notes = "预加载谱文件数据")
|
||||||
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
|
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request) {
|
||||||
String qcFileName, HttpServletRequest request) {
|
selfStationService.initValue(dbName, sampleId, analyst, sampleFileName, detFileName, request);
|
||||||
selfStationService.initValue(dbName, sampleId, analyst, sampleFileName, detFileName,qcFileName, request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("loadFromDB")
|
@GetMapping("loadFromDB")
|
||||||
|
@ -35,8 +34,8 @@ public class SelfStationController {
|
||||||
|
|
||||||
@GetMapping("loadFromFile")
|
@GetMapping("loadFromFile")
|
||||||
@ApiOperation(value = "从文件加载自建台站谱数据", notes = "从文件加载自建台站谱数据")
|
@ApiOperation(value = "从文件加载自建台站谱数据", notes = "从文件加载自建台站谱数据")
|
||||||
public Result loadFromFile(String sampleFileName, String detFileName, String qcFileName, HttpServletRequest request) {
|
public Result loadFromFile(String sampleFileName, String detFileName, HttpServletRequest request) {
|
||||||
return selfStationService.loadSelfStationByFile(sampleFileName, detFileName, qcFileName, request);
|
return selfStationService.loadSelfStationByFile(sampleFileName, detFileName, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("deleteSelfStationCache")
|
@DeleteMapping("deleteSelfStationCache")
|
||||||
|
|
|
@ -4,8 +4,9 @@ import lombok.Data;
|
||||||
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.LinkedList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class SelfStationData implements Serializable {
|
public class SelfStationData implements Serializable {
|
||||||
|
@ -20,11 +21,6 @@ public class SelfStationData implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String detTmpPath;
|
private String detTmpPath;
|
||||||
|
|
||||||
/**
|
|
||||||
* qc临时文件路径
|
|
||||||
*/
|
|
||||||
private String qcTmpPath;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sample文件分析内容
|
* sample文件分析内容
|
||||||
*/
|
*/
|
||||||
|
@ -116,31 +112,6 @@ public class SelfStationData implements Serializable {
|
||||||
public SelfStationData() {
|
public SelfStationData() {
|
||||||
sampleVueData = new SelfStationVueData();
|
sampleVueData = new SelfStationVueData();
|
||||||
detVueData = new SelfStationVueData();
|
detVueData = new SelfStationVueData();
|
||||||
|
|
||||||
betaList = new LinkedList<>();
|
|
||||||
betaFittingPara = new LinkedList<>();
|
|
||||||
betaFittingParaToUi = new LinkedList<>();
|
|
||||||
gammaList = new LinkedList<>();
|
|
||||||
gammaFittingPara = new LinkedList<>();
|
|
||||||
gammaFittingParaToUi = new LinkedList<>();
|
|
||||||
|
|
||||||
betaListNow = new LinkedList<>();
|
|
||||||
betaFittingParaNow = new LinkedList<>();
|
|
||||||
betaFittingParaToUiNow = new LinkedList<>();
|
|
||||||
gammaListNow = new LinkedList<>();
|
|
||||||
gammaFittingParaNow = new LinkedList<>();
|
|
||||||
gammaFittingParaToUiNow = new LinkedList<>();
|
|
||||||
|
|
||||||
bGammaEnergyValidSample = false;
|
|
||||||
bBetaEnergyValidSample = false;
|
|
||||||
bGammaEnergyValidGas = false;
|
|
||||||
bBetaEnergyValidGas = false;
|
|
||||||
bGammaEnergyValidDet = false;
|
|
||||||
bBetaEnergyValidDet = false;
|
|
||||||
|
|
||||||
gammaNewEnergyListNow = new LinkedList<>();
|
|
||||||
betaNewEnergyListNow = new LinkedList<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,44 +13,24 @@ public class SelfStationVueData implements Serializable {
|
||||||
/**
|
/**
|
||||||
* ROI-1结果数据
|
* ROI-1结果数据
|
||||||
*/
|
*/
|
||||||
/**
|
//折线图横纵坐标数组
|
||||||
* 折线图横纵坐标数组
|
|
||||||
*/
|
|
||||||
private List<SeriseData> ROIOneList;
|
private List<SeriseData> ROIOneList;
|
||||||
private List<Long> ROIOneCounts;
|
private List<Long> ROIOneCounts;
|
||||||
/**
|
//ROI-1范围矩形框起始道值
|
||||||
* ROI-1范围矩形框起始道值
|
|
||||||
*/
|
|
||||||
private Integer ROIOneBetaStart;
|
private Integer ROIOneBetaStart;
|
||||||
/**
|
//ROI-1范围矩形框终止道值
|
||||||
* ROI-1范围矩形框终止道值
|
|
||||||
*/
|
|
||||||
private Integer ROIOneBetaStop;
|
private Integer ROIOneBetaStop;
|
||||||
/**
|
|
||||||
* ROI-1 GammaPHD数据
|
|
||||||
*/
|
|
||||||
private PHDFile ROIOnePHDFile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ROI-2结果数据
|
* ROI-2结果数据
|
||||||
*/
|
*/
|
||||||
/**
|
//折线图横纵坐标数组
|
||||||
* 折线图横纵坐标数组
|
|
||||||
*/
|
|
||||||
private List<SeriseData> ROITwoList;
|
private List<SeriseData> ROITwoList;
|
||||||
private List<Long> ROITwoCounts;
|
private List<Long> ROITwoCounts;
|
||||||
/**
|
//ROI-2范围矩形框起始道值
|
||||||
* ROI-2范围矩形框起始道值
|
|
||||||
*/
|
|
||||||
private Integer ROITwoBetaStart;
|
private Integer ROITwoBetaStart;
|
||||||
/**
|
//ROI-2范围矩形框终止道值
|
||||||
* ROI-2范围矩形框终止道值
|
|
||||||
*/
|
|
||||||
private Integer ROITwoBetaStop;
|
private Integer ROITwoBetaStop;
|
||||||
/**
|
|
||||||
* ROI-2 GammaPHD数据
|
|
||||||
*/
|
|
||||||
private PHDFile ROITwoPHDFile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ROI-3结果数据
|
* ROI-3结果数据
|
||||||
|
@ -62,10 +42,6 @@ public class SelfStationVueData implements Serializable {
|
||||||
private Integer ROIThreeBetaStart;
|
private Integer ROIThreeBetaStart;
|
||||||
//ROI-3范围矩形框终止道值
|
//ROI-3范围矩形框终止道值
|
||||||
private Integer ROIThreeBetaStop;
|
private Integer ROIThreeBetaStop;
|
||||||
/**
|
|
||||||
* ROI-3 GammaPHD数据
|
|
||||||
*/
|
|
||||||
private PHDFile ROIThreePHDFile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ROI-4结果数据
|
* ROI-4结果数据
|
||||||
|
@ -77,10 +53,6 @@ public class SelfStationVueData implements Serializable {
|
||||||
private Integer ROIFourBetaStart;
|
private Integer ROIFourBetaStart;
|
||||||
//ROI-4范围矩形框终止道值
|
//ROI-4范围矩形框终止道值
|
||||||
private Integer ROIFourBetaStop;
|
private Integer ROIFourBetaStop;
|
||||||
/**
|
|
||||||
* ROI-4 GammaPHD数据
|
|
||||||
*/
|
|
||||||
private PHDFile ROIFourPHDFile;
|
|
||||||
|
|
||||||
// 当前修改的刻度名称
|
// 当前修改的刻度名称
|
||||||
private String newEner;
|
private String newEner;
|
||||||
|
|
|
@ -10,12 +10,11 @@ import java.util.List;
|
||||||
|
|
||||||
public interface ISelfStationService {
|
public interface ISelfStationService {
|
||||||
|
|
||||||
void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
|
void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request);
|
||||||
String qcFileName, HttpServletRequest request);
|
|
||||||
|
|
||||||
Result loadFromDB(String dbName, Integer sampleId, String analyst, HttpServletRequest request);
|
Result loadFromDB(String dbName, Integer sampleId, String analyst, HttpServletRequest request);
|
||||||
|
|
||||||
Result loadSelfStationByFile(String sampleFileName, String detFileName, String qcFileName, HttpServletRequest request);
|
Result loadSelfStationByFile(String sampleFileName, String detFileName, HttpServletRequest request);
|
||||||
|
|
||||||
void deleteSelfStationCache(String sampleFileName, HttpServletRequest request);
|
void deleteSelfStationCache(String sampleFileName, HttpServletRequest request);
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.cache.LocalCache;
|
||||||
import org.jeecg.common.cache.SelfCache;
|
import org.jeecg.common.cache.SelfCache;
|
||||||
import org.jeecg.common.properties.ParameterProperties;
|
import org.jeecg.common.properties.ParameterProperties;
|
||||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||||
|
@ -55,12 +55,11 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
private SpectrumAnalysisMapper spectrumAnalysisMapper;
|
private SpectrumAnalysisMapper spectrumAnalysisMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName,
|
public void initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String detFileName, HttpServletRequest request) {
|
||||||
String qcFileName, HttpServletRequest request) {
|
|
||||||
if (StringUtils.isNotBlank(dbName) && Objects.nonNull(sampleId)) {
|
if (StringUtils.isNotBlank(dbName) && Objects.nonNull(sampleId)) {
|
||||||
loadFromDB(dbName, sampleId, analyst, request);
|
loadFromDB(dbName, sampleId, analyst, request);
|
||||||
} else {
|
} else {
|
||||||
loadSelfStationByFile(sampleFileName, detFileName,qcFileName, request);
|
loadSelfStationByFile(sampleFileName, detFileName, request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,8 +164,7 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result loadSelfStationByFile(String sampleFileName, String detFileName, String qcFileName,
|
public Result loadSelfStationByFile(String sampleFileName, String detFileName, HttpServletRequest request) {
|
||||||
HttpServletRequest request) {
|
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
Map<String, Map<String, Object>> resultMap = new HashMap<>();
|
Map<String, Map<String, Object>> resultMap = new HashMap<>();
|
||||||
//获取用户名
|
//获取用户名
|
||||||
|
@ -211,21 +209,6 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
resultMap.put("det", map);
|
resultMap.put("det", map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断qc文件名是否为空
|
|
||||||
if (StringUtils.isNotBlank(qcFileName)) {
|
|
||||||
//拼接det文件路径
|
|
||||||
String qcFilePath = path + StringPool.SLASH + qcFileName;
|
|
||||||
//返回结果map
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
//获取sample分析后的对象
|
|
||||||
EnergySpectrumStruct struct = selfStationUtil.getSourceData(qcFilePath, "qc", selfStationData);
|
|
||||||
if (Objects.nonNull(struct)) {
|
|
||||||
selfStationData.setQcStruct(struct);
|
|
||||||
selfStationData.setQcTmpPath(qcFilePath);
|
|
||||||
selfStationUtil.loadFile(selfStationData, null, null, "qc", map);
|
|
||||||
resultMap.put("qc", map);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (StringUtils.isNotBlank(sampleFileName)) {
|
if (StringUtils.isNotBlank(sampleFileName)) {
|
||||||
//返回结果map
|
//返回结果map
|
||||||
|
@ -1658,110 +1641,79 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
|
|
||||||
|
|
||||||
// Gamma文件内容转换为PHD实体
|
// Gamma文件内容转换为PHD实体
|
||||||
PHDFile phdOne = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
|
PHDFile phd = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
|
||||||
PHDFile phdTwo = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
|
|
||||||
PHDFile phdThree = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
|
|
||||||
PHDFile phdFour = selfStationUtil.getGammaPHD(gammaTwoName, pathName);
|
|
||||||
|
|
||||||
// Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
// Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
// PHDFile phd = phdCache.getIfPresent(fileName + StringPool.DASH + userName);
|
// PHDFile phd = phdCache.getIfPresent(fileName + StringPool.DASH + userName);
|
||||||
if (Objects.isNull(phdOne)) {
|
if (Objects.isNull(phd)) {
|
||||||
result.error500("Please select the parse file first!");
|
result.error500("Please select the parse file first!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
phdOne.setUserId(processKey);
|
phd.setUserId(processKey);
|
||||||
// 赋值xml文件存放路径
|
// 赋值xml文件存放路径
|
||||||
phdOne.setXmlFilePath(parameterProperties.getFilePath());
|
phd.setXmlFilePath(parameterProperties.getFilePath());
|
||||||
// 获取当前角色的颜色配置
|
// 获取当前角色的颜色配置
|
||||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
// 分析文件数据
|
// 分析文件数据
|
||||||
int flag = gammaFileUtil.AnalyseData(phdOne);
|
int flag = gammaFileUtil.AnalyseData(phd);
|
||||||
if (flag == 0) {
|
if (flag == 0) {
|
||||||
String warning = "The spectrum needn't Analyed. Maybe:\n" +
|
String warning = "The spectrum needn't Analyed. Maybe:\n" +
|
||||||
"1. It has already Analyed.\n" +
|
"1. It has already Analyed.\n" +
|
||||||
"2. You didn't change any setting or calibration.";
|
"2. You didn't change any setting or calibration.";
|
||||||
result.error500(warning);
|
result.error500(warning);
|
||||||
} else if (flag == -1) {
|
} else if (flag == -1) {
|
||||||
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type());
|
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phd.getHeader().getSystem_type());
|
||||||
//分析时将phd的核素map重置
|
|
||||||
phdOne.setPhdNuclideMap(nuclideLinesMap);
|
|
||||||
//重新计算核素的活度浓度
|
|
||||||
gammaFileUtil.NuclidesIdent(phdOne, nuclideLinesMap);
|
|
||||||
phdOne.setEfficiencyParam(phdOne.getUsedEffiPara().getP());
|
|
||||||
phdOne.setEfficiencyEnergy(phdOne.getUsedEffiKD().getG_energy());
|
|
||||||
phdOne.setEfficiencyCurRow(0);
|
|
||||||
// 重新计算峰值
|
|
||||||
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
|
||||||
gammaFileUtil.getNuclideMDCValue(phdOne, phdOne.getMdcInfoMap(), nuclideLinesMDCMap);
|
|
||||||
String warning = "Finish three tasks:\n" +
|
|
||||||
"\t1.Update efficiencies of all peaks;\n" +
|
|
||||||
"\t2.Identify nuclides again;\n" +
|
|
||||||
"\t3.Test QC again.";
|
|
||||||
result.error500(warning);
|
|
||||||
} else {
|
|
||||||
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type());
|
|
||||||
|
|
||||||
try {
|
|
||||||
Map<String, Object> gammaResult = Maps.newHashMap();
|
|
||||||
Map<String, Object> map1 = this.gammaAnalyse(phdOne, nuclideLinesMap, colorMap);
|
|
||||||
Map<String, Object> map2 = this.gammaAnalyse(phdTwo, nuclideLinesMap, colorMap);
|
|
||||||
Map<String, Object> map3 = this.gammaAnalyse(phdThree, nuclideLinesMap, colorMap);
|
|
||||||
Map<String, Object> map4 = this.gammaAnalyse(phdFour, nuclideLinesMap, colorMap);
|
|
||||||
gammaResult.put("ROI1", map1);
|
|
||||||
gammaResult.put("ROI2", map2);
|
|
||||||
gammaResult.put("ROI3", map3);
|
|
||||||
gammaResult.put("ROI4", map4);
|
|
||||||
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
|
||||||
sampleVueData.setUsedEnerKD(phdOne.getUsedEnerKD());
|
|
||||||
sampleVueData.setUsedEffiKD(phdOne.getUsedEffiKD());
|
|
||||||
sampleVueData.setUsedResoKD(phdOne.getUsedResoKD());
|
|
||||||
sampleVueData.setMapEnerKD(phdOne.getMapEnerKD());
|
|
||||||
sampleVueData.setMapResoKD(phdOne.getMapResoKD());
|
|
||||||
sampleVueData.setMapEffiKD(phdOne.getMapEffiKD());
|
|
||||||
sampleVueData.setUsedEnerPara(phdOne.getUsedEnerPara());
|
|
||||||
sampleVueData.setUsedEffiPara(phdOne.getUsedEffiPara());
|
|
||||||
sampleVueData.setUsedResoPara(phdOne.getUsedResoPara());
|
|
||||||
sampleVueData.setMapEnerPara(phdOne.getMapEnerPara());
|
|
||||||
sampleVueData.setMapResoPara(phdOne.getMapResoPara());
|
|
||||||
sampleVueData.setMapEffiPara(phdOne.getMapEffiPara());
|
|
||||||
|
|
||||||
result.setSuccess(true);
|
|
||||||
result.setResult(gammaResult);
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<String, Object> gammaAnalyse(PHDFile phd, Map<String, NuclideLines> nuclideLinesMap,
|
|
||||||
Map<String, String> colorMap) throws RuntimeException{
|
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
|
|
||||||
//分析时将phd的核素map重置
|
//分析时将phd的核素map重置
|
||||||
phd.setPhdNuclideMap(nuclideLinesMap);
|
phd.setPhdNuclideMap(nuclideLinesMap);
|
||||||
//调用分析算法
|
//重新计算核素的活度浓度
|
||||||
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
|
||||||
|
// todo 不要qcflags
|
||||||
if (analyseSpectrum) {
|
// gammaFileUtil.RunQC(phd);
|
||||||
|
|
||||||
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
||||||
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
||||||
phd.setEfficiencyCurRow(0);
|
phd.setEfficiencyCurRow(0);
|
||||||
// 重新计算峰值
|
// 重新计算峰值
|
||||||
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
||||||
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap);
|
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap);
|
||||||
|
String warning = "Finish three tasks:\n" +
|
||||||
|
"\t1.Update efficiencies of all peaks;\n" +
|
||||||
|
"\t2.Identify nuclides again;\n" +
|
||||||
|
"\t3.Test QC again.";
|
||||||
|
result.error500(warning);
|
||||||
|
} else {
|
||||||
|
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phd.getHeader().getSystem_type());
|
||||||
|
//分析时将phd的核素map重置
|
||||||
|
phd.setPhdNuclideMap(nuclideLinesMap);
|
||||||
|
//调用分析算法
|
||||||
|
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
||||||
|
if (analyseSpectrum) {
|
||||||
|
// 重新分析各峰值对应的核素信息
|
||||||
|
// gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
|
||||||
|
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
||||||
|
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
||||||
|
phd.setEfficiencyCurRow(0);
|
||||||
|
// 重新计算峰值
|
||||||
|
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
||||||
|
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap);
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
|
// 更新 ‘QC Flags’ 状态
|
||||||
|
phd.getQcItems().clear();
|
||||||
|
// List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
||||||
|
// todo 不要qcflags
|
||||||
|
// map.put("QCFlag", qcstate);
|
||||||
map.put("bAnalyed", phd.isBAnalyed());
|
map.put("bAnalyed", phd.isBAnalyed());
|
||||||
map.put("peak", phd.getVPeak());
|
map.put("peak", phd.getVPeak());
|
||||||
map.put("BaseCtrls", phd.getBaseCtrls());
|
map.put("BaseCtrls", phd.getBaseCtrls());
|
||||||
// Bar Chart 柱状图
|
// Bar Chart 柱状图
|
||||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||||
map.put("barChart", differance);
|
map.put("barChart", differance);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(map);
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!");
|
result.error500("There is a problem with the current phd file, Analysis failure!");
|
||||||
}
|
}
|
||||||
return map;
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,19 +380,11 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
||||||
detaFileName = detphd;
|
detaFileName = detphd;
|
||||||
detStatus = true;
|
detStatus = true;
|
||||||
}
|
}
|
||||||
//匹配获取QCFile
|
|
||||||
boolean qcStatus = true;
|
|
||||||
String qcphd = phdFileUtil.GetQCPHD(sampleFileName, fileNames);
|
|
||||||
if (StringUtils.isBlank(qcphd)) {
|
|
||||||
qcphd = sampleFileName.substring(0, 23)+"_Q.PHD";
|
|
||||||
qcStatus = false;
|
|
||||||
}
|
|
||||||
map.put("sampleFileName", sampleFileName);
|
map.put("sampleFileName", sampleFileName);
|
||||||
map.put("gasFileName", "");
|
map.put("gasFileName", "");
|
||||||
map.put("detFileName", detaFileName);
|
map.put("detFileName", detaFileName);
|
||||||
map.put("detFileStatus", detStatus);
|
map.put("detFileStatus", detStatus);
|
||||||
map.put("qcFileName", qcphd);
|
map.put("qcFileName", "");
|
||||||
map.put("qcFileStatus", qcStatus);
|
|
||||||
map.put("sampleSystemType", sampleSystemType);
|
map.put("sampleSystemType", sampleSystemType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user