beta,gamma的存储逻辑修改,判断当天是否有对应台站的排班任务或是否有历史分析任务进行新增或修改操作
This commit is contained in:
parent
b9890950b5
commit
f1fbae787c
|
@ -85,6 +85,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileFtransitUtil fileFtransitUtil;
|
private FileFtransitUtil fileFtransitUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private NameStandUtil nameStandUtil;
|
||||||
|
@Autowired
|
||||||
private DBUtil dbUtil;
|
private DBUtil dbUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserTaskUtil userTaskUtil;
|
private UserTaskUtil userTaskUtil;
|
||||||
|
@ -4335,19 +4337,25 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
result.error500("Please select the parse file first!");
|
result.error500("Please select the parse file first!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// 查看分析员是否有权限操作当前台站信息
|
//获取当前操作的台站的id
|
||||||
// 判断当前分析员是否有过排班任务
|
|
||||||
Integer stationId = spectrumAnalysisMapper.getStationId(phd.getHeader().getSite_code());
|
Integer stationId = spectrumAnalysisMapper.getStationId(phd.getHeader().getSite_code());
|
||||||
boolean bAnalysisResultWriteAuthority = userTaskUtil.CheckUserWriteAuthorityForStation(userName, stationId);
|
//判断当前分析员当天是否有对应台站的排班任务
|
||||||
|
List<String> userStation = userTaskUtil.findUserStation(userName);
|
||||||
|
boolean bAnalysisResultWriteAuthority = false;
|
||||||
|
if (userStation.contains(String.valueOf(stationId))) {
|
||||||
|
bAnalysisResultWriteAuthority = true;
|
||||||
|
}
|
||||||
|
//根据系统类型获取系统存储前缀
|
||||||
|
String sysTemSubdir = nameStandUtil.GetSysTemSubdir(phd.getHeader().getSystem_type());
|
||||||
|
//根据数据类型获取数据存储前缀
|
||||||
|
String dateTypeSubdir = nameStandUtil.GetDateTypeSubdir(phd.getMsgInfo().getData_type());
|
||||||
|
//格式化名称
|
||||||
|
Map<String, String> nameMap = nameStandUtil.NameStandard(phd);
|
||||||
|
String mSaveFileName = nameMap.get("saveFile");
|
||||||
|
//判断当前分析员是否有过历史分析当前文件
|
||||||
|
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sysTemSubdir+ dateTypeSubdir + StringPool.SLASH + mSaveFileName, userName);
|
||||||
// 如果用户没有权限操作 则查看当前用户是否是高级分析员/管理员
|
// 如果用户没有权限操作 则查看当前用户是否是高级分析员/管理员
|
||||||
if (!bAnalysisResultWriteAuthority) {
|
if (!bAnalysisResultWriteAuthority && Objects.isNull(isExist)) {
|
||||||
List<String> roleCodes = userTaskUtil.findRoleCodeByUserName(userName);
|
|
||||||
// 如果只是分析员 则无法保存数据库 返回信息
|
|
||||||
if (roleCodes.contains(RoleType.Role_Analyst) && !roleCodes.contains(RoleType.Role_SuperAnalyst) && !roleCodes.contains(RoleType.Role_Manager)) {
|
|
||||||
bRet = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!bRet) {
|
|
||||||
result.error500("You have no permission to save results to DB!");
|
result.error500("You have no permission to save results to DB!");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -4523,6 +4531,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第三块数据
|
// 文本内容第三块数据
|
||||||
|
if (CollectionUtils.isNotEmpty(phd.getVPeak())) {
|
||||||
List<List<String>> peakNuclides = phd.getVPeak().stream().map(item -> item.nuclides).collect(Collectors.toList());
|
List<List<String>> peakNuclides = phd.getVPeak().stream().map(item -> item.nuclides).collect(Collectors.toList());
|
||||||
List<String> nuclides = new LinkedList<>();
|
List<String> nuclides = new LinkedList<>();
|
||||||
for (int i = 0; i < peakNuclides.size(); i++) {
|
for (int i = 0; i < peakNuclides.size(); i++) {
|
||||||
|
@ -4537,6 +4546,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(nuclideStr);
|
strBuild.append(nuclideStr);
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
|
}
|
||||||
// 换行
|
// 换行
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第四块
|
// 文本内容第四块
|
||||||
|
@ -4569,6 +4579,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
// 文本内容第五块数据
|
// 文本内容第五块数据
|
||||||
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
||||||
|
if (CollectionUtils.isNotEmpty(mapNucActMda)) {
|
||||||
for (Map.Entry<String, NuclideActMda> entry : mapNucActMda.entrySet()) {
|
for (Map.Entry<String, NuclideActMda> entry : mapNucActMda.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
NuclideActMda nuc = entry.getValue();
|
NuclideActMda nuc = entry.getValue();
|
||||||
|
@ -4607,6 +4618,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
strBuild.append(System.lineSeparator());
|
strBuild.append(System.lineSeparator());
|
||||||
String detectorCode = phd.getHeader().getDetector_code();
|
String detectorCode = phd.getHeader().getDetector_code();
|
||||||
String date = phd.getAcq().getAcquisition_start_date().replace("/", "");
|
String date = phd.getAcq().getAcquisition_start_date().replace("/", "");
|
||||||
|
|
|
@ -4074,13 +4074,13 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
String beginDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
String beginDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
//获取当前时间作为人工分析结束时间
|
//获取当前时间作为人工分析结束时间
|
||||||
String endDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
String endDate = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||||
//判断当前分析员是否有过排班任务
|
//根据台站名称获取台站id
|
||||||
Integer stationId = spectrumAnalysisMapper.getStationId(anlyseResultIn.getStationName());
|
Integer stationId = spectrumAnalysisMapper.getStationId(anlyseResultIn.getStationName());
|
||||||
//判断当前分析员是否有过当前台站的排班任务
|
//判断当前分析员当天是否有对应台站的排班任务
|
||||||
boolean bAnalysisResultWriteAuthority = userTaskUtil.CheckUserWriteAuthorityForStation(anlyseResultIn.getUserName(), stationId);
|
List<String> userStation = userTaskUtil.findUserStation(userName);
|
||||||
if ( !bAnalysisResultWriteAuthority ){
|
boolean bAnalysisResultWriteAuthority = false;
|
||||||
result.error500("This user has no right to store the results of the analysis to the database.");
|
if (userStation.contains(String.valueOf(stationId))) {
|
||||||
return result;
|
bAnalysisResultWriteAuthority = true;
|
||||||
}
|
}
|
||||||
//获取ROI Limit数据
|
//获取ROI Limit数据
|
||||||
// getROILimit(anlyseResultIn);
|
// getROILimit(anlyseResultIn);
|
||||||
|
@ -4120,16 +4120,22 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
anlyseResultIn.setDetFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
anlyseResultIn.setDetFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
||||||
anlyseResultIn.setQcFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
anlyseResultIn.setQcFilePath(ftpUtil.getFtpRootPath() + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理数据 获取对应的channel/energy值
|
|
||||||
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
|
||||||
//分析文件内容
|
|
||||||
analyzePHDFile(anlyseResultIn, BgCalPara, betaFittingPara, gammaFittingPara);
|
|
||||||
//处理文件名称
|
//处理文件名称
|
||||||
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||||
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||||
String detFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
String detFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||||
String qcFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getQcFilePath(), anlyseResultIn.getQcFileName());
|
String qcFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getQcFilePath(), anlyseResultIn.getQcFileName());
|
||||||
|
//判断当前分析员是否有过历史分析当前文件
|
||||||
|
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName());
|
||||||
|
//如果当前分析员在当天没有排班任务 并且 没有历史分析过当前文件 则不允许进行保存操作
|
||||||
|
if ( !bAnalysisResultWriteAuthority && Objects.isNull(isExist) ){
|
||||||
|
result.error500("This user has no right to store the results of the analysis to the database.");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
//处理数据 获取对应的channel/energy值
|
||||||
|
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
|
||||||
|
//分析文件内容
|
||||||
|
analyzePHDFile(anlyseResultIn, BgCalPara, betaFittingPara, gammaFittingPara);
|
||||||
//判断文件是否存储过 如果没有则解析文件并进行存储
|
//判断文件是否存储过 如果没有则解析文件并进行存储
|
||||||
if ( !OriginalDataStore(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName(), gasFilePathName, anlyseResultIn.getUserName()) ){
|
if ( !OriginalDataStore(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName(), gasFilePathName, anlyseResultIn.getUserName()) ){
|
||||||
result.error500("gasFile save failed");
|
result.error500("gasFile save failed");
|
||||||
|
@ -4149,8 +4155,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
||||||
result.error500("sampleFile save failed");
|
result.error500("sampleFile save failed");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//判断当前分析员是否有过历史分析当前文件
|
|
||||||
Integer isExist = spectrumAnalysisMapper.SampleIsExist(sampleFilePathName, anlyseResultIn.getUserName());
|
|
||||||
//根据文件名称查询对应的sampleId--- sampleFile gasFile detFile
|
//根据文件名称查询对应的sampleId--- sampleFile gasFile detFile
|
||||||
Integer sampleId = spectrumAnalysisMapper.getSampleId(sampleFilePathName);
|
Integer sampleId = spectrumAnalysisMapper.getSampleId(sampleFilePathName);
|
||||||
Integer gasId = spectrumAnalysisMapper.getSampleId(gasFilePathName);
|
Integer gasId = spectrumAnalysisMapper.getSampleId(gasFilePathName);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user