Compare commits

..

No commits in common. "c0ba24aae4bd90311e651619578936f0cf503217" and "8aeebe304741d3a205e27fe3857cfbfc0378c598" have entirely different histories.

3 changed files with 42 additions and 88 deletions

View File

@ -889,45 +889,6 @@ public class PHDFileUtil extends AbstractLogOrReport {
return path.toString();
}
}
public String NameStandardBy(String fileName, String systemType,String dataType) {
StringBuffer path = new StringBuffer();
try {
if(systemType.contains("B")) {
path.append("Spectrum");
path.append(StringPool.SLASH+"Xenon");
path.append(StringPool.SLASH+"Sauna");
} else if(systemType.contains("G")) {
path.append("Spectrum");
path.append(StringPool.SLASH+"Xenon");
path.append(StringPool.SLASH+"Spalax");
} else if (systemType.contains("C")) {
path.append("Spectrum");
path.append(StringPool.SLASH+"Xenon");
path.append(StringPool.SLASH+"Self");
}
if(dataType.contains("SAMPLEPHD")) {
path.append(StringPool.SLASH+"Samplephd");
} else if(dataType.contains("DETBKPHD")) {
path.append(StringPool.SLASH+"Detbkphd");
} else if(dataType.contains("GASBKPHD")) {
path.append(StringPool.SLASH+"Gasbkphd");
} else if(dataType.contains("QCPHD")) {
path.append(StringPool.SLASH+"Qcphd");
}
int pos = fileName.indexOf('-');
if(-1 == pos) {
} else if(fileName.length() >= pos+7) {
path.append(StringPool.SLASH+fileName.substring(pos+1,pos+5));
path.append(StringPool.SLASH+fileName.substring(pos+5,pos+7));
}
path.append(StringPool.SLASH+fileName);
return path.toString();
}catch (Exception e){
e.printStackTrace();
return path.toString();
}
}
public List<String> FileNameByStandardForm(String filePath, String sampleFileName) {
//用于最后的结果

View File

@ -939,38 +939,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
return phd;
}
/**
* 创建Gamma PHD文件并转换为数据存入SelfStationVueData
* @param path PHD保存地址
* @param sampleFileName beta样品谱名称
* @param struct beta谱数据
* @param sampleVueData 存储数据实体
*/
public void createGamma(String path, String sampleFileName, EnergySpectrumStruct struct, SelfStationVueData sampleVueData){
// 根据ROI生成四个Gamma谱文件, 文件命名为Beta名称后面_ROI_x.PHD
String gammaOneName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_1.PHD";
// 创建Gamma文件
this.createGammaFile(path, gammaOneName, struct, sampleVueData.getROIOneCounts());
String gammaTwoName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_2.PHD";
this.createGammaFile(path, gammaTwoName, struct, sampleVueData.getROITwoCounts());
String gammaThreeName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_3.PHD";
this.createGammaFile(path, gammaThreeName, struct, sampleVueData.getROIThreeCounts());
String gammaFourName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_4.PHD";
this.createGammaFile(path, gammaFourName, struct, sampleVueData.getROIFourCounts());
// Gamma文件内容转换为PHD实体
sampleVueData.setROIOneFileName(gammaOneName);
sampleVueData.setROIOnePHDFile(this.getGammaPHD(gammaOneName, path));
sampleVueData.setROITwoFileName(gammaTwoName);
sampleVueData.setROITwoPHDFile(this.getGammaPHD(gammaTwoName, path));
sampleVueData.setROIThreeFileName(gammaThreeName);
sampleVueData.setROIThreePHDFile(this.getGammaPHD(gammaThreeName, path));
sampleVueData.setROIFourFileName(gammaFourName);
sampleVueData.setROIFourPHDFile(this.getGammaPHD(gammaFourName, path));
}
/**
* 根据ROI卡出来的Gamma数据生成新的GammaPHD文件
* @param pathName 文件存储路径

View File

@ -28,7 +28,6 @@ import org.jeecg.common.properties.ParameterProperties;
import org.jeecg.common.properties.SpectrumPathProperties;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.*;
import org.jeecg.modules.base.abstracts.AbstractLogOrReport;
import org.jeecg.modules.base.dto.RoiDto;
import org.jeecg.modules.base.entity.configuration.GardsNuclLib;
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
@ -65,9 +64,9 @@ import java.util.*;
import java.util.stream.Collectors;
@Service("SelfStationService")
@Service
@DS("ora")
public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelfStationService {
public class SelfStationServiceImpl implements ISelfStationService {
@Autowired
private GammaFileUtil gammaFileUtil;
@ -421,7 +420,29 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
selfStationUtil.createGamma(path, sampleFileName, struct, sampleVueData);
// 根据ROI生成四个Gamma谱文件, 文件命名为Beta名称后面_ROI_x.PHD
String gammaOneName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_1.PHD";
// 创建Gamma文件
selfStationUtil.createGammaFile(path, gammaOneName, selfStationData.getSampleStruct(), sampleVueData.getROIOneCounts());
String gammaTwoName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_2.PHD";
selfStationUtil.createGammaFile(path, gammaTwoName, selfStationData.getSampleStruct(), sampleVueData.getROITwoCounts());
String gammaThreeName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_3.PHD";
selfStationUtil.createGammaFile(path, gammaThreeName, selfStationData.getSampleStruct(), sampleVueData.getROIThreeCounts());
String gammaFourName = StrUtil.subBefore(sampleFileName, ".PHD", true) + "_ROI_4.PHD";
selfStationUtil.createGammaFile(path, gammaFourName, selfStationData.getSampleStruct(), sampleVueData.getROIFourCounts());
// Gamma文件内容转换为PHD实体
sampleVueData.setROIOneFileName(gammaOneName);
sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaOneName, path));
sampleVueData.setROITwoFileName(gammaTwoName);
sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
sampleVueData.setROIThreeFileName(gammaThreeName);
sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaThreeName, path));
sampleVueData.setROIFourFileName(gammaFourName);
sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaFourName, path));
resultMap.put("sample", map);
// 初始化Configure
@ -563,6 +584,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
BeanUtils.copyProperties(roiFourPHDFile.getSetting(), roiFourPHDFile.getUsedSetting());
}
@DS("ora")
public void initConfigure(Integer idAnalysis, SelfStationData selfStationData){
GardsAnalySetting analySetting = spectrumAnalysisMapper.getAnalySetting(idAnalysis);
if (Objects.nonNull(analySetting)) {
@ -658,13 +680,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
roiBBoundaryStart.add(roiParam.getRoiNum() - 1, roiParam.getStartChannel());
roiBBoundaryStop.add(roiParam.getRoiNum() - 1, roiParam.getEndChannel());
}
// 根据ROI卡Gamma能谱数据
selfStationUtil.getGammaByROI("sample", roiBBoundaryStart, roiBBoundaryStop, selfStationData);
SelfStationVueData sampleData = selfStationData.getSampleVueData();
String path = StrUtil.subBefore(selfStationData.getSampleFilePathName(), StringPool.SLASH, true);
// 生成gamma数据
selfStationUtil.createGamma(path, selfStationData.getSampleFileName(), struct, sampleData);
}
@Override
@ -4557,6 +4573,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
@Override
@DS("ora")
public Result NuclideLibrary(Integer sampleId, String fileName, String editEnergy, double err, String libraryName, String nuclideName, HttpServletRequest request) {
Result result = new Result();
Map<String, Object> map = new HashMap<>();
@ -4731,6 +4748,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
}
@Override
@DS("ora")
public Result configUserLibrary(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
Map<String, List<String>> map = new HashMap<>();
@ -4941,7 +4959,8 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
}
@Override
@Transactional
@DS("ora")
@Transactional(propagation = Propagation.REQUIRES_NEW)
public Result saveToDB(String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
@ -5025,14 +5044,18 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
String qcTmpPath = selfStationData.getQcTmpPath();
//根据sample文件名称模糊查询sampleId
String sampleFilePath = "", qcFilePath = "", detFilePath = "";
if (StringUtils.isNotBlank(sampleFilePathName) && StringUtils.isNotBlank(sampleFileName)) {
sampleFilePathName = phdFileUtil.NameStandardBy(sampleFileName, sampleStruct.system_type, sampleStruct.data_type);
sampleFilePath = StrUtil.subBefore(sampleFilePathName, StringPool.SLASH, true);
sampleFilePathName = phdFileUtil.NameStandardBy(sampleFilePath, sampleFileName);
}
if (StringUtils.isNotBlank(detFilePathName) && StringUtils.isNotBlank(detFileName)) {
detFilePathName = phdFileUtil.NameStandardBy(detFileName, detStruct.system_type, detStruct.data_type);
detFilePath = StrUtil.subBefore(detFilePathName, StringPool.SLASH, true);
detFilePathName = phdFileUtil.NameStandardBy(detFilePath, detFileName);
}
if (StringUtils.isNotBlank(qcFilePathName) && StringUtils.isNotBlank(qcFileName)) {
qcFilePathName = phdFileUtil.NameStandardBy(qcFileName, qcStruct.system_type, qcStruct.data_type);
qcFilePath = StrUtil.subBefore(qcFilePathName, StringPool.SLASH, true);
qcFilePathName = phdFileUtil.NameStandardBy(qcFilePath, qcFileName);
}
// 读取参数内容
@ -5043,7 +5066,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
List<Map<String, CalMDCInfo>> mdcInfoMaps = ListUtil.toList(mdcInfoMap1, mdcInfoMap2,
mdcInfoMap3, mdcInfoMap4);
// 根据文件名称查询对应的sampleId 如果存在则赋值sampleId, Status 如果不存在则先存储数据信息到sampleData
PHDFile phd = sampleVueData.getROIOnePHDFile();
PHDFile phd = new PHDFile();
BeanUtils.copyProperties(phdFiles.get(0), phd);
GardsSampleDataSpectrum sampleData = spectrumAnalysisMapper.findSampleByFilePath(sampleInputFileName);
if (ObjectUtil.isNotNull(sampleData)) {
@ -5069,7 +5092,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
}
qcId = spectrumAnalysisMapper.getSampleId(qcFilePathName);
}
sampleData = spectrumAnalysisMapper.findSampleByFilePath(sampleFilePathName);
sampleData = spectrumAnalysisMapper.findSampleByFilePath(sampleInputFileName);
}
sampleId = sampleData.getSampleId();
// 根据sampleId 查询idAnalysis
@ -5277,6 +5300,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
@Override
@DS("ora")
public Result<?> viewARR(Integer sampleId, HttpServletResponse response) {
GardsAnalyses analyses = spectrumAnalysisMapper.viewARRSelf(sampleId);
Map<String, String> result = new HashMap<>();
@ -5334,6 +5358,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
}
@Override
@DS("ora")
public Result<?> viewAutomaticAnalysisLog(Integer sampleId) {
GardsAnalyses analyses = spectrumAnalysisMapper.viewLogSelf(sampleId);
Map<String, String> result = new HashMap<>();