From 0139655feef5ec30dc34cde2144746f24fe5aada Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 13 Dec 2023 15:55:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=88=86=E6=9E=90beta=E9=83=A8=E5=88=86=E6=9F=A5=E7=9C=8Bgamma?= =?UTF-8?q?EnergyCalibration=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9Cgamma=E7=9A=84=E8=AE=A1=E7=AE=97=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E6=98=AFfalse=EF=BC=8C=E6=B8=85=E9=99=A4beta=EF=BC=8C?= =?UTF-8?q?gamma=E7=9A=84=E4=B8=B4=E6=97=B6=E7=BC=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86?= =?UTF-8?q?=E6=9E=90beta=E9=83=A8=E5=88=86=E6=9F=A5=E7=9C=8BbetaEnergyCali?= =?UTF-8?q?bration=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9Cbeta=E7=9A=84=E8=AE=A1=E7=AE=97=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E6=98=AFfalse=EF=BC=8C=E6=B8=85=E9=99=A4beta=E7=9A=84=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E7=BC=93=E5=AD=98=E6=95=B0=E6=8D=AE=20=E4=BA=BA?= =?UTF-8?q?=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90resetButton?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8Cgamma=E7=9A=84tab=E8=BF=9B=E8=A1=8C=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=97=B6=EF=BC=8C=E5=B0=86beta=EF=BC=8Cgamma=E7=9A=84?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=BC=93=E5=AD=98=E6=95=B0=E6=8D=AE=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=EF=BC=8Cbeta=E7=9A=84tab=E8=BF=9B=E8=A1=8C=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=97=B6=EF=BC=8C=E5=B0=86beta=E7=9A=84=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E7=BC=93=E5=AD=98=E6=95=B0=E6=8D=AE=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=BD=93=E8=BF=9B=E8=A1=8C=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=88=86=E6=9E=90=E6=97=B6=E5=B0=86beta=EF=BC=8Cgamma=E7=9A=84?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=95=B0=E6=8D=AE=E6=A0=B9=E6=8D=AE=E5=90=84?= =?UTF-8?q?=E8=87=AA=E7=9A=84=E6=A0=87=E8=AF=86=E9=80=89=E6=8B=A9=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=B0=86=E4=B8=B4=E6=97=B6=E7=BC=93=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B5=8B=E5=80=BC=E7=BB=99=E5=88=B0=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=95=B0=E7=BB=84=20=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90beta=E9=83=A8=E5=88=86fitti?= =?UTF-8?q?ng=E6=8E=A5=E5=8F=A3=EF=BC=8Cgamma=E7=9A=84tab=E9=A1=B5?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=88=86=E6=9E=90=E6=96=B9=E6=B3=95=E6=97=B6?= =?UTF-8?q?=E6=B8=85=E7=A9=BAbeta=E7=9A=84=E4=B8=B4=E6=97=B6=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E6=8D=AE=20=E4=BA=BA=E5=B7=A5=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E5=88=86=E6=9E=90gamma=E9=83=A8=E5=88=86compare?= =?UTF-8?q?=EF=BC=8Cstrip=E4=BB=8E=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=96=87=E4=BB=B6=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9=E4=B8=BA=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E6=8F=90=E7=A4=BA=E5=B9=B6=E6=94=B9=E5=8F=98=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD=E5=8F=A5=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E5=88=86=E6=9E=90gamma=E9=83=A8=E5=88=86=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E5=BE=97=E5=88=B0=E7=9A=84peak=E7=9A=84significance=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=A4=84=E7=90=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?-9999=E5=88=99=E5=B0=86significance=E8=B5=8B=E5=80=BC=E4=B8=BAi?= =?UTF-8?q?nf=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90gamm?= =?UTF-8?q?a=E9=83=A8=E5=88=86peak=E7=9A=84significance=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E6=98=AF=E5=90=88=E6=B3=95?= =?UTF-8?q?=E6=95=B0=E5=AD=97=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86=EF=BC=8C=E5=90=A6=E5=88=99=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B8=BA=E5=AF=B9=E5=BA=94=E7=9A=84=E7=A9=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86?= =?UTF-8?q?=E6=9E=90gamma=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E8=93=9D=E8=89=B2=E6=A1=86=E5=86=85fwhm=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E6=95=B0=E6=8D=AE=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 16 +- .../SpectrumAnalysesController.java | 8 +- .../jeecg/modules/entity/vo/BetaDataFile.java | 27 +++ .../service/ISpectrumAnalysisService.java | 4 +- .../service/impl/GammaServiceImpl.java | 60 ++--- .../impl/GardsPeaksSpectrumServiceImpl.java | 3 +- .../impl/SpectrumAnalysisServiceImpl.java | 229 +++++++++++------- 7 files changed, 224 insertions(+), 123 deletions(-) diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 90a791d5..e51ba6e2 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2440,7 +2440,7 @@ public class GammaFileUtil extends AbstractLogOrReport { String fwhm = String.format("%.3f", Double.valueOf(middleData.peaks_Fwhm.get(i))); String area = String.format("%.3f", Double.valueOf(middleData.peaks_Area.get(i))); String areaErr = String.format("%.3f", Double.valueOf(middleData.peaks_areaErr.get(i)) / Double.valueOf(middleData.peaks_Area.get(i)) * 100); - String signif = String.format("%.3f", Double.valueOf(middleData.peaks_Significance.get(i))); + String signif = Objects.isNull(middleData.peaks_Significance.get(i))?"":String.format("%.3f", Double.valueOf(middleData.peaks_Significance.get(i))); String sensit = String.format("%.3f", Double.valueOf(middleData.peaks_Sensitivity.get(i))); String nuclide = middleData.peaks_Nuclide_name.get(i).length()>0?StringUtils.join(middleData.peaks_Nuclide_name.get(i), StringPool.SEMICOLON):""; strBuffer.append(rowFormat(data14, idPeak, energy, peakCentroid, fwhm, area, areaErr, signif, sensit, nuclide)); @@ -3420,7 +3420,7 @@ public class GammaFileUtil extends AbstractLogOrReport { dvctEFFICIENCY.add(fileAnlyse.getVPeak().get(m).efficiency); dvctFWHM.add(fileAnlyse.getVPeak().get(m).fwhm); dvctFWTM.add(fileAnlyse.getVPeak().get(m).fwhmc); - dvctSIGNIFICANCE.add(fileAnlyse.getVPeak().get(m).significance); + dvctSIGNIFICANCE.add(Double.isFinite(fileAnlyse.getVPeak().get(m).significance)?fileAnlyse.getVPeak().get(m).significance:null); dvctSENSITIVITY.add(fileAnlyse.getVPeak().get(m).sensitivity); dvctMULTIINDEX.add(Double.valueOf(fileAnlyse.getVPeak().get(m).multiIndex)); dvctROISTART.add(Double.valueOf(fileAnlyse.getVPeak().get(m).left)); @@ -3962,9 +3962,15 @@ public class GammaFileUtil extends AbstractLogOrReport { BigDecimal area = new BigDecimal(vPeak.get(i).area); area = area.setScale(3, RoundingMode.HALF_UP); peakInfo.area = area.doubleValue(); - BigDecimal significance = new BigDecimal(vPeak.get(i).significance); - significance = significance.setScale(3, RoundingMode.HALF_UP); - peakInfo.significance = significance.doubleValue(); + if (Double.isInfinite(vPeak.get(i).significance)) { + peakInfo.significance = Double.POSITIVE_INFINITY; + } else if (Double.isNaN(vPeak.get(i).significance)) { + peakInfo.significance = Double.NaN; + } else { + BigDecimal significance = new BigDecimal(vPeak.get(i).significance); + significance = significance.setScale(3, RoundingMode.HALF_UP); + peakInfo.significance = significance.doubleValue(); + } peakInfo.comments = vPeak.get(i).comments; peakInfo.nuclides = vPeak.get(i).nuclides; result.add(peakInfo); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java index f203a096..2545beae 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java @@ -134,14 +134,14 @@ public class SpectrumAnalysesController { @GetMapping("viewGammaDetectorCalibration") @ApiOperation(value = "查询GammaDetectorCalibration数据", notes = "查询GammaDetectorCalibration数据") - public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) { - return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, sampleFileName, qcFileName, request); + public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) { + return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, sampleFileName, qcFileName, fittingBtn, request); } @GetMapping("viewBetaDetectorCalibration") @ApiOperation(value = "查询BetaDetectorCalibration数据", notes = "查询BetaDetectorCalibration数据") - public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) { - return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, sampleFileName, qcFileName, request); + public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) { + return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, sampleFileName, qcFileName, fittingBtn, request); } @GetMapping("viewExtrapolation") diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java index 5a2b3936..92a31639 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/BetaDataFile.java @@ -69,6 +69,18 @@ public class BetaDataFile implements Serializable { private List gammaFittingParaToUi; + private List betaListNow; + + private List betaFittingParaNow; + + private List betaFittingParaToUiNow; + + private List gammaListNow; + + private List gammaFittingParaNow; + + private List gammaFittingParaToUiNow; + /** * 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮 */ @@ -147,6 +159,10 @@ public class BetaDataFile implements Serializable { private List> betaNewEnergyList; + private List> gammaNewEnergyListNow; + + private List> betaNewEnergyListNow; + private List sampleGammaOriginalSeriseData; private List sampleGammaProjectedSeriseData; @@ -237,6 +253,14 @@ public class BetaDataFile implements Serializable { gammaList = new LinkedList<>(); gammaFittingPara = new LinkedList<>(); gammaFittingParaToUi = new LinkedList<>(); + + betaListNow = new LinkedList<>(); + betaFittingParaNow = new LinkedList<>(); + betaFittingParaToUiNow = new LinkedList<>(); + gammaListNow = new LinkedList<>(); + gammaFittingParaNow = new LinkedList<>(); + gammaFittingParaToUiNow = new LinkedList<>(); + bGammaEnergyValidSample = false; bBetaEnergyValidSample = false; bGammaEnergyValidGas = false; @@ -246,6 +270,9 @@ public class BetaDataFile implements Serializable { gammaNewEnergyList = new LinkedList<>(); betaNewEnergyList = new LinkedList<>(); + gammaNewEnergyListNow = new LinkedList<>(); + betaNewEnergyListNow = new LinkedList<>(); + xeResultsSpectrumList = new LinkedList<>(); sampleBoundary = new LinkedList<>(); gasBoundary = new LinkedList<>(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java index dab28c74..ee0248af 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java @@ -50,9 +50,9 @@ public interface ISpectrumAnalysisService { void exportRLR(BetaRLR betaRLR, HttpServletResponse response); - Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request); + Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request); - Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request); + Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request); Result viewExtrapolation(Integer sampleId, String sampleFileName, HttpServletRequest request); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 0db36589..5154df22 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -968,19 +968,18 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } compareFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + compareFilePath; File compareFile = ftpUtil.downloadFile(compareFilePath, "betaGamma"); - if (Objects.nonNull(compareFile)) { - // 获取Compare数据 - List m_vecCompare = gammaFileUtil.loadCompareData(compareFile, userName, m_nCount, result); - if (CollectionUtils.isNotEmpty(m_vecCompare)) { - List chartDataList = gammaFileUtil.CompareData(m_vecCompare, m_nCount, colorMap, vEnergy); - result.setSuccess(true); - result.setResult(chartDataList); - } - compareFile.delete(); - } else { - result.error500("比较文件不存在!"); + if (Objects.isNull(compareFile)) { + result.error500("The comparison file path does not exist"); return result; } + // 获取Compare数据 + List m_vecCompare = gammaFileUtil.loadCompareData(compareFile, userName, m_nCount, result); + if (CollectionUtils.isNotEmpty(m_vecCompare)) { + List chartDataList = gammaFileUtil.CompareData(m_vecCompare, m_nCount, colorMap, vEnergy); + result.setSuccess(true); + result.setResult(chartDataList); + } + compareFile.delete(); return result; } @@ -1053,22 +1052,21 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } stripFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + stripFilePath; File stripFile = ftpUtil.downloadFile(stripFilePath, "betaGamma"); - if (Objects.nonNull(stripFile)) { - // 获取Compare数据 - List m_vecCompare = gammaFileUtil.loadCompareData(stripFile, userName, m_nCount, result); - if (CollectionUtils.isNotEmpty(m_vecCompare)) { - List referenceDataList = gammaFileUtil.ReferenceData(m_vecCompare, m_nCount, colorMap, vEnergy); - List chartDataList = gammaFileUtil.StripData(m_vecCompare, m_vCount, m_nCount, colorMap, vEnergy, ratioRate); - stripMap.put("reference", referenceDataList); - stripMap.put("result", chartDataList); - result.setSuccess(true); - result.setResult(stripMap); - } - stripFile.delete(); - } else { - result.error500("比较文件不存在!"); + if (Objects.isNull(stripFile)) { + result.error500("The comparison file path does not exist"); return result; } + // 获取Compare数据 + List m_vecCompare = gammaFileUtil.loadCompareData(stripFile, userName, m_nCount, result); + if (CollectionUtils.isNotEmpty(m_vecCompare)) { + List referenceDataList = gammaFileUtil.ReferenceData(m_vecCompare, m_nCount, colorMap, vEnergy); + List chartDataList = gammaFileUtil.StripData(m_vecCompare, m_vCount, m_nCount, colorMap, vEnergy, ratioRate); + stripMap.put("reference", referenceDataList); + stripMap.put("result", chartDataList); + result.setSuccess(true); + result.setResult(stripMap); + } + stripFile.delete(); return result; } @@ -1650,11 +1648,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi ObjectMapper mapper = new ObjectMapper(); String phdStr = mapper.writeValueAsString(phd); String strValue = CalValuesHandler.fitPeakFull(phdStr, Af, Cf, Ff); -// String strValue = HttpClient.fitPeakFull(phdStr, Af, Cf, Ff); Map parseMap = JSON.parseObject(strValue, Map.class); for (Map.Entry entry : parseMap.entrySet()) { if (entry.getKey().equalsIgnoreCase("vPeak")) { List value = JSON.parseArray(JSON.toJSONString(entry.getValue()), PeakInfo.class); + for (PeakInfo info:value) { + if (info.significance == -9999) { + info.significance = Double.POSITIVE_INFINITY; + } + } phd.setVPeak(value); } if (entry.getKey().equalsIgnoreCase("vBase")) { @@ -4361,7 +4363,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi tablePeak.setNetCountRate(rate); tablePeak.setNcRateErr(area_err); tablePeak.setLc(NumberFormatUtil.numberFormat(String.valueOf(peak.lc))); - tablePeak.setSignificance(NumberFormatUtil.numberFormat(String.valueOf(peak.significance))); + tablePeak.setSignificance(Double.isFinite(peak.significance)?NumberFormatUtil.numberFormat(String.valueOf(peak.significance)):(Double.isInfinite(peak.significance)?"inf":"nan")); peakFitList.add(tablePeak); } map.put("peakFit", peakFitList); @@ -4595,7 +4597,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi if (size > 0 && index < size && index >= 0) { PeakInfo peak = phd.getVPeak().get(index); String message = "Peak:" + String.format("%.2f", peak.peakCentroid) + " = " + String.format("%.2f", peak.energy) + " keV\n" + - "FWHM:" + String.format("%.2f", peak.fwhmc) + " keV\n" + + "FWHM:" + String.format("%.2f", peak.fwhm) + " keV\n" + "Net Area:" + String.format("%.2f", peak.area) + "\n" + "BaseLine:" + String.format("%.2f", phd.getVBase().get((int) Math.round(peak.peakCentroid))) + "\n" + "NID:" + StringUtils.join(peak.nuclides, ";"); @@ -4871,7 +4873,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String fwhm = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.fwhm)); String area = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.area)); String areaErr = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.areaErr)); - String signif = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.significance)); + String signif = Double.isFinite(peakInfo.significance)?NumberFormatUtil.numberFormat(String.valueOf(peakInfo.significance)):(Double.isInfinite(peakInfo.significance)?"inf":"nan"); String sensit = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.sensitivity)); String nuclide = StringUtils.join(peakInfo.nuclides, StringPool.SEMICOLON); strBuild.append(rowFormat(title2, peakId, energy, peakCentroid, multiIndex, fwhm, area, areaErr, signif, sensit, nuclide)); 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 911d4595..c30bce8d 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 @@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.LinkedList; import java.util.List; +import java.util.Objects; @Service("gardsPeaksSpectrumService") @DS("ora") @@ -39,7 +40,7 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl map = new HashMap<>(); + //根据请求头获取用户名称 String userName = JwtUtil.getUserNameByToken(request); + //获取beta的缓存数据 Cache cache = betaCache.getBetaCache(); BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); if (Objects.isNull(betaDataFile)) { result.error500("Load basic file information first!"); return result; } + //如果gamma的计算标识是false 则将gamma当前缓存数据进行重置 + if (!fittingBtn) { + betaDataFile.setGammaListNow(Collections.EMPTY_LIST); + betaDataFile.setGammaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setGammaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setGammaNewEnergyListNow(Collections.EMPTY_LIST); + } //获取qc的分析结果数据 EnergySpectrumStruct struct = betaDataFile.getQcStruct(); if (Objects.nonNull(struct)){ @@ -1799,7 +1809,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements map.put("min", min); map.put("max", max); map.put("gammaSpectrum", seriseDataList); - + //计算得到的 if (betaDataFile.getGammaList().size() <= 0 ) { betaDataFile.setGammaList(oldScatterSeries); } @@ -1816,8 +1826,9 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } @Override - public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) { + public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) { Result result = new Result(); + //返回结果内容 Map map = new HashMap<>(); //获取用户名 String userName = JwtUtil.getUserNameByToken(request); @@ -1828,6 +1839,13 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements result.error500("Load basic file information first!"); return result; } + //判断是否进行过计算标识为false时 清空当前beta对应的缓存数据 + if (!fittingBtn) { + betaDataFile.setBetaListNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST); + } //判断qc的分析结果是否为空 EnergySpectrumStruct struct = betaDataFile.getQcStruct(); if (Objects.nonNull(struct)){ @@ -1854,8 +1872,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } map.put("betaEnergy", betaEnergyList); //gamma Energy 散点图坐标点关联gamma部分相关数据 - if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) { - map.put("gammaEnergy", betaDataFile.getGammaNewEnergyList()); + if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyListNow())) { + map.put("gammaEnergy", betaDataFile.getGammaNewEnergyListNow()); } else { List gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy); List gchannels = new ArrayList<>(); @@ -2684,29 +2702,47 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements return result; } Map map = new HashMap<>(); + //记录点位的x轴数据 + List xs = new LinkedList<>(); + //记录点位的y轴数据 + List ys = new LinkedList<>(); + //接收算法计算得到的公式的数据 + List fittingPara = new LinkedList<>(); + //记录计算结果转换为字符串后数据的数组 第一组公式 + List fittingParaStr = new LinkedList<>(); + //记录点位道值的数组 + List channels = new LinkedList<>(); + //新计算的点位数组 + List seriseDataList = new LinkedList<>(); + //页面展示的表单数据数组 + List tableWidgets = new LinkedList<>(); + //新计算得到的线点位数组 + List newLineSeries = new LinkedList<>(); + //计算得到的新能量数组 + List> energyList = new LinkedList<>(); + //记录计算结果转换成字符串后数据的数组 第二组公式 + List fittingParaToUiStr = new LinkedList<>(); //tempPoint数组大小需要大于2个值 if ((CollectionUtils.isNotEmpty(tempPoints) && tempPoints.size() > 2 && Objects.nonNull(count) && tempPoints.size() != count) || (Objects.isNull(paramA) || StringUtils.isBlank(String.valueOf(paramA))) || (Objects.isNull(paramB) || StringUtils.isBlank(String.valueOf(paramB))) || (Objects.isNull(paramC) || StringUtils.isBlank(String.valueOf(paramC))) ){ - List xs = new LinkedList<>(); - List ys = new LinkedList<>(); + //遍历临时点数组 将点位的横坐标以及纵坐标封装到对应的数组 for (int i=0; i fittingPara = EnergySpectrumHandler.GetFileFittingPara(xs, ys); - List fittingParaStr = new LinkedList<>(); + fittingPara = EnergySpectrumHandler.GetFileFittingPara(xs, ys); for (Double para:fittingPara) { fittingParaStr.add(String.valueOf(para)); } map.put("CToE", fittingParaStr); - - List channels = new LinkedList<>(); + //填充道值数组的数据 for (int i=0; i<255; i++) { channels.add(Double.valueOf(i)); } + //计算道值的能量 List energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara); //如果当前fitting按钮没有进行过操作 并且 操作的是gamma探测器相关的 if (tabName.equalsIgnoreCase("gamma") && !fittingBtn) { @@ -2726,13 +2762,13 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } } } - List newLineSeries = new LinkedList<>(); - List> energyList = new LinkedList<>(); + //将新计算的能量封装到数组 for (Double calEnergy:energys) { List newEnergy = new LinkedList<>(); newEnergy.add(calEnergy); energyList.add(newEnergy); } + //遍历道值添加各道值对应点数据到数组 for (int i=0; i seriseDataList = new LinkedList<>(); - List tableWidgets = new LinkedList<>(); + //遍历点 缓存到表单数组以及折线图点位数组 for (int i=0; i fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs); - List fittingParaToUiStr = new LinkedList<>(); for (Double para:fittingParaToUi) { fittingParaToUiStr.add(String.valueOf(para)); } map.put("EToC", fittingParaToUiStr); - - if (tabName.equalsIgnoreCase("beta")) { - betaDataFile.setBetaList(tempPoints); - betaDataFile.setBetaFittingPara(fittingParaStr); - betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr); - betaDataFile.setBetaNewEnergyList(energyList); - } else if (tabName.equalsIgnoreCase("gamma")) { - betaDataFile.setGammaList(tempPoints); - betaDataFile.setGammaFittingPara(fittingParaStr); - betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr); - betaDataFile.setGammaNewEnergyList(energyList); - } } else { - List fittingPara = new LinkedList<>(); + //添加公式的数据到公式一的数组 fittingPara.add(paramA); fittingPara.add(paramB); fittingPara.add(paramC); - List fittingParaStr = new LinkedList<>(); + //将公式各数据转换成字符串存到数组中 fittingParaStr.add(String.valueOf(paramA)); fittingParaStr.add(String.valueOf(paramB)); fittingParaStr.add(String.valueOf(paramC)); map.put("CToE", fittingParaStr); - List xs = new LinkedList<>(); + //遍历点位数组 将横坐标的数据加入到数组中 for (int i=0; i ys = EnergySpectrumHandler.GetFileFittingData(xs, fittingPara); - List seriseDataList = new LinkedList<>(); - List tableWidgets = new LinkedList<>(); + //根据公式和横坐标值 计算新的纵坐标数据 + ys = EnergySpectrumHandler.GetFileFittingData(xs, fittingPara); + //遍历横坐标数值 将数据封存到表单数组以及折线图数组中 for (int i=0; i channels = new LinkedList<>(); + //填充道值数组的数据 for (int i=0; i<255; i++) { channels.add(Double.valueOf(i)); } + //根据道值和公式参数计算新的能量数据 List energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara); - List newLineSeries = new LinkedList<>(); - List> energyList = new LinkedList<>(); for (Double calEnergy:energys) { List newEnergy = new LinkedList<>(); newEnergy.add(calEnergy); energyList.add(newEnergy); } + //遍历道值 将道值和新的能量封装到新的点位数组 for (int i=0; i fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs); - List fittingParaToUiStr = new LinkedList<>(); for (Double para:fittingParaToUi) { fittingParaToUiStr.add(String.valueOf(para)); } map.put("EToC", fittingParaToUiStr); - - if (tabName.equalsIgnoreCase("beta")) { - betaDataFile.setBetaList(tempPoints); - betaDataFile.setBetaFittingPara(fittingParaStr); - betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr); - betaDataFile.setBetaNewEnergyList(energyList); - } else if (tabName.equalsIgnoreCase("gamma")) { - betaDataFile.setGammaList(tempPoints); - betaDataFile.setGammaFittingPara(fittingParaStr); - betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr); - betaDataFile.setGammaNewEnergyList(energyList); - } + } + if (tabName.equalsIgnoreCase("beta")) { + betaDataFile.setBetaListNow(tempPoints); + betaDataFile.setBetaFittingParaNow(fittingParaStr); + betaDataFile.setBetaFittingParaToUiNow(fittingParaToUiStr); + betaDataFile.setBetaNewEnergyListNow(energyList); + } else if (tabName.equalsIgnoreCase("gamma")) { + betaDataFile.setGammaListNow(tempPoints); + betaDataFile.setGammaFittingParaNow(fittingParaStr); + betaDataFile.setGammaFittingParaToUiNow(fittingParaToUiStr); + betaDataFile.setGammaNewEnergyListNow(energyList); + //gamma的进行计算后将当前的beta缓存的数据进行重置 + betaDataFile.setBetaListNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST); } result.setSuccess(true); result.setResult(map); @@ -2909,15 +2933,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements if (Objects.nonNull(betaDataFile)) { //判断需要重置的tab页 if (tabName.equalsIgnoreCase("gamma")) { - betaDataFile.setGammaList(Collections.EMPTY_LIST); - betaDataFile.setGammaFittingPara(Collections.EMPTY_LIST); - betaDataFile.setGammaFittingParaToUi(Collections.EMPTY_LIST); - betaDataFile.setGammaNewEnergyList(Collections.EMPTY_LIST); + betaDataFile.setGammaListNow(Collections.EMPTY_LIST); + betaDataFile.setGammaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setGammaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setGammaNewEnergyListNow(Collections.EMPTY_LIST); + betaDataFile.setBetaListNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST); } else if (tabName.equalsIgnoreCase("beta")) { - betaDataFile.setBetaList(Collections.EMPTY_LIST); - betaDataFile.setBetaFittingPara(Collections.EMPTY_LIST); - betaDataFile.setBetaFittingParaToUi(Collections.EMPTY_LIST); - betaDataFile.setBetaNewEnergyList(Collections.EMPTY_LIST); + betaDataFile.setBetaListNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST); + betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST); + betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST); } } } @@ -2970,16 +2998,21 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements List gammaList = new LinkedList<>(); List gammaFittingPara = new LinkedList<>(); List gammaFittingParaToUi = new LinkedList<>(); - if (Objects.nonNull(betaDataFile)) { - betaList = betaDataFile.getBetaList(); - betaFittingPara = betaDataFile.getBetaFittingPara(); - betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi(); - gammaList = betaDataFile.getGammaList(); - gammaFittingPara = betaDataFile.getGammaFittingPara(); - gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); - } //判断是否对beta页面进行过分析 if (analyseData.isBetaEnergyValid()) { + //如果进行过分析 则将当前beta用于分析的新的数据 赋值到最终使用的数组 + if (Objects.nonNull(betaDataFile)) { + //重新分析时将当前的数组封装给到最终记录结果的数组中 + betaDataFile.setBetaList(betaDataFile.getBetaListNow()); + betaDataFile.setBetaFittingPara(betaDataFile.getBetaFittingParaNow()); + betaDataFile.setBetaFittingParaToUi(betaDataFile.getBetaFittingParaToUiNow()); + betaDataFile.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow()); + //将新的数组封装到各自的数组中 + betaList = betaDataFile.getBetaList(); + betaFittingPara = betaDataFile.getBetaFittingPara(); + betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi(); + } + //封装重新计算的数据 List beCal = new LinkedList<>(); beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); @@ -3020,6 +3053,16 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } //判断是否对gamma页面进行过分析 if (analyseData.isGammaEnergyValid()) { + //如果缓存数据不为空 且对gamma进行了计算 将当前gamma的计算结果赋值到最终的结果数组 进行新的分析使用 + if (Objects.nonNull(betaDataFile)) { + betaDataFile.setGammaList(betaDataFile.getGammaListNow()); + betaDataFile.setGammaFittingPara(betaDataFile.getGammaFittingParaNow()); + betaDataFile.setGammaFittingParaToUi(betaDataFile.getGammaFittingParaToUiNow()); + betaDataFile.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow()); + gammaList = betaDataFile.getGammaList(); + gammaFittingPara = betaDataFile.getGammaFittingPara(); + gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); + } List geCal = new LinkedList<>(); geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); @@ -3173,28 +3216,31 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements List gammaList = new LinkedList<>(); List gammaFittingPara = new LinkedList<>(); List gammaFittingParaToUi = new LinkedList<>(); - if (Objects.nonNull(betaDataFile)) { - betaList = betaDataFile.getBetaList(); - betaFittingPara = betaDataFile.getBetaFittingPara(); - betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi(); - gammaList = betaDataFile.getGammaList(); - gammaFittingPara = betaDataFile.getGammaFittingPara(); - gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); - } //根据sample文件名称获取当前文件的缓存信息 BetaDataFile sampleBetaData = cache.getIfPresent(sampleFileName + "-" + userName); - //将当前文件用到的计算数据同步到需要计算的文件缓存 - sampleBetaData.setBetaList(betaList); - sampleBetaData.setBetaFittingPara(betaFittingPara); - sampleBetaData.setBetaFittingParaToUi(betaFittingParaToUi); - sampleBetaData.setGammaList(gammaList); - sampleBetaData.setGammaFittingPara(gammaFittingPara); - sampleBetaData.setGammaFittingParaToUi(gammaFittingParaToUi); //存储重新分析字段的实体类 SpectrumGroup spectrum_group = new SpectrumGroup(); //声明一个map 缓存xeData计算后的结果 Map xeMap = new HashMap<>(); + //判断beta是否进行过分析 if (analyseData.isBetaEnergyValid()) { + //判断缓存数据是否为空 + if (Objects.nonNull(betaDataFile) && Objects.nonNull(sampleBetaData)) { + //重新分析时将当前的数组封装给到最终记录结果的数组中 + betaDataFile.setBetaList(betaDataFile.getBetaListNow()); + betaDataFile.setBetaFittingPara(betaDataFile.getBetaFittingParaNow()); + betaDataFile.setBetaFittingParaToUi(betaDataFile.getBetaFittingParaToUiNow()); + betaDataFile.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow()); + //将当前文件用到的计算数据同步到需要计算的文件缓存 + sampleBetaData.setBetaList(betaList); + sampleBetaData.setBetaFittingPara(betaFittingPara); + sampleBetaData.setBetaFittingParaToUi(betaFittingParaToUi); + sampleBetaData.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow()); + //将新的数组封装到各自的数组中 + betaList = betaDataFile.getBetaList(); + betaFittingPara = betaDataFile.getBetaFittingPara(); + betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi(); + } List beCal = new LinkedList<>(); beCal.add(Double.valueOf(betaFittingParaToUi.get(0))); beCal.add(Double.valueOf(betaFittingParaToUi.get(1))); @@ -3233,7 +3279,26 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } } } + //判断gamma是否进行了计算 if (analyseData.isGammaEnergyValid()) { + //判断缓存数据是否为空 + if (Objects.nonNull(betaDataFile) && Objects.nonNull(sampleBetaData)) { + //重新分析时将当前的数组封装给到最终记录结果的数组中 + betaDataFile.setGammaList(betaDataFile.getGammaListNow()); + betaDataFile.setGammaFittingPara(betaDataFile.getGammaFittingParaNow()); + betaDataFile.setGammaFittingParaToUi(betaDataFile.getGammaFittingParaToUiNow()); + betaDataFile.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow()); + //将当前文件用到的计算数据同步到需要计算的文件缓存 + sampleBetaData.setGammaList(gammaList); + sampleBetaData.setGammaFittingPara(gammaFittingPara); + sampleBetaData.setGammaFittingParaToUi(gammaFittingParaToUi); + sampleBetaData.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow()); + //将新的数组封装到各自的数组中 + gammaList = betaDataFile.getGammaList(); + gammaFittingPara = betaDataFile.getGammaFittingPara(); + gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); + + } List geCal = new LinkedList<>(); geCal.add(Double.valueOf(gammaFittingParaToUi.get(0))); geCal.add(Double.valueOf(gammaFittingParaToUi.get(1))); From ddeeef40944cd33e3689f7ea7c93ba3dba71c0ab Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 13 Dec 2023 17:43:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=BD=AC=E6=8D=A2SPC?= =?UTF-8?q?=E8=BD=AC=E6=88=90IMS=E6=8E=A5=E5=8F=A3=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E6=97=B6=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20loadFromFile=E6=8E=A5=E5=8F=A3=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=83=85=E5=86=B5=E4=B8=8B=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E5=86=85=E5=AE=B9=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/jeecg/common/util/GammaFileUtil.java | 2 +- .../java/org/jeecg/modules/service/impl/GammaServiceImpl.java | 4 +++- .../jeecg/modules/service/impl/SpectrumFileServiceImpl.java | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index e51ba6e2..095fff1b 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -65,11 +65,11 @@ public class GammaFileUtil extends AbstractLogOrReport { phd.setFilename(fileName); String fromPath = pathName + StringPool.SLASH + fileName; File file = ftpUtil.downloadFile(fromPath, "betaGamma"); - phd.setTmpFilePath(file.getAbsolutePath()); if (Objects.isNull(file)) { result.error500("ftp file can't find"); return false; } + phd.setTmpFilePath(file.getAbsolutePath()); try { //读取文件信息 EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 5154df22..f7f9aab9 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -5281,7 +5281,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi @Override public void SpcToIms(FileData datas, MultipartFile file, HttpServletResponse response) { String SpcName = file.getOriginalFilename(); - String ImsName = SpcName.substring(0, SpcName.length() - 4) + ".PHD"; File spcFile = null; InputStream inputStream = null; // 导出数据内容到txt文本 @@ -5293,6 +5292,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi if (!fileFtransitUtil.ReadSPC(spcFile, datas)) return; String imsValue = fileFtransitUtil.WriteIMS(datas); + String suffix = nameStandUtil.GetSuffix(datas.getData_type(), datas.getQuantity(), String.valueOf(datas.getAcq_live())); + String ImsName = datas.getDetector()+StringPool.DASH+datas.getAcq_date().replace(StringPool.SLASH, StringPool.EMPTY)+StringPool.UNDERSCORE+ + datas.getAcq_time().substring(0, 5).replace(StringPool.COLON, StringPool.EMPTY)+ suffix; // 设置响应类型 response.setContentType("application/octet-stream"); // 解决中文不能生成文件 diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumFileServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumFileServiceImpl.java index e35dd774..8cc0bd31 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumFileServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumFileServiceImpl.java @@ -106,7 +106,9 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService { if (!regexPattern.matcher(fileName).find() && !regexPattern1.matcher(fileName).find()) { EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(oneFile); String suffix = nameStandUtil.GetSuffix(struct.data_type, struct.spectrum_quantity, String.valueOf(struct.acquisition_live_time)); - fileName = oneFile.getName().substring(0, 23)+suffix; + String filePreffix = struct.detector_code + StringPool.DASH + struct.acquisition_start_date.replace(StringPool.SLASH, StringPool.EMPTY)+StringPool.UNDERSCORE + + struct.acquisition_start_time.substring(0, 5).replace(StringPool.COLON, StringPool.EMPTY); + fileName = filePreffix+suffix; } String fullFilePath = rootPath + filePath + slash + fileName; FileInputStream local = new FileInputStream(oneFile); From 0f2d8af41673a7169514b2b43e87832eb34187a6 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 13 Dec 2023 18:47:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?beta=EF=BC=8Cgamma=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E4=BB=A5=E5=8F=8A=E6=97=A5=E5=BF=97=E7=9A=84?= =?UTF-8?q?=E9=97=B4=E8=B7=9D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/GammaFileUtil.java | 172 +++++++++++------- .../impl/SpectrumAnalysisServiceImpl.java | 31 ++-- 2 files changed, 119 insertions(+), 84 deletions(-) diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java index 095fff1b..be865e00 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java @@ -2345,30 +2345,66 @@ public class GammaFileUtil extends AbstractLogOrReport { //文本日志内容第六部分数据 if(middleData.calibration_pairs_E_idCalPoint.size()>0) { String title = String.format("Energy Calibration [%s ]", middleData.calibration_pairs_E_Input); - String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"}; - String[] dataContent = new String[]{"", middleData.calibration_E_functionTypeDef, middleData.calibration_E_functionDef, middleData.calibration_E_coeff_string, middleData.calibration_E_uncoeff_string, middleData.calibration_pairs_E_Input}; - strBuffer.append(attributeGFormat(dataTitle, dataContent)); + strBuffer.append(title); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_E_functionTypeDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_E_functionDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_E_coeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_E_uncoeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_E_Input)); + strBuffer.append(System.lineSeparator()); } //文本日志内容第七部分数据 if(middleData.calibration_pairs_R_idCalPoint.size()>0) { String title = String.format("Resolution Calibration [%s ]", middleData.calibration_pairs_R_Input); - String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"}; - String[] dataContent = new String[]{"", middleData.calibration_R_functionTypeDef, middleData.calibration_R_functionDef, middleData.calibration_R_coeff_string, middleData.calibration_R_uncoeff_string, middleData.calibration_pairs_R_Input}; - strBuffer.append(attributeGFormat(dataTitle, dataContent)); + strBuffer.append(title); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_R_functionTypeDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_R_functionDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_R_coeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_R_uncoeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_R_Input)); + strBuffer.append(System.lineSeparator()); } //文本日志内容第八部分数据 if(middleData.calibration_pairs_EF_idCalPoint.size()>0) { String title = String.format("Efficiency Calibration [%s ]", middleData.calibration_pairs_EF_Input); - String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"}; - String[] dataContent = new String[]{"", middleData.calibration_EF_functionTypeDef, middleData.calibration_EF_functionDef, middleData.calibration_EF_coeff_string, middleData.calibration_EF_uncoeff_string, middleData.calibration_pairs_EF_Input}; - strBuffer.append(attributeGFormat(dataTitle, dataContent)); + strBuffer.append(title); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_EF_functionTypeDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_EF_functionDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_EF_coeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_EF_uncoeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_EF_Input)); + strBuffer.append(System.lineSeparator()); } //文本日志内容第九部分数据 if(middleData.calibration_pairs_T_idCalPoint.size()>0) { String title = String.format("Tot_efficiency Calibration [%s ]", middleData.calibration_pairs_T_Input); - String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"}; - String[] dataContent = new String[]{"", middleData.calibration_T_functionTypeDef, middleData.calibration_T_functionDef, middleData.calibration_T_coeff_string, middleData.calibration_T_uncoeff_string, middleData.calibration_pairs_T_Input}; - strBuffer.append(attributeGFormat(dataTitle, dataContent)); + strBuffer.append(title); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_T_functionTypeDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_T_functionDef)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_T_coeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_T_uncoeff_string)); + strBuffer.append(System.lineSeparator()); + strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_T_Input)); + strBuffer.append(System.lineSeparator()); } //文本日志内容第十一部分头部信息 String logHead11 = "%s Calibration Finished %s"; @@ -2569,33 +2605,33 @@ public class GammaFileUtil extends AbstractLogOrReport { //换行 strBuffer.append(System.lineSeparator()); //报告内容第一部分数据 - strBuffer.append(rowFormat("%sStation ID:%-29s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_stationID)); + strBuffer.append(rowFormat("%sStation ID:%-25s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_stationID)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sDetector ID:%-28s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_detectID)); + strBuffer.append(rowFormat("%sDetector ID:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_detectID)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSample ID:%-30s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_id)); + strBuffer.append(rowFormat("%sSample ID:%-26s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_id)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSample Geometry:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Geometry)); + strBuffer.append(rowFormat("%sSample Geometry:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Geometry)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSample Quantity[m3]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_quantity)); + strBuffer.append(rowFormat("%sSample Quantity[m3]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_quantity)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSample Type:%-28s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Type)); + strBuffer.append(rowFormat("%sSample Type:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Type)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCollection Start:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_start)); + strBuffer.append(rowFormat("%sCollection Start:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_start)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCollection Stop:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_stop)); + strBuffer.append(rowFormat("%sCollection Stop:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_stop)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSampling Time[h]:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_time)); + strBuffer.append(rowFormat("%sSampling Time[h]:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_time)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sDecay Time[h]:%-26s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_decay_time)); + strBuffer.append(rowFormat("%sDecay Time[h]:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_decay_time)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcquisition Start:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquisiton_start)); + strBuffer.append(rowFormat("%sAcquisition Start:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquisiton_start)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcquisition Stop:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_stop)); + strBuffer.append(rowFormat("%sAcquisition Stop:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_stop)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcquisition Time[s]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_time)); + strBuffer.append(rowFormat("%sAcquisition Time[s]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_time)); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAvg Flow Rate[m3/h]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Avg_Flow_Rate)); + strBuffer.append(rowFormat("%sAvg Flow Rate[m3/h]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Avg_Flow_Rate)); strBuffer.append(System.lineSeparator()); String[] cells1 = new String[]{" Collection Station Comments"}; String[] datas1 = new String[]{middleData.Collection_Station_Comments}; @@ -2606,7 +2642,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title1.size(); i++) { String title = title1.get(i); String content = content1.get(i); - strBuffer.append(String.format("%s:%-12s%s", title, StringPool.SPACE, content)); + strBuffer.append(String.format("%s:%-8s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2620,7 +2656,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title2.size(); i++) { String title = title2.get(i); String content = content2.get(i); - strBuffer.append(String.format("%s:%-14s%s", title, StringPool.SPACE, content)); + strBuffer.append(String.format("%s:%-10s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2649,20 +2685,20 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title3.size(); i++) { String title = title3.get(i); String content = content3.get(i); - strBuffer.append(String.format("%s:%-20s%s", title, StringPool.SPACE, content)); + strBuffer.append(String.format("%s:%-16s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } - strBuffer.append(String.format("%s:%-8s%s", " Keyline Activities for Nuclides", StringPool.SPACE, "")); + strBuffer.append(String.format("%s:%-4s%s", " Keyline Activities for Nuclides", StringPool.SPACE, "")); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(String.format("%s:%-12s%s", " with defined Reference Line", StringPool.SPACE, "")); + strBuffer.append(String.format("%s:%-8s%s", " with defined Reference Line", StringPool.SPACE, "")); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(String.format("%s:%-16s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start)); + strBuffer.append(String.format("%s:%-12s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start)); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(String.format("%s:%-11s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start)); + strBuffer.append(String.format("%s:%-7s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start)); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2725,38 +2761,38 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append("#PROCESSING PARAMETERS"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sECutAnalysis_Low:%-23s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low()))); + strBuffer.append(rowFormat("%sECutAnalysis_Low:%-19s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sECutAnalysis_High:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High()))); + strBuffer.append(rowFormat("%sECutAnalysis_High:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sEnergyTolerance:%-24s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance()))); + strBuffer.append(rowFormat("%sEnergyTolerance:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sBaseImprovePSS:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS()))); + strBuffer.append(rowFormat("%sBaseImprovePSS:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sPSS_low:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low()))); + strBuffer.append(rowFormat("%sPSS_low:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sk_back:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back()))); + strBuffer.append(rowFormat("%sk_back:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sk_alpha:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha()))); + strBuffer.append(rowFormat("%sk_alpha:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sk_beta:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta()))); + strBuffer.append(rowFormat("%sk_beta:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sRiskLevelK:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK()))); + strBuffer.append(rowFormat("%sRiskLevelK:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK()))); //换行 strBuffer.append(System.lineSeparator()); Date refTimeAct = middleData.setting_specSetup.getRefTime_act(); - strBuffer.append(rowFormat("%srefTime_act:%-28s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss")); + strBuffer.append(rowFormat("%srefTime_act:%-24s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss")); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%srefTime_conc:%-27s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss"))); + strBuffer.append(rowFormat("%srefTime_conc:%-23s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss"))); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2764,16 +2800,16 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append("#CALIBRATION PARAMETERS"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCalibrationPSS_low:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low()))); + strBuffer.append(rowFormat("%sCalibrationPSS_low:%-17s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCalibrationPSS_high:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high()))); + strBuffer.append(rowFormat("%sCalibrationPSS_high:%-16s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high()))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sbUpdateCal:%-29s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0"))); + strBuffer.append(rowFormat("%sbUpdateCal:%-25s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0"))); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-17s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0"))); + strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-13s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0"))); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2785,7 +2821,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(" Energy Calibration ["+middleData.calibration_pairs_E_Input+" ]"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef)); + strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef)); //换行 strBuffer.append(System.lineSeparator()); String[] cellsE4 = new String[]{" E"}; @@ -2797,7 +2833,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< titleE4.size(); i++) { String title = titleE4.get(i); String content = contentE4.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2810,16 +2846,16 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title4.size(); i++) { String title = title4.get(i); String content = content4.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string)); + strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string)); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input)); + strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input)); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2831,7 +2867,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(" Resolution Calibration ["+middleData.calibration_pairs_R_Input+" ]"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef)); + strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef)); //换行 strBuffer.append(System.lineSeparator()); String[] cellsE5 = new String[]{" E"}; @@ -2843,7 +2879,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< titleE5.size(); i++) { String title = titleE5.get(i); String content = contentE5.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2856,14 +2892,14 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title5.size(); i++) { String title = title5.get(i); String content = content5.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } - strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string)); + strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string)); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input)); + strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input)); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2873,7 +2909,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(" Efficiency Calibration ["+middleData.calibration_pairs_EF_Input+" ]"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef)); + strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef)); //换行 strBuffer.append(System.lineSeparator()); String[] cellsE6 = new String[]{" E"}; @@ -2885,7 +2921,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< titleE6.size(); i++) { String title = titleE6.get(i); String content = contentE6.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2898,14 +2934,14 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title6.size(); i++) { String title = title6.get(i); String content = content6.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } - strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string)); + strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string)); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input)); + strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input)); //换行 strBuffer.append(System.lineSeparator()); //换行 @@ -2915,7 +2951,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(" Tot_efficiency Calibration ["+middleData.calibration_pairs_T_Input+" ]"); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef)); + strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef)); //换行 strBuffer.append(System.lineSeparator()); String[] cellsE7 = new String[]{" E"}; @@ -2927,7 +2963,7 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< titleE7.size(); i++) { String title = titleE7.get(i); String content = contentE7.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } @@ -2940,14 +2976,14 @@ public class GammaFileUtil extends AbstractLogOrReport { for (int i=0; i< title7.size(); i++) { String title = title7.get(i); String content = content7.get(i); - strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content)); + strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content)); //换行 strBuffer.append(System.lineSeparator()); } - strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string)); + strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string)); //换行 strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input)); + strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input)); //换行 strBuffer.append(System.lineSeparator()); //换行 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 e4b96acb..161cce2c 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 @@ -1001,44 +1001,44 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#FILE INFORMATION"); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSampleMeasID:%-38s%s", StringPool.SPACE, StringPool.SPACE, information.getMeasurementID())); + strBuffer.append(rowFormat("%sSampleMeasID:%-15s%s", StringPool.SPACE, StringPool.SPACE, information.getMeasurementID())); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sGASBKMeasID:%-39s%s", StringPool.SPACE, StringPool.SPACE, information.getGasBkgdMeasurementID())); + strBuffer.append(rowFormat("%sGASBKMeasID:%-16s%s", StringPool.SPACE, StringPool.SPACE, information.getGasBkgdMeasurementID())); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sSRID:%-46s%s", StringPool.SPACE, StringPool.SPACE, information.getSampleRefId())); + strBuffer.append(rowFormat("%sSRID:%-23s%s", StringPool.SPACE, StringPool.SPACE, information.getSampleRefId())); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sDetector Type:%-37s%s", StringPool.SPACE, StringPool.SPACE, "3D b-g")); + strBuffer.append(rowFormat("%sDetector Type:%-14s%s", StringPool.SPACE, StringPool.SPACE, "3D b-g")); strBuffer.append(System.lineSeparator()); strBuffer.append(System.lineSeparator()); strBuffer.append("#COLLECTION INFORMATION"); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sStation CODE:%-38s%s", StringPool.SPACE, StringPool.SPACE, information.getSit_det_code())); + strBuffer.append(rowFormat("%sStation CODE:%-15s%s", StringPool.SPACE, StringPool.SPACE, information.getSit_det_code())); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sDetector CODE:%-37s%s", StringPool.SPACE, StringPool.SPACE, information.getDetect_code())); + strBuffer.append(rowFormat("%sDetector CODE:%-14s%s", StringPool.SPACE, StringPool.SPACE, information.getDetect_code())); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCollection Start:%-34s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss"))); + strBuffer.append(rowFormat("%sCollection Start:%-11s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss"))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCollection Stop:%-35s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss"))); + strBuffer.append(rowFormat("%sCollection Stop:%-12s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss"))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sCollection TIME(h):%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(((information.getCollect_stop().getTime()-information.getCollect_start().getTime())/1000)/3600))); + strBuffer.append(rowFormat("%sCollection TIME(h):%-9s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(((information.getCollect_stop().getTime()-information.getCollect_start().getTime())/1000)/3600))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAir Volume[cm3]:%-35s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_xe_stable_volume()))); + strBuffer.append(rowFormat("%sAir Volume[cm3]:%-12s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_xe_stable_volume()))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sXe Volume[cm3]:%-36s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_volume_of_Xe()))); + strBuffer.append(rowFormat("%sXe Volume[cm3]:%-13s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_volume_of_Xe()))); strBuffer.append(System.lineSeparator()); strBuffer.append(System.lineSeparator()); strBuffer.append("#ACQUISITION INFORMATION"); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcquisition Start:%-33s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss"))); + strBuffer.append(rowFormat("%sAcquisition Start:%-10s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss"))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcq Real Time(s):%-34s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_real_sec()))); + strBuffer.append(rowFormat("%sAcq Real Time(s):%-11s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_real_sec()))); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sAcq Live Time:%-37s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_live_sec()))); + strBuffer.append(rowFormat("%sAcq Live Time:%-14s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_live_sec()))); strBuffer.append(System.lineSeparator()); strBuffer.append(System.lineSeparator()); strBuffer.append("#SOFTWARE"); strBuffer.append(System.lineSeparator()); - strBuffer.append(rowFormat("%sversion:%-43s%s", StringPool.SPACE, StringPool.SPACE, "1.0.1")); + strBuffer.append(rowFormat("%sversion:%-20s%s", StringPool.SPACE, StringPool.SPACE, "1.0.1")); strBuffer.append(System.lineSeparator()); strBuffer.append(System.lineSeparator()); strBuffer.append("#SAMPLE Old CALIBRATION"); @@ -3297,7 +3297,6 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements gammaList = betaDataFile.getGammaList(); gammaFittingPara = betaDataFile.getGammaFittingPara(); gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi(); - } List geCal = new LinkedList<>(); geCal.add(Double.valueOf(gammaFittingParaToUi.get(0)));