beta功能分析增加拦截,如果分析结果中的错误日志不为空,则不返回分析内容
This commit is contained in:
parent
25ddaf9b28
commit
4984689190
|
@ -613,6 +613,9 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
} else {
|
||||
analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
|
||||
}
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
return;
|
||||
} else {
|
||||
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
||||
|
@ -693,6 +696,7 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
map.put("DetBoundary", boundaryList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EnergySpectrumStruct analyzeFileSourceData(String filePath, String fileName) {
|
||||
EnergySpectrumStruct struct = null;
|
||||
|
@ -1239,19 +1243,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
if (bgAnalyseResult.s_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_b_fitting_c_e)) {
|
||||
if (bgAnalyseResult.s_b_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十七行数据
|
||||
if (bgAnalyseResult.s_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_b_fitting_e_c)) {
|
||||
if (bgAnalyseResult.s_b_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_b_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1261,19 +1273,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
if (bgAnalyseResult.s_g_fitting_c_e !=null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_g_fitting_c_e)) {
|
||||
if (bgAnalyseResult.s_g_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十七行数据
|
||||
if (bgAnalyseResult.s_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.s_g_fitting_e_c)) {
|
||||
if (bgAnalyseResult.s_g_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.s_g_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1323,20 +1343,28 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
if (bgAnalyseResult.d_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_b_fitting_c_e)) {
|
||||
if (bgAnalyseResult.d_b_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十五行数据
|
||||
if (bgAnalyseResult.d_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_b_fitting_e_c)) {
|
||||
if (bgAnalyseResult.d_b_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_b_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1346,19 +1374,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
if (bgAnalyseResult.d_g_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_g_fitting_c_e)) {
|
||||
if (bgAnalyseResult.d_g_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十五行数据
|
||||
if (bgAnalyseResult.d_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.d_g_fitting_e_c)) {
|
||||
if (bgAnalyseResult.d_g_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.d_g_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1403,19 +1439,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十一行数据
|
||||
if (bgAnalyseResult.g_b_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_b_fitting_c_e)) {
|
||||
if (bgAnalyseResult.g_b_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十二行数据
|
||||
if (bgAnalyseResult.g_b_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_b_fitting_e_c)) {
|
||||
if (bgAnalyseResult.g_b_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_b_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1425,19 +1469,27 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十四行数据
|
||||
if (bgAnalyseResult.g_g_fitting_c_e != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_g_fitting_c_e)) {
|
||||
if (bgAnalyseResult.g_g_fitting_c_e.size() > 0) {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_c_e.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("energy to channel equation: CH(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十五行数据
|
||||
if (bgAnalyseResult.g_g_fitting_e_c != null && CollectionUtils.isNotEmpty(bgAnalyseResult.g_g_fitting_e_c)) {
|
||||
if (bgAnalyseResult.g_g_fitting_e_c.size() > 0) {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(0))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(1))), NumberFormatUtil.numberFormat(String.valueOf(bgAnalyseResult.g_g_fitting_e_c.get(2)))));
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
} else {
|
||||
out.append(rowFormat("channel to energy equation: E(x) = (%s)+(%s)*x+(%s)x*x", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.collect.Lists;
|
||||
import kotlin.collections.EmptyList;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.net.ftp.FTP;
|
||||
|
@ -3326,6 +3327,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
|
||||
//调用重新分析算法 获取算法结果
|
||||
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
return Collections.EMPTY_LIST;
|
||||
} else {
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
|
@ -3418,6 +3422,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
@ -3543,6 +3548,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
detTmp = phdFileUtil.analyzeFile(detFilePath, detFileName);
|
||||
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
|
||||
BgAnalyseResult analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), spectrum_group.BgCalPara);
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
continue;
|
||||
} else {
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
|
@ -3638,6 +3646,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
analyseResultMap.put(sampleFileName, xeResultsSpectrumList);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
@ -4140,7 +4149,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName());
|
||||
//如果当前分析员在当天没有排班任务 并且 没有历史分析过当前文件 则不允许进行保存操作
|
||||
if ( !bAnalysisResultWriteAuthority && Objects.isNull(isExist) ){
|
||||
result.error500("This user has no right to store the results of the analysis to the database.");
|
||||
result.error500("You have no permission to save results to DB!");
|
||||
return result;
|
||||
}
|
||||
//处理数据 获取对应的channel/energy值
|
||||
|
|
Loading…
Reference in New Issue
Block a user