fix:Sample_G_Analysis

This commit is contained in:
nieziyan 2023-09-04 09:29:28 +08:00
parent 866cc35790
commit ba02a0567f
3 changed files with 36 additions and 3 deletions

View File

@ -1,5 +1,7 @@
package org.jeecg.modules.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.base.entity.rnauto.GardsAnalyses;
import org.jeecg.modules.base.enums.AnalysesType;
@ -7,6 +9,9 @@ import org.jeecg.modules.mapper.GardsAnalysesMapper;
import org.jeecg.modules.native_jni.struct.BgAnalyseResult;
import org.jeecg.modules.service.GardsAnalysesService;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* 存储谱数据分析的基本信息
*/
@ -41,7 +46,9 @@ public class GardsAnalysesServiceImpl extends ServiceImpl<GardsAnalysesMapper, G
@Override
public Integer getIdAnalysis(Integer sampleId) {
return null;
LambdaQueryWrapper<GardsAnalyses> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(GardsAnalyses::getSampleId,sampleId);
GardsAnalyses gardsAnalyses = getOne(wrapper);
return ObjectUtil.isNull(gardsAnalyses) ? null : gardsAnalyses.getIdAnalysis();
}
}

View File

@ -11,6 +11,7 @@ import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
import org.jeecg.modules.base.entity.original.GardsSampleData;
import org.jeecg.modules.base.entity.rnauto.GardsAnalyses;
import org.jeecg.modules.base.entity.rnauto.GardsCalibrationPairs;
import org.jeecg.modules.base.entity.rnauto.GardsRoiChannels;
import org.jeecg.modules.base.vo.GStoreMiddleProcessData;
import org.jeecg.modules.base.vo.PHDFile;
@ -44,14 +45,37 @@ public class Sample_G_Analysis {
/* 准备Gamma分析需要的数据 */
PHDFile phdFile = getSettingFromDB();
// 从MiddleData获取需要的数据
GStoreMiddleProcessData middleData = new GStoreMiddleProcessData();
String calibrationSampleType = middleData.getCalibration_sample_type();
String calibrationPairsECaltype = middleData.getCalibration_pairs_E_Caltype();
String calibrationPairsEInput = middleData.getCalibration_pairs_E_Input();
List<String> calibrationPairsEIdCalPoint = middleData.getCalibration_pairs_E_idCalPoint();
List<String> calibrationPairsEXValue = middleData.getCalibration_pairs_E_xValue();
List<String> calibrationPairsEYValue = middleData.getCalibration_pairs_E_yValue();
List<String> calibrationPairsEUncYValue = middleData.getCalibration_pairs_E_uncYValue();
// 保存分析结果(Gards_Analyses)
GardsAnalyses analysis = toAnalysis(middleData);
Integer sampleId = sampleData.getSampleId();
analysis.setSampleId(sampleId);
serviceQuotes.getAnalysesService().save(analysis);
// 获取分析结果ID
// 获取分析结果ID ==> SELECT IDANALYSIS
Integer IdAnalysis = serviceQuotes.getAnalysesService().getIdAnalysis(sampleId);
// ==> UPDATE ORIGINAL.GARDS_SAMPLE_DATA
serviceQuotes.getSampleDataService().updateStatus(null,null);
// ==> INSERT INTO RNAUTO.GARDS_CALIBRATION_PAIRS
GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs();
calibrationPairs.setSampleId(sampleId);
calibrationPairs.setIdAnalysis(IdAnalysis);
calibrationPairs.setSampleType(calibrationSampleType);
calibrationPairs.setCaltype(calibrationPairsECaltype);
calibrationPairs.setInput(calibrationPairsEInput);
calibrationPairs.setIdCalPoint(null);
calibrationPairs.setXValue(null);
calibrationPairs.setYValue(null);
calibrationPairs.setUncYValue(null);
serviceQuotes.getGardsCalibrationPairsService().save(calibrationPairs);
}

View File

@ -49,4 +49,6 @@ public class SpectrumServiceQuotes {
private final GardsAnalysesService analysesService;
private final IGardsGammaDefaultParamsService gammaDefaultParamsService;
private final GardsCalibrationPairsService gardsCalibrationPairsService;
}