From 905d5f5cbccb7a7843273b840c50be46353ee601 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Mon, 11 Dec 2023 17:19:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=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=E5=A2=9E=E5=8A=A0comp?= =?UTF-8?q?are=EF=BC=8Cstrip=E5=AF=B9=E6=AF=94=E6=96=87=E4=BB=B6=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E6=98=AF=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E7=9A=84=E6=8E=A5=E5=8F=A3=20=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90gamma=E9=83=A8=E5=88=86ARR,?= =?UTF-8?q?RRR=E6=8A=A5=E5=91=8A=E9=97=B4=E8=B7=9D=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90compare?= =?UTF-8?q?=EF=BC=8Cstrip=E5=85=AC=E7=94=A8=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86?= =?UTF-8?q?=E6=9E=90strip=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=A2=9E=E5=8A=A0=E5=8F=82=E8=80=83=E8=B0=B1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=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=86fit=E6=97=B6?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90gamma?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=9F=A5=E7=9C=8B=E6=A0=B8=E7=B4=A0=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=9C=80=E5=A4=A7=E6=AF=94=E4=BE=8B=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=9A=84=E6=A0=87=E8=AF=86=E5=AD=97=E6=AE=B5=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA1=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=E6=96=87=E4=BB=B6=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E8=BD=AC=E6=8D=A2=E4=B8=BA?= =?UTF-8?q?IMS=E7=9A=84=E6=A0=BC=E5=BC=8F=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8E=E7=BC=80=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BAPHD=20?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90gamma?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A2=9C=E8=89=B2=E9=85=8D=E7=BD=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E4=B8=AA=E5=8E=9F=E6=9C=89=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=A4=E4=B8=AA=E9=A2=9C=E8=89=B2=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=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=E8=AE=A1=E7=AE=97=E6=9B=B2?= =?UTF-8?q?=E7=BA=BF=E5=85=AC=E5=BC=8F=E6=96=B9=E6=B3=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=A0=87=E8=AF=86=E5=BA=94=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=80=BB=E8=BE=91=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=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E7=BD=AE=E8=AE=A1=E7=AE=97=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=20=E4=BA=BA=E5=B7=A5=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E5=88=86=E6=9E=90beta=E9=83=A8=E5=88=86=E6=9F=A5?= =?UTF-8?q?=E7=9C=8Bbeta=E6=A0=87=E7=AD=BE=E9=A1=B5=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BA=A4=E4=BA=92=E5=88=86=E6=9E=90beta?= =?UTF-8?q?=EF=BC=8Cgamma=E7=BC=93=E5=AD=98=E6=9C=BA=E5=88=B6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E6=94=B9=E4=B8=BA24=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/entity/postgre/SysUserColor.java | 16 +- .../jeecg/modules/entity/vo/FittingBody.java | 2 + .../org/jeecg/common/util/GammaFileUtil.java | 59 +++++-- .../org/jeecg/common/cache/BetaCache.java | 2 +- .../org/jeecg/common/cache/LocalCache.java | 2 +- .../modules/controller/GammaController.java | 10 ++ .../SpectrumAnalysesController.java | 8 +- .../jeecg/modules/entity/vo/ColorInfo.java | 5 +- .../jeecg/modules/service/IGammaService.java | 4 + .../service/ISpectrumAnalysisService.java | 4 +- .../service/impl/GammaServiceImpl.java | 149 +++++++++++++++--- .../impl/SpectrumAnalysisServiceImpl.java | 65 ++++++-- .../service/impl/SysUserColorServiceImpl.java | 24 ++- 13 files changed, 292 insertions(+), 58 deletions(-) diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/postgre/SysUserColor.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/postgre/SysUserColor.java index 7a42ea99..356c1bbf 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/postgre/SysUserColor.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/entity/postgre/SysUserColor.java @@ -63,8 +63,20 @@ public class SysUserColor implements Serializable { /** * 两谱和曲线颜色 */ - @TableField(value = "color_strip") - private String colorStrip; + @TableField(value = "color_spec_sum") + private String colorSpecSum; + + /** + * 两谱差曲线颜色 + */ + @TableField(value = "color_spec_cut") + private String colorSpecCut; + + /** + * 参考谱曲线颜色 + */ + @TableField(value = "color_reference") + private String colorReference; /** * 创建人 diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/FittingBody.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/FittingBody.java index 07c90286..84ec2a9d 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/FittingBody.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/FittingBody.java @@ -16,6 +16,8 @@ public class FittingBody implements Serializable { private List tempPoints; + private boolean fittingBtn; + private Integer count; private String sampleFileName; 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 ef18043e..90a791d5 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 @@ -2669,7 +2669,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(System.lineSeparator()); //换行 strBuffer.append(System.lineSeparator()); - String nuclideTitle = "%-41s%-33s%-15s%-14s%-15s%-21s%-15s"; + String nuclideTitle = "%-15s%-18s%-15s%-15s%-15s%-21s%-15s"; String[] nuclideData = new String[]{" Nuclide", "Halflife(s)", "Activity(Bq)", "RelErr%", "MDA(Bq)", "Conc(uBq/m^3)", "MDC"}; strBuffer.append(rowFormat(nuclideTitle, nuclideData)); strBuffer.append(System.lineSeparator()); @@ -2704,7 +2704,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append(System.lineSeparator()); //换行 strBuffer.append(System.lineSeparator()); - String peakTitle = "%-41s%-33s%-15s%-14s%-15s%-21s%-15s%-11s%-28s"; + String peakTitle = "%-10s%-15s%-15s%-14s%-15s%-21s%-15s%-11s%-28s"; String[] peakData = new String[]{" PeakID", "Energy[kev]", "Centroid", "FWHM[kev]", "NetArea", "NAErr%", "Signif", "Sensit", "Nuclide"}; strBuffer.append(rowFormat(peakTitle, peakData)); strBuffer.append(System.lineSeparator()); @@ -2958,7 +2958,7 @@ public class GammaFileUtil extends AbstractLogOrReport { strBuffer.append("#DATA QUALITY FLAGS"); //换行 strBuffer.append(System.lineSeparator()); - String qualityTitle = "%-41s%-33s%-15s%-14s"; + String qualityTitle = "%-15s%-15s%-15s%-15s"; strBuffer.append(rowFormat(qualityTitle, " Name", "Pass/Fail", "Value", "Test")); //换行 strBuffer.append(System.lineSeparator()); @@ -4084,11 +4084,8 @@ public class GammaFileUtil extends AbstractLogOrReport { } } - public List loadCompareData(String compareFileName, String userName, long m_nCount, Result result) { + public List loadCompareData(File file, String userName, long m_nCount, Result result) { List m_vecCompare = new LinkedList<>(); - String compareFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; - String fromPath = compareFilePath + StringPool.SLASH + compareFileName; - File file = ftpUtil.downloadFile(fromPath, "betaGamma"); //读取文件信息 EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); //判断当前用来进行比较的文件的#g_Spectrum数量是否与原文件的大小一致 @@ -4101,8 +4098,6 @@ public class GammaFileUtil extends AbstractLogOrReport { m_vecCompare.add(0L); m_vecCompare.remove(0); } - if (ObjectUtil.isNotNull(file)) - file.delete(); return m_vecCompare; } @@ -4140,6 +4135,40 @@ public class GammaFileUtil extends AbstractLogOrReport { return datalist; } + public List ReferenceData(List m_vecCompare, long m_nCount, Map colorMap, List vEnergy) { + List datalist = new LinkedList<>(); + int size = m_vecCompare.size(); + if(size == m_nCount) { + ChartData data1 = new ChartData(); + data1.setName("Compare"); + data1.setGroup("channel"); + data1.setColor(colorMap.get("Color_Reference")); + // Compare two Spectrum in Channel + for(int i=0; i StripData(List m_vecCompare, List m_vCount, long m_nCount, Map colorMap, List vEnergy, Double ratioRate) { List datalist = new LinkedList<>(); int size = m_vecCompare.size(); @@ -4147,7 +4176,11 @@ public class GammaFileUtil extends AbstractLogOrReport { ChartData data1 = new ChartData(); data1.setName("Compare"); data1.setGroup("channel"); - data1.setColor(colorMap.get("Color_Strip")); + if (ratioRate<0) { + data1.setColor(colorMap.get("Color_SpecCut")); + } else { + data1.setColor(colorMap.get("Color_SpecSum")); + } // type: 1 Add a Spectrum in Channel; -1 Cut a Spectrum in Channel for(int i=0; i tempPointsArray, Integer count, String sampleFileName, String tabName, HttpServletRequest request); + Result fitting(Double paramA, Double paramB, Double paramC, List tempPointsArray, Integer count, String sampleFileName, String tabName, boolean fittingBtn, HttpServletRequest request); Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, String sampleFileName, HttpServletRequest request); + void resetButton(String sampleFileName, String tabName, HttpServletRequest request); + Result ReAnalyse(AnalyseData analyseData, HttpServletRequest request); Result analyseCurrentSpectrum(String dbName, Integer sampleId, String sampleFileName, String gasFileName, String detFileName, String qcFileName, 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 d07cfc7a..ef66ce6a 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 @@ -899,6 +899,43 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi localCache.deletePHDCache(key); } + @Override + public Result CompareDB(String fileName, Integer sampleId, HttpServletRequest request) { + Result result = new Result(); + //获取用户名称 + String userName = JwtUtil.getUserNameByToken(request); + // 获取当前角色配置的颜色信息 + Map colorMap = sysUserColorService.initColor(userName); + // 获取缓存的phd数据 + Cache phdCache = localCache.getPHDCache(); + PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName); + if (Objects.isNull(phd)) { + result.error500("Please select the parse file first!"); + return result; + } + long m_nCount = phd.getSpec().getNum_g_channel(); + List vEnergy = phd.getVEnergy(); + //根据sampleId查询文件路径 + String compareFilePath = spectrumAnalysisMapper.getSampleFilePath(sampleId); + if (StringUtils.isBlank(compareFilePath)) { + result.error500("The comparison file path does not exist"); + return result; + } + 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(); + } + return result; + } + @Override public Result Compare(String fileName, String compareFileName, HttpServletRequest request) { Result result = new Result(); @@ -914,19 +951,27 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } long m_nCount = phd.getSpec().getNum_g_channel(); List vEnergy = phd.getVEnergy(); - // 获取Compare数据 - List m_vecCompare = gammaFileUtil.loadCompareData(compareFileName, 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); + //加载compare文件 + String compareFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + String fromPath = compareFilePath + StringPool.SLASH + compareFileName; + File compareFile = ftpUtil.downloadFile(fromPath, "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(); } return result; } @Override - public Result Strip(String fileName, String stripFileName, Double ratioRate, HttpServletRequest request) { + public Result StripDB(String fileName, Integer sampleId, Double ratioRate, HttpServletRequest request) { Result result = new Result(); + Map> stripMap = new HashMap<>(); String userName = JwtUtil.getUserNameByToken(request); // 获取当前角色配置的颜色信息 Map colorMap = sysUserColorService.initColor(userName); @@ -952,12 +997,75 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi if (m_nSChan == 0) { m_vCount.add(0L); } - // 获取Compare数据 - List m_vecCompare = gammaFileUtil.loadCompareData(stripFileName, userName, m_nCount, result); - if (CollectionUtils.isNotEmpty(m_vecCompare)) { - List chartDataList = gammaFileUtil.StripData(m_vecCompare, m_vCount, m_nCount, colorMap, vEnergy, ratioRate); - result.setSuccess(true); - result.setResult(chartDataList); + //根据sampleId查询文件路径 + String stripFilePath = spectrumAnalysisMapper.getSampleFilePath(sampleId); + if (StringUtils.isBlank(stripFilePath)) { + result.error500("The comparison file path does not exist"); + return result; + } + 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(); + } + return result; + } + + @Override + public Result Strip(String fileName, String stripFileName, Double ratioRate, HttpServletRequest request) { + Result result = new Result(); + Map> stripMap = new HashMap<>(); + String userName = JwtUtil.getUserNameByToken(request); + // 获取当前角色配置的颜色信息 + Map colorMap = sysUserColorService.initColor(userName); + // 获取缓存的phd数据 + Cache phdCache = localCache.getPHDCache(); + PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName); + if (Objects.isNull(phd)) { + result.error500("Please select the parse file first!"); + return result; + } + long m_nCount = phd.getSpec().getNum_g_channel(); + List vEnergy = phd.getVEnergy(); + long m_nSChan = phd.getSpec().getBegin_channel(); + List m_vCount = new LinkedList<>(); + // 确保绘制曲线时所有谱都是从1道开始 + int i = 0; + if (m_nSChan == 0) { + i = 1; + } + for (; i < m_nCount; ++i) { + m_vCount.add(phd.getSpec().getCounts().get(i)); + } + if (m_nSChan == 0) { + m_vCount.add(0L); + } + //加载strip文件 + String stripFilePath = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName; + String fromPath = stripFilePath + StringPool.SLASH + stripFileName; + File stripFile = ftpUtil.downloadFile(fromPath, "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(); } return result; } @@ -1436,12 +1544,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi // 根据boolean 决定是否保留本次数据 如果保留则不需要操作vPeak 并重新拟合线 if (accept) { Map nuclideLinesMap = (Map) redisUtil.get(userName+"-"+phd.getHeader().getSystem_type()); - if (flag.equalsIgnoreCase("fit")) {// 如果传递的flag标识 是 fit则进行修改峰值等数据 - for (int j = 0; j < newPeak.size(); j++) { - PeakInfo peakInfo = newPeak.get(j); - phd.getVPeak().set(peakInfo.index - 1, peakInfo); - } - } else if (flag.equalsIgnoreCase("insert")) {// 如果传递的flag标识 是 Insert则进行峰值的插入 + if (flag.equalsIgnoreCase("insert")) {// 如果传递的flag标识 是 Insert则进行峰值的插入 //重新赋值index for (int k=0; k parseMap = JSON.parseObject(strValue, Map.class); for (Map.Entry entry : parseMap.entrySet()) { if (entry.getKey().equalsIgnoreCase("vPeak")) { @@ -2008,6 +2112,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi item.setYieldUncert(Double.valueOf(String.format("%.3f", 0.0))); } }); + nuclideTableList.stream().max(Comparator.comparing(GardsNuclLinesLib::getYield)).get().setKeyFlag(1); map.put("table", nuclideTableList); gammaFileUtil.InitChart(nuclideTableList, phd, map, colorMap); } @@ -5074,7 +5179,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi @Override public void IecToIms(FileData datas, MultipartFile file, HttpServletResponse response) { String IecName = file.getOriginalFilename(); - String ImsName = IecName.substring(0, IecName.length() - 4) + ".Ims"; + String ImsName = IecName.substring(0, IecName.length() - 4) + ".PHD"; File iecFile = null; InputStream inputStream = null; // 导出数据内容到txt文本 @@ -5120,7 +5225,7 @@ 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) + ".IMS"; + String ImsName = SpcName.substring(0, SpcName.length() - 4) + ".PHD"; File spcFile = null; InputStream inputStream = null; // 导出数据内容到txt文本 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 e75221d0..28e15a40 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 @@ -1854,16 +1854,20 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } map.put("betaEnergy", betaEnergyList); //gamma Energy 散点图坐标点关联gamma部分相关数据 - List gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy); - List gchannels = new ArrayList<>(); - List> gammaEnergyList = new LinkedList<>(); - for (int i=0; i gammaEnergy = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam); - gammaEnergyList.add(gammaEnergy); + if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) { + map.put("gammaEnergy", betaDataFile.getGammaNewEnergyList()); + } else { + List gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy); + List gchannels = new ArrayList<>(); + List> gammaEnergyList = new LinkedList<>(); + for (int i=0; i gammaEnergy = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam); + gammaEnergyList.add(gammaEnergy); + } + map.put("gammaEnergy", gammaEnergyList); } - map.put("gammaEnergy", gammaEnergyList); //Beta-Gamma Spectrum: QC 散点图相关数据 List histogramDataList = new LinkedList<>(); for (int column=0; column tempPoints, Integer count, String sampleFileName, String tabName, HttpServletRequest request) { + public Result fitting(Double paramA, Double paramB, Double paramC, List tempPoints, Integer count, String sampleFileName, String tabName, boolean fittingBtn, HttpServletRequest request) { Result result = new Result(); //获取用户名 String userName = JwtUtil.getUserNameByToken(request); @@ -2704,6 +2708,24 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements channels.add(Double.valueOf(i)); } List energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara); + //如果当前fitting按钮没有进行过操作 并且 操作的是gamma探测器相关的 + if (tabName.equalsIgnoreCase("gamma") && !fittingBtn) { + //根据临时点的道值修改对应能量值 + //遍历所有道值 + for (int i=0; i< channels.size(); i++) { + //获取道值 + double channel = channels.get(i).doubleValue(); + //遍历临时点数据 + for (int j=0; j newLineSeries = new LinkedList<>(); List> energyList = new LinkedList<>(); for (Double calEnergy:energys) { @@ -2877,6 +2899,29 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements return result; } + @Override + public void resetButton(String sampleFileName, String tabName, HttpServletRequest request) { + //获取用户名 + String userName = JwtUtil.getUserNameByToken(request); + //获取缓存信息 + Cache cache = betaCache.getBetaCache(); + BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName); + 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); + } 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); + } + } + } + @Override public Result ReAnalyse(AnalyseData analyseData, HttpServletRequest request) { Result result = new Result(); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SysUserColorServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SysUserColorServiceImpl.java index 0a3da6d2..7eb6d6eb 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SysUserColorServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SysUserColorServiceImpl.java @@ -31,14 +31,16 @@ public class SysUserColorServiceImpl extends ServiceImpl Date: Mon, 11 Dec 2023 17:58:33 +0800 Subject: [PATCH 2/2] =?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=86RRR=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E9=97=B4=E8=B7=9D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SpectrumAnalysisServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 28e15a40..29445c0e 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 @@ -1089,7 +1089,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#SAMPLE: LIMITS PER ROI"); strBuffer.append(System.lineSeparator()); - String limitRoi = "%s%-51s%-51s%-12s"; + String limitRoi = "%s%-15s%-15s%-15s"; strBuffer.append(rowFormat(limitRoi, StringPool.SPACE, "Roi", "Beta", "Gamma")); strBuffer.append(System.lineSeparator()); if (CollectionUtils.isNotEmpty(roiChannelsSpectrumsSample)) { @@ -1218,7 +1218,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#GROSS COUNTS PER ROI"); strBuffer.append(System.lineSeparator()); - String grossRoi = "%s%-51s%-51s%-13s%-15s"; + String grossRoi = "%s%-15s%-15s%-15s%-15s"; strBuffer.append(rowFormat(grossRoi, StringPool.SPACE, "Roi", "Sample", "GasBkgnd", "DetBkgnd")); strBuffer.append(System.lineSeparator()); if (CollectionUtils.isNotEmpty(resultsSpectrums)) { @@ -1230,7 +1230,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#NET COUNTS AND LC PER ROI"); strBuffer.append(System.lineSeparator()); - String netRoi = "%s%-51s%-51s%-13s"; + String netRoi = "%s%-15s%-25s%-15s"; if (betaDataFile.isBProcessed()) { if (CollectionUtils.isNotEmpty(resultsSpectrums)) { if (Objects.isNull(resultsSpectrums.get(0).getLcCts())) { @@ -1285,7 +1285,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#CONCENTRATION AND LC PER ROI"); strBuffer.append(System.lineSeparator()); - String conLcRoi = "%s%-51s%-51s%-13s%-15s"; + String conLcRoi = "%s%-15s%-25s%-15s%-15s"; strBuffer.append(rowFormat(conLcRoi, StringPool.SPACE, "Roi", "Conc(mBq/m3)", "LC(mBq/m3)", "MDC(mBq/m3):")); strBuffer.append(System.lineSeparator()); if (betaDataFile.isBProcessed()) { @@ -1306,7 +1306,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements strBuffer.append(System.lineSeparator()); strBuffer.append("#RESULT SUMMARY"); strBuffer.append(System.lineSeparator()); - String resultSum = "%s%-51s%-51s%-13s%-15s%-11s"; + String resultSum = "%s%-15s%-25s%-15s%-15s%-15s"; strBuffer.append(rowFormat(resultSum, StringPool.SPACE, "Nuclide Name", "Conc", "LC", "MDC", "NID Flag")); strBuffer.append(System.lineSeparator()); if (CollectionUtils.isNotEmpty(xeResultsSpectrums)) {