Merge remote-tracking branch 'origin/station' into station
# Conflicts: # jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/common/util/GammaFileUtil.java
This commit is contained in:
commit
96df7732d0
|
@ -18,7 +18,7 @@ public class FittingBody implements Serializable {
|
|||
|
||||
private Integer count;
|
||||
|
||||
private String qcFileName;
|
||||
private String sampleFileName;
|
||||
|
||||
private String tabName;
|
||||
|
||||
|
|
|
@ -903,6 +903,19 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
|
||||
public void UpdateChart(PHDFile phd, Map<String, Object> map, Map<String, String> colorMap) {
|
||||
ChartData shadowEnergyChart = Energy_Count(phd, colorMap.get("Color_Spec"));
|
||||
ChartData shadowChannelChart = Channel_Count(phd, colorMap.get("Color_Spec"));
|
||||
map.put("shadowEnergyChart", shadowEnergyChart);
|
||||
map.put("shadowChannelChart", shadowChannelChart);
|
||||
List<ChartData> allData = AllData(false, phd, colorMap);
|
||||
map.put("allData", allData);
|
||||
List<ShapeData> shapeEnergyData = Energy_BaseCP(phd);
|
||||
map.put("shapeEnergyData", shapeEnergyData);
|
||||
List<ShapeData> shapeChannelData = Channel_BaseCP(phd);
|
||||
map.put("shapeChannelData", shapeChannelData);
|
||||
}
|
||||
|
||||
public ChartData Energy_Count(PHDFile phd, String color) {
|
||||
//声明一个数组
|
||||
List<Long> m_vCount = new LinkedList<>();
|
||||
//获取 phdFile的Spec的num_g_channel
|
||||
|
@ -919,19 +932,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
if(m_nSChan == 0) {
|
||||
m_vCount.add(0L);
|
||||
}
|
||||
ChartData shadowEnergyChart = Energy_Count(phd, m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||
ChartData shadowChannelChart = Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||
map.put("shadowEnergyChart", shadowEnergyChart);
|
||||
map.put("shadowChannelChart", shadowChannelChart);
|
||||
List<ChartData> allData = AllData(false, phd, m_vCount, m_nCount, colorMap);
|
||||
map.put("allData", allData);
|
||||
List<ShapeData> shapeEnergyData = Energy_BaseCP(phd);
|
||||
map.put("shapeEnergyData", shapeEnergyData);
|
||||
List<ShapeData> shapeChannelData = Channel_BaseCP(phd);
|
||||
map.put("shapeChannelData", shapeChannelData);
|
||||
}
|
||||
|
||||
public ChartData Energy_Count(PHDFile phd, List<Long> m_vCount, long m_nCount, String color) {
|
||||
int start = 0;
|
||||
long end = -1;
|
||||
//Energy
|
||||
|
@ -943,10 +944,10 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
if(end < 1 || end > m_nCount){
|
||||
end = m_nCount;
|
||||
}
|
||||
for(int i=start-1; i<end; i++) {
|
||||
for(int j=start-1; j<end; j++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(phd.getVEnergy().get(i));
|
||||
seriseData.setY(m_vCount.get(i));
|
||||
seriseData.setX(phd.getVEnergy().get(j));
|
||||
seriseData.setY(m_vCount.get(j));
|
||||
data1.getPointlist().add(seriseData);
|
||||
}
|
||||
data1.setName("Energy");
|
||||
|
@ -956,7 +957,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
return data1;
|
||||
}
|
||||
|
||||
public ChartData Channel_Count(List<Long> m_vCount, long m_nCount, String color) {
|
||||
public ChartData Channel_Count(PHDFile phd, String color) {
|
||||
// Chart 折线图
|
||||
List<Long> m_vCount = new LinkedList<>();
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||
// 确保绘制曲线时所有谱都是从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);
|
||||
}
|
||||
int start = 1;
|
||||
long end = -1;
|
||||
ChartData data1 = new ChartData();
|
||||
|
@ -967,10 +983,10 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
if(end < 1 || end > m_nCount){
|
||||
end = m_nCount;
|
||||
}
|
||||
for(int i=start-1; i<end; i++) {
|
||||
for(int j=start-1; j<end; j++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_vCount.get(i));
|
||||
seriseData.setX(j+1);
|
||||
seriseData.setY(m_vCount.get(j));
|
||||
data1.getPointlist().add(seriseData);
|
||||
}
|
||||
data1.setName("Count");
|
||||
|
@ -980,7 +996,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
return data1;
|
||||
}
|
||||
|
||||
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, long m_nCount, Map<String, String> colorMap) {
|
||||
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, Map<String, String> colorMap) {
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
int start = 0;
|
||||
long end = -1;
|
||||
|
@ -1093,12 +1110,12 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
return datalist;
|
||||
}
|
||||
|
||||
public List<ChartData> Channel_Peak(PHDFile phd, long m_nCount, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, null, false);
|
||||
public List<ChartData> Channel_Peak(PHDFile phd, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, phd.getSpec().getNum_g_channel(), null, false);
|
||||
}
|
||||
|
||||
public List<ChartData> Energy_Peak(PHDFile phd, long m_nCount, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, phd.getUsedEnerPara().getP(), true);
|
||||
public List<ChartData> Energy_Peak(PHDFile phd, String color) {
|
||||
return PeakSet(phd.getVPeak(), phd.getVBase(), color, phd.getSpec().getNum_g_channel(), phd.getUsedEnerPara().getP(), true);
|
||||
}
|
||||
|
||||
public List<ChartData> PeakSet(List<PeakInfo> vPeak, List<Double> vBase, String color, long m_nCount, List<Double> p, boolean bEnergy) {
|
||||
|
@ -1134,7 +1151,6 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
|
||||
for(int i=startPeak; i<=endPeak; i++) {
|
||||
PeakInfo peak = vPeak.get(i);
|
||||
|
||||
ChartData cData = new ChartData();
|
||||
cData.setColor(color);
|
||||
cData.setName("Peak");
|
||||
|
@ -1169,7 +1185,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(regChan.get(ii));
|
||||
seriseData.setY(regPeak.get(ii));
|
||||
seriseData.setY(regPeak.get(ii).isNaN()?0:regPeak.get(ii));
|
||||
cData.getPointlist().add(seriseData);
|
||||
}
|
||||
}
|
||||
|
@ -1213,13 +1229,13 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
return shapes;
|
||||
}
|
||||
|
||||
public List<ChartData> AllData(boolean showLc, PHDFile phd, List<Long> m_vCount, long m_nCount, Map<String, String> colorMap) {
|
||||
public List<ChartData> AllData(boolean showLc, PHDFile phd, Map<String, String> colorMap) {
|
||||
List<ChartData> datalist = new LinkedList<>();
|
||||
datalist.add(Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||
datalist.add(Energy_Count(phd, m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||
datalist.addAll(Lc_Scac_base(showLc, phd, m_nCount, colorMap));
|
||||
datalist.addAll(Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak")));
|
||||
datalist.addAll(Energy_Peak(phd, m_nCount, colorMap.get("Color_Peak")));
|
||||
datalist.add(Channel_Count(phd, colorMap.get("Color_Spec")));
|
||||
datalist.add(Energy_Count(phd, colorMap.get("Color_Spec")));
|
||||
datalist.addAll(Lc_Scac_base(showLc, phd, colorMap));
|
||||
datalist.addAll(Channel_Peak(phd, colorMap.get("Color_Peak")));
|
||||
datalist.addAll(Energy_Peak(phd, colorMap.get("Color_Peak")));
|
||||
return datalist;
|
||||
}
|
||||
|
||||
|
@ -1776,7 +1792,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
}
|
||||
|
||||
public ChartData Channel_BaseLine(PHDFile phd, long m_nCount, String color) {
|
||||
public ChartData Channel_BaseLine(PHDFile phd, String color) {
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
ChartData cData = new ChartData();
|
||||
int start =0;
|
||||
long end = -1;
|
||||
|
@ -1802,7 +1819,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
return cData;
|
||||
}
|
||||
|
||||
public List<SeriseData> Differance(PHDFile phd, List<PeakInfo> vecPeak, List<Long> m_vCount, long m_nCount) {
|
||||
public List<SeriseData> Differance(PHDFile phd, List<PeakInfo> vecPeak) {
|
||||
// Chart 折线图
|
||||
List<Long> m_vCount = new LinkedList<>();
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||
// 确保绘制曲线时所有谱都是从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);
|
||||
}
|
||||
List<SeriseData> pointlist = new LinkedList<>();
|
||||
int start =0;
|
||||
long end = -1;
|
||||
|
@ -1838,8 +1870,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
|
||||
List<Double> regPeak = new LinkedList<>();
|
||||
int channel = 1;
|
||||
for(int i=start-1; i<end; i++) {
|
||||
channel = i + 1;
|
||||
for(int j=start-1; j<end; j++) {
|
||||
channel = j + 1;
|
||||
PeakInfo peak = vecPeak.get(startPeak);
|
||||
if(channel >= peak.left && channel <= peak.right) {
|
||||
if(CollectionUtils.isEmpty(regPeak)) {
|
||||
|
@ -1854,12 +1886,12 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
// 差值 = 原谱值 - 峰面积
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(channel);
|
||||
seriseData.setY(m_vCount.get(i) - regPeak.get(channel-peak.left));
|
||||
seriseData.setY(m_vCount.get(j) - regPeak.get(channel-peak.left));
|
||||
pointlist.add(seriseData);
|
||||
} else if(m_vCount.get(i) > 0 && phd.getVBase().get(i) > 0) {
|
||||
} else if(m_vCount.get(j) > 0 && phd.getVBase().get(j) > 0) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(channel);
|
||||
seriseData.setY(m_vCount.get(i) - phd.getVBase().get(i));
|
||||
seriseData.setY(m_vCount.get(j) - phd.getVBase().get(j));
|
||||
pointlist.add(seriseData);
|
||||
} else{
|
||||
SeriseData seriseData = new SeriseData();
|
||||
|
@ -1869,21 +1901,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
}
|
||||
|
||||
if(vecPeak.get(startPeak).right < channel) {
|
||||
++startPeak; regPeak.clear();
|
||||
++startPeak;
|
||||
regPeak.clear();
|
||||
}
|
||||
if(startPeak > endPeak){
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(int i=channel; i<end; i++) {
|
||||
if(m_vCount.get(i) > 0 && phd.getVBase().get(i) > 0) {
|
||||
for(int j=channel; j<end; j++) {
|
||||
if(m_vCount.get(j) > 0 && phd.getVBase().get(j) > 0) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_vCount.get(i) - phd.getVBase().get(i));
|
||||
seriseData.setX(j+1);
|
||||
seriseData.setY(m_vCount.get(j) - phd.getVBase().get(j));
|
||||
pointlist.add(seriseData);
|
||||
} else {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setX(j+1);
|
||||
seriseData.setY(0);
|
||||
pointlist.add(seriseData);
|
||||
}
|
||||
|
@ -3792,8 +3825,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
int j = i;
|
||||
double temp = channel - peak.peakCentroid;
|
||||
while(++j < peakNum && vPeak.get(j).multiIndex == peak.multiIndex) {
|
||||
if(Math.abs(vPeak.get(j).peakCentroid - channel) < temp) // 找出重峰中峰中心道离 channel 最近的峰
|
||||
{
|
||||
// 找出重峰中峰中心道离 channel 最近的峰
|
||||
if(Math.abs(vPeak.get(j).peakCentroid - channel) < temp) {
|
||||
temp = Math.abs(vPeak.get(j).peakCentroid - channel);
|
||||
i = j;
|
||||
}
|
||||
|
@ -3820,6 +3853,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for(int i=0; i<vPeak.size(); i++) {
|
||||
PeakInfo peakInfo = new PeakInfo();
|
||||
peakInfo.index = i+1;
|
||||
peakInfo.left = vPeak.get(i).left;
|
||||
peakInfo.right = vPeak.get(i).right;
|
||||
BigDecimal energy = new BigDecimal(vPeak.get(i).energy);
|
||||
energy = energy.setScale(3, RoundingMode.HALF_UP);
|
||||
peakInfo.energy = energy.doubleValue();
|
||||
|
@ -3862,7 +3897,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
NuclideActMda ActMda = new NuclideActMda();
|
||||
ActMda.setHalflife(Objects.isNull(mapHalflife.get(nucName))?lines.halflife : mapHalflife.get(nucName));
|
||||
for (int i=0, j=0; i<vEnergy.size(); i++) {
|
||||
for(; j<vPeakIdx.size(); ++j) {
|
||||
for(; j<vPeakIdx.size(); j++) {
|
||||
double energy = phd.getVPeak().get(vPeakIdx.get(j)).energy;
|
||||
if(vEnergy.get(i) < energy - energyWidth) {
|
||||
break;
|
||||
|
@ -3915,18 +3950,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
// 否则删除该核素与该峰所有关联的射线信息
|
||||
boolean needReCalc = false;
|
||||
for(int i=nuc.getVPeakIdx().size()-1; i>=0; i--) {
|
||||
//判断当前下标对应的核素下标是否是需要删除的下标
|
||||
if(nuc.getVPeakIdx().get(i) == removePeakIdx) {
|
||||
nuc.getVEnergy().remove(i);
|
||||
nuc.getVUncertE().remove(i);
|
||||
nuc.getVYield().remove(i);
|
||||
nuc.getVUncertY().remove(i);
|
||||
nuc.getFullNames().remove(i);
|
||||
//判断主峰核素下标是否与当前下标一致 且 BCalculateMDA是true
|
||||
if(nuc.getCalculateIdx() == i && nuc.isBCalculateMDA()) {
|
||||
needReCalc = true;
|
||||
}
|
||||
nuc.setCalculateIdx(nuc.getVEnergy().size()-1);
|
||||
nuc.getVPeakIdx().remove(i);
|
||||
}
|
||||
}
|
||||
nuc.getVPeakIdx().remove(removePeakIdx);
|
||||
|
||||
// 如果该核素只与一个峰对应则直接删除该核素的 MDA 信息
|
||||
if(nuc.getVPeakIdx().size() < 1) {
|
||||
phd.getMapNucActMda().remove(nuclide);
|
||||
|
@ -3936,7 +3975,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
if(needReCalc) {
|
||||
double maxYield = 0;
|
||||
int mainPeakIdx = -1;
|
||||
for(int j=0; j<nuc.getVYield().size(); ++j) {
|
||||
for(int j=0; j<nuc.getVYield().size(); j++) {
|
||||
if(nuc.getVYield().get(j) > maxYield) {
|
||||
nuc.setCalculateIdx(j);
|
||||
maxYield = nuc.getVYield().get(j);
|
||||
|
@ -4327,7 +4366,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
String number1 = RightFill(String.valueOf(j), 5);
|
||||
String number2 = RightFill(String.valueOf(phd.getSpec().getCounts().get(i)), 10);
|
||||
spectrum.append(rowFormat(spectrumData3, number1, number2));
|
||||
for(i = i+1; i < phd.getSpec().getNum_g_channel(); ++i) {
|
||||
for(i = i+1; i < phd.getSpec().getNum_g_channel(); i++) {
|
||||
String spectrumData4 = " %s";
|
||||
String number3 = RightFill(String.valueOf(phd.getSpec().getCounts().get(i)), 10);
|
||||
spectrum.append(rowFormat(spectrumData4, number3));
|
||||
|
@ -4344,7 +4383,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
ChartData cData = new ChartData();
|
||||
cData.setColor(color);
|
||||
cData.setName(name);
|
||||
for(int i=0; i<m_baseCtrl.getBaseline().size(); ++i) {
|
||||
for(int i=0; i<m_baseCtrl.getBaseline().size(); i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_baseCtrl.getBaseline().get(i));
|
||||
|
@ -4355,7 +4394,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
|
||||
public List<ShapeData> CreateShapeCP(BaseControls baseControls) {
|
||||
List<ShapeData> shapes = new LinkedList<>();
|
||||
for(int i=0; i<baseControls.getXCtrl().size(); ++i) {
|
||||
for(int i=0; i<baseControls.getXCtrl().size(); i++) {
|
||||
ShapeData shape = new ShapeData();
|
||||
shape.setType("Shape_Round");
|
||||
shape.setName("tmpCP"+i);
|
||||
|
|
|
@ -624,34 +624,34 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//存入计算后得到的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.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe131m_con))));
|
||||
xe131m.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe131m_uncer))));
|
||||
xe131m.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe131m))));
|
||||
xe131m.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(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.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133_con))));
|
||||
xe133.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133_uncer))));
|
||||
xe133.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe133))));
|
||||
xe133.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(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.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133m_con))));
|
||||
xe133m.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe133m_uncer))));
|
||||
xe133m.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe133m))));
|
||||
xe133m.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(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.setConc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe135_con))));
|
||||
xe135.setConcErr(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.Xe135_uncer))));
|
||||
xe135.setLc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.LC_Xe135))));
|
||||
xe135.setMdc(Double.valueOf(NumberFormatUtil.numberFormat(String.valueOf(analyseResult.MDC_Xe135))));
|
||||
xe135.setNidFlag(analyseResult.XE_135_NID_FLAG);
|
||||
xeResultsSpectrumList.add(xe135);
|
||||
map.put("XeData", xeResultsSpectrumList);
|
||||
|
@ -1239,11 +1239,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十七行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1253,11 +1261,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十六行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第三十七行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1307,11 +1323,20 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十五行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1321,11 +1346,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十四行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第四十五行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1370,11 +1403,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十一行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十二行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -1384,11 +1425,19 @@ public class PHDFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十四行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//第五十五行数据
|
||||
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.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", "?", "?", "?"));
|
||||
}
|
||||
//换行
|
||||
out.append(System.lineSeparator());
|
||||
//换行
|
||||
|
|
|
@ -123,14 +123,14 @@ public class SpectrumAnalysesController {
|
|||
|
||||
@GetMapping("viewGammaDetectorCalibration")
|
||||
@ApiOperation(value = "查询GammaDetectorCalibration数据", notes = "查询GammaDetectorCalibration数据")
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, qcFileName, request);
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, sampleFileName, qcFileName, request);
|
||||
}
|
||||
|
||||
@GetMapping("viewBetaDetectorCalibration")
|
||||
@ApiOperation(value = "查询BetaDetectorCalibration数据", notes = "查询BetaDetectorCalibration数据")
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, qcFileName, request);
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, sampleFileName, qcFileName, request);
|
||||
}
|
||||
|
||||
@GetMapping("viewExtrapolation")
|
||||
|
@ -176,7 +176,7 @@ public class SpectrumAnalysesController {
|
|||
@PostMapping("fitting")
|
||||
@ApiOperation(value = "公式计算新的曲线", notes = "公式计算新的曲线")
|
||||
public Result fitting(@RequestBody FittingBody fittingBody, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.fitting(fittingBody.getParamA(), fittingBody.getParamB(), fittingBody.getParamC(), fittingBody.getTempPoints(), fittingBody.getCount(), fittingBody.getQcFileName(), fittingBody.getTabName(), request);
|
||||
return spectrumAnalysisService.fitting(fittingBody.getParamA(), fittingBody.getParamB(), fittingBody.getParamC(), fittingBody.getTempPoints(), fittingBody.getCount(), fittingBody.getSampleFileName(), fittingBody.getTabName(), request);
|
||||
}
|
||||
|
||||
@GetMapping("getGammaGated")
|
||||
|
|
|
@ -46,9 +46,9 @@ public interface ISpectrumAnalysisService {
|
|||
|
||||
void exportRLR(BetaRLR betaRLR, HttpServletResponse response);
|
||||
|
||||
Result viewGammaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request);
|
||||
Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request);
|
||||
|
||||
Result viewBetaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request);
|
||||
Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request);
|
||||
|
||||
Result viewExtrapolation(Integer sampleId, String sampleFileName, HttpServletRequest request);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public interface ISpectrumAnalysisService {
|
|||
|
||||
Result statisticsQueryBtn(Integer detectorId, String detectorName, Integer stationId, String statisticsType, Date startTime, Date endTime);
|
||||
|
||||
Result fitting(Double paramA, Double paramB, Double paramC, List<SeriseData> tempPointsArray, Integer count, String qcFileName, String tabName, HttpServletRequest request);
|
||||
Result fitting(Double paramA, Double paramB, Double paramC, List<SeriseData> tempPointsArray, Integer count, String sampleFileName, String tabName, HttpServletRequest request);
|
||||
|
||||
Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, HttpServletRequest request);
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Autowired
|
||||
private UserTaskUtil userTaskUtil;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private ISysDefaultNuclideSpectrumService defaultNuclideSpectrumService;
|
||||
@Autowired
|
||||
private ISysUserColorService sysUserColorService;
|
||||
|
@ -138,12 +140,12 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Override
|
||||
public Result initValue(Integer sampleId, String dbName, String samfileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//
|
||||
//获取用户名
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||
PHDFile phd = new PHDFile();
|
||||
// 读取文件内容
|
||||
String lastName = "";
|
||||
String key = "";
|
||||
if (Objects.nonNull(sampleId) && StringUtils.isNotBlank(dbName)) {
|
||||
// 根据sampleId获取sample文件路径
|
||||
String sampleFilePath = spectrumAnalysisMapper.getSampleFilePath(sampleId);
|
||||
|
@ -164,7 +166,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!bRet) {
|
||||
return result;
|
||||
}
|
||||
lastName = fileName;
|
||||
key = fileName + "-" + userName;
|
||||
} else {
|
||||
String pathName = ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||
String fileName = samfileName;
|
||||
|
@ -172,9 +174,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!flag) {
|
||||
return result;
|
||||
}
|
||||
lastName = fileName;
|
||||
key = fileName + "-" + userName;
|
||||
}
|
||||
phdCache.put(lastName, phd);
|
||||
phdCache.put(key, phd);
|
||||
localCache.setPHDCache(phdCache);
|
||||
result.setSuccess(true);
|
||||
result.setResult(phd);
|
||||
|
@ -443,6 +445,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
gammaFileUtil.SetBaseInfo(phd);
|
||||
// 从数据库中读取phd其他相关信息
|
||||
boolean bRet = getResultFromDB(dbName, userName, sampleId, phd, result);
|
||||
// 查询当前用户关联的核素信息
|
||||
List<String> userLib = new LinkedList<>();
|
||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
if (CollectionUtils.isEmpty(userLib)) {
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
}
|
||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
||||
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
||||
// 判断数据库信息是否读取正常
|
||||
if (!bRet) {
|
||||
return result;
|
||||
|
@ -465,6 +476,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
map.put("checkBox_updateCal", phd.getSetting().isBUpdateCal());
|
||||
map.put("bAnalyed", phd.isBAnalyed());
|
||||
map.put("peak", phd.getVPeak());
|
||||
map.put("BaseCtrls", phd.getBaseCtrls());
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
// 更新页面折线图信息
|
||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||
// 将当前加载的phd信息加入到缓存中 文件名称作为缓存信息的key
|
||||
|
@ -784,6 +798,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
phd = new PHDFile();
|
||||
// 加载文件内容
|
||||
boolean bRet = gammaFileUtil.loadFile(path, fileName, phd, result);
|
||||
// 查询当前用户关联的核素信息
|
||||
List<String> userLib = new LinkedList<>();
|
||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
if (CollectionUtils.isEmpty(userLib)) {
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
}
|
||||
Map<String, NuclideLines> nuclideMap = GetNuclideLines(userLib);
|
||||
redisUtil.set(fileName+"-"+userName, nuclideMap);
|
||||
if (!bRet) {
|
||||
return result;
|
||||
}
|
||||
|
@ -803,6 +826,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
map.put("checkBox_updateCal", phd.getSetting().isBUpdateCal());
|
||||
map.put("bAnalyed", phd.isBAnalyed());
|
||||
map.put("peak", phd.getVPeak());
|
||||
map.put("BaseCtrls", phd.getBaseCtrls());
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||
phdCache.put(fileName + "-" + userName, phd);
|
||||
localCache.setPHDCache(phdCache);
|
||||
|
@ -972,13 +998,13 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
phd.setXmlFilePath(parameterProperties.getFilePath());
|
||||
// 获取当前角色的颜色配置
|
||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||
// 查询当前用户关联的核素信息
|
||||
List<String> nuclides = new LinkedList<>();
|
||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
if (CollectionUtils.isEmpty(nuclides)) {
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
}
|
||||
// // 查询当前用户关联的核素信息
|
||||
// List<String> nuclides = new LinkedList<>();
|
||||
// // 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
// nuclides = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
// if (CollectionUtils.isEmpty(nuclides)) {
|
||||
// nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
// }
|
||||
// 分析文件数据
|
||||
int flag = gammaFileUtil.AnalyseData(phd);
|
||||
if (flag == 0) {
|
||||
|
@ -987,7 +1013,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
"2. You didn't change any setting or calibration.";
|
||||
result.error500(warning);
|
||||
} else if (flag == -1) {
|
||||
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
|
||||
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(fileName+"-"+userName);//GetNuclideLines(nuclides);
|
||||
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
|
||||
gammaFileUtil.RunQC(phd);
|
||||
String warning = "Finish three tasks:\n" +
|
||||
|
@ -996,7 +1022,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
"\t3.Test QC again.";
|
||||
result.error500(warning);
|
||||
} else {
|
||||
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
|
||||
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(fileName+"-"+userName);//GetNuclideLines(nuclides);
|
||||
gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
||||
// 重新分析各峰值对应的核素信息
|
||||
// gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
|
||||
|
@ -1007,6 +1033,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
map.put("QCFlag", qcstate);
|
||||
map.put("bAnalyed", phd.isBAnalyed());
|
||||
map.put("peak", phd.getVPeak());
|
||||
map.put("BaseCtrls", phd.getBaseCtrls());
|
||||
// Bar Chart 柱状图
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
}
|
||||
|
@ -1073,16 +1103,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (m_nSChan == 0) {
|
||||
m_vCount.add(0L);
|
||||
}
|
||||
ChartData channelCountChart = gammaFileUtil.Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||
ChartData channelBaseLineChart = gammaFileUtil.Channel_BaseLine(phd, m_nCount, colorMap.get("Color_Base"));
|
||||
List<ChartData> channelPeakChart = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||
ChartData channelCountChart = gammaFileUtil.Channel_Count(phd, colorMap.get("Color_Spec"));
|
||||
ChartData channelBaseLineChart = gammaFileUtil.Channel_BaseLine(phd, colorMap.get("Color_Base"));
|
||||
List<ChartData> channelPeakChart = gammaFileUtil.Channel_Peak(phd, colorMap.get("Color_Peak"));
|
||||
List<ShapeData> channelBaseCPChart = gammaFileUtil.Channel_BaseCP(phd);
|
||||
map.put("channelCountChart", channelCountChart);
|
||||
map.put("channelBaseLineChart", channelBaseLineChart);
|
||||
map.put("channelPeakChart", channelPeakChart);
|
||||
map.put("channelBaseCPChart", channelBaseCPChart);
|
||||
// Bar Chart 柱状图
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak(), m_vCount, m_nCount);
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
// 赋值energy
|
||||
map.put("energy", phd.getVEnergy());
|
||||
|
@ -1370,11 +1400,11 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
|
||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||
map.put("table", vPeak);
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, colorMap.get("Color_Peak"));
|
||||
map.put("channelPeakChart", channelPeak);
|
||||
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, m_nCount, colorMap.get("Color_Base"));
|
||||
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, colorMap.get("Color_Base"));
|
||||
map.put("channelBaseLineChart", channelBaseLine);
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak(), m_vCount, m_nCount);
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||
} else {// 如果不保留 根据下标移除对应的vPeak数据
|
||||
|
@ -1382,7 +1412,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
phd.getVPeak().clear();
|
||||
phd.setVPeak(oldPeak);
|
||||
map.put("table", phd.getVPeak());
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, colorMap.get("Color_Peak"));
|
||||
map.put("channelPeakChart", channelPeak);
|
||||
}
|
||||
}
|
||||
|
@ -1397,24 +1427,61 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Override
|
||||
public Result deletePeak(String fileName, int curRow, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//获取用户名称
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
//获取缓存的核素信息
|
||||
Map<String, NuclideLines> nuclideMap = (Map<String, NuclideLines>) redisUtil.get(fileName + "-" + userName);
|
||||
//获取PHDFile的缓存信息
|
||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||
PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName);
|
||||
if (Objects.isNull(phd)) {
|
||||
result.error500("Please select the parse file first!");
|
||||
return result;
|
||||
}
|
||||
//获取颜色信息
|
||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
//声明一个结果的map
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
//获取峰的大小
|
||||
int peakNum = phd.getVPeak().size();
|
||||
if (peakNum < 1) {
|
||||
result.error500("No peak to delete.");
|
||||
return result;
|
||||
}
|
||||
//判断当前要操作的下标是否在范围内
|
||||
if (curRow >= 0 && curRow < peakNum) {
|
||||
//获取当前下标位置的峰值信息
|
||||
PeakInfo info = phd.getVPeak().get(curRow);
|
||||
//获取当前选中的峰值信息的能量值
|
||||
double energy = info.energy;
|
||||
//遍历核素信息
|
||||
for (String nuclideName : info.nuclides) {
|
||||
//从缓存信息中获取核素名称
|
||||
NuclideLines nuclideLines = nuclideMap.get(nuclideName);
|
||||
//获取最大活度的核素位置
|
||||
int maxYeildIdx = nuclideLines.maxYeildIdx;
|
||||
//获取最大活度对应的核素能量值
|
||||
Double maxEnergy = nuclideLines.getVenergy().get(maxYeildIdx);
|
||||
//判断当前选中的峰值信息的能量值 是否在 最大活度对应的核素能量值公差范围内
|
||||
if (energy >= maxEnergy-0.5 && energy <= maxEnergy+0.5) {
|
||||
//则需要删除所有关联的核素信息并 从MapNucAct中移除相关核素内容
|
||||
for (PeakInfo peakInfo: phd.getVPeak()) {
|
||||
//如果峰的核素名称中包含当前删除的核素
|
||||
if (peakInfo.nuclides.contains(nuclideName)) {
|
||||
peakInfo.nuclides.remove(nuclideName);
|
||||
}
|
||||
}
|
||||
//从核素相关map中移除核素信息
|
||||
phd.getMapNucActMda().remove(nuclideName);
|
||||
//移除核素信息
|
||||
nuclideMap.remove(nuclideName);
|
||||
}
|
||||
}
|
||||
//重新计算核素活度浓度
|
||||
gammaFileUtil.NuclidesIdent(phd, nuclideMap);
|
||||
//将当前行从峰数组中移除
|
||||
phd.getVPeak().remove(curRow);
|
||||
|
||||
//重新分析数据
|
||||
gammaFileUtil.PeaksChanged(phd);
|
||||
for (int i = 0; i < phd.getVPeak().size(); i++) {
|
||||
PeakInfo peakInfo = phd.getVPeak().get(i);
|
||||
|
@ -1422,7 +1489,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||
map.put("table", vPeak);
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, colorMap.get("Color_Peak"));
|
||||
map.put("channelPeakChart", channelPeak);
|
||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||
}
|
||||
|
@ -1542,14 +1609,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
// 根据要进行修改的列的数据下标 操作Vpeak数据
|
||||
phd.getVPeak().get(curRow).nuclides.add(nuclideName);
|
||||
// 查询当前用户所关心的核素名称
|
||||
// 查询当前用户关联的核素信息
|
||||
List<String> userLib = new LinkedList<>();
|
||||
// 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
if (CollectionUtils.isEmpty(userLib)) {
|
||||
userLib = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
}
|
||||
Map<String, NuclideLines> mapNucLines = GetNuclideLines(userLib);
|
||||
// // 查询当前用户关联的核素信息
|
||||
// List<String> userLib = new LinkedList<>();
|
||||
// // 从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
// userLib = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
// if (CollectionUtils.isEmpty(userLib)) {
|
||||
// userLib = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
// }
|
||||
Map<String, NuclideLines> mapNucLines = (Map<String, NuclideLines>) redisUtil.get(fileName+"-"+userName);//GetNuclideLines(userLib);
|
||||
// 查询出核素信息
|
||||
NuclideLines it_line = mapNucLines.get(nuclideName);
|
||||
// 如果核素信息不存在返回
|
||||
|
@ -1576,30 +1643,65 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Override
|
||||
public Result deleteNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//获取用户名
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Map<String, NuclideLines> nuclideMap = (Map<String, NuclideLines>) redisUtil.get(fileName + "-" + userName);
|
||||
//缓存中获取缓存信息
|
||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||
PHDFile phd = phdCache.getIfPresent(fileName + "-" + userName);
|
||||
if (Objects.isNull(phd)) {
|
||||
result.error500("Please select the parse file first!");
|
||||
return result;
|
||||
}
|
||||
//判断当前选择的核素名称是否包含在当前Peak的核素列表中
|
||||
int index = list_identify.indexOf(nuclideName);
|
||||
if (index >= 0) {
|
||||
// 如果所选的行下标小于0 或者 超出界限 则不进行处理
|
||||
if (curRow < 0 || curRow >= phd.getVPeak().size()) {
|
||||
return result;
|
||||
}
|
||||
// 更新峰信息列表和表格
|
||||
// 根据核素名称获取对应的下标并从list_identify,phd.getVPeak()移除
|
||||
list_identify.remove(index);
|
||||
int peakNuclIndex = phd.getVPeak().get(curRow).nuclides.indexOf(nuclideName);
|
||||
phd.getVPeak().get(curRow).nuclides.remove(peakNuclIndex);
|
||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||
// 处理核素MDA、MDC
|
||||
gammaFileUtil.ReCalcMdaMdc(phd, nuclideName, curRow + 1);
|
||||
map.put("identify", list_identify);
|
||||
map.put("table", vPeak);
|
||||
//从缓存信息中获取核素名称
|
||||
NuclideLines nuclideLines = nuclideMap.get(nuclideName);
|
||||
//获取最大活度的核素位置
|
||||
int maxYeildIdx = nuclideLines.maxYeildIdx;
|
||||
//获取最大活度对应的核素能量值
|
||||
Double maxEnergy = nuclideLines.getVenergy().get(maxYeildIdx);
|
||||
//获取当前选中的峰值信息的能量值
|
||||
double energy = phd.getVPeak().get(curRow).energy;
|
||||
//判断当前选中的峰值信息的能量值 是否在 最大活度对应的核素能量值公差范围内
|
||||
if (energy >= maxEnergy-0.5 && energy <= maxEnergy+0.5) {
|
||||
//则需要删除所有关联的核素信息并 从MapNucAct中移除相关核素内容
|
||||
for (PeakInfo peakInfo: phd.getVPeak()) {
|
||||
//如果峰的核素名称中包含当前删除的核素
|
||||
if (peakInfo.nuclides.contains(nuclideName)) {
|
||||
peakInfo.nuclides.remove(nuclideName);
|
||||
}
|
||||
}
|
||||
//从核素相关map中移除核素信息
|
||||
phd.getMapNucActMda().remove(nuclideName);
|
||||
//移除核素信息
|
||||
nuclideMap.remove(nuclideName);
|
||||
//重新计算核素活度浓度
|
||||
gammaFileUtil.NuclidesIdent(phd, nuclideMap);
|
||||
//从核素的选中列表中移除对应下标的核素信息
|
||||
list_identify.remove(index);
|
||||
//重新初始化峰列表信息
|
||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||
map.put("identify", list_identify);
|
||||
map.put("table", vPeak);
|
||||
} else {
|
||||
// 更新峰信息列表和表格
|
||||
// 根据核素名称获取对应的下标并从list_identify,phd.getVPeak()移除
|
||||
list_identify.remove(index);
|
||||
int peakNuclIndex = phd.getVPeak().get(curRow).nuclides.indexOf(nuclideName);
|
||||
phd.getVPeak().get(curRow).nuclides.remove(peakNuclIndex);
|
||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||
// 处理核素MDA、MDC
|
||||
gammaFileUtil.ReCalcMdaMdc(phd, nuclideName, curRow + 1);
|
||||
map.put("identify", list_identify);
|
||||
map.put("table", vPeak);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
}
|
||||
|
@ -1909,30 +2011,17 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
phd.setBaseCtrls(m_baseCtrl);
|
||||
phd.setVBase(m_baseCtrl.getBaseline());
|
||||
// }
|
||||
List<Long> m_vCount = new LinkedList<>();
|
||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||
// 获取当前角色的颜色配置
|
||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||
// 确保绘制曲线时所有谱都是从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);
|
||||
}
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak(), m_vCount, m_nCount);
|
||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||
map.put("barChart", differance);
|
||||
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, m_nCount, colorMap.get("Color_Base"));
|
||||
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, colorMap.get("Color_Base"));
|
||||
map.put("channelBaseLineChart", channelBaseLine);
|
||||
List<ChartData> peakSet = gammaFileUtil.PeakSet(phd.getVPeak(), phd.getVBase(), colorMap.get("Color_Peak"), m_nCount, null, false);
|
||||
List<ChartData> peakSet = gammaFileUtil.PeakSet(phd.getVPeak(), phd.getVBase(), colorMap.get("Color_Peak"), phd.getSpec().getNum_g_channel(), null, false);
|
||||
map.put("peakSet", peakSet);
|
||||
List<ShapeData> shapeData = gammaFileUtil.CreateShapeCP(phd.getBaseCtrls());
|
||||
map.put("shapeData", shapeData);
|
||||
map.put("peak", phd.getVPeak());
|
||||
// 更新主界面的 Chart
|
||||
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||
result.setSuccess(true);
|
||||
|
|
|
@ -155,60 +155,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
result.error500("The database type does not exist");
|
||||
return result;
|
||||
}
|
||||
StringBuilder sbSql = new StringBuilder();
|
||||
sbSql.append("SELECT\n" +
|
||||
" DISTINCT\n" +
|
||||
" cfg_stations.station_code stationName,\n" +
|
||||
" cfg_detectors.detector_code detectorsName\n" +
|
||||
" FROM\n" +
|
||||
" CONFIGURATION.GARDS_STATIONS cfg_stations,\n" +
|
||||
" CONFIGURATION.GARDS_DETECTORS cfg_detectors,\n" +
|
||||
" ORIGINAL.GARDS_SAMPLE_DATA org_samples,\n" +
|
||||
" (SELECT analyses.sample_id FROM "+dbName+" analyses) analyses_sample_ids\n" +
|
||||
" where\n" +
|
||||
" org_samples.sample_id=analyses_sample_ids.sample_id\n" +
|
||||
" AND org_samples.station_id=cfg_stations.station_id\n" +
|
||||
" AND org_samples.detector_id=cfg_detectors.detector_id\n" +
|
||||
" AND cfg_stations.type in (");
|
||||
for (String f : stationTypes) {
|
||||
sbSql.append("'").append(f).append("',");
|
||||
}
|
||||
|
||||
sbSql = new StringBuilder(sbSql.substring(0, sbSql.length()-1));
|
||||
sbSql.append(") ");
|
||||
|
||||
if (userStations.size() > 0) {
|
||||
sbSql.append("and org_samples.station_id in (");
|
||||
for (String f : userStations) {
|
||||
sbSql.append("'").append(f).append("',");
|
||||
}
|
||||
sbSql = new StringBuilder(sbSql.substring(0, sbSql.length()-1));
|
||||
sbSql.append(") ");
|
||||
}
|
||||
System.out.println(sbSql.toString());
|
||||
List<GardsSampleDataSpectrum> sampleData = Lists.newArrayList();
|
||||
long start = System.currentTimeMillis();
|
||||
try (Connection connection = jdbcTemplate.getDataSource().getConnection();
|
||||
PreparedStatement statement = connection.prepareStatement(sbSql.toString());
|
||||
ResultSet resultSet = statement.executeQuery()) {
|
||||
ResultSetMetaData metaData = resultSet.getMetaData();
|
||||
int columnCount = metaData.getColumnCount();
|
||||
while (resultSet.next()) {
|
||||
|
||||
GardsSampleDataSpectrum sp = new GardsSampleDataSpectrum();
|
||||
sp.setStationName(resultSet.getObject(1).toString());
|
||||
sp.setDetectorsName(resultSet.getObject(2).toString());
|
||||
sampleData.add(sp);
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
Object value = resultSet.getObject(i);
|
||||
// 处理结果集的每一列数据
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println(">>>>>>>>>>>>>"+(System.currentTimeMillis() - start));
|
||||
// List<GardsSampleDataSpectrum> sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers);
|
||||
List<GardsSampleDataSpectrum> sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers);
|
||||
//获取台站编码
|
||||
List<String> stationCodes = new LinkedList<>();
|
||||
List<String> detectorCodes = new LinkedList<>();
|
||||
|
@ -638,9 +585,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
@Override
|
||||
public void deleteSpectrumCacheData(String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
String betaKey = qcFileName + "-" + userName + "-beta";
|
||||
String betaKey = sampleFileName + "-" + userName + "-beta";
|
||||
betaCache.deleteBetaCache(betaKey);
|
||||
String gammaKey = qcFileName + "-" + userName + "-gamma";
|
||||
String gammaKey = sampleFileName + "-" + userName + "-gamma";
|
||||
betaCache.deleteBetaCache(gammaKey);
|
||||
String analyseKey = sampleFileName + "-" + userName + "-reAnalyseParam";
|
||||
betaCache.deleteBetaCache(analyseKey);
|
||||
|
@ -820,12 +767,12 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
if (Objects.nonNull(cache)) {
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(rrrLogInfo.getQcFileName() + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + userName + "-beta");
|
||||
if (CollectionUtils.isNotEmpty(betaMap)) {
|
||||
betaFittingPara = (List<String>) betaMap.get("fittingPara");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(rrrLogInfo.getQcFileName() + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(rrrLogInfo.getSampleFileName() + "-" + userName + "-gamma");
|
||||
if (CollectionUtils.isNotEmpty(gammaMap)) {
|
||||
gammaFittingPara = (List<String>) gammaMap.get("fittingPara");
|
||||
}
|
||||
|
@ -1758,7 +1705,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request) {
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
|
@ -1878,7 +1825,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
cacheMap.put("Series", oldScatterSeries);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-gamma", cacheMap);
|
||||
cache.put(sampleFileName+"-"+userName+"-gamma", cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
}
|
||||
|
@ -1905,7 +1852,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String qcFileName, HttpServletRequest request) {
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
|
@ -2027,7 +1974,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
cacheMap.put("Series", oldScatterSeries);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-beta", cacheMap);
|
||||
cache.put(sampleFileName+"-"+userName+"-beta", cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
}
|
||||
|
@ -2855,7 +2802,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result fitting(Double paramA, Double paramB, Double paramC, List<SeriseData> tempPoints, Integer count, String qcFileName, String tabName, HttpServletRequest request) {
|
||||
public Result fitting(Double paramA, Double paramB, Double paramC, List<SeriseData> tempPoints, Integer count, String sampleFileName, String tabName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
|
@ -2904,7 +2851,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
cacheMap.put("Series", tempPoints);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
cache.put(sampleFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
} else {
|
||||
List<Double> fittingPara = new LinkedList<>();
|
||||
|
@ -2962,7 +2909,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
cacheMap.put("Series", seriseDataList);
|
||||
cacheMap.put("fittingPara", fittingParaStr);
|
||||
cacheMap.put("fittingParaToUi", fittingParaToUiStr);
|
||||
cache.put(qcFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
cache.put(sampleFileName+"-"+userName+"-"+tabName, cacheMap);
|
||||
betaCache.setBetaCache(cache);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
|
@ -3198,7 +3145,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//从本地缓存获取beta gamma的数组
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingPara = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
|
@ -3208,7 +3155,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
|
@ -3420,7 +3367,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//从本地缓存获取beta gamma的数组
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(currentQCFileName + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(currentFileName + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingPara = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
|
@ -3428,10 +3375,10 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaList = (List<SeriseData>)betaMap.get("Series");
|
||||
betaFittingPara = (List<String>) betaMap.get("fittingPara");
|
||||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
cache.put(qcFileName+ "-" + userName + "-beta", betaMap);
|
||||
cache.put(sampleFileName+ "-" + userName + "-beta", betaMap);
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(currentQCFileName + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(currentFileName + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
|
@ -3439,7 +3386,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
gammaList = (List<SeriseData>)gammaMap.get("Series");
|
||||
gammaFittingPara = (List<String>) gammaMap.get("fittingPara");
|
||||
gammaFittingParaToUi = (List<String>) gammaMap.get("fittingParaToUi");
|
||||
cache.put(qcFileName+ "-" + userName + "-gamma", gammaMap);
|
||||
cache.put(sampleFileName+ "-" + userName + "-gamma", gammaMap);
|
||||
}
|
||||
|
||||
if (analyseData.isBetaEnergyValid()) {
|
||||
|
@ -3674,7 +3621,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//获取本地缓存的数据信息
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(betaMap)) {
|
||||
|
@ -3682,7 +3629,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(gammaMap)) {
|
||||
|
@ -3816,7 +3763,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//获取本地缓存的数据信息
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(qcFileName + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(betaMap)) {
|
||||
|
@ -3824,7 +3771,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(qcFileName + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(sampleFileName + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(gammaMap)) {
|
||||
|
@ -3983,7 +3930,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//从本地缓存获取beta gamma的数组
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(anlyseResultIn.getSampleFileName() + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingPara = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(betaMap)) {
|
||||
|
@ -3991,7 +3938,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaFittingPara = (List<String>) betaMap.get("fittingPara");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(anlyseResultIn.getSampleFileName() + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
if (CollectionUtils.isNotEmpty(gammaMap)) {
|
||||
|
@ -4251,7 +4198,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//从本地缓存获取beta gamma的数组
|
||||
Cache<String, Map<String, Object>> cache = betaCache.getBetaCache();
|
||||
//根据qc文件名称-用户名-beta的方式获取beta的内容
|
||||
Map<String, Object> betaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-beta");
|
||||
Map<String, Object> betaMap = cache.getIfPresent(anlyseResultIn.getSampleFileName() + "-" + userName + "-beta");
|
||||
List<SeriseData> betaList = new LinkedList<>();
|
||||
List<String> betaFittingPara = new LinkedList<>();
|
||||
List<String> betaFittingParaToUi = new LinkedList<>();
|
||||
|
@ -4261,7 +4208,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
betaFittingParaToUi = (List<String>) betaMap.get("fittingParaToUi");
|
||||
}
|
||||
//根据qc文件名称-用户名-gamma的方式获取gamma的内容
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(anlyseResultIn.getQcFileName() + "-" + userName + "-gamma");
|
||||
Map<String, Object> gammaMap = cache.getIfPresent(anlyseResultIn.getSampleFileName() + "-" + userName + "-gamma");
|
||||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
|
|
Loading…
Reference in New Issue
Block a user