新增SysUserColor实体类
GammaFileUtil部分颜色保持与用户存储颜色一致 GammaController新增主页面点击peakInformation接口 GammaController新增查询颜色配置信息接口 GammaController新增修改颜色配置信息接口 SpectrumAnalysisMapper增加新增ROIResults表数据sql
This commit is contained in:
parent
c9fed16807
commit
b7c256a044
|
@ -0,0 +1,75 @@
|
||||||
|
package org.jeecg.modules.base.entity.postgre;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName(value = "sys_user_color")
|
||||||
|
public class SysUserColor implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原谱曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_spec")
|
||||||
|
private String colorSpec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拟合峰曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_peak")
|
||||||
|
private String colorPeak;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LC曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_lc")
|
||||||
|
private String colorLc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseLine曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_base")
|
||||||
|
private String colorBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scac曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_scac")
|
||||||
|
private String colorScac;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比较谱曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_compare")
|
||||||
|
private String colorCompare;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拟合基线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_fitbase")
|
||||||
|
private String colorFitbase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 两谱和曲线颜色
|
||||||
|
*/
|
||||||
|
@TableField(value = "color_strip")
|
||||||
|
private String colorStrip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(value = "create_by")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
}
|
|
@ -1175,7 +1175,7 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateChart(PHDFile phd, Map<String, Object> map){
|
public void UpdateChart(PHDFile phd, Map<String, Object> map, Map<String, String> colorMap){
|
||||||
List<Long> m_vCount = new LinkedList<>();
|
List<Long> m_vCount = new LinkedList<>();
|
||||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||||
|
@ -1191,11 +1191,11 @@ public class GammaFileUtil {
|
||||||
if(m_nSChan == 0) {
|
if(m_nSChan == 0) {
|
||||||
m_vCount.add(0L);
|
m_vCount.add(0L);
|
||||||
}
|
}
|
||||||
ChartData shadowEnergyChart = this.Energy_Count(phd, m_vCount, m_nCount);
|
ChartData shadowEnergyChart = this.Energy_Count(phd, m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||||
ChartData shadowChannelChart = this.Channel_Count(m_vCount, m_nCount);
|
ChartData shadowChannelChart = this.Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||||
map.put("shadowEnergyChart", shadowEnergyChart);
|
map.put("shadowEnergyChart", shadowEnergyChart);
|
||||||
map.put("shadowChannelChart", shadowChannelChart);
|
map.put("shadowChannelChart", shadowChannelChart);
|
||||||
List<ChartData> allData = AllData(false, phd, m_vCount, m_nCount);
|
List<ChartData> allData = AllData(false, phd, m_vCount, m_nCount, colorMap);
|
||||||
map.put("allData", allData);
|
map.put("allData", allData);
|
||||||
List<ShapeData> shapeEnergyData = Energy_BaseCP(phd);
|
List<ShapeData> shapeEnergyData = Energy_BaseCP(phd);
|
||||||
map.put("shapeEnergyData", shapeEnergyData);
|
map.put("shapeEnergyData", shapeEnergyData);
|
||||||
|
@ -1203,7 +1203,7 @@ public class GammaFileUtil {
|
||||||
map.put("shapeChannelData", shapeChannelData);
|
map.put("shapeChannelData", shapeChannelData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChartData Energy_Count(PHDFile phd, List<Long> m_vCount, long m_nCount){
|
public ChartData Energy_Count(PHDFile phd, List<Long> m_vCount, long m_nCount, String color){
|
||||||
int start = 0;
|
int start = 0;
|
||||||
long end = -1;
|
long end = -1;
|
||||||
//Energy
|
//Energy
|
||||||
|
@ -1223,12 +1223,12 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
data1.setName("Energy");
|
data1.setName("Energy");
|
||||||
data1.setGroup("energy");
|
data1.setGroup("energy");
|
||||||
data1.setColor("255,255,0");
|
data1.setColor(color);
|
||||||
}
|
}
|
||||||
return data1;
|
return data1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChartData Channel_Count(List<Long> m_vCount, long m_nCount){
|
public ChartData Channel_Count(List<Long> m_vCount, long m_nCount, String color){
|
||||||
int start = 1;
|
int start = 1;
|
||||||
long end = -1;
|
long end = -1;
|
||||||
ChartData data1 = new ChartData();
|
ChartData data1 = new ChartData();
|
||||||
|
@ -1247,12 +1247,12 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
data1.setName("Count");
|
data1.setName("Count");
|
||||||
data1.setGroup("channel");
|
data1.setGroup("channel");
|
||||||
data1.setColor("255,255,0");
|
data1.setColor(color);
|
||||||
}
|
}
|
||||||
return data1;
|
return data1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, long m_nCount){
|
public List<ChartData> Lc_Scac_base(boolean showLc, PHDFile phd, long m_nCount, Map<String, String> colorMap){
|
||||||
List<ChartData> datalist = new LinkedList<>();
|
List<ChartData> datalist = new LinkedList<>();
|
||||||
int start = 0;
|
int start = 0;
|
||||||
long end = -1;
|
long end = -1;
|
||||||
|
@ -1306,26 +1306,26 @@ public class GammaFileUtil {
|
||||||
// 颜色:原谱:0;峰:1;Lc:2;BaseLine:3;Scac:4;比较谱:5;
|
// 颜色:原谱:0;峰:1;Lc:2;BaseLine:3;Scac:4;比较谱:5;
|
||||||
data2.setGroup("channel");
|
data2.setGroup("channel");
|
||||||
data2.setName("Lc");
|
data2.setName("Lc");
|
||||||
data2.setColor("255,0,0");
|
data2.setColor(colorMap.get("Color_Lc"));
|
||||||
data2.setShow(showLc);
|
data2.setShow(showLc);
|
||||||
data3.setGroup("channel");
|
data3.setGroup("channel");
|
||||||
data3.setName("Scac");
|
data3.setName("Scac");
|
||||||
data3.setColor("244,112,247");
|
data3.setColor(colorMap.get("Color_Scac"));
|
||||||
data3.setShow(showLc);
|
data3.setShow(showLc);
|
||||||
data4.setGroup("channel");
|
data4.setGroup("channel");
|
||||||
data4.setName("BaseLine");
|
data4.setName("BaseLine");
|
||||||
data4.setColor("0,246,255");
|
data4.setColor(colorMap.get("Color_Base"));
|
||||||
data6.setGroup("energy");
|
data6.setGroup("energy");
|
||||||
data6.setName("Lc");
|
data6.setName("Lc");
|
||||||
data6.setColor("255,0,0");
|
data6.setColor(colorMap.get("Color_Lc"));
|
||||||
data6.setShow(showLc);
|
data6.setShow(showLc);
|
||||||
data7.setGroup("energy");
|
data7.setGroup("energy");
|
||||||
data7.setName("Scac");
|
data7.setName("Scac");
|
||||||
data7.setColor("244,112,247");
|
data7.setColor(colorMap.get("Color_Scac"));
|
||||||
data7.setShow(showLc);
|
data7.setShow(showLc);
|
||||||
data8.setGroup("energy");
|
data8.setGroup("energy");
|
||||||
data8.setName("BaseLine");
|
data8.setName("BaseLine");
|
||||||
data8.setColor("0,246,255");
|
data8.setColor(colorMap.get("Color_Base"));
|
||||||
data2.setType("Line");
|
data2.setType("Line");
|
||||||
data3.setType("Line");
|
data3.setType("Line");
|
||||||
data4.setType("Line");
|
data4.setType("Line");
|
||||||
|
@ -1342,15 +1342,15 @@ public class GammaFileUtil {
|
||||||
return datalist;
|
return datalist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> Channel_Peak(PHDFile phd, long m_nCount){
|
public List<ChartData> Channel_Peak(PHDFile phd, long m_nCount, String color){
|
||||||
return PeakSet(phd.getVPeak(), phd.getVBase(), m_nCount, null, false);
|
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> Energy_Peak(PHDFile phd, long m_nCount){
|
public List<ChartData> Energy_Peak(PHDFile phd, long m_nCount, String color){
|
||||||
return PeakSet(phd.getVPeak(), phd.getVBase(), m_nCount, phd.getUsedEnerPara().getP(), true);
|
return PeakSet(phd.getVPeak(), phd.getVBase(), color, m_nCount, phd.getUsedEnerPara().getP(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> PeakSet(List<PeakInfo> vPeak, List<Double> vBase, long m_nCount, List<Double> p, boolean bEnergy){
|
public List<ChartData> PeakSet(List<PeakInfo> vPeak, List<Double> vBase, String color, long m_nCount, List<Double> p, boolean bEnergy){
|
||||||
System.loadLibrary("GammaAnaly");
|
System.loadLibrary("GammaAnaly");
|
||||||
List<ChartData> datalist = new LinkedList<>();
|
List<ChartData> datalist = new LinkedList<>();
|
||||||
int peakNum = vPeak.size();
|
int peakNum = vPeak.size();
|
||||||
|
@ -1386,7 +1386,7 @@ public class GammaFileUtil {
|
||||||
PeakInfo peak = vPeak.get(i);
|
PeakInfo peak = vPeak.get(i);
|
||||||
|
|
||||||
ChartData cData = new ChartData();
|
ChartData cData = new ChartData();
|
||||||
cData.setColor("255,127,39");
|
cData.setColor(color);
|
||||||
cData.setName("Peak");
|
cData.setName("Peak");
|
||||||
|
|
||||||
List<Double> regChan = new LinkedList<>();
|
List<Double> regChan = new LinkedList<>();
|
||||||
|
@ -1464,13 +1464,13 @@ public class GammaFileUtil {
|
||||||
return shapes;
|
return shapes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> AllData(boolean showLc, PHDFile phd, List<Long> m_vCount, long m_nCount){
|
public List<ChartData> AllData(boolean showLc, PHDFile phd, List<Long> m_vCount, long m_nCount, Map<String, String> colorMap){
|
||||||
List<ChartData> datalist = new LinkedList<>();
|
List<ChartData> datalist = new LinkedList<>();
|
||||||
datalist.add(Channel_Count(m_vCount, m_nCount));
|
datalist.add(Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||||
datalist.add(Energy_Count(phd, m_vCount, m_nCount));
|
datalist.add(Energy_Count(phd, m_vCount, m_nCount, colorMap.get("Color_Spec")));
|
||||||
datalist.addAll(Lc_Scac_base(showLc, phd, m_nCount));
|
datalist.addAll(Lc_Scac_base(showLc, phd, m_nCount, colorMap));
|
||||||
datalist.addAll(Channel_Peak(phd, m_nCount));
|
datalist.addAll(Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak")));
|
||||||
datalist.addAll(Energy_Peak(phd, m_nCount));
|
datalist.addAll(Energy_Peak(phd, m_nCount, colorMap.get("Color_Peak")));
|
||||||
return datalist;
|
return datalist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1864,7 +1864,7 @@ public class GammaFileUtil {
|
||||||
return mapLines;
|
return mapLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChartData Channel_BaseLine(PHDFile phd, long m_nCount) {
|
public ChartData Channel_BaseLine(PHDFile phd, long m_nCount, String color) {
|
||||||
ChartData cData = new ChartData();
|
ChartData cData = new ChartData();
|
||||||
int start =0;
|
int start =0;
|
||||||
long end = -1;
|
long end = -1;
|
||||||
|
@ -1884,7 +1884,7 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
cData.setGroup("channel");
|
cData.setGroup("channel");
|
||||||
cData.setName("BaseLine");
|
cData.setName("BaseLine");
|
||||||
cData.setColor("0,246,255");
|
cData.setColor(color);
|
||||||
cData.setType("Line");
|
cData.setType("Line");
|
||||||
}
|
}
|
||||||
return cData;
|
return cData;
|
||||||
|
@ -2038,7 +2038,7 @@ public class GammaFileUtil {
|
||||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||||
// 拟合曲线
|
// 拟合曲线
|
||||||
ChartData lData = new ChartData();
|
ChartData lData = new ChartData();
|
||||||
lData.setColor("255, 255, 0");
|
lData.setColor("rgb(255, 255, 0)");
|
||||||
lData.setType("Line");
|
lData.setType("Line");
|
||||||
|
|
||||||
List<Double> vChan = new LinkedList<>();
|
List<Double> vChan = new LinkedList<>();
|
||||||
|
@ -2102,7 +2102,7 @@ public class GammaFileUtil {
|
||||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||||
// 拟合曲线
|
// 拟合曲线
|
||||||
ChartData lData = new ChartData();
|
ChartData lData = new ChartData();
|
||||||
lData.setColor("255, 255, 0");
|
lData.setColor("rgb(255, 255, 0)");
|
||||||
lData.setType("Line");
|
lData.setType("Line");
|
||||||
|
|
||||||
List<Double> vChan = new LinkedList<>();
|
List<Double> vChan = new LinkedList<>();
|
||||||
|
@ -2235,7 +2235,7 @@ public class GammaFileUtil {
|
||||||
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
if(CollectionUtils.isNotEmpty(m_curParam.getP())) {
|
||||||
// 拟合曲线
|
// 拟合曲线
|
||||||
ChartData lData = new ChartData();
|
ChartData lData = new ChartData();
|
||||||
lData.setColor("255, 255, 0");
|
lData.setColor("rgb(255, 255, 0)");
|
||||||
lData.setType("Line");
|
lData.setType("Line");
|
||||||
|
|
||||||
List<Double> vChan = new LinkedList<>();
|
List<Double> vChan = new LinkedList<>();
|
||||||
|
@ -3637,13 +3637,13 @@ public class GammaFileUtil {
|
||||||
return nuclideList;
|
return nuclideList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitTable(String name, Map<String, Object> map, PHDFile phd){
|
public void InitTable(String name, Map<String, Object> map, PHDFile phd, Map<String, String> colorMap){
|
||||||
InitNuclideInfo(name, map);
|
InitNuclideInfo(name, map);
|
||||||
long span = phd.getSpec().getG_energy_span();
|
long span = phd.getSpec().getG_energy_span();
|
||||||
List<GardsNuclLinesLib> nuclideTableList = spectrumAnalysisMapper.getNuclideTable(name, span);
|
List<GardsNuclLinesLib> nuclideTableList = spectrumAnalysisMapper.getNuclideTable(name, span);
|
||||||
if (CollectionUtils.isNotEmpty(nuclideTableList)){
|
if (CollectionUtils.isNotEmpty(nuclideTableList)){
|
||||||
map.put("table", nuclideTableList);
|
map.put("table", nuclideTableList);
|
||||||
InitChart(nuclideTableList, phd, map);
|
InitChart(nuclideTableList, phd, map, colorMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3679,13 +3679,13 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitChart(List<GardsNuclLinesLib> nuclideTableList, PHDFile phd, Map<String, Object> map){
|
public void InitChart(List<GardsNuclLinesLib> nuclideTableList, PHDFile phd, Map<String, Object> map, Map<String, String> colorMap){
|
||||||
List<Map<String, Object>> chartList = new LinkedList<>();
|
List<Map<String, Object>> chartList = new LinkedList<>();
|
||||||
for (int i=0; i < nuclideTableList.size(); i++){
|
for (int i=0; i < nuclideTableList.size(); i++){
|
||||||
Map<String, Object> chartMap = new HashMap<>();
|
Map<String, Object> chartMap = new HashMap<>();
|
||||||
GardsNuclLinesLib item = nuclideTableList.get(i);
|
GardsNuclLinesLib item = nuclideTableList.get(i);
|
||||||
double energy = item.getEnergy();
|
double energy = item.getEnergy();
|
||||||
List<ChartData> chartData = Energy_Count_Base(energy, 30, phd);
|
List<ChartData> chartData = Energy_Count_Base(energy, 30, phd, colorMap);
|
||||||
String title = "Line" + (i+1);
|
String title = "Line" + (i+1);
|
||||||
String bottom = "Abundance:" + item.getYield();
|
String bottom = "Abundance:" + item.getYield();
|
||||||
String selPos = energy+"";
|
String selPos = energy+"";
|
||||||
|
@ -3700,7 +3700,7 @@ public class GammaFileUtil {
|
||||||
map.put("chart", chartList);
|
map.put("chart", chartList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ChartData> Energy_Count_Base(double energy, int chanNum, PHDFile phd) {
|
public List<ChartData> Energy_Count_Base(double energy, int chanNum, PHDFile phd, Map<String, String> colorMap) {
|
||||||
List<ChartData> datalist = new LinkedList<>();
|
List<ChartData> datalist = new LinkedList<>();
|
||||||
int channel = GetChannelByEnergy(energy, 0, phd);
|
int channel = GetChannelByEnergy(energy, 0, phd);
|
||||||
int start = channel-chanNum/2, end = channel+chanNum/2;
|
int start = channel-chanNum/2, end = channel+chanNum/2;
|
||||||
|
@ -3711,12 +3711,12 @@ public class GammaFileUtil {
|
||||||
end = (int) phd.getSpec().getNum_g_channel();
|
end = (int) phd.getSpec().getNum_g_channel();
|
||||||
start = end - chanNum;
|
start = end - chanNum;
|
||||||
}
|
}
|
||||||
datalist.add(Energy_CountCahrt(start, end, phd));
|
datalist.add(Energy_CountChart(start, end, phd, colorMap.get("Color_Spec")));
|
||||||
datalist.add(Energy_BaseLine(start, end, phd));
|
datalist.add(Energy_BaseLine(start, end, phd, colorMap.get("Color_Base")));
|
||||||
return datalist;
|
return datalist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChartData Energy_CountCahrt(int start, int end, PHDFile phd) {
|
public ChartData Energy_CountChart(int start, int end, PHDFile phd, String color) {
|
||||||
ChartData data1 = new ChartData();
|
ChartData data1 = new ChartData();
|
||||||
if(phd.getSpec().getNum_g_channel() > 1 && phd.getVEnergy().size() == phd.getSpec().getNum_g_channel()) {
|
if(phd.getSpec().getNum_g_channel() > 1 && phd.getVEnergy().size() == phd.getSpec().getNum_g_channel()) {
|
||||||
if(start < 1){
|
if(start < 1){
|
||||||
|
@ -3734,12 +3734,12 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
data1.setName("Energy");
|
data1.setName("Energy");
|
||||||
data1.setGroup("energy");
|
data1.setGroup("energy");
|
||||||
data1.setColor("255,255,0"); // 颜色:原谱:0;峰:1;Lc:2;BaseLine:3;Scac:4;比较谱:5;
|
data1.setColor(color); // 颜色:原谱:0;峰:1;Lc:2;BaseLine:3;Scac:4;比较谱:5;
|
||||||
}
|
}
|
||||||
return data1;
|
return data1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChartData Energy_BaseLine(int start, int end, PHDFile phd) {
|
public ChartData Energy_BaseLine(int start, int end, PHDFile phd, String color) {
|
||||||
ChartData cData = new ChartData();
|
ChartData cData = new ChartData();
|
||||||
if(phd.getSpec().getNum_g_channel() > 1 && phd.getVEnergy().size() == phd.getSpec().getNum_g_channel() && phd.getVBase().size() == phd.getSpec().getNum_g_channel()) {
|
if(phd.getSpec().getNum_g_channel() > 1 && phd.getVEnergy().size() == phd.getSpec().getNum_g_channel() && phd.getVBase().size() == phd.getSpec().getNum_g_channel()) {
|
||||||
if(start < 1){
|
if(start < 1){
|
||||||
|
@ -3757,7 +3757,7 @@ public class GammaFileUtil {
|
||||||
}
|
}
|
||||||
cData.setGroup("energy");
|
cData.setGroup("energy");
|
||||||
cData.setName("BaseLine");
|
cData.setName("BaseLine");
|
||||||
cData.setColor("0,246,255");
|
cData.setColor(color);
|
||||||
cData.setType("Line");
|
cData.setType("Line");
|
||||||
}
|
}
|
||||||
return cData;
|
return cData;
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class GammaController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("gammaByDB")
|
@GetMapping("gammaByDB")
|
||||||
public Result gammaByDB(@RequestParam Integer sampleId, @RequestParam String dbName){
|
public Result gammaByDB(@RequestParam Integer sampleId, @RequestParam String dbName, HttpServletRequest request){
|
||||||
return gammaService.gammaByDB(dbName, sampleId);
|
return gammaService.gammaByDB(dbName, sampleId, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("gammaByFile")
|
@GetMapping("gammaByFile")
|
||||||
|
@ -73,8 +73,8 @@ public class GammaController {
|
||||||
|
|
||||||
@GetMapping("InteractiveTool")
|
@GetMapping("InteractiveTool")
|
||||||
@ApiOperation(value = "analyze菜单下InteractiveTool页面数据", notes = "analyze菜单下InteractiveTool页面数据")
|
@ApiOperation(value = "analyze菜单下InteractiveTool页面数据", notes = "analyze菜单下InteractiveTool页面数据")
|
||||||
public Result InteractiveTool(@RequestParam Integer sampleId, @RequestParam String fileName) {
|
public Result InteractiveTool(@RequestParam Integer sampleId, @RequestParam String fileName, HttpServletRequest request) {
|
||||||
return gammaService.InteractiveTool(sampleId, fileName);
|
return gammaService.InteractiveTool(sampleId, fileName, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("insertPeak")
|
@GetMapping("insertPeak")
|
||||||
|
@ -85,20 +85,20 @@ public class GammaController {
|
||||||
|
|
||||||
@PostMapping("acceptResults")
|
@PostMapping("acceptResults")
|
||||||
@ApiOperation(value = "InteractiveTool页面Insert页面save", notes = "InteractiveTool页面Insert页面save")
|
@ApiOperation(value = "InteractiveTool页面Insert页面save", notes = "InteractiveTool页面Insert页面save")
|
||||||
public Result acceptResults(@RequestBody AcceptInfo acceptInfo) {
|
public Result acceptResults(@RequestBody AcceptInfo acceptInfo, HttpServletRequest request) {
|
||||||
return gammaService.acceptResults(acceptInfo.getFileName(), acceptInfo.isAccept(), acceptInfo.getOldPeak());
|
return gammaService.acceptResults(acceptInfo.getFileName(), acceptInfo.isAccept(), acceptInfo.getOldPeak(), request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("deletePeak")
|
@GetMapping("deletePeak")
|
||||||
@ApiOperation(value = "InteractiveTool页面delete按钮", notes = "InteractiveTool页面delete按钮")
|
@ApiOperation(value = "InteractiveTool页面delete按钮", notes = "InteractiveTool页面delete按钮")
|
||||||
public Result deletePeak(String fileName, int curRow) {
|
public Result deletePeak(String fileName, int curRow, HttpServletRequest request) {
|
||||||
return gammaService.deletePeak(fileName, curRow);
|
return gammaService.deletePeak(fileName, curRow, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("getSelPosNuclide")
|
@GetMapping("getSelPosNuclide")
|
||||||
@ApiOperation(value = "InteractiveTool页面选择channel加载对应核素信息接口", notes = "InteractiveTool页面选择channel加载对应核素信息接口")
|
@ApiOperation(value = "InteractiveTool页面选择channel加载对应核素信息接口", notes = "InteractiveTool页面选择channel加载对应核素信息接口")
|
||||||
public Result getSelPosNuclide(Integer sampleId, String fileName, int channel, String nuclides, HttpServletRequest request) {
|
public Result getSelPosNuclide(Integer sampleId, String fileName, int channel, HttpServletRequest request) {
|
||||||
return gammaService.getSelPosNuclide(sampleId, fileName, channel, nuclides, request);
|
return gammaService.getSelPosNuclide(sampleId, fileName, channel, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("addNuclide")
|
@PostMapping("addNuclide")
|
||||||
|
@ -145,8 +145,8 @@ public class GammaController {
|
||||||
|
|
||||||
@GetMapping("changeNuclide")
|
@GetMapping("changeNuclide")
|
||||||
@ApiOperation(value = "Nuclide Review页面切换nuclide数据", notes = "Nuclide Review页面切换nuclide数据")
|
@ApiOperation(value = "Nuclide Review页面切换nuclide数据", notes = "Nuclide Review页面切换nuclide数据")
|
||||||
public Result changeNuclide(Integer sampleId, String fileName, String nuclideName) {
|
public Result changeNuclide(Integer sampleId, String fileName, String nuclideName, HttpServletRequest request) {
|
||||||
return gammaService.changeNuclide(sampleId, fileName, nuclideName);
|
return gammaService.changeNuclide(sampleId, fileName, nuclideName, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("searchNuclide")
|
@GetMapping("searchNuclide")
|
||||||
|
@ -349,6 +349,24 @@ public class GammaController {
|
||||||
return gammaService.viewGammaviewerLog(sampleId, fileName);
|
return gammaService.viewGammaviewerLog(sampleId, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("clickPeakInformation")
|
||||||
|
@ApiOperation(value = "gamma主页面点击peakInformation返回信息接口", notes = "gamma主页面点击peakInformation返回信息接口")
|
||||||
|
public Result clickPeakInformation(String fileName, int index) {
|
||||||
|
return gammaService.clickPeakInformation(fileName, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("viewColorConfig")
|
||||||
|
@ApiOperation(value = "查看颜色配置信息", notes = "查看颜色配置信息")
|
||||||
|
public Result viewColorConfig(HttpServletRequest request) {
|
||||||
|
return gammaService.viewColorConfig(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("updateColorConfig")
|
||||||
|
@ApiOperation(value = "修改颜色配置信息", notes = "修改颜色配置信息")
|
||||||
|
public Result updateColorConfig(@RequestBody ColorInfo colorInfo, HttpServletRequest request) {
|
||||||
|
return gammaService.updateColorConfig(colorInfo, request);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("saveToDB")
|
@GetMapping("saveToDB")
|
||||||
@ApiOperation(value = "Save To DB按钮", notes = "Save To DB按钮")
|
@ApiOperation(value = "Save To DB按钮", notes = "Save To DB按钮")
|
||||||
public Result saveToDB(String fileName, String userName) {
|
public Result saveToDB(String fileName, String userName) {
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package org.jeecg.modules.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ColorInfo implements Serializable {
|
||||||
|
|
||||||
|
private String colorSpec;
|
||||||
|
|
||||||
|
private String colorPeak;
|
||||||
|
|
||||||
|
private String colorLc;
|
||||||
|
|
||||||
|
private String colorBase;
|
||||||
|
|
||||||
|
private String colorScac;
|
||||||
|
|
||||||
|
private String colorCompare;
|
||||||
|
|
||||||
|
private String colorFitbase;
|
||||||
|
|
||||||
|
private String colorStrip;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -146,6 +146,8 @@ public interface SpectrumAnalysisMapper {
|
||||||
|
|
||||||
void deleteROIResults(Integer idAnalysis);
|
void deleteROIResults(Integer idAnalysis);
|
||||||
|
|
||||||
|
void insertROIResults(List<GardsROIResultsSpectrum> roiResultsSpectrumList);
|
||||||
|
|
||||||
String getIdAnalysisByIdAnalyst(@Param(value = "sampleId") String sampleId, @Param(value = "userName") String userName);
|
String getIdAnalysisByIdAnalyst(@Param(value = "sampleId") String sampleId, @Param(value = "userName") String userName);
|
||||||
|
|
||||||
void deletePeaks(Integer idAnalysis);
|
void deletePeaks(Integer idAnalysis);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.jeecg.modules.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.modules.base.entity.postgre.SysUserColor;
|
||||||
|
|
||||||
|
public interface SysUserColorMapper extends BaseMapper<SysUserColor> {
|
||||||
|
}
|
|
@ -931,6 +931,42 @@
|
||||||
DELETE FROM RNMAN.GARDS_ROI_RESULTS WHERE IDANALYSIS=#{idAnalysis}
|
DELETE FROM RNMAN.GARDS_ROI_RESULTS WHERE IDANALYSIS=#{idAnalysis}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertROIResults">
|
||||||
|
<foreach collection="roiResultsSpectrumList" item="roiResultsSpectrum" open="(" separator="," close=")">
|
||||||
|
INSERT INTO
|
||||||
|
RNMAN.GARDS_ROI_RESULTS(SAMPLE_ID,
|
||||||
|
IDANALYSIS,
|
||||||
|
ROI,
|
||||||
|
LC,
|
||||||
|
S_GROSS,
|
||||||
|
G_GROSS,
|
||||||
|
B_GROSS,
|
||||||
|
S_NET,
|
||||||
|
G_NET,
|
||||||
|
NET,
|
||||||
|
NET_ERR,
|
||||||
|
CONC,
|
||||||
|
CONC_ERR,
|
||||||
|
MDC,
|
||||||
|
NID_FLAG)
|
||||||
|
VALUES(#{roiResultsSpectrum.sampleId},
|
||||||
|
#{roiResultsSpectrum.idAnalysis},
|
||||||
|
#{roiResultsSpectrum.roi},
|
||||||
|
#{roiResultsSpectrum.lc},
|
||||||
|
#{roiResultsSpectrum.sGross},
|
||||||
|
#{roiResultsSpectrum.gGross},
|
||||||
|
#{roiResultsSpectrum.bGross},
|
||||||
|
#{roiResultsSpectrum.sNet},
|
||||||
|
#{roiResultsSpectrum.gNet},
|
||||||
|
#{roiResultsSpectrum.net},
|
||||||
|
#{roiResultsSpectrum.netErr},
|
||||||
|
#{roiResultsSpectrum.conc},
|
||||||
|
#{roiResultsSpectrum.concErr},
|
||||||
|
#{roiResultsSpectrum.mdc},
|
||||||
|
#{roiResultsSpectrum.nidFlag})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<select id="getIdAnalysisByIdAnalyst" resultType="java.lang.String">
|
<select id="getIdAnalysisByIdAnalyst" resultType="java.lang.String">
|
||||||
SELECT IDANALYSIS FROM RNMAN.GARDS_ANALYSES WHERE SAMPLE_ID = #{sampleId} AND ANALYST = #{userName}
|
SELECT IDANALYSIS FROM RNMAN.GARDS_ANALYSES WHERE SAMPLE_ID = #{sampleId} AND ANALYST = #{userName}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -13,7 +13,7 @@ public interface IGammaService{
|
||||||
|
|
||||||
Result initValue(Integer sampleId, String dbName);
|
Result initValue(Integer sampleId, String dbName);
|
||||||
|
|
||||||
Result gammaByDB(String dbName, Integer sampleId);
|
Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request);
|
||||||
|
|
||||||
Result gammaByFile(String fileName, HttpServletRequest request);
|
Result gammaByFile(String fileName, HttpServletRequest request);
|
||||||
|
|
||||||
|
@ -21,15 +21,15 @@ public interface IGammaService{
|
||||||
|
|
||||||
Result Reprocessing(ConfigureData configureData, HttpServletRequest request);
|
Result Reprocessing(ConfigureData configureData, HttpServletRequest request);
|
||||||
|
|
||||||
Result InteractiveTool(Integer sampleId, String fileName);
|
Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request);
|
||||||
|
|
||||||
Result insertPeak(Integer sampleId, String fileName, Integer curChan);
|
Result insertPeak(Integer sampleId, String fileName, Integer curChan);
|
||||||
|
|
||||||
Result acceptResults(String fileName, boolean accept, List<PeakInfo> oldPeak);
|
Result acceptResults(String fileName, boolean accept, List<PeakInfo> oldPeak, HttpServletRequest request);
|
||||||
|
|
||||||
Result deletePeak(String fileName, int curRow);
|
Result deletePeak(String fileName, int curRow, HttpServletRequest request);
|
||||||
|
|
||||||
Result getSelPosNuclide(Integer sampleId, String fileName, int channel, String nuclides, HttpServletRequest request);
|
Result getSelPosNuclide(Integer sampleId, String fileName, int channel, HttpServletRequest request);
|
||||||
|
|
||||||
Result addNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request);
|
Result addNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public interface IGammaService{
|
||||||
|
|
||||||
Result nuclideReview(Integer sampleId, String fileName, Double channel, HttpServletRequest request);
|
Result nuclideReview(Integer sampleId, String fileName, Double channel, HttpServletRequest request);
|
||||||
|
|
||||||
Result changeNuclide(Integer sampleId, String fileName, String nuclideName);
|
Result changeNuclide(Integer sampleId, String fileName, String nuclideName, HttpServletRequest request);
|
||||||
|
|
||||||
Result searchNuclide(Integer sampleId, String fileName, Double energy, Double tolerance, HttpServletRequest request);
|
Result searchNuclide(Integer sampleId, String fileName, Double energy, Double tolerance, HttpServletRequest request);
|
||||||
|
|
||||||
|
@ -114,6 +114,12 @@ public interface IGammaService{
|
||||||
|
|
||||||
Result viewGammaviewerLog(Integer sampleId, String fileName);
|
Result viewGammaviewerLog(Integer sampleId, String fileName);
|
||||||
|
|
||||||
|
Result clickPeakInformation(String fileName, int index);
|
||||||
|
|
||||||
|
Result viewColorConfig(HttpServletRequest request);
|
||||||
|
|
||||||
|
Result updateColorConfig(ColorInfo colorInfo, HttpServletRequest request);
|
||||||
|
|
||||||
Result saveToDB(String fileName, String userName);
|
Result saveToDB(String fileName, String userName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.modules.base.entity.postgre.SysUserColor;
|
||||||
|
import org.jeecg.modules.entity.vo.ColorInfo;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ISysUserColorService extends IService<SysUserColor> {
|
||||||
|
|
||||||
|
Map<String, String> initColor(String userName);
|
||||||
|
|
||||||
|
Map<String, String> updateColor(ColorInfo colorInfo, String userName);
|
||||||
|
|
||||||
|
}
|
|
@ -5,18 +5,16 @@ import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import org.apache.commons.net.ftp.FTPClient;
|
import org.apache.commons.net.ftp.FTPClient;
|
||||||
import org.apache.commons.net.ftp.FTPFile;
|
import org.apache.commons.net.ftp.FTPFile;
|
||||||
import org.jeecg.common.Excel.ExportExcel;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.cache.LocalCache;
|
import org.jeecg.common.cache.LocalCache;
|
||||||
import org.jeecg.common.constant.DateConstant;
|
import org.jeecg.common.constant.DateConstant;
|
||||||
|
@ -32,11 +30,8 @@ import org.jeecg.modules.entity.*;
|
||||||
import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
|
import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
|
||||||
import org.jeecg.modules.native_jni.CalValuesHandler;
|
import org.jeecg.modules.native_jni.CalValuesHandler;
|
||||||
import org.jeecg.modules.service.*;
|
import org.jeecg.modules.service.*;
|
||||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.io.DefaultResourceLoader;
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.ServletOutputStream;
|
import javax.servlet.ServletOutputStream;
|
||||||
|
@ -72,6 +67,8 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDefaultNuclideSpectrumService defaultNuclideSpectrumService;
|
private ISysDefaultNuclideSpectrumService defaultNuclideSpectrumService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ISysUserColorService sysUserColorService;
|
||||||
|
@Autowired
|
||||||
private SpectrumAnalysisMapper spectrumAnalysisMapper;
|
private SpectrumAnalysisMapper spectrumAnalysisMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SpectrumPathProperties spectrumPathProperties;
|
private SpectrumPathProperties spectrumPathProperties;
|
||||||
|
@ -145,8 +142,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result gammaByDB(String dbName, Integer sampleId) {
|
public Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = new PHDFile();
|
PHDFile phd = new PHDFile();
|
||||||
|
@ -170,6 +168,8 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
if (!bRet){
|
if (!bRet){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
//获取当前角色配置的颜色信息
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
// 更新 ‘QC Flags’ 状态
|
// 更新 ‘QC Flags’ 状态
|
||||||
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
||||||
map.put("QCFlag", qcstate);
|
map.put("QCFlag", qcstate);
|
||||||
|
@ -182,7 +182,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
|
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
|
||||||
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
|
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
|
||||||
map.put("dead_time", String.format("%.2f", deadTime*100));
|
map.put("dead_time", String.format("%.2f", deadTime*100));
|
||||||
gammaFileUtil.UpdateChart(phd, map);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
phdCache.put(fileName, phd);
|
phdCache.put(fileName, phd);
|
||||||
localCache.setPHDCache(phdCache);
|
localCache.setPHDCache(phdCache);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
|
@ -193,13 +193,16 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
@Override
|
@Override
|
||||||
public Result gammaByFile(String fileName, HttpServletRequest request) {
|
public Result gammaByFile(String fileName, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
//上传文件路径
|
//上传文件路径
|
||||||
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + JwtUtil.getUserNameByToken(request);
|
String path = StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName;
|
||||||
PHDFile phd = new PHDFile();
|
PHDFile phd = new PHDFile();
|
||||||
//加载文件内容
|
//加载文件内容
|
||||||
gammaFileUtil.loadFile(path, fileName, phd, result);
|
gammaFileUtil.loadFile(path, fileName, phd, result);
|
||||||
|
//获取当前角色的颜色配置
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
// 更新 ‘QC Flags’ 状态
|
// 更新 ‘QC Flags’ 状态
|
||||||
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
List<String> qcstate = gammaFileUtil.Qcstate(phd);
|
||||||
map.put("QCFlag", qcstate);
|
map.put("QCFlag", qcstate);
|
||||||
|
@ -212,7 +215,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
|
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
|
||||||
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
|
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
|
||||||
map.put("dead_time", String.format("%.2f", deadTime*100));
|
map.put("dead_time", String.format("%.2f", deadTime*100));
|
||||||
gammaFileUtil.UpdateChart(phd, map);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
phdCache.put(fileName, phd);
|
phdCache.put(fileName, phd);
|
||||||
localCache.setPHDCache(phdCache);
|
localCache.setPHDCache(phdCache);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
|
@ -268,6 +271,8 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
//获取当前角色的颜色配置
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
//查询当前用户关联的核素信息
|
//查询当前用户关联的核素信息
|
||||||
List<String> nuclides = new LinkedList<>();
|
List<String> nuclides = new LinkedList<>();
|
||||||
//从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
//从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||||
|
@ -289,7 +294,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
phd.getUsedSetting().setRiskLevelK(configureData.getRiskLevelK());
|
phd.getUsedSetting().setRiskLevelK(configureData.getRiskLevelK());
|
||||||
phd.getUsedSetting().setRefTime_act(configureData.getRefTime_act());
|
phd.getUsedSetting().setRefTime_act(configureData.getRefTime_act());
|
||||||
phd.getUsedSetting().setRefTime_conc(configureData.getRefTime_conc());
|
phd.getUsedSetting().setRefTime_conc(configureData.getRefTime_conc());
|
||||||
gammaFileUtil.UpdateChart(phd, map);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(map);
|
result.setResult(map);
|
||||||
}else {
|
}else {
|
||||||
|
@ -302,8 +307,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result InteractiveTool(Integer sampleId, String fileName) {
|
public Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
|
@ -311,6 +317,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
result.error500("请先选择解析文件!");
|
result.error500("请先选择解析文件!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
//表单
|
//表单
|
||||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||||
map.put("table", vPeak);
|
map.put("table", vPeak);
|
||||||
|
@ -329,9 +336,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
if(m_nSChan == 0) {
|
if(m_nSChan == 0) {
|
||||||
m_vCount.add(0L);
|
m_vCount.add(0L);
|
||||||
}
|
}
|
||||||
ChartData channelCountChart = gammaFileUtil.Channel_Count(m_vCount, m_nCount);
|
ChartData channelCountChart = gammaFileUtil.Channel_Count(m_vCount, m_nCount, colorMap.get("Color_Spec"));
|
||||||
ChartData channelBaseLineChart = gammaFileUtil.Channel_BaseLine(phd, m_nCount);
|
ChartData channelBaseLineChart = gammaFileUtil.Channel_BaseLine(phd, m_nCount, colorMap.get("Color_Base"));
|
||||||
List<ChartData> channelPeakChart = gammaFileUtil.Channel_Peak(phd, m_nCount);
|
List<ChartData> channelPeakChart = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||||
List<ShapeData> channelBaseCPChart = gammaFileUtil.Channel_BaseCP(phd);
|
List<ShapeData> channelBaseCPChart = gammaFileUtil.Channel_BaseCP(phd);
|
||||||
map.put("channelCountChart", channelCountChart);
|
map.put("channelCountChart", channelCountChart);
|
||||||
map.put("channelBaseLineChart", channelBaseLineChart);
|
map.put("channelBaseLineChart", channelBaseLineChart);
|
||||||
|
@ -484,8 +491,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result acceptResults(String fileName, boolean accept, List<PeakInfo> oldPeak) {
|
public Result acceptResults(String fileName, boolean accept, List<PeakInfo> oldPeak, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
if (Objects.isNull(phd)){
|
if (Objects.isNull(phd)){
|
||||||
|
@ -495,7 +503,8 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
List<Long> m_vCount = new LinkedList<>();
|
List<Long> m_vCount = new LinkedList<>();
|
||||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||||
long m_nSChan = phd.getSpec().getBegin_channel();
|
long m_nSChan = phd.getSpec().getBegin_channel();
|
||||||
|
//获取当前角色的颜色配置
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
// 确保绘制曲线时所有谱都是从1道开始
|
// 确保绘制曲线时所有谱都是从1道开始
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if(m_nSChan == 0){
|
if(m_nSChan == 0){
|
||||||
|
@ -515,19 +524,19 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
|
|
||||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||||
map.put("table", vPeak);
|
map.put("table", vPeak);
|
||||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount);
|
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||||
map.put("channelPeakChart", channelPeak);
|
map.put("channelPeakChart", channelPeak);
|
||||||
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, m_nCount);
|
ChartData channelBaseLine = gammaFileUtil.Channel_BaseLine(phd, m_nCount, colorMap.get("Color_Base"));
|
||||||
map.put("channelBaseLineChart", channelBaseLine);
|
map.put("channelBaseLineChart", channelBaseLine);
|
||||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak(), m_vCount, m_nCount);
|
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak(), m_vCount, m_nCount);
|
||||||
map.put("barChart", differance);
|
map.put("barChart", differance);
|
||||||
gammaFileUtil.UpdateChart(phd, map);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
} else {//如果不保留 根据下标移除对应的vPeak数据
|
} else {//如果不保留 根据下标移除对应的vPeak数据
|
||||||
if (CollectionUtils.isNotEmpty(oldPeak)) {
|
if (CollectionUtils.isNotEmpty(oldPeak)) {
|
||||||
phd.getVPeak().clear();
|
phd.getVPeak().clear();
|
||||||
phd.setVPeak(oldPeak);
|
phd.setVPeak(oldPeak);
|
||||||
map.put("table", phd.getVPeak());
|
map.put("table", phd.getVPeak());
|
||||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount);
|
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||||
map.put("channelPeakChart", channelPeak);
|
map.put("channelPeakChart", channelPeak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -537,14 +546,16 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result deletePeak(String fileName, int curRow) {
|
public Result deletePeak(String fileName, int curRow, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
if (Objects.isNull(phd)){
|
if (Objects.isNull(phd)){
|
||||||
result.error500("请先选择解析文件!");
|
result.error500("请先选择解析文件!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
long m_nCount = phd.getSpec().getNum_g_channel();
|
long m_nCount = phd.getSpec().getNum_g_channel();
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
int peakNum = phd.getVPeak().size();
|
int peakNum = phd.getVPeak().size();
|
||||||
|
@ -562,9 +573,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
|
||||||
map.put("table", vPeak);
|
map.put("table", vPeak);
|
||||||
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount);
|
List<ChartData> channelPeak = gammaFileUtil.Channel_Peak(phd, m_nCount, colorMap.get("Color_Peak"));
|
||||||
map.put("channelPeakChart", channelPeak);
|
map.put("channelPeakChart", channelPeak);
|
||||||
gammaFileUtil.UpdateChart(phd, map);
|
gammaFileUtil.UpdateChart(phd, map, colorMap);
|
||||||
}
|
}
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(map);
|
result.setResult(map);
|
||||||
|
@ -572,9 +583,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getSelPosNuclide(Integer sampleId, String fileName, int channel, String nuclides, HttpServletRequest request) {
|
public Result getSelPosNuclide(Integer sampleId, String fileName, int channel, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
Map<String, List<String>> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
|
@ -597,11 +608,10 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
double min = phd.getVPeak().get(index).energy - phd.getSetting().getEnergyTolerance();
|
double min = phd.getVPeak().get(index).energy - phd.getSetting().getEnergyTolerance();
|
||||||
double max = phd.getVPeak().get(index).energy + phd.getSetting().getEnergyTolerance();
|
double max = phd.getVPeak().get(index).energy + phd.getSetting().getEnergyTolerance();
|
||||||
List<String> list_possible = spectrumAnalysisMapper.getPossibleNuclide(userLib, min, max);
|
List<String> list_possible = spectrumAnalysisMapper.getPossibleNuclide(userLib, min, max);
|
||||||
|
//用户当前已选中的核素名称
|
||||||
|
List<String> list_identify = phd.getVPeak().get(index).nuclides;
|
||||||
|
|
||||||
List<String> list_identify = new LinkedList<>();
|
map.put("index", index);
|
||||||
List<String> identify = Arrays.asList(nuclides.split(";"));
|
|
||||||
list_identify.addAll(identify);
|
|
||||||
|
|
||||||
map.put("possible", list_possible);
|
map.put("possible", list_possible);
|
||||||
map.put("identify", list_identify);
|
map.put("identify", list_identify);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
|
@ -778,6 +788,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
result.error500("请先选择解析文件!");
|
result.error500("请先选择解析文件!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
double value = gammaFileUtil.GetEnergyByFloatChan(phd, channel.intValue());
|
double value = gammaFileUtil.GetEnergyByFloatChan(phd, channel.intValue());
|
||||||
BigDecimal bigDecimal = BigDecimal.valueOf(value);
|
BigDecimal bigDecimal = BigDecimal.valueOf(value);
|
||||||
bigDecimal = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
|
bigDecimal = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
|
@ -793,7 +804,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
if(CollectionUtils.isNotEmpty(nuclideList)) {
|
if(CollectionUtils.isNotEmpty(nuclideList)) {
|
||||||
map.put("list", nuclideList);
|
map.put("list", nuclideList);
|
||||||
String name = nuclideList.get(0);
|
String name = nuclideList.get(0);
|
||||||
gammaFileUtil.InitTable(name, map, phd);
|
gammaFileUtil.InitTable(name, map, phd, colorMap);
|
||||||
} else {
|
} else {
|
||||||
map.put("list", nuclideList);
|
map.put("list", nuclideList);
|
||||||
map.put("chart", new LinkedList<>());
|
map.put("chart", new LinkedList<>());
|
||||||
|
@ -809,8 +820,9 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result changeNuclide(Integer sampleId, String fileName, String nuclideName) {
|
public Result changeNuclide(Integer sampleId, String fileName, String nuclideName, HttpServletRequest request) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
|
@ -818,7 +830,8 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
result.error500("请先选择解析文件!");
|
result.error500("请先选择解析文件!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
gammaFileUtil.InitTable(nuclideName, map, phd);
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
|
gammaFileUtil.InitTable(nuclideName, map, phd, colorMap);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(map);
|
result.setResult(map);
|
||||||
return result;
|
return result;
|
||||||
|
@ -835,6 +848,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
result.error500("请先选择解析文件!");
|
result.error500("请先选择解析文件!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
BigDecimal bigDecimal = BigDecimal.valueOf(energy);
|
BigDecimal bigDecimal = BigDecimal.valueOf(energy);
|
||||||
bigDecimal = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
|
bigDecimal = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||||
map.put("energy", bigDecimal);
|
map.put("energy", bigDecimal);
|
||||||
|
@ -849,7 +863,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
if(CollectionUtils.isNotEmpty(nuclideList)) {
|
if(CollectionUtils.isNotEmpty(nuclideList)) {
|
||||||
map.put("list", nuclideList);
|
map.put("list", nuclideList);
|
||||||
String name = nuclideList.get(0);
|
String name = nuclideList.get(0);
|
||||||
gammaFileUtil.InitTable(name, map, phd);
|
gammaFileUtil.InitTable(name, map, phd, colorMap);
|
||||||
} else {
|
} else {
|
||||||
map.put("list", nuclideList);
|
map.put("list", nuclideList);
|
||||||
map.put("chart", new LinkedList<>());
|
map.put("chart", new LinkedList<>());
|
||||||
|
@ -1615,15 +1629,7 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
tablePeak.setAreaErr(peak.area>0?String.format("%.3f",(peak.areaErr/peak.area)*100):"0");
|
tablePeak.setAreaErr(peak.area>0?String.format("%.3f",(peak.areaErr/peak.area)*100):"0");
|
||||||
tablePeak.setSignificant(String.format("%.3f", peak.significance));
|
tablePeak.setSignificant(String.format("%.3f", peak.significance));
|
||||||
tablePeak.setSensitivity(String.format("%.3f", peak.sensitivity));
|
tablePeak.setSensitivity(String.format("%.3f", peak.sensitivity));
|
||||||
List<String> nuclides = peak.nuclides;
|
tablePeak.setIndentify(StringUtils.join(peak.nuclides, ";"));
|
||||||
String nuclide = "";
|
|
||||||
if (CollectionUtils.isNotEmpty(nuclides)){
|
|
||||||
for (String name:nuclides) {
|
|
||||||
nuclide+=name+StringPool.COMMA;
|
|
||||||
}
|
|
||||||
nuclide = nuclide.substring(0, nuclide.length()-1);
|
|
||||||
}
|
|
||||||
tablePeak.setIndentify(nuclide);
|
|
||||||
tablePeaks.add(tablePeak);
|
tablePeaks.add(tablePeak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2220,6 +2226,50 @@ public class GammaServiceImpl implements IGammaService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result clickPeakInformation(String fileName, int index) {
|
||||||
|
Result result = new Result();
|
||||||
|
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||||
|
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||||
|
if (Objects.isNull(phd)){
|
||||||
|
result.error500("请先选择解析文件!");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
int size = phd.getVPeak().size();
|
||||||
|
//vPeak的数组大小大于0 当前下标在范围内
|
||||||
|
if (size>0 && index<size && index>=0) {
|
||||||
|
PeakInfo peak = phd.getVPeak().get(index);
|
||||||
|
String message = "Peak:"+String.format("%.2f", peak.peakCentroid)+" = "+String.format("%.2f", peak.energy)+" keV\n" +
|
||||||
|
"FWHM:"+String.format("%.2f", peak.fwhmc)+" keV\n" +
|
||||||
|
"Net Area:"+String.format("%.2f", peak.area)+"\n" +
|
||||||
|
"BaseLine:"+String.format("%.2f", phd.getVBase().get((int) Math.round(peak.peakCentroid)))+"\n" +
|
||||||
|
"NID:"+ StringUtils.join(peak.nuclides, ";");
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(message);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result viewColorConfig(HttpServletRequest request) {
|
||||||
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(colorMap);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updateColorConfig(ColorInfo colorInfo, HttpServletRequest request) {
|
||||||
|
Result result = new Result();
|
||||||
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
Map<String, String> colorMap = sysUserColorService.updateColor(colorInfo, userName);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(colorMap);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result saveToDB(String fileName, String userName) {
|
public Result saveToDB(String fileName, String userName) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.modules.base.entity.postgre.SysUserColor;
|
||||||
|
import org.jeecg.modules.entity.vo.ColorInfo;
|
||||||
|
import org.jeecg.modules.mapper.SysUserColorMapper;
|
||||||
|
import org.jeecg.modules.service.ISysUserColorService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Service("sysUserColorService")
|
||||||
|
@DS("master")
|
||||||
|
public class SysUserColorServiceImpl extends ServiceImpl<SysUserColorMapper, SysUserColor> implements ISysUserColorService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||||
|
public Map<String, String> initColor(String userName) {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
//查询数据库是否存在当前用户名的颜色数据 如果存在返回查询结果 如果不存在初始化当前用户的颜色信息
|
||||||
|
LambdaQueryWrapper<SysUserColor> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SysUserColor::getCreateBy, userName);
|
||||||
|
SysUserColor userColor = this.baseMapper.selectOne(queryWrapper);
|
||||||
|
if (Objects.isNull(userColor)) {
|
||||||
|
userColor = new SysUserColor();
|
||||||
|
userColor.setId(String.valueOf(IdWorker.getId()));
|
||||||
|
userColor.setColorSpec("yellow");
|
||||||
|
userColor.setColorPeak("rgb(255, 127, 39)");
|
||||||
|
userColor.setColorLc("red");
|
||||||
|
userColor.setColorBase("rgb(0, 246, 255)");
|
||||||
|
userColor.setColorScac("rgb(244, 112, 247)");
|
||||||
|
userColor.setColorCompare("green");
|
||||||
|
userColor.setColorFitbase("white");
|
||||||
|
userColor.setColorStrip("blue");
|
||||||
|
userColor.setCreateBy(userName);
|
||||||
|
this.baseMapper.insert(userColor);
|
||||||
|
}
|
||||||
|
map.put("Color_Spec", userColor.getColorSpec());
|
||||||
|
map.put("Color_Peak", userColor.getColorPeak());
|
||||||
|
map.put("Color_Lc", userColor.getColorLc());
|
||||||
|
map.put("Color_Base", userColor.getColorBase());
|
||||||
|
map.put("Color_Scac", userColor.getColorScac());
|
||||||
|
map.put("Color_Compare", userColor.getColorCompare());
|
||||||
|
map.put("Color_Fitbase", userColor.getColorFitbase());
|
||||||
|
map.put("Color_Strip", userColor.getColorStrip());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||||
|
public Map<String, String> updateColor(ColorInfo colorInfo, String userName) {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
LambdaQueryWrapper<SysUserColor> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SysUserColor::getCreateBy, userName);
|
||||||
|
SysUserColor userColor = this.baseMapper.selectOne(queryWrapper);
|
||||||
|
if (Objects.nonNull(userColor)) {
|
||||||
|
userColor.setColorSpec(colorInfo.getColorSpec());
|
||||||
|
userColor.setColorPeak(colorInfo.getColorPeak());
|
||||||
|
userColor.setColorLc(colorInfo.getColorLc());
|
||||||
|
userColor.setColorBase(colorInfo.getColorBase());
|
||||||
|
userColor.setColorScac(colorInfo.getColorScac());
|
||||||
|
userColor.setColorCompare(colorInfo.getColorCompare());
|
||||||
|
userColor.setColorFitbase(colorInfo.getColorFitbase());
|
||||||
|
userColor.setColorStrip(colorInfo.getColorStrip());
|
||||||
|
this.baseMapper.updateById(userColor);
|
||||||
|
}
|
||||||
|
map.put("Color_Spec", userColor.getColorSpec());
|
||||||
|
map.put("Color_Peak", userColor.getColorPeak());
|
||||||
|
map.put("Color_Lc", userColor.getColorLc());
|
||||||
|
map.put("Color_Base", userColor.getColorBase());
|
||||||
|
map.put("Color_Scac", userColor.getColorScac());
|
||||||
|
map.put("Color_Compare", userColor.getColorCompare());
|
||||||
|
map.put("Color_Fitbase", userColor.getColorFitbase());
|
||||||
|
map.put("Color_Strip", userColor.getColorStrip());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user