diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java index 267c3eac..cbd3872a 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/PHDFileUtil.java @@ -232,10 +232,13 @@ public class PHDFileUtil { Double mdc = xeData.getMdc(); if (conc < 0){ xeData.setColor("red"); + xeData.setNidFlag(0); } else if (0 mdc) { xeData.setColor("green"); + xeData.setNidFlag(1); } } map.put("XeData", xeDataList); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/UserTaskUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/UserTaskUtil.java index eb6b0bde..875ae6a7 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/UserTaskUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/UserTaskUtil.java @@ -70,7 +70,7 @@ public class UserTaskUtil { String userId = user.getId(); List userStations = userTaskService.findUserStations(userId); if (Objects.nonNull(stationId) && CollectionUtils.isNotEmpty(userStations)){ - if (userStations.contains(stationId)){ + if (userStations.contains(String.valueOf(stationId))){ flag = true; } } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgDataAnlyseResultIn.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgDataAnlyseResultIn.java index c671c694..2f500869 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgDataAnlyseResultIn.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BgDataAnlyseResultIn.java @@ -1,6 +1,10 @@ package org.jeecg.modules.entity.vo; import lombok.Data; +import org.jeecg.modules.entity.GardsCalibrationSpectrum; +import org.jeecg.modules.entity.GardsROIChannelsSpectrum; +import org.jeecg.modules.entity.GardsROIResultsSpectrum; +import org.jeecg.modules.entity.GardsXeResultsSpectrum; import java.io.Serializable; import java.util.List; @@ -205,24 +209,14 @@ public class BgDataAnlyseResultIn implements Serializable { private int Xe135Flag; - private List s_roi_cts; + List gammaCalibrationSpectrumList; - private List LC; + List betaCalibrationSpectrumList; - private List g_roi_cts; + List roiChannelsSpectrumList; - private List d_roi_cts; + List roiResultsSpectrumList; - private List s_deduct_d_cts; - - private List g_deduct_d_cts; - - private List ROI_net_coutns; - - private List ROI_net_err; - - private List ROI_con_uncer; - - private List MDC; + List XeData; } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIChannelsSpectrumMapper.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIChannelsSpectrumMapper.java new file mode 100644 index 00000000..67ebc0a6 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIChannelsSpectrumMapper.java @@ -0,0 +1,7 @@ +package org.jeecg.modules.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.base.entity.rnman.GardsRoiChannels; + +public interface GardsROIChannelsSpectrumMapper extends BaseMapper { +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIResultsSpectrumMapper.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIResultsSpectrumMapper.java new file mode 100644 index 00000000..83cabd03 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsROIResultsSpectrumMapper.java @@ -0,0 +1,7 @@ +package org.jeecg.modules.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.base.entity.rnman.GardsRoiResults; + +public interface GardsROIResultsSpectrumMapper extends BaseMapper { +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsXeResultsSpectrumMapper.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsXeResultsSpectrumMapper.java new file mode 100644 index 00000000..1ea32951 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/GardsXeResultsSpectrumMapper.java @@ -0,0 +1,7 @@ +package org.jeecg.modules.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.base.entity.rnman.GardsXeResults; + +public interface GardsXeResultsSpectrumMapper extends BaseMapper { +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java index a9306dde..391690f6 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/SpectrumAnalysisMapper.java @@ -1,5 +1,6 @@ package org.jeecg.modules.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; @@ -7,7 +8,9 @@ import org.apache.ibatis.annotations.Param; import org.jeecg.modules.base.entity.configuration.GardsDetectors; import org.jeecg.modules.base.entity.configuration.GardsNuclLib; import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib; +import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.base.entity.rnman.GardsAnalySetting; +import org.jeecg.modules.base.entity.rnman.GardsCalibrationPairs; import org.jeecg.modules.entity.*; import org.jeecg.modules.entity.vo.*; @@ -116,6 +119,8 @@ public interface SpectrumAnalysisMapper { Integer SampleIsExist(@Param(value = "filePathName") String filePathName, @Param(value = "userName") String userName); + GardsSampleData findSampleByFile(@Param(value = "filePathName") String filePathName); + void updateAnalysesStatus(String filePathName); Integer getStationId(String stationName); @@ -124,13 +129,14 @@ public interface SpectrumAnalysisMapper { Integer getSampleId(@Param(value = "filePathName") String filePathName); - void updateGardsAnalyses(GardsAnalysesSpectrum gardsAnalyses); + void updateGardsAnalyses(@Param(value = "gardsAnalyses") GardsAnalysesSpectrum gardsAnalyses); - void insertGardsAnalyses(GardsAnalysesSpectrum gardsAnalyses); + void insertGardsAnalyses(@Param(value = "gardsAnalyses") GardsAnalysesSpectrum gardsAnalyses); void deleteCalibrationPairs(Integer idAnalysis); - void insertCalibrationPairs(List calibrationPairsList); + @InterceptorIgnore(tenantLine = "true") + void insertCalibrationPairs(List calibrationPairsList); void deleteCalibration(Integer idAnalysis); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml index 458b6737..2fc9b382 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/mapper/xml/SpectrumAnalysisMapper.xml @@ -748,6 +748,10 @@ SELECT IDANALYSIS FROM RNMAN.GARDS_ANALYSES WHERE SAMPLE_ID=(SELECT SAMPLE_ID FROM ORIGINAL.GARDS_SAMPLE_DATA WHERE INPUT_FILE_NAME = #{filePathName}) AND ANALYST= #{userName} + + UPDATE ORIGINAL.GARDS_SAMPLE_DATA A SET A.STATUS='R' WHERE INPUT_FILE_NAME=#{filePathName} @@ -819,26 +823,11 @@ DELETE FROM RNMAN.GARDS_CALIBRATION_PAIRS WHERE IDANALYSIS=#{idAnalysis} - - - INSERT INTO - RNMAN.GARDS_CALIBRATION_PAIRS( - SAMPLE_ID, - IDANALYSIS, - SAMPLE_TYPE, - CALTYPE, - INPUT, - IDCALPOINT, - XVALUE, - YVALUE) - VALUES(#{calibrationPairs.sampleId}, - #{calibrationPairs.idAnalysis}, - #{calibrationPairs.sampleType}, - #{calibrationPairs.caltype}, - #{calibrationPairs.input}, - #{calibrationPairs.idCalPoint}, - #{calibrationPairs.xValue}, - #{calibrationPairs.yValue},) + + INSERT INTO RNMAN.GARDS_CALIBRATION_PAIRS(SAMPLE_ID,IDANALYSIS,SAMPLE_TYPE,CALTYPE,INPUT,IDCALPOINT,XVALUE,YVALUE) + VALUES + + (#{calibrationPairs.sampleId},#{calibrationPairs.idAnalysis},#{calibrationPairs.sampleType},#{calibrationPairs.caltype},#{calibrationPairs.input},#{calibrationPairs.idCalPoint},#{calibrationPairs.xValue},#{calibrationPairs.yValue}) @@ -847,20 +836,20 @@ - - INSERT INTO - RNMAN.GARDS_CALIBRATION( - SAMPLE_ID, - IDANALYSIS, - SAMPLE_TYPE, - CALTYPE, - FUNCTION, - FUNCTIONDEF, - STARTOFRANGE, - ENDOFRANGE, - COEFF1, - COEFF2, - COEFF3) + INSERT INTO + RNMAN.GARDS_CALIBRATION( + SAMPLE_ID, + IDANALYSIS, + SAMPLE_TYPE, + CALTYPE, + FUNCTION, + FUNCTIONDEF, + STARTOFRANGE, + ENDOFRANGE, + COEFF1, + COEFF2, + COEFF3) + VALUES(#{calibration.sampleId}, #{calibration.idAnalysis}, #{calibration.sampleType}, @@ -881,16 +870,16 @@ - - INSERT INTO - RNMAN.GARDS_ROI_CHANNELS( - SAMPLE_ID, - IDANALYSIS, - ROI, - B_CHAN_START, - B_CHAN_STOP, - G_CHAN_START, - G_CHAN_STOP) + INSERT INTO + RNMAN.GARDS_ROI_CHANNELS( + SAMPLE_ID, + IDANALYSIS, + ROI, + B_CHAN_START, + B_CHAN_STOP, + G_CHAN_START, + G_CHAN_STOP) + VALUES(#{roiChannels.sampleId}, #{roiChannels.idAnalysis}, #{roiChannels.roi}, @@ -906,16 +895,16 @@ - - INSERT INTO - RNMAN.GARDS_XE_RESULTS(SAMPLE_ID, - IDANALYSIS, - NUCLIDE_NAME, - CONC, - CONC_ERR, - MDC, - LC, - NID_FLAG) + INSERT INTO + RNMAN.GARDS_XE_RESULTS(SAMPLE_ID, + IDANALYSIS, + NUCLIDE_NAME, + CONC, + CONC_ERR, + MDC, + LC, + NID_FLAG) + VALUES(#{xeResult.sampleId}, #{xeResult.idAnalysis}, #{xeResult.nuclideName}, @@ -932,23 +921,23 @@ - - INSERT INTO - RNMAN.GARDS_ROI_RESULTS(SAMPLE_ID, - IDANALYSIS, - ROI, - LC, - S_GROSS, - G_GROSS, - B_GROSS, - S_NET, - G_NET, - NET, - NET_ERR, - CONC, - CONC_ERR, - MDC, - NID_FLAG) + INSERT INTO + RNMAN.GARDS_ROI_RESULTS(SAMPLE_ID, + IDANALYSIS, + ROI, + LC, + S_GROSS, + G_GROSS, + B_GROSS, + S_NET, + G_NET, + NET, + NET_ERR, + CONC, + CONC_ERR, + MDC, + NID_FLAG) + VALUES(#{roiResultsSpectrum.sampleId}, #{roiResultsSpectrum.idAnalysis}, #{roiResultsSpectrum.roi}, diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java index 8ef1d592..b02d240d 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java @@ -6,8 +6,7 @@ import java.util.List; * 能谱结构体字段信息 */ public class EnergySpectrumStruct { - - /************************* Infomations ******************/ +/************************* Infomations ******************/ /** * 消息类型 */ @@ -70,9 +69,9 @@ public class EnergySpectrumStruct { * transmit time (hh : mm : ss . s) */ public String transmit_time; + /************************* Sample ******************/ public double dimension_1; - public double dimension_2; /************************* Comment ******************/ @@ -267,7 +266,7 @@ public class EnergySpectrumStruct { /** * ROI number */ - public List bg_ROI_number; + public List bg_ROI_number; /** * β-γ coincidence efficiency (counts in ROI/β-γ pair emitted) */ @@ -420,6 +419,7 @@ public class EnergySpectrumStruct { public List intensity_b_particle; public int record_count; + /************************* Totaleff Block ******************/ /** * γ-energy (keV) diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationPairsSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationPairsSpectrumService.java index 288ff94f..c6aad278 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationPairsSpectrumService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationPairsSpectrumService.java @@ -5,8 +5,12 @@ import org.jeecg.modules.base.entity.rnman.GardsCalibrationPairs; import org.jeecg.modules.entity.vo.GStoreMiddleProcessData; import org.jeecg.modules.entity.vo.PHDFile; +import java.util.List; + public interface IGardsCalibrationPairsSpectrumService extends IService { + int saveGardsCalibrationPairs(List calibrationPairsList); + boolean saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationSpectrumService.java index 0167cc8f..5ee16735 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationSpectrumService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsCalibrationSpectrumService.java @@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.base.entity.rnman.GardsCalibration; import org.jeecg.modules.entity.vo.GStoreMiddleProcessData; +import java.util.List; + public interface IGardsCalibrationSpectrumService extends IService { + int saveGardsCalibration(List calibrationPairsList); + boolean saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis); } diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIChannelsSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIChannelsSpectrumService.java new file mode 100644 index 00000000..90b781d4 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIChannelsSpectrumService.java @@ -0,0 +1,12 @@ +package org.jeecg.modules.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.base.entity.rnman.GardsRoiChannels; + +import java.util.List; + +public interface IGardsROIChannelsSpectrumService extends IService { + + int saveGardsROIChannels(List roiChannelsList); + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIResultsSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIResultsSpectrumService.java new file mode 100644 index 00000000..eed0f3d2 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsROIResultsSpectrumService.java @@ -0,0 +1,12 @@ +package org.jeecg.modules.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.base.entity.rnman.GardsRoiResults; + +import java.util.List; + +public interface IGardsROIResultsSpectrumService extends IService { + + int saveGardsROIResults(List roiResultsList); + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsXeResultsSpectrumService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsXeResultsSpectrumService.java new file mode 100644 index 00000000..800d3726 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGardsXeResultsSpectrumService.java @@ -0,0 +1,12 @@ +package org.jeecg.modules.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.base.entity.rnman.GardsXeResults; + +import java.util.List; + +public interface IGardsXeResultsSpectrumService extends IService { + + int saveGardsXeResults(List xeResultsList); + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalySettingSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalySettingSpectrumServiceImpl.java index 8fbfe812..ed6165ab 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalySettingSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalySettingSpectrumServiceImpl.java @@ -7,12 +7,14 @@ import org.jeecg.modules.entity.vo.PHDFile; import org.jeecg.modules.mapper.GardsAnalySettingSpectrumMapper; import org.jeecg.modules.service.IGardsAnalySettingSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; @Service("gardsAnalySettingSpectrumService") @DS("ora") public class GardsAnalySettingSpectrumServiceImpl extends ServiceImpl implements IGardsAnalySettingSpectrumService { @Override + @Transactional public boolean saveAnalySettingGamma(PHDFile phd, String idAnalysis) { boolean bRet = false; GardsAnalySetting analySetting = new GardsAnalySetting(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalysesSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalysesSpectrumServiceImpl.java index 755e2391..1d71bf85 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalysesSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsAnalysesSpectrumServiceImpl.java @@ -10,6 +10,7 @@ import org.jeecg.modules.entity.GardsAnalysesSpectrum; import org.jeecg.modules.mapper.GardsAnalysesManMapper; import org.jeecg.modules.service.IGardsAnalysesSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.ParseException; import java.util.Date; @@ -19,6 +20,7 @@ import java.util.Date; public class GardsAnalysesSpectrumServiceImpl extends ServiceImpl implements IGardsAnalysesSpectrumService { @Override + @Transactional public Integer insertEntity(GStoreMiddleProcessData middleData, PHDFile phd, String userName, String comments) { try { GardsAnalyses analyses = new GardsAnalyses(); @@ -46,6 +48,7 @@ public class GardsAnalysesSpectrumServiceImpl extends ServiceImpl implements IGardsBgEfficiencyPairsSpectrumService { @Override + @Transactional public Integer saveBgEfficiencyPairs(EnergySpectrumStruct sourceData, Integer sampleId) { List bgEfficiencyPairsList = new LinkedList<>(); for (int i=0; i< sourceData.bg_record_count; i++){ GardsBgEfficiencyPairs bgEfficiencyPairs = new GardsBgEfficiencyPairs(); bgEfficiencyPairs.setSampleId(sampleId); - bgEfficiencyPairs.setRoi(Integer.valueOf(sourceData.bg_ROI_number.get(i))); + bgEfficiencyPairs.setRoi(sourceData.bg_ROI_number.get(i).intValue()); bgEfficiencyPairs.setNuclideName(sourceData.bg_nuclide_name.get(i)); bgEfficiencyPairs.setBgEfficiency(sourceData.bg_efficiency.get(i)); bgEfficiencyPairs.setBgEfficError(sourceData.bg_uncertainty.get(i)); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsOrigSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsOrigSpectrumServiceImpl.java index 205415b8..3872d4e1 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsOrigSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsOrigSpectrumServiceImpl.java @@ -16,6 +16,7 @@ import org.jeecg.modules.mapper.GardsCalibrationPairsOrigSpectrumMapper; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.service.IGardsCalibrationPairsOrigSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -25,6 +26,7 @@ import java.util.List; public class GardsCalibrationPairsOrigSpectrumServiceImpl extends ServiceImpl implements IGardsCalibrationPairsOrigSpectrumService { @Override + @Transactional public Integer saveGardsCalibrationPairsOrig(EnergySpectrumStruct sourceData, Integer sampleId, List readLines) { List calibrationPairsOrigList = new LinkedList<>(); //判断文件是否包含g_Energy块 新增Gards_Calibration_Pairs_Orig数据 @@ -106,6 +108,7 @@ public class GardsCalibrationPairsOrigSpectrumServiceImpl extends ServiceImpl calibrationPairsOrigList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsSpectrumServiceImpl.java index 9e8ec425..723d86cd 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationPairsSpectrumServiceImpl.java @@ -11,6 +11,7 @@ import org.jeecg.modules.entity.GardsCalibrationSpectrum; import org.jeecg.modules.mapper.GardsCalibrationPairsSpectrumMapper; import org.jeecg.modules.service.IGardsCalibrationPairsSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -19,8 +20,17 @@ import java.util.List; @DS("ora") public class GardsCalibrationPairsSpectrumServiceImpl extends ServiceImpl implements IGardsCalibrationPairsSpectrumService { + @Override + @Transactional + public int saveGardsCalibrationPairs(List calibrationPairsList) { + if (CollectionUtils.isNotEmpty(calibrationPairsList)) { + this.saveBatch(calibrationPairsList); + } + return calibrationPairsList.size(); + } @Override + @Transactional public boolean saveGardsCalibrationPairsGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) { boolean bRet = false; List calibrationPairsList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationSpectrumServiceImpl.java index 725edc90..fe948518 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsCalibrationSpectrumServiceImpl.java @@ -8,6 +8,7 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessData; import org.jeecg.modules.mapper.GardsCalibrationSpectrumMapper; import org.jeecg.modules.service.IGardsCalibrationSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -18,6 +19,16 @@ public class GardsCalibrationSpectrumServiceImpl extends ServiceImpl calibrationPairsList) { + if (CollectionUtils.isNotEmpty(calibrationPairsList)) { + this.saveBatch(calibrationPairsList); + } + return calibrationPairsList.size(); + } + + @Override + @Transactional public boolean saveCalibrationGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) { boolean bRet = false; List calibrationList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsHistogramSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsHistogramSpectrumServiceImpl.java index 9da481bb..aadade52 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsHistogramSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsHistogramSpectrumServiceImpl.java @@ -7,6 +7,7 @@ import org.jeecg.modules.mapper.GardsHistogramSpectrumMapper; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.service.IGardsHistogramSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -15,6 +16,7 @@ import java.util.List; public class GardsHistogramSpectrumServiceImpl extends ServiceImpl implements IGardsHistogramSpectrumService { @Override + @Transactional public Integer saveHistogram(EnergySpectrumStruct sourceData, Integer sampleId, String filePathName) { GardsHistogram histogram = new GardsHistogram(); histogram.setSampleId(sampleId); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java index c5144c77..42d0dcf7 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclIdedSpectrumServiceImpl.java @@ -9,6 +9,7 @@ import org.jeecg.modules.entity.GardsNuclIdedSpectrum; import org.jeecg.modules.mapper.GardsNuclIdedSpectrumMapper; import org.jeecg.modules.service.IGardsNuclIdedSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -19,6 +20,7 @@ public class GardsNuclIdedSpectrumServiceImpl extends ServiceImpl nuclIdedList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesIdedSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesIdedSpectrumServiceImpl.java index 28805f4e..379edb47 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesIdedSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsNuclLinesIdedSpectrumServiceImpl.java @@ -9,6 +9,7 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessDataNuclLinesIded; import org.jeecg.modules.mapper.GardsNuclLinesIdedSpectrumMapper; import org.jeecg.modules.service.IGardsNuclLinesIdedSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -19,6 +20,7 @@ import java.util.Map; public class GardsNuclLinesIdedSpectrumServiceImpl extends ServiceImpl implements IGardsNuclLinesIdedSpectrumService { @Override + @Transactional public boolean saveNuclLinesIdedGamma(GStoreMiddleProcessData middleData, Integer sampleId, String idAnalysis) { boolean bRet = false; Map map = middleData.nucl_lines_ided_data; diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsPeaksSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsPeaksSpectrumServiceImpl.java index 5415249a..51544117 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsPeaksSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsPeaksSpectrumServiceImpl.java @@ -8,6 +8,7 @@ import org.jeecg.modules.entity.vo.GStoreMiddleProcessData; import org.jeecg.modules.mapper.GardsPeaksSpectrumMapper; import org.jeecg.modules.service.IGardsPeaksSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -18,6 +19,7 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl peaksList = new LinkedList<>(); int t_size = middleData.peaks_idPeak.size(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsQcCheckSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsQcCheckSpectrumServiceImpl.java index e501c0a5..d6974a04 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsQcCheckSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsQcCheckSpectrumServiceImpl.java @@ -9,6 +9,7 @@ import org.jeecg.modules.entity.GardsQcCheckSpectrum; import org.jeecg.modules.mapper.GardsQcCheckSpectrumMapper; import org.jeecg.modules.service.IGardsQcCheckSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -19,6 +20,7 @@ public class GardsQcCheckSpectrumServiceImpl extends ServiceImpl implements IGardsROIChannelsSpectrumService { + + @Override + @Transactional + public int saveGardsROIChannels(List roiChannelsList) { + if (CollectionUtils.isNotEmpty(roiChannelsList)) { + this.saveBatch(roiChannelsList); + } + return roiChannelsList.size(); + } + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsROIResultsSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsROIResultsSpectrumServiceImpl.java new file mode 100644 index 00000000..db672e27 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsROIResultsSpectrumServiceImpl.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.base.entity.rnman.GardsRoiResults; +import org.jeecg.modules.mapper.GardsROIResultsSpectrumMapper; +import org.jeecg.modules.service.IGardsROIResultsSpectrumService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("roiResultsSpectrumService") +@DS("ora") +public class GardsROIResultsSpectrumServiceImpl extends ServiceImpl implements IGardsROIResultsSpectrumService { + + @Override + public int saveGardsROIResults(List roiResultsList) { + if (CollectionUtils.isNotEmpty(roiResultsList)) { + this.saveBatch(roiResultsList); + } + return roiResultsList.size(); + } + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsRoiLimitsSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsRoiLimitsSpectrumServiceImpl.java index 39213c97..26b3e8a5 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsRoiLimitsSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsRoiLimitsSpectrumServiceImpl.java @@ -8,6 +8,7 @@ import org.jeecg.modules.mapper.GardsRoiLimitsSpectrumMapper; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.service.IGardsRoiLimitsSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; @@ -17,6 +18,7 @@ import java.util.List; public class GardsRoiLimitsSpectrumServiceImpl extends ServiceImpl implements IGardsRoiLimitsSpectrumService { @Override + @Transactional public Integer saveRoiLimits(EnergySpectrumStruct sourceData, Integer sampleId) { List roiLimitsList = new LinkedList<>(); for (int i=0; i implements IGardsSampleAuxSpectrumService { @Override + @Transactional public Integer saveSampleAux(EnergySpectrumStruct sourceData, Integer sampleId, List readLines) { String sampleRefId = ""; String measurementID = ""; @@ -37,16 +39,11 @@ public class GardsSampleAuxSpectrumServiceImpl extends ServiceImpl implements IGardsSampleCertLineSpectrumService { @Override + @Transactional public Integer saveSampleCertLine(EnergySpectrumStruct sourceData, Integer sampleId) { List sampleCertLineList = new LinkedList<>(); for (int i=0; i sampleCertLineList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsSampleCertSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsSampleCertSpectrumServiceImpl.java index c3880123..3a295c47 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsSampleCertSpectrumServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsSampleCertSpectrumServiceImpl.java @@ -9,6 +9,7 @@ import org.jeecg.modules.mapper.GardsSampleCertSpectrumMapper; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.service.IGardsSampleCertSpectrumService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.ParseException; @@ -17,6 +18,7 @@ import java.text.ParseException; public class GardsSampleCertSpectrumServiceImpl extends ServiceImpl implements IGardsSampleCertSpectrumService { @Override + @Transactional public Integer saveSampleCert(EnergySpectrumStruct sourceData, Integer sampleId) { GardsSampleCert sampleCert = new GardsSampleCert(); try { @@ -32,6 +34,7 @@ public class GardsSampleCertSpectrumServiceImpl extends ServiceImpl implements IGardsSampleDataSpectrumService { @Override + @Transactional public Integer saveSampleData(EnergySpectrumStruct sourceData, Integer stationId, Integer detectorId, String filePathName, List readLines) { String sample_type = ""; String detect_code = ""; @@ -35,16 +38,14 @@ public class GardsSampleDataSpectrumServiceImpl extends ServiceImpl implements IGardsSampleDescriptionSpectrumService { @Override + @Transactional public Integer saveSampleDescription(EnergySpectrumStruct sourceData, Integer sampleId) { GardsSampleDescription sampleDescription = new GardsSampleDescription(); String comment = sourceData.comment; @@ -28,6 +30,7 @@ public class GardsSampleDescriptionSpectrumServiceImpl extends ServiceImpl implements IGardsSampleRatiosSpectrumService { @Override + @Transactional public Integer saveSampleRatios(EnergySpectrumStruct sourceData, Integer sampleId) { List sampleRatiosList = new LinkedList<>(); for (int i=0; i implements IGardsSpectrumSpectrumService { @Override + @Transactional public Integer saveSpectrum(EnergySpectrumStruct sourceData, Integer sampleId, List readLines, String filePathName) { List spectrumList = new LinkedList<>(); //判断是否包含b_Spectrum块 新增Gards_Spectrum数据 @@ -52,6 +54,7 @@ public class GardsSpectrumSpectrumServiceImpl extends ServiceImpl implements IGardsTotalEfficiencyPairsSpectrumService { @Override + @Transactional public Integer saveTotalEfficiencyPairs(EnergySpectrumStruct sourceData, Integer sampleId) { List totalEfficiencyPairsList = new LinkedList<>(); for (int i=0; i totalEfficiencyPairsList = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsXeResultsSpectrumServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsXeResultsSpectrumServiceImpl.java new file mode 100644 index 00000000..f4c2b5b0 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GardsXeResultsSpectrumServiceImpl.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.base.entity.rnman.GardsXeResults; +import org.jeecg.modules.mapper.GardsXeResultsSpectrumMapper; +import org.jeecg.modules.service.IGardsXeResultsSpectrumService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service("xeResultsSpectrumService") +@DS("ora") +public class GardsXeResultsSpectrumServiceImpl extends ServiceImpl implements IGardsXeResultsSpectrumService { + + @Override + @Transactional + public int saveGardsXeResults(List xeResultsList) { + if (CollectionUtils.isNotEmpty(xeResultsList)) { + this.saveBatch(xeResultsList); + } + return xeResultsList.size(); + } + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index 4c92d6ab..ff41225c 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -22,16 +22,17 @@ import org.jeecg.common.util.*; import org.jeecg.modules.base.bizVo.BetaRLR; import org.jeecg.modules.base.entity.configuration.GardsDetectors; import org.jeecg.modules.base.entity.original.*; +import org.jeecg.modules.base.entity.rnman.*; import org.jeecg.modules.base.enums.*; import org.jeecg.modules.entity.*; import org.jeecg.modules.entity.vo.*; import org.jeecg.modules.mapper.SpectrumAnalysisMapper; import org.jeecg.modules.native_jni.EnergySpectrumHandler; -import org.jeecg.modules.native_jni.struct.BgBoundary; import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; import org.jeecg.modules.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; @@ -73,6 +74,16 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { @Autowired private IGardsSampleCertLineSpectrumService sampleCertLineSpectrumService; @Autowired + private IGardsCalibrationSpectrumService calibrationSpectrumService; + @Autowired + private IGardsROIChannelsSpectrumService roiChannelsSpectrumService; + @Autowired + private IGardsXeResultsSpectrumService xeResultsSpectrumService; + @Autowired + private IGardsROIResultsSpectrumService roiResultsSpectrumService; + @Autowired + private IGardsCalibrationPairsSpectrumService calibrationPairsSpectrumService; + @Autowired private IGardsCalibrationPairsOrigSpectrumService calibrationPairsOrigSpectrumService; @Autowired private IGardsBgEfficiencyPairsSpectrumService bgEfficiencyPairsSpectrumService; @@ -2532,7 +2543,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { map.put("sampleFileName", sampleFileName); BgDataAnlyseResultIn resultIn = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, map); if (Objects.nonNull(resultIn)) { - List xeDataList = getXeResults(resultIn, sampleId, analysisID); + List xeDataList = getXeDataList(resultIn, sampleId, analysisID); if (CollectionUtils.isNotEmpty(xeDataList)){ for (GardsXeResultsSpectrum xeData:xeDataList) { Double conc = xeData.getConc(); @@ -2606,7 +2617,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { File detTmp = phdFileUtil.analyzeFile(detPath, detFileName); map.put("sampleFileName", sampleFileName); BgDataAnlyseResultIn resultIn = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, map); - List xeDataList = getXeResults(resultIn, sampleId, analysisID); + List xeDataList = getXeDataList(resultIn, sampleId, analysisID); if (CollectionUtils.isNotEmpty(xeDataList)){ for (GardsXeResultsSpectrum xeData:xeDataList) { Double conc = xeData.getConc(); @@ -2634,6 +2645,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } @Override + @Transactional public Result saveToDB(BgDataAnlyseResultIn anlyseResultIn) { Result result = new Result(); Map map = new HashMap<>(); @@ -2669,16 +2681,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } //判断当前分析员是否有过历史分析当前文件 Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName()); - //获取sample,gas,det对应的临时文件 - File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName()); - File gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName()); - File detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName()); - if (Objects.isNull(sampleTmp) || Objects.isNull(gasTmp) || Objects.isNull(detTmp)) { - result.error500("ftp文件获取失败!"); - return result; - } - //解析文件内容获取对应数据 - BgDataAnlyseResultIn resultIn = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, map); //根据文件名称查询对应的sampleId--- sampleFile gasFile detFile Integer sampleId = spectrumAnalysisMapper.getSampleId(sampleFilePathName); Integer gasId = spectrumAnalysisMapper.getSampleId(gasFilePathName); @@ -2698,84 +2700,76 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { gardsAnalyses.setUsedgasphdId(gasId); gardsAnalyses.setUseddetphdId(detId); gardsAnalyses.setAnalyst(anlyseResultIn.getUserName()); - map.put("gardsAnalyses", gardsAnalyses); if (Objects.nonNull(isExist)){ - //spectrumAnalysisMapper.updateGardsAnalyses(gardsAnalyses); + spectrumAnalysisMapper.updateGardsAnalyses(gardsAnalyses); }else {//如果没有分析过就新增--GARDS_ANALYSES - //spectrumAnalysisMapper.insertGardsAnalyses(gardsAnalyses); + spectrumAnalysisMapper.insertGardsAnalyses(gardsAnalyses); } //查询analysisId根据sampleId 分析员名称--GARDS_ANALYSES GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis("RNMAN.GARDS_ANALYSES", sampleId); Integer idAnalysis = analysis.getIdAnalysis(); //获取sample,gas,det三个文件分别对应的beta,gamma数据集合 - List calibrationPairsList = getCalibrationPairs(anlyseResultIn, sampleId, gasId, detId, idAnalysis); - map.put("calibrationPairsList", calibrationPairsList); + List calibrationPairsList = getCalibrationPairs(anlyseResultIn, sampleId, gasId, detId, idAnalysis); //如果分析过--删除GARDS_CALIBRATION_PAIRS表数据 新增GARDS_CALIBRATION_PAIRS表数据 if (Objects.nonNull(isExist)){ //根据idAnalysis删除GARDS_CALIBRATION_PAIRS表数据 - //spectrumAnalysisMapper.deleteCalibrationPairs(idAnalysis); + spectrumAnalysisMapper.deleteCalibrationPairs(idAnalysis); //新增GARDS_CALIBRATION_PAIRS表数据 - //spectrumAnalysisMapper.insertCalibrationPairs(calibrationPairsList); + spectrumAnalysisMapper.insertCalibrationPairs(calibrationPairsList); }else {//如果没有分析过--新增GARDS_CALIBRATION_PAIRS表数据 //新增GARDS_CALIBRATION_PAIRS表数据 - //spectrumAnalysisMapper.insertCalibrationPairs(calibrationPairsList); + spectrumAnalysisMapper.insertCalibrationPairs(calibrationPairsList); } //gards_calibration 数据表 - List calibrationList = getCalibration(anlyseResultIn, sampleId, gasId, detId, idAnalysis); - map.put("calibrationList", calibrationList); + List calibrationList = getCalibration(anlyseResultIn, sampleId, gasId, detId, idAnalysis); //判断是否分析过 if (Objects.nonNull(isExist)) { //删除Gards_Calibration表数据 - //spectrumAnalysisMapper.deleteCalibration(idAnalysis); + spectrumAnalysisMapper.deleteCalibration(idAnalysis); //新增数据 - //spectrumAnalysisMapper.insertCalibration(calibrationList); + calibrationSpectrumService.saveGardsCalibration(calibrationList); } else { //新增数据 - //spectrumAnalysisMapper.insertCalibration(calibrationList); + calibrationSpectrumService.saveGardsCalibration(calibrationList); } //gards_roi_channels数据表 - List roiChannelsList = new LinkedList<>(); - List roiChannelsSpectrumList = (List) map.get("roiChannelsSpectrumList"); - getROIChannel(sampleId, idAnalysis, roiChannelsSpectrumList, roiChannelsList); - getROIChannel(gasId, idAnalysis, roiChannelsSpectrumList, roiChannelsList); - getROIChannel(detId, idAnalysis, roiChannelsSpectrumList, roiChannelsList); - map.put("roiChannelsList", roiChannelsList); + List roiChannelsList = new LinkedList<>(); + getROIChannel(sampleId, idAnalysis, anlyseResultIn.getRoiChannelsSpectrumList(), roiChannelsList); + getROIChannel(gasId, idAnalysis, anlyseResultIn.getRoiChannelsSpectrumList(), roiChannelsList); + getROIChannel(detId, idAnalysis, anlyseResultIn.getRoiChannelsSpectrumList(), roiChannelsList); //如果分析过数据 if (Objects.nonNull(isExist)){ //删除gards_roi_channels数据表数据 - //spectrumAnalysisMapper.deleteROIChannels(idAnalysis); + spectrumAnalysisMapper.deleteROIChannels(idAnalysis); //新增gards_roi_channels数据表数据 - //spectrumAnalysisMapper.insertROIChannels(roiChannelsList); + roiChannelsSpectrumService.saveGardsROIChannels(roiChannelsList); }else {//没有分析过 //新增gards_roi_channels数据表数据 - //spectrumAnalysisMapper.insertROIChannels(roiChannelsList); + roiChannelsSpectrumService.saveGardsROIChannels(roiChannelsList); } //gards_Xe_results数据表 - List xeResults = getXeResults(anlyseResultIn, sampleId, idAnalysis); - map.put("xeResults", xeResults); + List xeResults = getXeResults(anlyseResultIn, sampleId, idAnalysis); if(Objects.nonNull(isExist)) { //删除gards_Xe_results数据表数据 - //spectrumAnalysisMapper.deleteXeResult(idAnalysis); + spectrumAnalysisMapper.deleteXeResult(idAnalysis); //新增gards_Xe_results数据表数据 - //spectrumAnalysisMapper.insertXeResult(xeResults); + xeResultsSpectrumService.saveGardsXeResults(xeResults); } else { //新增gards_Xe_results数据表数据 - //spectrumAnalysisMapper.insertXeResult(xeResults); + xeResultsSpectrumService.saveGardsXeResults(xeResults); } //gards_roi_results数据表 - List roiResultsSpectrumList = getROIResult(anlyseResultIn, sampleId, idAnalysis, isExist); - map.put("roiResultsSpectrumList", roiResultsSpectrumList); + List roiResultsSpectrumList = getROIResult(anlyseResultIn.getRoiResultsSpectrumList(), sampleId, idAnalysis, isExist); if(Objects.nonNull(isExist)) { //删除gards_roi_results数据表数据 - //spectrumAnalysisMapper.deleteROIResults(idAnalysis); + spectrumAnalysisMapper.deleteROIResults(idAnalysis); //新增gards_roi_results数据表数据 - //spectrumAnalysisMapper.insertROIResults(roiResultsSpectrumList); + roiResultsSpectrumService.saveGardsROIResults(roiResultsSpectrumList); } else { //新增gards_roi_results数据表数据 - //spectrumAnalysisMapper.insertROIResults(roiResultsSpectrumList); + roiResultsSpectrumService.saveGardsROIResults(roiResultsSpectrumList); } result.setSuccess(true); - result.setResult(map); return result; } @@ -2786,8 +2780,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { File detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName()); System.loadLibrary("ReadPHDFile"); //如果勾选了Energy Calibration页面下sample Data - if (Objects.nonNull(sampleTmp)){ - if(anlyseResultIn.isCheckSample()){ + if (Objects.nonNull(sampleTmp)) { + if(anlyseResultIn.isCheckSample()) { EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath()); //没有点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮 channel/energy数据读取文件 如果点击过数据来源页面 if (!anlyseResultIn.isBGammaEnergyValid()){ @@ -2807,8 +2801,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { anlyseResultIn.setB_energy_sample(sourceData.b_electron_energy); } } - if (Objects.nonNull(gasTmp)){ - if (anlyseResultIn.isCheckGas()){ + if (Objects.nonNull(gasTmp)) { + if (anlyseResultIn.isCheckGas()) { EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(gasTmp.getAbsolutePath()); if (!anlyseResultIn.isBGammaEnergyValid()){ anlyseResultIn.setG_channel_gas(sourceData.g_centroid_channel); @@ -2826,8 +2820,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { anlyseResultIn.setB_energy_gas(sourceData.b_electron_energy); } } - if (Objects.nonNull(detTmp)){ - if (anlyseResultIn.isCheckDet()){ + if (Objects.nonNull(detTmp)) { + if (anlyseResultIn.isCheckDet()) { EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(detTmp.getAbsolutePath()); if (!anlyseResultIn.isBGammaEnergyValid()){ anlyseResultIn.setG_channel_det(sourceData.g_centroid_channel); @@ -2847,10 +2841,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } } - public List getCalibrationPairs(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer gasId, Integer detId, Integer idAnalysis) { - List calibrationPairsList = new LinkedList<>(); + public List getCalibrationPairs(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer gasId, Integer detId, Integer idAnalysis) { + List calibrationPairsList = new LinkedList<>(); for (int i=0; i< anlyseResultIn.getB_channel_sample().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(sampleId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.BETA.getType()); @@ -2862,7 +2856,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationPairsList.add(calibrationPairs); } for (int i=0; i< anlyseResultIn.getG_channel_sample().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(sampleId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.GAMMA.getType()); @@ -2875,7 +2869,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } for (int i=0; i< anlyseResultIn.getB_channel_gas().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(gasId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.BETA.getType()); @@ -2888,7 +2882,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } for (int i=0; i< anlyseResultIn.getG_channel_gas().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(gasId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.GAMMA.getType()); @@ -2901,7 +2895,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } for (int i=0; i< anlyseResultIn.getB_channel_det().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(detId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.BETA.getType()); @@ -2914,7 +2908,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } for (int i=0; i< anlyseResultIn.getG_channel_det().size(); i++){ - GardsCalibrationPairsSpectrum calibrationPairs = new GardsCalibrationPairsSpectrum(); + GardsCalibrationPairs calibrationPairs = new GardsCalibrationPairs(); calibrationPairs.setSampleId(detId); calibrationPairs.setIdAnalysis(idAnalysis); calibrationPairs.setSampleType(SystemType.GAMMA.getType()); @@ -2989,10 +2983,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } } - public List getCalibration(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer gasId, Integer detId, Integer idAnalysis) { - List calibrationSpectrumList = new LinkedList<>(); - if (Objects.nonNull(sampleId)){ - GardsCalibrationSpectrum calibrationB = new GardsCalibrationSpectrum(); + public List getCalibration(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer gasId, Integer detId, Integer idAnalysis) { + List calibrationSpectrumList = new LinkedList<>(); + if (Objects.nonNull(sampleId)) { + GardsCalibration calibrationB = new GardsCalibration(); calibrationB.setSampleId(sampleId); calibrationB.setIdAnalysis(idAnalysis); calibrationB.setSampleType(SystemType.BETA.getType()); @@ -3005,7 +2999,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationB.setCoeff2(Double.valueOf(anlyseResultIn.getParam_b_c2e_b_sample())); calibrationB.setCoeff3(Double.valueOf(anlyseResultIn.getParam_c_c2e_b_sample())); calibrationSpectrumList.add(calibrationB); - GardsCalibrationSpectrum calibrationG = new GardsCalibrationSpectrum(); + GardsCalibration calibrationG = new GardsCalibration(); calibrationG.setSampleId(sampleId); calibrationG.setIdAnalysis(idAnalysis); calibrationG.setSampleType(SystemType.GAMMA.getType()); @@ -3020,8 +3014,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationSpectrumList.add(calibrationG); } - if (Objects.nonNull(gasId)){ - GardsCalibrationSpectrum calibrationB = new GardsCalibrationSpectrum(); + if (Objects.nonNull(gasId)) { + GardsCalibration calibrationB = new GardsCalibration(); calibrationB.setSampleId(gasId); calibrationB.setIdAnalysis(idAnalysis); calibrationB.setSampleType(SystemType.BETA.getType()); @@ -3034,7 +3028,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationB.setCoeff2(Double.valueOf(anlyseResultIn.getParam_b_c2e_b_gas())); calibrationB.setCoeff3(Double.valueOf(anlyseResultIn.getParam_c_c2e_b_gas())); calibrationSpectrumList.add(calibrationB); - GardsCalibrationSpectrum calibrationG = new GardsCalibrationSpectrum(); + GardsCalibration calibrationG = new GardsCalibration(); calibrationG.setSampleId(gasId); calibrationG.setIdAnalysis(idAnalysis); calibrationG.setSampleType(SystemType.BETA.getType()); @@ -3049,8 +3043,8 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationSpectrumList.add(calibrationG); } - if (Objects.nonNull(detId)){ - GardsCalibrationSpectrum calibrationB = new GardsCalibrationSpectrum(); + if (Objects.nonNull(detId)) { + GardsCalibration calibrationB = new GardsCalibration(); calibrationB.setSampleId(detId); calibrationB.setIdAnalysis(idAnalysis); calibrationB.setSampleType(SystemType.BETA.getType()); @@ -3063,7 +3057,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { calibrationB.setCoeff2(Double.valueOf(anlyseResultIn.getParam_b_c2e_b_det())); calibrationB.setCoeff3(Double.valueOf(anlyseResultIn.getParam_c_c2e_b_det())); calibrationSpectrumList.add(calibrationB); - GardsCalibrationSpectrum calibrationG = new GardsCalibrationSpectrum(); + GardsCalibration calibrationG = new GardsCalibration(); calibrationG.setSampleId(detId); calibrationG.setIdAnalysis(idAnalysis); calibrationG.setSampleType(SystemType.GAMMA.getType()); @@ -3080,9 +3074,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return calibrationSpectrumList; } - public void getROIChannel(Integer sampleId, Integer idAnalysis, List roiChannelsSpectrumList, List roiChannelsList) { + public void getROIChannel(Integer sampleId, Integer idAnalysis, List roiChannelsSpectrumList, List roiChannelsList) { for (int i=0; i getXeResults(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer idAnalysis) { + public List getXeDataList(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer idAnalysis) { List xeResultsList = new LinkedList<>(); //Xe131m GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum(); @@ -3143,9 +3137,58 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return xeResultsList; } + public List getXeResults(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer idAnalysis) { + List xeResultsList = new LinkedList<>(); + //Xe131m + GardsXeResults xe131m = new GardsXeResults(); + xe131m.setSampleId(sampleId); + xe131m.setIdAnalysis(idAnalysis); + xe131m.setNuclideName(XeNuclideName.XE_131m.getType()); + xe131m.setConc(anlyseResultIn.getXe131m_con()); + xe131m.setConcErr(anlyseResultIn.getXe131m_uncer()); + xe131m.setMdc(anlyseResultIn.getMDC_Xe131m()); + xe131m.setLc(anlyseResultIn.getLC_Xe131m()); + xe131m.setNidFlag(anlyseResultIn.getXe131mFlag()); + xeResultsList.add(xe131m); + //Xe133 + GardsXeResults xe133 = new GardsXeResults(); + xe133.setSampleId(sampleId); + xe133.setIdAnalysis(idAnalysis); + xe133.setNuclideName(XeNuclideName.XE_133.getType()); + xe133.setConc(anlyseResultIn.getXe133_con()); + xe133.setConcErr(anlyseResultIn.getXe133_uncer()); + xe133.setMdc(anlyseResultIn.getMDC_Xe133()); + xe133.setLc(anlyseResultIn.getLC_Xe133()); + xe133.setNidFlag(anlyseResultIn.getXe133Flag()); + xeResultsList.add(xe133); + //Xe133m + GardsXeResults xe133m = new GardsXeResults(); + xe133m.setSampleId(sampleId); + xe133m.setIdAnalysis(idAnalysis); + xe133m.setNuclideName(XeNuclideName.XE_133m.getType()); + xe133m.setConc(anlyseResultIn.getXe133m_con()); + xe133m.setConcErr(anlyseResultIn.getXe133m_uncer()); + xe133m.setMdc(anlyseResultIn.getMDC_Xe133m()); + xe133m.setLc(anlyseResultIn.getLC_Xe133m()); + xe133m.setNidFlag(anlyseResultIn.getXe133mFlag()); + xeResultsList.add(xe133m); + //Xe135 + GardsXeResults xe135 = new GardsXeResults(); + xe135.setSampleId(sampleId); + xe135.setIdAnalysis(idAnalysis); + xe135.setNuclideName(XeNuclideName.XE_135.getType()); + xe135.setConc(anlyseResultIn.getXe135_con()); + xe135.setConcErr(anlyseResultIn.getXe135_uncer()); + xe135.setMdc(anlyseResultIn.getMDC_Xe135()); + xe135.setLc(anlyseResultIn.getLC_Xe135()); + xe135.setNidFlag(anlyseResultIn.getXe135Flag()); + xeResultsList.add(xe135); + return xeResultsList; + } + public boolean OriginalDataStore(String filePath, String fileName, String filePathName, String userName) { //根据新的文件路径名称查询数据是否存在 - Integer isExist = spectrumAnalysisMapper.SampleIsExist(filePathName, userName); + GardsSampleData isExist = spectrumAnalysisMapper.findSampleByFile(filePathName); //如果数据已经存入过数据库 则 修改状态后返回 if (Objects.nonNull(isExist)){ //如果文件已经存入过数据库则修改状态 @@ -3263,32 +3306,28 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { return readLines; } - public List getROIResult(BgDataAnlyseResultIn anlyseResultIn, Integer sampleId, Integer idAnalysis, Integer isExist) { - List roiResultsSpectrumList = new LinkedList<>(); - for (int i=0; i getROIResult(List roiResultsSpectrumList, Integer sampleId, Integer idAnalysis, Integer isExist) { + List roiResultsList = new LinkedList<>(); + for (int i=0; ianlyseResultIn.getMDC().get(i)) { - roiResults.setNidFlag(1); - } else { - roiResults.setNidFlag(0); - } - roiResultsSpectrumList.add(roiResults); + roiResults.setLc(roiResultsSpectrumList.get(i).getLc()); + roiResults.setSGross(roiResultsSpectrumList.get(i).getSGross()); + roiResults.setGGross(roiResultsSpectrumList.get(i).getGGross()); + roiResults.setBGross(roiResultsSpectrumList.get(i).getBGross()); + roiResults.setSNet(roiResultsSpectrumList.get(i).getSNet()); + roiResults.setGNet(roiResultsSpectrumList.get(i).getGNet()); + roiResults.setNet(roiResultsSpectrumList.get(i).getNet()); + roiResults.setNetErr(roiResultsSpectrumList.get(i).getNetErr()); + roiResults.setConc(roiResultsSpectrumList.get(i).getConc()); + roiResults.setConcErr(roiResultsSpectrumList.get(i).getConcErr()); + roiResults.setMdc(roiResultsSpectrumList.get(i).getMdc()); + roiResults.setNidFlag(roiResultsSpectrumList.get(i).getNidFlag()); + roiResultsList.add(roiResults); } - return roiResultsSpectrumList; + return roiResultsList; } }