fix:bug

This commit is contained in:
nieziyan 2024-08-15 09:36:25 +08:00
parent 6d2ec53b4c
commit 2693294331
4 changed files with 65 additions and 11 deletions

View File

@ -1407,7 +1407,7 @@ public class Sample_C_Analysis {
public void saveAnalysis(Integer sampleId, GardsSampleData detSampleData, Date analysisBegin,
Date analysisEnd, String logPath, String reportPath){
GardsAnalyses analysis = new GardsAnalyses();
GardsAnalyses analysis = new GardsAnalyses(); // TODO 自动处理 分析表数据补全 (包括update)
analysis.setSampleId(sampleId);
analysis.setCategory(1);//按C++代码写死的1该字段是分级结果张博士还没有想好数据要不要分级1,2,3,4
analysis.setAnalysisBegin(analysisBegin);
@ -1421,6 +1421,10 @@ public class Sample_C_Analysis {
analysis.setUseddetphd(detSampleData.getInputFileName());
analysis.setUseddetphdId(detSampleData.getSampleId());
}
// 基础数据
// Beta分析产生的 baseline log report等文件地址补全 ...
analysis.setLogPath(FileOperation.separatorConvert(logPath));
analysis.setReportPath(FileOperation.separatorConvert(reportPath));
serviceQuotes.getAnalysesService().save(analysis);

View File

@ -211,6 +211,7 @@
AND qc_samples.SPECTRAL_QUALIFIE='FULL'
AND qc_samples.ACQUISITION_START <= TO_DATE('${collectStartStr}', 'YYYY-MM-DD hh24:mi:ss'))
AND org_sample_data.SITE_DET_CODE= '${siteDetCode}'
AND org_sample_data.DATA_TYPE = 'Q'
</where>
</select>
@ -535,7 +536,7 @@
</select>
<select id="getCalibrationPairs" resultType="org.jeecg.modules.entity.GardsCalibrationPairsSpectrum">
SELECT CALTYPE, INPUT, XVALUE, YVALUE, UNCYVALUE, ROI_ID FROM ${dbName} WHERE IDANALYSIS = #{idAnalysis} ORDER BY XVALUE
SELECT CALTYPE, INPUT, XVALUE, YVALUE, UNCYVALUE FROM ${dbName} WHERE IDANALYSIS = #{idAnalysis} ORDER BY XVALUE
</select>
<select id="getCalibrationPairsROI" resultType="org.jeecg.modules.entity.GardsCalibrationPairsSpectrum">

View File

@ -59,15 +59,21 @@ public class GardsAnalysesSpectrumServiceImpl extends ServiceImpl<GardsAnalysesM
@Override
public Integer saveAnalyses(Integer sampleId, String startTime, String userName) {
GardsAnalyses analyses = new GardsAnalyses();
GardsAnalyses analyses = new GardsAnalyses(); // TODO 人工交互 分析表数据补全 (包括update)
try {
analyses.setSampleId(sampleId);
analyses.setCategory(1);//按C++代码写死的1该字段是分级结果张博士还没有想好数据要不要分级1,2,3,4
analyses.setAnalysisBegin(DateUtils.parseDate(startTime));
analyses.setAnalysisEnd(new Date());
analyses.setType("Interactive");
analyses.setSoftware("");
analyses.setSwVersion("1.0.1");
analyses.setAnalyst(userName);
// 基础数据
// Beta分析产生的 baseline log report等文件地址
} catch (ParseException e) {
throw new RuntimeException(e);
}
@ -106,6 +112,7 @@ public class GardsAnalysesSpectrumServiceImpl extends ServiceImpl<GardsAnalysesM
analyses.setAnalysisBeginStr(startTime);
analyses.setAnalyst(userName);
analyses.setAnalysisEndStr(DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"));
this.baseMapper.updateAnalyses(analyses);
}
}

View File

@ -307,11 +307,6 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
//将自建台站的数据封装到缓存对象中
selfCache.put(sampleFileName + StringPool.DASH + userName, selfStationData);
//将缓存对象存入到缓存中
selfStationCache.setSelfCache(selfCache);
}
}
//判断det文件名是否为空
@ -326,13 +321,17 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
selfStationData.setDetStruct(struct);
selfStationData.setDetTmpPath(detFilePath);
selfStationUtil.loadFile(selfStationData, detBg.getSampleId(), detBg.getStatus(), "det", map);
resultMap.put("det", map);
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
}
}
//判断qc文件名是否为空
if (Objects.nonNull(qc)) {
//拼接det文件路径
String qcFilePath = prefix + dbSpectrumFilePath.getQcFilePath();
String qcFilePath = prefix + qc.getInputFileName();
//返回结果map
Map<String, Object> map = new HashMap<>();
//获取sample分析后的对象
@ -341,11 +340,16 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
selfStationData.setQcStruct(struct);
selfStationData.setQcTmpPath(qcFilePath);
selfStationUtil.loadFile(selfStationData, qc.getSampleId(), qc.getStatus(), "qc", map);
resultMap.put("qc", map);
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
}
}
// 初始化自建台站Configure信息
if (!StrUtil.equals(dbName, "RNAUTO")) initConfigure(analysisID, selfStationData);
// 初始化自建台站用户核素库信息
if (ObjectUtil.isNotNull(selfStationData.getSampleStruct())){
String systemType = selfStationData.getSampleStruct().getSystem_type();
@ -371,6 +375,11 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
redisUtil.set(userName+StringPool.DASH+systemType+"-self", nuclideMap);
}
}
//将自建台站的数据封装到缓存对象中
selfCache.put(sampleFileName + StringPool.DASH + userName, selfStationData);
//将缓存对象存入到缓存中
selfStationCache.setSelfCache(selfCache);
} else {
if (Objects.nonNull(sample)) {
//返回结果map
@ -407,7 +416,19 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
//返回结果map
Map<String, Object> map = new HashMap<>();
selfStationUtil.loadFile(selfStationData, detBg.getSampleId(), detBg.getStatus(), "det", map);
resultMap.put("det", map);
// 返回Beta和Gamma的数据
bGSpectrum(selfStationData.getDetStruct(), map);
}
if (Objects.nonNull(qc)) {
//返回结果map
Map<String, Object> map = new HashMap<>();
selfStationUtil.loadFile(selfStationData, qc.getSampleId(), qc.getStatus(), "qc", map);
resultMap.put("qc", map);
// 返回Beta和Gamma的数据
bGSpectrum(selfStationData.getQcStruct(), map);
}
}
}
@ -459,8 +480,10 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
selfStationUtil.createGamma(path, sampleFileName, struct, sampleVueData);
resultMap.put("sample", map);
// 初始化Configure
initConfigure(struct, selfStationData);
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
}
@ -479,6 +502,9 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
selfStationData.setDetFileName(detFileName);
selfStationUtil.loadFile(selfStationData, null, null, "det", map);
resultMap.put("det", map);
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
}
}
//判断qc文件名是否为空
@ -495,6 +521,9 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
selfStationData.setQcFileName(qcFileName);
selfStationUtil.loadFile(selfStationData, null, null, "qc", map);
resultMap.put("qc", map);
// 返回Beta和Gamma的数据
bGSpectrum(struct, map);
}
}
if (ObjectUtil.isNotNull(selfStationData.getSampleStruct())){
@ -527,6 +556,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
Map<String, Object> map = new HashMap<>();
selfStationUtil.loadFile(selfStationData, null, null, "sample", map);
resultMap.put("sample", map);
// 返回Beta和Gamma的数据
bGSpectrum(selfStationData.getSampleStruct(), map);
}
@ -535,6 +565,18 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
Map<String, Object> map = new HashMap<>();
selfStationUtil.loadFile(selfStationData, null, null, "det", map);
resultMap.put("det", map);
// 返回Beta和Gamma的数据
bGSpectrum(selfStationData.getDetStruct(), map);
}
if (StringUtils.isNotBlank(qcFileName)) {
//返回结果map
Map<String, Object> map = new HashMap<>();
selfStationUtil.loadFile(selfStationData, null, null, "qc", map);
resultMap.put("qc", map);
// 返回Beta和Gamma的数据
bGSpectrum(selfStationData.getQcStruct(), map);
}
}
//将自建台站的数据封装到缓存对象中
@ -5381,7 +5423,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
EnergySpectrumStruct detStruct = selfStationData.getDetStruct();
String siteCode = sampleStruct.site_code;
Integer stationId = spectrumAnalysisMapper.getStationId(siteCode);
Integer sampleId = null, gasId = null, detId = null, qcId = null;
Integer sampleId; Integer detId;
//判断当前分析员当天是否有对应台站的排班任务
List<String> userStation = userTaskUtil.findUserStation(userName);
boolean bAnalysisResultWriteAuthority = userStation.contains(String.valueOf(stationId));
@ -5478,13 +5520,13 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
result.error500("detFile save failed");
return result;
}
detId = spectrumAnalysisMapper.getSampleId(detFilePathName);
}
if (StringUtils.isNotBlank(qcFilePathName)) {
if (!this.OriginalDataStore(qcStruct, qcTmpPath, qcFilePathName) ){
result.error500("qcFile save failed");
return result;
}
qcId = spectrumAnalysisMapper.getSampleId(qcFilePathName);
}
sampleData = spectrumAnalysisMapper.findSampleByFilePath(sampleFilePathName);
}