SpecSetup修改实体类字段信息

UserTaskUtil新增查询用户信息方法
GammaController新增configureSave接口,实现Reprocessing接口
ConfigureData修改字段名称
This commit is contained in:
qiaoqinzheng 2023-09-25 11:24:42 +08:00
parent 3ce210b557
commit f3406dabb4
10 changed files with 115 additions and 137 deletions

View File

@ -10,21 +10,19 @@ import java.util.Date;
@Data
public class ConfigureData implements Serializable {
private Integer sampleId;
private String fileName;
private Double ECutAnalysis_Low;
private Double eCutAnalysis_Low;
private Double ECutAnalysis_High;
private Double eCutAnalysis_High;
private Double EnergyTolerance;
private Double energyTolerance;
private Double PSS_low;
private Double pss_low;
private Double CalibrationPSS_low;
private Double calibrationPSS_low;
private Double CalibrationPSS_high;
private Double calibrationPSS_high;
private Double k_back;
@ -32,16 +30,16 @@ public class ConfigureData implements Serializable {
private Double k_beta;
private Double BaseImprovePSS;
private Double baseImprovePSS;
private Double RiskLevelK;
private Double riskLevelK;
@DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
private Date RefTime_act;
private Date refTime_act;
@DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
private Date RefTime_conc;
private Date refTime_conc;
}

View File

@ -22,7 +22,7 @@ public class SpecSetup implements Serializable {
private double baseImprovePSS;
private double pSS_low;
private double pss_low;
private double k_back;
@ -51,7 +51,7 @@ public class SpecSetup implements Serializable {
calibrationPSS_high = 10.0;
calibrationPSS_low = 5.0;
baseImprovePSS = 10.0;
pSS_low = 2.7;
pss_low = 2.7;
k_back = 1.25;
k_alpha = 2.576;
k_beta = 1.645;

View File

@ -749,7 +749,7 @@ public class GammaFileUtil {
phd.getUsedSetting().setCalibrationPSS_high(analySetting.getCalibrationpssHigh());
phd.getUsedSetting().setCalibrationPSS_low(analySetting.getCalibrationpssLow());
phd.getUsedSetting().setBaseImprovePSS(analySetting.getBaseimprovepss());
phd.getUsedSetting().setPSS_low(analySetting.getPssLow());
phd.getUsedSetting().setPss_low(analySetting.getPssLow());
phd.getUsedSetting().setK_back(analySetting.getKBack());
phd.getUsedSetting().setK_alpha(analySetting.getKAlpha());
phd.getUsedSetting().setK_beta(analySetting.getKBeta());
@ -1481,7 +1481,7 @@ public class GammaFileUtil {
phdSetting.setECutAnalysis_Low(configureData.getECutAnalysis_Low());
phdSetting.setECutAnalysis_High(configureData.getECutAnalysis_High());
phdSetting.setEnergyTolerance(configureData.getEnergyTolerance());
phdSetting.setPSS_low(configureData.getPSS_low());
phdSetting.setPss_low(configureData.getPss_low());
phdSetting.setBaseImprovePSS(configureData.getBaseImprovePSS());
phdSetting.setK_back(configureData.getK_back());
phdSetting.setK_alpha(configureData.getK_alpha());
@ -1528,7 +1528,7 @@ public class GammaFileUtil {
if(newSets.getECutAnalysis_Low() != oldSets.getECutAnalysis_Low()
|| newSets.getECutAnalysis_High() != oldSets.getECutAnalysis_High()
|| newSets.getEnergyTolerance() != oldSets.getEnergyTolerance()
|| newSets.getPSS_low() != oldSets.getCalibrationPSS_low()
|| newSets.getPss_low() != oldSets.getCalibrationPSS_low()
|| newSets.getBaseImprovePSS() != oldSets.getBaseImprovePSS()
|| newSets.getK_back() != oldSets.getK_back()
|| newSets.getK_alpha() != oldSets.getK_alpha()
@ -2489,7 +2489,7 @@ public class GammaFileUtil {
strBuffer.append("ECutAnalysis_High : "+middleData.setting_specSetup.getECutAnalysis_High()+"\n");
strBuffer.append("EnergyTolerance : "+middleData.setting_specSetup.getEnergyTolerance()+"\n");
strBuffer.append("BaseImprovePSS : "+middleData.setting_specSetup.getBaseImprovePSS()+"\n");
strBuffer.append("PSS_low : "+middleData.setting_specSetup.getPSS_low()+"\n");
strBuffer.append("PSS_low : "+middleData.setting_specSetup.getPss_low()+"\n");
strBuffer.append("k_back : "+middleData.setting_specSetup.getK_back()+"\n");
strBuffer.append("k_alpha : "+middleData.setting_specSetup.getK_alpha()+"\n");
strBuffer.append("k_beta : "+middleData.setting_specSetup.getK_beta()+"\n");
@ -2642,7 +2642,7 @@ public class GammaFileUtil {
strBuffer.append(" ECutAnalysis_High: "+middleData.setting_specSetup.getECutAnalysis_High()+"\n");
strBuffer.append(" EnergyTolerance: "+middleData.setting_specSetup.getEnergyTolerance()+"\n");
strBuffer.append(" BaseImprovePSS: "+middleData.setting_specSetup.getBaseImprovePSS()+"\n");
strBuffer.append(" PSS_low: "+middleData.setting_specSetup.getPSS_low()+"\n");
strBuffer.append(" PSS_low: "+middleData.setting_specSetup.getPss_low()+"\n");
strBuffer.append(" k_back: "+middleData.setting_specSetup.getK_back()+"\n");
strBuffer.append(" k_alpha: "+middleData.setting_specSetup.getK_alpha()+"\n");
strBuffer.append(" k_beta: "+middleData.setting_specSetup.getK_beta()+"\n");

View File

@ -289,7 +289,7 @@ public class Sample_G_Analysis {
infoMap.put("ECutAnalysis_High", middleData.setting_specSetup.getECutAnalysis_High());
infoMap.put("EnergyTolerance", middleData.setting_specSetup.getEnergyTolerance());
infoMap.put("BaseImprovePSS", middleData.setting_specSetup.getBaseImprovePSS());
infoMap.put("PSS_low", middleData.setting_specSetup.getPSS_low());
infoMap.put("PSS_low", middleData.setting_specSetup.getPss_low());
infoMap.put("k_back", middleData.setting_specSetup.getK_back());
infoMap.put("k_alpha", middleData.setting_specSetup.getK_alpha());
infoMap.put("k_beta", middleData.setting_specSetup.getK_beta());
@ -779,7 +779,7 @@ public class Sample_G_Analysis {
setting.setK_beta(Double.parseDouble(k_beta));
String PSS_low = mapSetting.get(Setting.PSS_LOW);
if (StrUtil.isNotBlank(PSS_low))
setting.setPSS_low(Double.parseDouble(PSS_low));
setting.setPss_low(Double.parseDouble(PSS_low));
String RiskLevelK = mapSetting.get(Setting.RISKLEVELK);
if (StrUtil.isNotBlank(RiskLevelK))
setting.setRiskLevelK(Double.parseDouble(RiskLevelK));

View File

@ -1,5 +1,6 @@
package org.jeecg.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
@ -25,6 +26,7 @@ import org.jeecg.modules.native_jni.CalValuesHandler;
import org.jeecg.modules.native_jni.EnergySpectrumHandler;
import org.jeecg.modules.native_jni.struct.CalValuesOut;
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -239,7 +241,9 @@ public class GammaFileUtil {
}
phd.getSetting().setRefTime_conc(DateUtils.parseDate(phd.getCollect().getCollection_start_date() + StringPool.SPACE + phd.getCollect().getCollection_start_time().substring(0, phd.getCollect().getCollection_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"));
phd.getSetting().setRefTime_act(DateUtils.parseDate(phd.getAcq().getAcquisition_start_date() + StringPool.SPACE + phd.getAcq().getAcquisition_start_time().substring(0, phd.getAcq().getAcquisition_start_time().indexOf(StringPool.DOT)), "yyyy/MM/dd HH:mm:ss"));
phd.setUsedSetting(phd.getSetting());
SpecSetup usedSetting = new SpecSetup();
BeanUtils.copyProperties(phd.getSetting(), usedSetting);
phd.setUsedSetting(usedSetting);
phd.setBAnalyed(false);
phd.setAnaly_start_time(DateUtils.formatDate(new Date(), "yyyy/MM/dd HH:mm:ss"));
@ -743,7 +747,7 @@ public class GammaFileUtil {
phd.getUsedSetting().setCalibrationPSS_high(analySetting.getCalibrationpssHigh());
phd.getUsedSetting().setCalibrationPSS_low(analySetting.getCalibrationpssLow());
phd.getUsedSetting().setBaseImprovePSS(analySetting.getBaseimprovepss());
phd.getUsedSetting().setPSS_low(analySetting.getPssLow());
phd.getUsedSetting().setPss_low(analySetting.getPssLow());
phd.getUsedSetting().setK_back(analySetting.getKBack());
phd.getUsedSetting().setK_alpha(analySetting.getKAlpha());
phd.getUsedSetting().setK_beta(analySetting.getKBeta());
@ -1470,23 +1474,7 @@ public class GammaFileUtil {
return datalist;
}
public int AnalyseData(PHDFile phd, ConfigureData configureData, List<String> nuclides, Result result) {
//调用方法判断是否修改了参数
if (Objects.nonNull(configureData)){
SpecSetup phdSetting = phd.getSetting();
phdSetting.setECutAnalysis_Low(configureData.getECutAnalysis_Low());
phdSetting.setECutAnalysis_High(configureData.getECutAnalysis_High());
phdSetting.setEnergyTolerance(configureData.getEnergyTolerance());
phdSetting.setPSS_low(configureData.getPSS_low());
phdSetting.setBaseImprovePSS(configureData.getBaseImprovePSS());
phdSetting.setK_back(configureData.getK_back());
phdSetting.setK_alpha(configureData.getK_alpha());
phdSetting.setK_beta(configureData.getK_beta());
phdSetting.setRiskLevelK(configureData.getRiskLevelK());
phdSetting.setRefTime_act(configureData.getRefTime_act());
phdSetting.setRefTime_conc(configureData.getRefTime_conc());
}
public int AnalyseData(PHDFile phd, List<String> nuclides) {
int change = SettingChanged(phd);
if(change == 0 && phd.getVPeak().size() > 0) {
return change;
@ -1498,10 +1486,6 @@ public class GammaFileUtil {
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
NuclidesIdent(phd, nuclideLinesMap);
RunQC(phd);
result.error500("Finish three tasks:\n"+
"\t1.Update efficiencies of all peaks;\n"+
"\t2.Identify nuclides again;\n"+
"\t3.Test QC again.");
} else {
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
AnalyseSpectrum(phd, nuclideLinesMap);
@ -1511,14 +1495,29 @@ public class GammaFileUtil {
public boolean AnalyseSpectrum(PHDFile phd, Map<String, NuclideLines> mapLines){
System.loadLibrary("GammaAnaly");
//解析获取临时文件信息
File tmpFile = analyzeFile(phd.getFilepath(), phd.getFilename());
ObjectMapper mapper = new ObjectMapper();
try {
String phdStr = mapper.writeValueAsString(phd);
String mapLinesStr = mapper.writeValueAsString(mapLines);
String analyseSpectrum = CalValuesHandler.analyseSpectrum(phdStr, mapLinesStr, "");
JSONObject jsonObject = JSONObject.parseObject(analyseSpectrum);
String jsonString = jsonObject.toJSONString();
String nuclideLinesMap = mapper.writeValueAsString(mapLines);
String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath());
PHDFile phdFile = JSON.parseObject(strValue, PHDFile.class);
phd.setVLc(phdFile.getVLc());
phd.setVScac(phdFile.getVScac());
phd.setVBase(phdFile.getVBase());
phd.setVEnergy(phdFile.getVEnergy());
phd.setVPeak(phdFile.getVPeak());
for (PeakInfo peak:phd.getVPeak()) {
if (StringUtils.isBlank(peak.recoilBetaChan)) {
peak.recoilBetaChan = "1";
}
if (StringUtils.isBlank(peak.recoilDeltaChan)) {
peak.recoilDeltaChan = "1";
}
}
//重新分析各峰值对应的核素信息
NuclidesIdent(phd, mapLines);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
@ -1532,7 +1531,7 @@ public class GammaFileUtil {
if(newSets.getECutAnalysis_Low() != oldSets.getECutAnalysis_Low()
|| newSets.getECutAnalysis_High() != oldSets.getECutAnalysis_High()
|| newSets.getEnergyTolerance() != oldSets.getEnergyTolerance()
|| newSets.getPSS_low() != oldSets.getCalibrationPSS_low()
|| newSets.getPss_low() != oldSets.getPss_low()
|| newSets.getBaseImprovePSS() != oldSets.getBaseImprovePSS()
|| newSets.getK_back() != oldSets.getK_back()
|| newSets.getK_alpha() != oldSets.getK_alpha()
@ -2493,7 +2492,7 @@ public class GammaFileUtil {
strBuffer.append("ECutAnalysis_High : "+middleData.setting_specSetup.getECutAnalysis_High()+"\n");
strBuffer.append("EnergyTolerance : "+middleData.setting_specSetup.getEnergyTolerance()+"\n");
strBuffer.append("BaseImprovePSS : "+middleData.setting_specSetup.getBaseImprovePSS()+"\n");
strBuffer.append("PSS_low : "+middleData.setting_specSetup.getPSS_low()+"\n");
strBuffer.append("PSS_low : "+middleData.setting_specSetup.getPss_low()+"\n");
strBuffer.append("k_back : "+middleData.setting_specSetup.getK_back()+"\n");
strBuffer.append("k_alpha : "+middleData.setting_specSetup.getK_alpha()+"\n");
strBuffer.append("k_beta : "+middleData.setting_specSetup.getK_beta()+"\n");
@ -2650,7 +2649,7 @@ public class GammaFileUtil {
strBuffer.append(" ECutAnalysis_High: "+middleData.setting_specSetup.getECutAnalysis_High()+"\n");
strBuffer.append(" EnergyTolerance: "+middleData.setting_specSetup.getEnergyTolerance()+"\n");
strBuffer.append(" BaseImprovePSS: "+middleData.setting_specSetup.getBaseImprovePSS()+"\n");
strBuffer.append(" PSS_low: "+middleData.setting_specSetup.getPSS_low()+"\n");
strBuffer.append(" PSS_low: "+middleData.setting_specSetup.getPss_low()+"\n");
strBuffer.append(" k_back: "+middleData.setting_specSetup.getK_back()+"\n");
strBuffer.append(" k_alpha: "+middleData.setting_specSetup.getK_alpha()+"\n");
strBuffer.append(" k_beta: "+middleData.setting_specSetup.getK_beta()+"\n");

View File

@ -77,8 +77,17 @@ public class UserTaskUtil {
return flag;
}
/**
* 根据用户名获取用户相关权限信息
* @param userName
* @return
*/
public List<String> findRoleCodeByUserName(String userName){
return userTaskService.findRoleCodeByUserName(userName);
}
public SysUser findUserByName(String userName) {
return userTaskService.findUserByName(userName);
}
}

View File

@ -53,11 +53,6 @@ public class GammaController {
redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params);;
}
@GetMapping("testFun")
public Result testFun(String fileName,HttpServletRequest request){
return gammaService.testFun(fileName, request);
}
@GetMapping("gammaByDB")
public Result gammaByDB(Integer sampleId, String dbName, HttpServletRequest request){
return gammaService.gammaByDB(dbName, sampleId, request);
@ -84,10 +79,15 @@ public class GammaController {
return gammaService.configure(sampleId, fileName);
}
@PostMapping("configureSave")
public Result configureSave(@RequestBody ConfigureData configureData) {
return gammaService.configureSave(configureData);
}
@PostMapping("Reprocessing")
@ApiOperation(value = "analyze菜单下Reprocessing页面数据", notes = "analyze菜单下Reprocessing页面数据")
public Result Reprocessing(@RequestBody ConfigureData configureData, HttpServletRequest request) {
return gammaService.Reprocessing(configureData, request);
public Result Reprocessing(String fileName, HttpServletRequest request) {
return gammaService.Reprocessing(fileName, request);
}
@GetMapping("InteractiveTool")

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.base.bizVo.GammaRLR;
import org.jeecg.modules.entity.vo.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
@ -13,8 +14,6 @@ public interface IGammaService{
Result initValue(Integer sampleId, String dbName, HttpServletRequest request);
Result testFun(String fileName, HttpServletRequest request);
Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request);
Result gammaByFile(String fileName, HttpServletRequest request);
@ -25,7 +24,9 @@ public interface IGammaService{
Result configure(Integer sampleId, String fileName);
Result Reprocessing(ConfigureData configureData, HttpServletRequest request);
Result configureSave(ConfigureData configureData);
Result Reprocessing(String fileName, HttpServletRequest request);
Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request);

View File

@ -28,6 +28,7 @@ import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.*;
import org.jeecg.modules.base.bizVo.GammaRLR;
import org.jeecg.modules.base.entity.configuration.GardsNuclLinesLib;
import org.jeecg.modules.base.entity.postgre.SysUser;
import org.jeecg.modules.base.enums.ExportTemplate;
import org.jeecg.modules.base.enums.RoleType;
import org.jeecg.modules.entity.vo.*;
@ -121,6 +122,7 @@ public class GammaServiceImpl implements IGammaService {
@Override
public Result initValue(Integer sampleId, String dbName, HttpServletRequest request) {
Result result = new Result();
//
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = new PHDFile();
@ -151,66 +153,6 @@ public class GammaServiceImpl implements IGammaService {
return result;
}
@Override
public Result testFun(String fileName, HttpServletRequest request) {
Result result = new Result();
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
}
phd.setUserId("1");
phd.setXmlFilePath(parameterFilePath);
String userName = JwtUtil.getUserNameByToken(request);
//获取当前角色的颜色配置
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());
}
Map<String, NuclideLines> nuclideLinesMap = gammaFileUtil.GetNuclideLines(nuclides);
//解析获取临时文件信息
File tmpFile = gammaFileUtil.analyzeFile(StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName, fileName);
ObjectMapper mapper = new ObjectMapper();
try {
String phdStr = mapper.writeValueAsString(phd);
String mapLines = mapper.writeValueAsString(nuclideLinesMap);
String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, tmpFile.getAbsolutePath());
PHDFile phdFile = JSON.parseObject(strValue, PHDFile.class);
phd.setVLc(phdFile.getVLc());
phd.setVScac(phdFile.getVScac());
phd.setVBase(phdFile.getVBase());
phd.setVEnergy(phdFile.getVEnergy());
phd.setVPeak(phdFile.getVPeak());
for (PeakInfo peak:phd.getVPeak()) {
if (StringUtils.isBlank(peak.recoilBetaChan)) {
peak.recoilBetaChan = "1";
}
if (StringUtils.isBlank(peak.recoilDeltaChan)) {
peak.recoilDeltaChan = "1";
}
}
gammaFileUtil.UpdateChart(phd, map, colorMap);
//
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
// 更新 QC Flags 状态
List<String> qcstate = gammaFileUtil.Qcstate(phd);
map.put("QCFlag", qcstate);
phdCache.put(fileName, phd);
localCache.setPHDCache(phdCache);
result.setResult(map);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
result.setSuccess(true);
return result;
}
@Override
public Result gammaByDB(String dbName, Integer sampleId, HttpServletRequest request) {
Result result = new Result();
@ -366,7 +308,7 @@ public class GammaServiceImpl implements IGammaService {
map.put("edit_ps_low", setup.getECutAnalysis_Low());
map.put("edit_ps_high", setup.getECutAnalysis_High());
map.put("edit_energy", setup.getEnergyTolerance());
map.put("edit_pss_low", setup.getPSS_low());
map.put("edit_pss_low", setup.getPss_low());
map.put("edit_cal_low", setup.getCalibrationPSS_low());
map.put("edit_cal_high", setup.getCalibrationPSS_high());
map.put("checkBox_updateCal", setup.isBUpdateCal());
@ -389,7 +331,7 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result Reprocessing(ConfigureData configureData, HttpServletRequest request) {
public Result configureSave(ConfigureData configureData) {
Result result = new Result();
String fileName = configureData.getFileName();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
@ -398,7 +340,41 @@ public class GammaServiceImpl implements IGammaService {
result.error500("请先选择解析文件!");
return result;
}
SpecSetup phdSetting = phd.getSetting();
phdSetting.setECutAnalysis_Low(configureData.getECutAnalysis_Low());
phdSetting.setECutAnalysis_High(configureData.getECutAnalysis_High());
phdSetting.setEnergyTolerance(configureData.getEnergyTolerance());
phdSetting.setPss_low(configureData.getPss_low());
phdSetting.setBaseImprovePSS(configureData.getBaseImprovePSS());
phdSetting.setK_back(configureData.getK_back());
phdSetting.setK_alpha(configureData.getK_alpha());
phdSetting.setK_beta(configureData.getK_beta());
phdSetting.setRiskLevelK(configureData.getRiskLevelK());
phdSetting.setRefTime_act(configureData.getRefTime_act());
phdSetting.setRefTime_conc(configureData.getRefTime_conc());
phdCache.put(fileName, phd);
localCache.setPHDCache(phdCache);
result.success("保存成功");
return result;
}
@Override
public Result Reprocessing(String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
}
//获取当前用户信息
SysUser user = userTaskUtil.findUserByName(userName);
if (Objects.nonNull(user)) {
phd.setUserId(user.getId());
}
//赋值xml文件存放路径
phd.setXmlFilePath(parameterFilePath);
//获取当前角色的颜色配置
Map<String, String> colorMap = sysUserColorService.initColor(userName);
//查询当前用户关联的核素信息
@ -408,7 +384,8 @@ public class GammaServiceImpl implements IGammaService {
if (CollectionUtils.isEmpty(nuclides)){
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
}
int flag = gammaFileUtil.AnalyseData(phd, configureData, nuclides, result);
//分析文件数据
int flag = gammaFileUtil.AnalyseData(phd, nuclides);
if (flag == 0){
String warning = "The spectrum needn't Analyed. Maybe:\n"+
"1. It has already Analyed.\n"+
@ -422,21 +399,15 @@ public class GammaServiceImpl implements IGammaService {
result.error500(warning);
} else {
Map<String, Object> map = new HashMap<>();
phd.getUsedSetting().setECutAnalysis_Low(configureData.getECutAnalysis_Low());
phd.getUsedSetting().setECutAnalysis_High(configureData.getECutAnalysis_High());
phd.getUsedSetting().setEnergyTolerance(configureData.getEnergyTolerance());
phd.getUsedSetting().setPSS_low(configureData.getPSS_low());
phd.getUsedSetting().setBaseImprovePSS(configureData.getBaseImprovePSS());
phd.getUsedSetting().setK_back(configureData.getK_back());
phd.getUsedSetting().setK_alpha(configureData.getK_alpha());
phd.getUsedSetting().setK_beta(configureData.getK_beta());
phd.getUsedSetting().setRiskLevelK(configureData.getRiskLevelK());
phd.getUsedSetting().setRefTime_act(configureData.getRefTime_act());
phd.getUsedSetting().setRefTime_conc(configureData.getRefTime_conc());
gammaFileUtil.UpdateChart(phd, map, colorMap);
// 更新 QC Flags 状态
List<String> qcstate = gammaFileUtil.Qcstate(phd);
map.put("QCFlag", qcstate);
result.setSuccess(true);
result.setResult(map);
}
phdCache.put(fileName, phd);
localCache.setPHDCache(phdCache);
return result;
}

View File

@ -25,7 +25,7 @@ public class GardsAnalySettingSpectrumServiceImpl extends ServiceImpl<GardsAnaly
analySetting.setCalibrationpssHigh(phd.getUsedSetting().getCalibrationPSS_high());
analySetting.setCalibrationpssLow(phd.getUsedSetting().getCalibrationPSS_low());
analySetting.setBaseimprovepss(phd.getUsedSetting().getBaseImprovePSS());
analySetting.setPssLow(phd.getUsedSetting().getPSS_low());
analySetting.setPssLow(phd.getUsedSetting().getPss_low());
analySetting.setKBack(phd.getUsedSetting().getK_back());
analySetting.setKAlpha(phd.getUsedSetting().getK_alpha());
analySetting.setKBeta(phd.getUsedSetting().getK_beta());