fix:修改 findHistogram 解决数据加载不了问题
This commit is contained in:
parent
e9201cb9a6
commit
2908b406d7
|
@ -646,7 +646,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
// LambdaQueryWrapper<GardsHistogram> histogramQueryWrapper = new LambdaQueryWrapper<>();
|
// LambdaQueryWrapper<GardsHistogram> histogramQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
// histogramQueryWrapper.eq(GardsHistogram::getSampleId, sampleId);
|
// histogramQueryWrapper.eq(GardsHistogram::getSampleId, sampleId);
|
||||||
// GardsHistogram gardsHistogram = gardsHistogramMapper.selectOne(histogramQueryWrapper);
|
// GardsHistogram gardsHistogram = gardsHistogramMapper.selectOne(histogramQueryWrapper);
|
||||||
if (CollectionUtils.isNotEmpty(sourceData.h_counts)){
|
if (CollectionUtils.isNotEmpty(sourceData.h_counts) || null != sourceData.h_count_arr ){
|
||||||
histogramBlock = new Histogram();
|
histogramBlock = new Histogram();
|
||||||
List<HistogramData> histogramSubBlock = readValue(sourceData);
|
List<HistogramData> histogramSubBlock = readValue(sourceData);
|
||||||
// Map<String, Object> map = readLineUtil.readLine(gardsHistogram.getFilename(), SampleFileHeader.HISTOGRAM.getMessage());
|
// Map<String, Object> map = readLineUtil.readLine(gardsHistogram.getFilename(), SampleFileHeader.HISTOGRAM.getMessage());
|
||||||
|
@ -717,8 +717,11 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
|
|
||||||
public List<HistogramData> readValue(EnergySpectrumStruct sourceData) {
|
public List<HistogramData> readValue(EnergySpectrumStruct sourceData) {
|
||||||
List<HistogramData> result = new LinkedList<>();
|
List<HistogramData> result = new LinkedList<>();
|
||||||
|
if (Objects.isNull(sourceData.g_channels) || Objects.isNull(sourceData.b_channels)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
if (!sourceData.system_type.equals("C")) {
|
if (!sourceData.system_type.equals("C")) {
|
||||||
if (CollectionUtils.isNotEmpty(sourceData.h_counts) && Objects.nonNull(sourceData.g_channels) && Objects.nonNull(sourceData.b_channels)) {
|
if (CollectionUtils.isNotEmpty(sourceData.h_counts) ) {
|
||||||
for (int i=0; i<sourceData.g_channels; i++) {
|
for (int i=0; i<sourceData.g_channels; i++) {
|
||||||
for (int j=0; j<sourceData.b_channels; j++) {
|
for (int j=0; j<sourceData.b_channels; j++) {
|
||||||
List<Long> subList = sourceData.h_counts.subList((int) (i * sourceData.b_channels), (int) ((i + 1) * sourceData.b_channels));
|
List<Long> subList = sourceData.h_counts.subList((int) (i * sourceData.b_channels), (int) ((i + 1) * sourceData.b_channels));
|
||||||
|
@ -733,7 +736,8 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (null != sourceData.h_count_arr && Objects.nonNull(sourceData.g_channels) && Objects.nonNull(sourceData.b_channels)) {
|
// 自建台站的数据单独存储的
|
||||||
|
if (null != sourceData.h_count_arr) {
|
||||||
for (int i=0; i<sourceData.g_channels; i++) {
|
for (int i=0; i<sourceData.g_channels; i++) {
|
||||||
for (int j=0; j<sourceData.b_channels; j++) {
|
for (int j=0; j<sourceData.b_channels; j++) {
|
||||||
Long count = sourceData.h_count_arr[i][j];
|
Long count = sourceData.h_count_arr[i][j];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user