beta功能分析增加拦截,如果分析结果中的错误日志不为空,则不返回分析内容
This commit is contained in:
parent
25ddaf9b28
commit
4984689190
|
@ -613,84 +613,88 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
} else {
|
||||
analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
|
||||
}
|
||||
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
||||
String sampleFileName = (String) map.get("sampleFileName");
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//需要返回到前端的XeData数据
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
//存入计算后得到的xeData数据
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
map.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
return;
|
||||
} else {
|
||||
EnergySpectrumStruct sample = analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = analyzeFileSourceData(detTmp);
|
||||
String sampleFileName = (String) map.get("sampleFileName");
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//需要返回到前端的XeData数据
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
//存入计算后得到的xeData数据
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
map.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
map.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
map.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
map.put("GasBoundary", boundaryList);
|
||||
}
|
||||
map.put("GasBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
map.put("DetBoundary", boundaryList);
|
||||
}
|
||||
map.put("DetBoundary", boundaryList);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1239,16 +1243,24 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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", "?", "?", "?"));
|
||||
}
|
||||
|
@ -1261,16 +1273,24 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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", "?", "?", "?"));
|
||||
}
|
||||
|
@ -1323,20 +1343,28 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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,16 +1374,24 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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", "?", "?", "?"));
|
||||
}
|
||||
|
@ -1403,16 +1439,24 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十一行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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", "?", "?", "?"));
|
||||
}
|
||||
|
@ -1425,16 +1469,24 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十四行数据
|
||||
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)))));
|
||||
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.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)))));
|
||||
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", "?", "?", "?"));
|
||||
}
|
||||
|
|
|
@ -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,97 +3327,101 @@ 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);
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp);
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//存入分析用到的数据
|
||||
map.put("reAnalyseParam", spectrum_group.BgCalPara);
|
||||
//存入计算后得到的xeData数据
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
xeMap.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
return Collections.EMPTY_LIST;
|
||||
} else {
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp);
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//存入分析用到的数据
|
||||
map.put("reAnalyseParam", spectrum_group.BgCalPara);
|
||||
//存入计算后得到的xeData数据
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
xeMap.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("GasBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("GasBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("DetBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("DetBoundary", boundaryList);
|
||||
}
|
||||
if (analyseData.isQcData()) {
|
||||
if (StringUtils.isNotBlank(qcFilePath)) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcFilePath, qcFileName);
|
||||
if (Objects.nonNull(struct)) {
|
||||
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap);
|
||||
if (analyseData.isQcData()) {
|
||||
if (StringUtils.isNotBlank(qcFilePath)) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcFilePath, qcFileName);
|
||||
if (Objects.nonNull(struct)) {
|
||||
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
//将重新计算的参数以及重新计算后的xeData的数据缓存到本地缓存中
|
||||
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
||||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
//将重新计算的参数以及重新计算后的xeData的数据缓存到本地缓存中
|
||||
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
||||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -3543,99 +3548,103 @@ 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);
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp);
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//存入重新分析的参数
|
||||
map.put("reAnalyseParam", spectrum_group.BgCalPara);
|
||||
//存入xeData数据
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
xeMap.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (StringUtils.isNotBlank(analyseResult.error_log)) {
|
||||
continue;
|
||||
} else {
|
||||
//生成分析操作日志
|
||||
EnergySpectrumStruct sample = phdFileUtil.analyzeFileSourceData(sampleTmp);
|
||||
EnergySpectrumStruct gas = phdFileUtil.analyzeFileSourceData(gasTmp);
|
||||
EnergySpectrumStruct det = phdFileUtil.analyzeFileSourceData(detTmp);
|
||||
String logName = sampleFileName.replace("PHD", "log");
|
||||
phdFileUtil.OutPutRnLog(analyseResult, sample, gas, det, logName);
|
||||
//存入重新分析的参数
|
||||
map.put("reAnalyseParam", spectrum_group.BgCalPara);
|
||||
//存入xeData数据
|
||||
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
|
||||
GardsXeResultsSpectrum xe131m = new GardsXeResultsSpectrum();
|
||||
xe131m.setNuclideName(XeNuclideName.XE_131m.getType());
|
||||
xe131m.setConc(analyseResult.Xe131m_con);
|
||||
xe131m.setConcErr(analyseResult.Xe131m_uncer);
|
||||
xe131m.setLc(analyseResult.LC_Xe131m);
|
||||
xe131m.setMdc(analyseResult.MDC_Xe131m);
|
||||
xe131m.setNidFlag(analyseResult.XE_131m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe131m);
|
||||
GardsXeResultsSpectrum xe133 = new GardsXeResultsSpectrum();
|
||||
xe133.setNuclideName(XeNuclideName.XE_133.getType());
|
||||
xe133.setConc(analyseResult.Xe133_con);
|
||||
xe133.setConcErr(analyseResult.Xe133_uncer);
|
||||
xe133.setLc(analyseResult.LC_Xe133);
|
||||
xe133.setMdc(analyseResult.MDC_Xe133);
|
||||
xe133.setNidFlag(analyseResult.XE_133_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133);
|
||||
GardsXeResultsSpectrum xe133m = new GardsXeResultsSpectrum();
|
||||
xe133m.setNuclideName(XeNuclideName.XE_133m.getType());
|
||||
xe133m.setConc(analyseResult.Xe133m_con);
|
||||
xe133m.setConcErr(analyseResult.Xe133m_uncer);
|
||||
xe133m.setLc(analyseResult.LC_Xe133m);
|
||||
xe133m.setMdc(analyseResult.MDC_Xe133m);
|
||||
xe133m.setNidFlag(analyseResult.XE_133m_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe133m);
|
||||
GardsXeResultsSpectrum xe135 = new GardsXeResultsSpectrum();
|
||||
xe135.setNuclideName(XeNuclideName.XE_135.getType());
|
||||
xe135.setConc(analyseResult.Xe135_con);
|
||||
xe135.setConcErr(analyseResult.Xe135_uncer);
|
||||
xe135.setLc(analyseResult.LC_Xe135);
|
||||
xe135.setMdc(analyseResult.MDC_Xe135);
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
xeMap.put("XeData", xeResultsSpectrumList);
|
||||
//新计算得到的边界值
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("SampleBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("GasBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("GasBoundary", boundaryList);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
|
||||
List<Boundary> boundaryList = new LinkedList<>();
|
||||
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
|
||||
Boundary boundary = new Boundary();
|
||||
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
|
||||
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
|
||||
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
|
||||
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
|
||||
boundaryList.add(boundary);
|
||||
}
|
||||
xeMap.put("DetBoundary", boundaryList);
|
||||
}
|
||||
xeMap.put("DetBoundary", boundaryList);
|
||||
}
|
||||
if (analyseData.isQcData()) {
|
||||
if (StringUtils.isNotBlank(qcFilePath)) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcFilePath, qcFileName);
|
||||
if (Objects.nonNull(struct)) {
|
||||
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap);
|
||||
if (analyseData.isQcData()) {
|
||||
if (StringUtils.isNotBlank(qcFilePath)) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(qcFilePath, qcFileName);
|
||||
if (Objects.nonNull(struct)) {
|
||||
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
//将重新计算的参数以及重新计算后的xeData的数据缓存到本地缓存中
|
||||
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
||||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
analyseResultMap.put(sampleFileName, xeResultsSpectrumList);
|
||||
}
|
||||
//将重新计算的参数以及重新计算后的xeData的数据缓存到本地缓存中
|
||||
cache.put(sampleFileName + "-" + userName + "-reAnalyseParam", map);
|
||||
cache.put(sampleFileName + "-" + userName + "-xeData", xeMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
analyseResultMap.put(sampleFileName, xeResultsSpectrumList);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -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