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 b90fb98b..fea65e37 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 @@ -1201,42 +1201,46 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); String netRoi = "%s%-51s%-51s%-13s"; if (betaDataFile.isBProcessed()) { - if (Objects.isNull(resultsSpectrums.get(0).getLcCts())) { - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", StringPool.SPACE)); - strBuffer.append(System.lineSeparator()); - if (CollectionUtils.isNotEmpty(resultsSpectrums)) { - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNetErr())), StringPool.SPACE)); - strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + if (Objects.isNull(resultsSpectrums.get(0).getLcCts())) { + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", StringPool.SPACE)); + strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNetErr())), StringPool.SPACE)); + strBuffer.append(System.lineSeparator()); + } } - } - } else { - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", "LC")); - strBuffer.append(System.lineSeparator()); - if (CollectionUtils.isNotEmpty(resultsSpectrums)) { - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNetErr())), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())))); - strBuffer.append(System.lineSeparator()); + } else { + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", "LC")); + strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNetErr())), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())))); + strBuffer.append(System.lineSeparator()); + } } } } } else { - if (Objects.isNull(resultsSpectrums.get(0).getLcCts())) { - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", StringPool.SPACE)); - strBuffer.append(System.lineSeparator()); - if (CollectionUtils.isNotEmpty(resultsSpectrums)) { - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(Math.sqrt(resultsSpectrum.getNetErr()))), StringPool.SPACE)); - strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + if (Objects.isNull(resultsSpectrums.get(0).getLcCts())) { + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", StringPool.SPACE)); + strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(Math.sqrt(resultsSpectrum.getNetErr()))), StringPool.SPACE)); + strBuffer.append(System.lineSeparator()); + } } - } - } else { - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", "LC")); - strBuffer.append(System.lineSeparator()); - if (CollectionUtils.isNotEmpty(resultsSpectrums)) { - for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ - strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(Math.sqrt(resultsSpectrum.getNetErr()))), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())))); - strBuffer.append(System.lineSeparator()); + } else { + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, "Roi", "Net count", "LC")); + strBuffer.append(System.lineSeparator()); + if (CollectionUtils.isNotEmpty(resultsSpectrums)) { + for (GardsROIResultsSpectrum resultsSpectrum:resultsSpectrums){ + strBuffer.append(rowFormat(netRoi, StringPool.SPACE, String.valueOf(resultsSpectrum.getRoi()), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getNet()))+" +/- "+NumberFormatUtil.numberSixLen(String.valueOf(Math.sqrt(resultsSpectrum.getNetErr()))), NumberFormatUtil.numberSixLen(String.valueOf(resultsSpectrum.getLcCts())))); + strBuffer.append(System.lineSeparator()); + } } } }