feat:完善AutoProcess F状态数据解析

This commit is contained in:
nieziyan 2024-06-07 18:25:16 +08:00
parent 6b16aa6a40
commit 939ffb1f6c
4 changed files with 87 additions and 5 deletions

View File

@ -22,6 +22,8 @@ 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, String orderField, String orderType);
Page<GardsSampleDataSpectrum> getDBSpectrumListInner(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, String dbName, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType);
Page<GardsSampleDataSpectrum> loadSampleData(IPage<GardsSampleDataSpectrum> page, GardsSampleDataSpectrum gardsSampleData, List<String> stationTypes, boolean CollectStopB, boolean AcqStartB, String startTime, String endTime, List<String> userStations, boolean AllUsers, String orderField, String orderType);
SpectrumFileRecord getDBSpectrumFilePath(String dbName, Integer sampleId, Integer analysisID);

View File

@ -103,6 +103,78 @@
</if>
</select>
<select id="getDBSpectrumListInner" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
select c.sample_id sampleId,
b.station_code stationName,
a.detector_code detectorsName,
c.sample_type sampleType,
c.data_type dataType,
c.spectral_qualifie spectralQualifie,
c.collect_stop collectStop,
c.acquisition_start acquisitionStart,
c.acquisition_real_sec acquisitionRealSec,
c.acquisition_live_sec acquisitionLiveSec,
d.IDANALYSIS analysitId,
d.analyst analyst,
c.status status,
c.input_file_name inputFileName
FROM
ORIGINAL.GARDS_SAMPLE_DATA c
INNER JOIN ${dbName} d ON c.sample_id = d.sample_id
INNER JOIN CONFIGURATION.GARDS_DETECTORS a ON c.detector_id = a.detector_id
INNER JOIN CONFIGURATION.GARDS_STATIONS b ON c.station_id = b.station_id
<where>
b.type in
<foreach collection="stationTypes" item="stationType" open="(" close=")" separator=",">
#{stationType}
</foreach>
<if test=" gardsSampleData.sampleId != null ">
and c.sample_id = #{gardsSampleData.sampleId}
</if>
<if test=" gardsSampleData.stationName != null and gardsSampleData.stationName != '' ">
and b.station_code = #{gardsSampleData.stationName}
</if>
<if test=" gardsSampleData.detectorsName != null and gardsSampleData.detectorsName != '' ">
and a.detector_code = #{gardsSampleData.detectorsName}
</if>
<if test=" gardsSampleData.sampleType != null and gardsSampleData.sampleType != '' ">
and c.sample_type = #{gardsSampleData.sampleType}
</if>
<if test=" gardsSampleData.dataType != null and gardsSampleData.dataType != '' ">
and c.data_type = #{gardsSampleData.dataType}
</if>
<if test=" gardsSampleData.spectralQualifie != null and gardsSampleData.spectralQualifie != '' ">
and c.spectral_qualifie = #{gardsSampleData.spectralQualifie}
</if>
<if test=" gardsSampleData.status != null and gardsSampleData.status != '' ">
and c.status = #{gardsSampleData.status}
</if>
<if test=" CollectStopB == true ">
and c.collect_stop between TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test=" AcqStartB == true ">
and c.acquisition_start between TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="AllUsers == false">
<if test=" userStations.size == 0 and userStations != null ">
and c.station_id in ('')
</if>
<if test=" userStations.size > 0 and userStations != null ">
and c.station_id in
<foreach collection="userStations" item="userStation" open="(" close=")" separator=",">
#{userStation}
</foreach>
</if>
</if>
</where>
<if test=" orderField != 'createTime' and orderField != '' and orderField != null and orderType != '' and orderType != null ">
ORDER BY ${orderField} ${orderType}
</if>
<if test=" orderField == 'createTime' or orderField == '' or orderField == null or orderType == '' or orderType == null ">
ORDER BY collectStop DESC
</if>
</select>
<select id="loadSampleData" resultType="org.jeecg.modules.entity.GardsSampleDataSpectrum">
select
c.sample_id sampleId,

View File

@ -4842,10 +4842,13 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
idAnalysis = spectrumAnalysisMapper.getIdAnalysisByIdAnalyst(phd.getId_sample(), userName);
// 写入 RNMAN数据库
// 获取phd文件中的totalcmt信息 存入数据库
String comments = phd.getTotalCmt().trim();
// 如果comment的数据长度大于1024 则截取前1024部分
if (comments.length() > 1024) {
comments = comments.substring(0, 1024);
String comments = null;
if (StrUtil.isNotBlank(phd.getTotalCmt())){
comments = phd.getTotalCmt().trim();
// 如果comment的数据长度大于1024 则截取前1024部分
if (comments.length() > 1024) {
comments = comments.substring(0, 1024);
}
}
// 判断idAnalysis是否为空
if (StringUtils.isBlank(idAnalysis)) {

View File

@ -291,7 +291,12 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
}
//声明分页page
Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder());
String status = gardsSampleData.getStatus();
Page<GardsSampleDataSpectrum> sampleDataPage;
if (StrUtil.equals(SampleStatus.FAIL.getValue(), status))
sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder());
else
sampleDataPage = spectrumAnalysisMapper.getDBSpectrumListInner(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers, queryRequest.getField(), queryRequest.getOrder());
sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);});
result.setSuccess(true);
result.setResult(sampleDataPage);