diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java index 20237b90..267f1ffb 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/common/util/SelfStationUtil.java @@ -54,8 +54,9 @@ public class SelfStationUtil extends AbstractLogOrReport { } else { return; } - //存储页面操作数据 - SelfStationVueData selfStationVueData = new SelfStationVueData(); + SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); + SelfStationVueData detVueData = selfStationData.getDetVueData(); + //封装散点图下的基础数据信息 SpectrumData spectrumData = new SpectrumData(); //Station Code @@ -119,7 +120,6 @@ public class SelfStationUtil extends AbstractLogOrReport { spectrumData.setMeasurementId(measurementId); map.put("spectrumData", spectrumData); - //计算边界值 //gamma能量部分的计算参数 道值对应能量 List gEnergy = struct.g_energy; //gamma能量部分的计算参数 道值 @@ -144,92 +144,9 @@ public class SelfStationUtil extends AbstractLogOrReport { List roiBBoundaryStart = bgBoundary.ROI_B_Boundary_start; List roiBBoundaryStop = bgBoundary.ROI_B_Boundary_stop; - SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); - SelfStationVueData detVueData = selfStationData.getDetVueData(); - //根据范围1划分 范围1对应的折线图 - Map oneMap = statisticsROIList(roiBBoundaryStart.get(0), roiBBoundaryStop.get(0), struct.b_channels, struct.g_channels, struct.h_counts); - if (CollectionUtils.isNotEmpty(oneMap) ) { - Integer startChannel = (Integer) oneMap.get("startChannel"); - Integer endChannel = (Integer) oneMap.get("endChannel"); - List seriseDataList = (List) oneMap.get("dataList"); - if (systemType.equals("sample")) { - sampleVueData.setROIOneBetaStart(startChannel); - sampleVueData.setROIOneBetaStop(endChannel); - sampleVueData.setROIOneList(seriseDataList); - sampleVueData.setROIOneCounts((List)oneMap.get("counts")); - } else if (systemType.equals("det")) { - detVueData.setROIOneBetaStart(startChannel); - detVueData.setROIOneBetaStop(endChannel); - detVueData.setROIOneList(seriseDataList); - } - map.put("ROIOneStart", roiBBoundaryStart.get(0)); - map.put("ROIOneStop", roiBBoundaryStop.get(0)); - map.put("ROIOneList", seriseDataList); - } - //根据范围2划分 范围2对应的折线图 - Map twoMap = statisticsROIList(roiBBoundaryStart.get(1), roiBBoundaryStop.get(1), - struct.b_channels, struct.g_channels, struct.h_counts); - if ( CollectionUtils.isNotEmpty(twoMap) ) { - Integer startChannel = (Integer) twoMap.get("startChannel"); - Integer endChannel = (Integer) twoMap.get("endChannel"); - List seriseDataList = (List) twoMap.get("dataList"); - if (systemType.equals("sample")) { - sampleVueData.setROITwoBetaStart(startChannel); - sampleVueData.setROITwoBetaStop(endChannel); - sampleVueData.setROITwoList(seriseDataList); - sampleVueData.setROITwoCounts((List)twoMap.get("counts")); - } else if (systemType.equals("det")) { - detVueData.setROITwoBetaStart(startChannel); - detVueData.setROITwoBetaStop(endChannel); - detVueData.setROITwoList(seriseDataList); - } - map.put("ROITwoStart", roiBBoundaryStart.get(1)); - map.put("ROITwoStop", roiBBoundaryStop.get(1)); - map.put("ROITwoList", seriseDataList); - } - //根据范围3划分 范围3对应的折线图 - Map threeMap = statisticsROIList(roiBBoundaryStart.get(2), roiBBoundaryStop.get(2), - struct.b_channels, struct.g_channels, struct.h_counts); - if ( CollectionUtils.isNotEmpty(threeMap) ) { - Integer startChannel = (Integer) threeMap.get("startChannel"); - Integer endChannel = (Integer) threeMap.get("endChannel"); - List seriseDataList = (List) threeMap.get("dataList"); - if (systemType.equals("sample")) { - sampleVueData.setROIThreeBetaStart(startChannel); - sampleVueData.setROIThreeBetaStop(endChannel); - sampleVueData.setROIThreeList(seriseDataList); - sampleVueData.setROIThreeCounts((List)threeMap.get("counts")); - } else if (systemType.equals("det")) { - detVueData.setROIThreeBetaStart(startChannel); - detVueData.setROIThreeBetaStop(endChannel); - detVueData.setROIThreeList(seriseDataList); - } - map.put("ROIThreeStart", roiBBoundaryStart.get(2)); - map.put("ROIThreeStop", roiBBoundaryStop.get(2)); - map.put("ROIThreeList", seriseDataList); - } - //根据范围4划分 范围4对应的折线图 - Map fourMap = statisticsROIList(roiBBoundaryStart.get(3), roiBBoundaryStop.get(3), struct.b_channels, struct.g_channels, struct.h_counts); - if ( CollectionUtils.isNotEmpty(fourMap) ) { - Integer startChannel = (Integer) fourMap.get("startChannel"); - Integer endChannel = (Integer) fourMap.get("endChannel"); - List seriseDataList = (List) fourMap.get("dataList"); - if (systemType.equals("sample")) { - sampleVueData.setROIFourBetaStart(startChannel); - sampleVueData.setROIFourBetaStop(endChannel); - sampleVueData.setROIFourList(seriseDataList); - sampleVueData.setROIFourCounts((List)fourMap.get("counts")); - } else if (systemType.equals("det")) { - detVueData.setROIFourBetaStart(startChannel); - detVueData.setROIFourBetaStop(endChannel); - detVueData.setROIFourList(seriseDataList); - } - map.put("ROIFourStart", roiBBoundaryStart.get(3)); - map.put("ROIFourStop", roiBBoundaryStop.get(3)); - map.put("ROIFourList", seriseDataList); - } - //散点图 + Map gammaByROI = this.getGammaByROI(systemType, roiBBoundaryStart, roiBBoundaryStop, selfStationData); + map.putAll(gammaByROI); //统计散点图 //横坐标 beta-gamma long bChannels = struct.b_channels; @@ -262,7 +179,7 @@ public class SelfStationUtil extends AbstractLogOrReport { map.put("histogramDataList", histogramDataList); // map.put("histogramDataDList", histogramDataDList); //调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数 - List gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy); + List gammaParam = EnergySpectrumHandler.GetFileFittingPara(struct.g_centroid_channel, struct.g_energy); //存储需要计算gamma能量的道值 List gchannels = new ArrayList<>(); for (int i=0; i betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy); + List betaParam = EnergySpectrumHandler.GetFileFittingPara(struct.b_channel, struct.b_electron_energy); List bchannels = new ArrayList<>(); for (int i=0; i getGammaByROI(String systemType, List roiBBoundaryStart, List roiBBoundaryStop, + SelfStationData selfStationData) { + Map map = new HashMap<>(); + + + + EnergySpectrumStruct struct = selfStationData.getSampleStruct(); + long betaChannels = struct.b_channels, gammaChannels = struct.g_channels; + List h_counts = struct.h_counts; + + SelfStationVueData sampleVueData = selfStationData.getSampleVueData(); + SelfStationVueData detVueData = selfStationData.getDetVueData(); + + for (int r = 0; r < roiBBoundaryStart.size(); r++) { + List seriseDataList = new LinkedList<>(); + // g_counts + List counts = new LinkedList<>(); + //存储同一列不同行加和后的数量 + List sumList = new LinkedList<>(); + String roiStart = "", roiStop= "", roiList = ""; + + //根据范围划分 范围对应的折线图 + int startChannel = roiBBoundaryStart.get(r); + int endChannel = roiBBoundaryStop.get(r); + //遍历所有列 + for (int i=0; i 0 && index < h_counts.size()) { + count = h_counts.get(index); + } + sum+=count; + } + seriseData.setY(sum); + sumList.add(sum); + counts.add((long) sum); + seriseDataList.add(seriseData); + } + switch (r){ + case 0: + roiStart = "ROIOneStart"; + roiStop = "ROIOneStop"; + roiList = "ROIOneList"; + if (systemType.equals("sample")) { + sampleVueData.setROIOneBetaStart(startChannel); + sampleVueData.setROIOneBetaStop(endChannel); + sampleVueData.setROIOneList(seriseDataList); + sampleVueData.setROIOneCounts(counts); + } else if (systemType.equals("det")) { + detVueData.setROIOneBetaStart(startChannel); + detVueData.setROIOneBetaStop(endChannel); + detVueData.setROIOneList(seriseDataList); + } + break; + case 1: + roiStart = "ROITwoStart"; + roiStop = "ROITwoStop"; + roiList = "ROITwoList"; + if (systemType.equals("sample")) { + sampleVueData.setROITwoBetaStart(startChannel); + sampleVueData.setROITwoBetaStop(endChannel); + sampleVueData.setROITwoList(seriseDataList); + sampleVueData.setROITwoCounts(counts); + } else if (systemType.equals("det")) { + detVueData.setROITwoBetaStart(startChannel); + detVueData.setROITwoBetaStop(endChannel); + detVueData.setROITwoList(seriseDataList); + } + break; + case 2: + roiStart = "ROIThreeStart"; + roiStop = "ROIThreeStop"; + roiList = "ROIThreeList"; + if (systemType.equals("sample")) { + sampleVueData.setROIThreeBetaStart(startChannel); + sampleVueData.setROIThreeBetaStop(endChannel); + sampleVueData.setROIThreeList(seriseDataList); + sampleVueData.setROIThreeCounts(counts); + } else if (systemType.equals("det")) { + detVueData.setROIThreeBetaStart(startChannel); + detVueData.setROIThreeBetaStop(endChannel); + detVueData.setROIThreeList(seriseDataList); + } + break; + case 3: + roiStart = "ROIFourStart"; + roiStop = "ROIFourStop"; + roiList = "ROIFourList"; + if (systemType.equals("sample")) { + sampleVueData.setROIFourBetaStart(startChannel); + sampleVueData.setROIFourBetaStop(endChannel); + sampleVueData.setROIFourList(seriseDataList); + sampleVueData.setROIFourCounts(counts); + } else if (systemType.equals("det")) { + detVueData.setROIFourBetaStart(startChannel); + detVueData.setROIFourBetaStop(endChannel); + detVueData.setROIFourList(seriseDataList); + } + break; + } + + map.put(roiStart, startChannel); + map.put(roiStop, endChannel); + map.put(roiList, seriseDataList); + } + + return map; + } + public List roiList(Integer startChannel, Integer endChannel, long betaChannels, long gammaChannels, List h_counts) { // g_counts List counts = new LinkedList<>(); 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 3a088bde..b411f1c9 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 @@ -90,9 +90,9 @@ public interface SpectrumAnalysisMapper { List UserNuclide(@Param(value = "systemType") String systemType, @Param(value = "userName") String userName); - Integer getAnalysisID(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId, @Param(value = "userName") String userName); + List roiPaths(@Param("dbName") String dbName, @Param("idAnalysis") Integer idAnalysis); - List roiPaths(@Param("dbName") String dbName, @Param("analysisId") Integer analysisId); + Integer getAnalysisID(@Param(value = "dbName") String dbName, @Param(value = "sampleId") Integer sampleId, @Param(value = "userName") String userName); List ReadGammaFitChannelEnergy(@Param(value = "idAnalysis") 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 c8b7a0fe..fd0e282d 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 @@ -1113,7 +1113,7 @@ select NAME from CONFIGURATION.GARDS_NUCL_LIB \ No newline at end of file diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java index a1a9b8fc..9ba57e9a 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SelfStationServiceImpl.java @@ -12,12 +12,12 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.cache.Cache; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.io.FileUtils; import org.apache.commons.math3.fitting.WeightedObservedPoints; import org.jeecg.common.api.vo.Result; import org.jeecg.common.cache.SelfCache; -import org.jeecg.common.constant.Prompt; import org.jeecg.common.constant.StringConstant; import org.jeecg.common.constant.enums.FileTypeEnum; import org.jeecg.common.properties.ParameterProperties; @@ -29,7 +29,7 @@ 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.rnauto.GardsAnalyses; -import org.jeecg.modules.base.entity.rnauto.GardsAnalysisRoi; +import org.jeecg.modules.base.entity.rnman.GardsAnalysisRoi; import org.jeecg.modules.base.entity.rnman.GardsAnalySetting; import org.jeecg.modules.base.enums.SampleFileHeader; import org.jeecg.modules.entity.*; @@ -57,9 +57,9 @@ import java.text.ParseException; import java.util.*; import java.util.stream.Collectors; -import static org.aspectj.weaver.tools.cache.SimpleCacheFactory.path; @Service +@DS("ora") public class SelfStationServiceImpl implements ISelfStationService { @Autowired @@ -133,10 +133,18 @@ public class SelfStationServiceImpl implements ISelfStationService { } @Override - @DS("ora") public Result loadFromDB(String dbName, Integer sampleId, String analyst, HttpServletRequest request) { Result result = new Result(); Map> resultMap = new HashMap<>(); + //页面展示结果数组 + List xeResultsSpectrumList = new LinkedList<>(); + List gammaCalibrationSpectrumList= new LinkedList<>(); + List betaCalibrationSpectrumList = new LinkedList<>(); + List roiChannelsSpectrumList = new LinkedList<>(); + List roiResultsSpectrumList = new LinkedList<>(); + List gammaCalibrationPairsList = new LinkedList<>(); + List betaCalibrationPairsList = new LinkedList<>(); + //获取用户名 String userName = JwtUtil.getUserNameByToken(request); //获取自建台站缓存信息 @@ -152,14 +160,16 @@ public class SelfStationServiceImpl implements ISelfStationService { List roiPaths = new ArrayList<>(); if (dbName.equalsIgnoreCase("auto")){ dbName = "RNAUTO"; - analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, "RNAUTO"); - // 获取gamma谱 - roiPaths = spectrumAnalysisMapper.roiPaths(dbName, analysisID); + analyst = "RNAUTO"; } else if (dbName.equalsIgnoreCase("man")){ dbName = "RNMAN"; - analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, analyst); - roiPaths = spectrumAnalysisMapper.roiPaths(dbName, analysisID); } + analysisID = spectrumAnalysisMapper.getAnalysisID(dbName, sampleId, analyst); + if (analysisID == null) { + result.error500("The queried Sample data does not exist"); + return result; + } + roiPaths = spectrumAnalysisMapper.roiPaths(dbName, analysisID); try { if (Objects.nonNull(analysisID)) { //查询数据库文件信息 @@ -180,11 +190,39 @@ public class SelfStationServiceImpl implements ISelfStationService { detBg = spectrumAnalysisMapper.findSampleByFilePath(dbSpectrumFilePath.getDetBgFilePath()); detFileName = dbSpectrumFilePath.getDetBgFilePath().substring(dbSpectrumFilePath.getDetBgFilePath().lastIndexOf(StringPool.SLASH)+1); } + //获取qc相关信息 + String dbQcFilePath = ""; + GardsSampleData qc = null; + String qcFileName = ""; + if (Objects.nonNull(dbSpectrumFilePath.getCollectStart()) && StringUtils.isNotBlank(dbSpectrumFilePath.getSiteDetCode())) { + String collectStartStr = DateUtils.formatDate(dbSpectrumFilePath.getCollectStart(), "yyyy/MM/dd HH:mm:ss"); + dbQcFilePath = spectrumAnalysisMapper.getQCFilePath(dbSpectrumFilePath.getSiteDetCode(), collectStartStr); + if (StringUtils.isNotBlank(dbQcFilePath)) { + qc = spectrumAnalysisMapper.findSampleByFilePath(dbQcFilePath); + qcFileName = dbQcFilePath.substring(dbQcFilePath.lastIndexOf(StringPool.SLASH)+1); + } + } + //从缓存中获取公用变量的数据 SelfStationData selfStationData = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName); if (Objects.isNull(selfStationData)) { //初始化自建台站数据对象 selfStationData = new SelfStationData(); + if (dbName.equalsIgnoreCase("RNAUTO")) { + xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", analysisID); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", analysisID); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", analysisID, sampleId); + } else { + gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(analysisID); + betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(analysisID); + xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults(dbName, analysisID, sampleId); + gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", analysisID); + betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", analysisID); + roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", analysisID, sampleId); + roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", analysisID, sampleId); + } //判断sample文件名是否为空 if (Objects.nonNull(sample)) { //拼接sample文件路径 @@ -197,6 +235,18 @@ public class SelfStationServiceImpl implements ISelfStationService { selfStationData.setSampleStruct(struct); selfStationData.setSampleTmpPath(sampleFilePath); selfStationUtil.loadFile(selfStationData, sample.getSampleId(), sample.getStatus(), "sample", map); + // 交互库需要获取最新的ROI数据 + if (dbName.equalsIgnoreCase("man")) { + List roiList = analysisRoiManService.analysisRoi(analysisID); + LinkedList start = Lists.newLinkedList(); + LinkedList stop = Lists.newLinkedList(); + for (GardsAnalysisRoi f : roiList) { + start.add(f.getRoiNum() -1, f.getMinX().intValue()); + stop.add(f.getRoiNum() -1, f.getMinY().intValue()); + } + Map gammaByROI = selfStationUtil.getGammaByROI("", start, stop, selfStationData); + map.putAll(gammaByROI); + } resultMap.put("sample", map); // 返回Beta和Gamma的数据 @@ -218,6 +268,21 @@ public class SelfStationServiceImpl implements ISelfStationService { resultMap.put("det", map); } } + //判断qc文件名是否为空 + if (Objects.nonNull(qc)) { + //拼接det文件路径 + String qcFilePath = prefix + dbSpectrumFilePath.getQcFilePath(); + //返回结果map + Map map = new HashMap<>(); + //获取sample分析后的对象 + EnergySpectrumStruct struct = selfStationUtil.getSourceData(qcFilePath, "qc", selfStationData); + if (Objects.nonNull(struct)) { + selfStationData.setQcStruct(struct); + selfStationData.setQcTmpPath(qcFilePath); + selfStationUtil.loadFile(selfStationData, qc.getSampleId(), qc.getStatus(), "qc", map); + resultMap.put("qc", map); + } + } // 初始化自建台站Configure信息 if (!StrUtil.equals(dbName, "RNAUTO")) initConfigure(analysisID, selfStationData); // 初始化自建台站用户核素库信息 @@ -280,6 +345,18 @@ public class SelfStationServiceImpl implements ISelfStationService { //返回结果map Map map = new HashMap<>(); selfStationUtil.loadFile(selfStationData, sample.getSampleId(), sample.getStatus(), "sample", map); + // 交互库需要获取最新的ROI数据 + if (dbName.equalsIgnoreCase("man")) { + List roiList = analysisRoiManService.analysisRoi(analysisID); + LinkedList start = Lists.newLinkedList(); + LinkedList stop = Lists.newLinkedList(); + for (GardsAnalysisRoi f : roiList) { + start.add(f.getRoiNum() -1, f.getMinX().intValue()); + stop.add(f.getRoiNum() -1, f.getMinY().intValue()); + } + Map gammaByROI = selfStationUtil.getGammaByROI("", start, stop, selfStationData); + map.putAll(gammaByROI); + } resultMap.put("sample", map); // 返回Beta和Gamma的数据 bGSpectrum(selfStationData.getSampleStruct(), map); @@ -664,35 +741,39 @@ public class SelfStationServiceImpl implements ISelfStationService { default: break; } + LinkedList roiBBoundaryStart = Lists.newLinkedList(); + LinkedList roiBBoundaryStop = Lists.newLinkedList(); for (ROIParam roiParam : roiParams) { - Integer ROINum = roiParam.getRoiNum(); - Map resultMap = selfStationUtil.statisticsROIList(roiParam.getStartChannel(), roiParam.getEndChannel(), - struct.b_channels, struct.g_channels, struct.h_counts); - if ( CollectionUtils.isNotEmpty(resultMap) ) { - Integer startChannelValue = (Integer) resultMap.get("startChannel"); - Integer endChannelValue = (Integer) resultMap.get("endChannel"); - List seriseDataList = (List) resultMap.get("dataList"); - if (1 == ROINum) { - map.put("ROIOneList", seriseDataList); - map.put("ROIOneStart", startChannelValue); - map.put("ROIOneStop", endChannelValue); - } else if (2 == ROINum) { - map.put("ROITwoList", seriseDataList); - map.put("ROITwoStart", startChannelValue); - map.put("ROITwoStop", endChannelValue); - } else if (3 == ROINum) { - map.put("ROIThreeList", seriseDataList); - map.put("ROIThreeStart", startChannelValue); - map.put("ROIThreeStop", endChannelValue); - } else if (4 == ROINum) { - map.put("ROIFourList", seriseDataList); - map.put("ROIFourStart", startChannelValue); - map.put("ROIFourStop", endChannelValue); - } - } + roiBBoundaryStart.add(roiParam.getRoiNum()-1, roiParam.getStartChannel()); + roiBBoundaryStop.add(roiParam.getRoiNum()-1, roiParam.getEndChannel()); + +// Map resultMap = selfStationUtil.statisticsROIList(roiParam.getStartChannel(), roiParam.getEndChannel(), +// struct.b_channels, struct.g_channels, struct.h_counts); +// if ( CollectionUtils.isNotEmpty(resultMap) ) { +// Integer startChannelValue = (Integer) resultMap.get("startChannel"); +// Integer endChannelValue = (Integer) resultMap.get("endChannel"); +// List seriseDataList = (List) resultMap.get("dataList"); +// if (1 == ROINum) { +// map.put("ROIOneList", seriseDataList); +// map.put("ROIOneStart", startChannelValue); +// map.put("ROIOneStop", endChannelValue); +// } else if (2 == ROINum) { +// map.put("ROITwoList", seriseDataList); +// map.put("ROITwoStart", startChannelValue); +// map.put("ROITwoStop", endChannelValue); +// } else if (3 == ROINum) { +// map.put("ROIThreeList", seriseDataList); +// map.put("ROIThreeStart", startChannelValue); +// map.put("ROIThreeStop", endChannelValue); +// } else if (4 == ROINum) { +// map.put("ROIFourList", seriseDataList); +// map.put("ROIFourStart", startChannelValue); +// map.put("ROIFourStop", endChannelValue); +// } +// } } result.setSuccess(true); - result.setResult(map); + result.setResult(selfStationUtil.getGammaByROI(struct.system_type, roiBBoundaryStart, roiBBoundaryStop, selfStationData)); return result; } @@ -5219,8 +5300,8 @@ public class SelfStationServiceImpl implements ISelfStationService { if (!FileUtil.exist(reportPath)) return Result.error("The automatic handler generated report does not exist!"); result.put("Beta", FileUtil.readUtf8String(reportPath)); - List analysisRois = analysisRoiAutoService.analysisRoi(idAnalysis); - for (GardsAnalysisRoi analysisRoi : analysisRois) { + List analysisRois = analysisRoiAutoService.analysisRoi(idAnalysis); + for (org.jeecg.modules.base.entity.rnauto.GardsAnalysisRoi analysisRoi : analysisRois) { Integer roiNum = analysisRoi.getRoiNum(); String roiReportPath = analysisRoi.getReportPath(); roiReportPath = rootPath + saveFilePath + StrUtil.SLASH + roiReportPath + FileTypeEnum.arr.getType();