fix:新beta savetodb增加保存注释

This commit is contained in:
xiaoguangbin 2024-10-11 15:52:21 +08:00
parent 76e07badd5
commit a5f53e8d54
5 changed files with 74 additions and 31 deletions

View File

@ -176,7 +176,7 @@ public class SelfStationUtil extends SelfBaseUtil {
his.setC(count);
histogramDataList.add(his);
histogramDataDList.add(his);
}else {
}else if(count == 0 && i < 512){
HistogramData his = new HistogramData();
his.setG(i);
his.setB(j);

View File

@ -400,8 +400,8 @@ public class SelfStationController {
@GetMapping("saveToDB")
@ApiOperation(value = "Save To DB按钮", notes = "Save To DB按钮")
public Result saveToDB(String fileName, HttpServletRequest request) {
return selfStationService.saveToDB(fileName, request);
public Result saveToDB(String fileName, String comment, HttpServletRequest request) {
return selfStationService.saveToDB(fileName, comment,request);
}
@GetMapping("viewARR")

View File

@ -1025,10 +1025,18 @@
SWVERSION=#{gardsAnalyses.swVersion},
CATEGORY=#{gardsAnalyses.category},
COMMENTS=#{gardsAnalyses.comments},
USEDGASPHD=#{gardsAnalyses.usedgasphd},
USEDDETPHD=#{gardsAnalyses.useddetphd},
USEDGASPHD_ID=#{gardsAnalyses.usedgasphdId},
USEDDETPHD_ID=#{gardsAnalyses.useddetphdId},
<if test=" gardsAnalyses.usedgasphd != null">
USEDGASPHD=#{gardsAnalyses.usedgasphd},
</if>
<if test=" gardsAnalyses.useddetphd != null">
USEDDETPHD=#{gardsAnalyses.useddetphd},
</if>
<if test=" gardsAnalyses.usedgasphdId != null">
USEDGASPHD_ID=#{gardsAnalyses.usedgasphdId},
</if>
<if test=" gardsAnalyses.useddetphdId != null">
USEDDETPHD_ID=#{gardsAnalyses.useddetphdId},
</if>
LOG_PATH = #{gardsAnalyses.logPath},
REPORT_PAHT = #{gardsAnalyses.reportPath}
WHERE
@ -1048,11 +1056,19 @@
ANALYST,
CATEGORY,
COMMENTS,
USEDGASPHD,
USEDDETPHD,
USEDGASPHD_ID,
USEDDETPHD_ID,
LOG_PATH,
<if test=" gardsAnalyses.usedgasphd != null">
USEDGASPHD,
</if>
<if test=" gardsAnalyses.useddetphd != null">
USEDDETPHD,
</if>
<if test=" gardsAnalyses.usedgasphdId != null">
USEDGASPHD_ID,
</if>
<if test=" gardsAnalyses.useddetphdId != null">
USEDDETPHD_ID,
</if>
LOG_PATH,
REPORT_PAHT)
VALUES(#{gardsAnalyses.sampleId},
to_date(#{gardsAnalyses.analysisBeginStr},'YYYY-MM-DD hh24:mi:ss'),
@ -1063,10 +1079,18 @@
#{gardsAnalyses.analyst},
#{gardsAnalyses.category},
#{gardsAnalyses.comments},
#{gardsAnalyses.usedgasphd},
#{gardsAnalyses.useddetphd},
#{gardsAnalyses.usedgasphdId},
#{gardsAnalyses.useddetphdId},
<if test=" gardsAnalyses.usedgasphd != null">
#{gardsAnalyses.usedgasphd},
</if>
<if test=" gardsAnalyses.useddetphd != null">
#{gardsAnalyses.useddetphd},
</if>
<if test=" gardsAnalyses.usedgasphdId != null">
#{gardsAnalyses.usedgasphdId},
</if>
<if test=" gardsAnalyses.useddetphdId != null">
#{gardsAnalyses.useddetphdId},
</if>
#{gardsAnalyses.logPath},
#{gardsAnalyses.reportPath})
</insert>

View File

@ -129,7 +129,7 @@ public interface ISelfStationService {
Result viewSpectrum(String fileName, HttpServletRequest request);
Result saveToDB(String fileName, HttpServletRequest request);
Result saveToDB(String fileName, String comment, HttpServletRequest request);
Result<?> viewARR(Integer sampleId, HttpServletResponse response);

View File

@ -40,10 +40,7 @@ import org.jeecg.modules.base.entity.rnman.GardsAnalySettingRoi;
import org.jeecg.modules.base.entity.rnman.GardsAnalysisRoi;
import org.jeecg.modules.base.entity.rnman.GardsAnalySetting;
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
import org.jeecg.modules.base.enums.CalName;
import org.jeecg.modules.base.enums.CalType;
import org.jeecg.modules.base.enums.DataTypeAbbr;
import org.jeecg.modules.base.enums.SampleFileHeader;
import org.jeecg.modules.base.enums.*;
import org.jeecg.modules.entity.*;
import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.exception.AnalyseException;
@ -2646,6 +2643,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
List<GardsXeResults> xeResults = Lists.newArrayList(betaResult);
betaDataFile.setXeDataList(xeResults);
betaDataFile.setXeResultsSpectrumList(betaResult);
result.setSuccess(true);
result.setResult(resultMap);
@ -5430,7 +5428,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
@Override
@Transactional
public Result saveToDB(String fileName, HttpServletRequest request) {
public Result saveToDB(String fileName, String comment, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
boolean bRet = false;
@ -5452,7 +5450,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
EnergySpectrumStruct detStruct = selfStationData.getDetStruct();
String siteCode = sampleStruct.site_code;
Integer stationId = spectrumAnalysisMapper.getStationId(siteCode);
Integer sampleId; Integer detId;
Integer sampleId = null; Integer detId = null;
//判断当前分析员当天是否有对应台站的排班任务
List<String> userStation = userTaskUtil.findUserStation(userName);
boolean bAnalysisResultWriteAuthority = userStation.contains(String.valueOf(stationId));
@ -5500,9 +5498,9 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
}
//处理文件名称
String sampleFilePathName = selfStationData.getSampleFilePathName();
String detFilePathName = selfStationData.getDetFilePathName();
String qcFilePathName = selfStationData.getQcFilePathName();
String sampleFilePathName = "";
String detFilePathName = "";
String qcFilePathName = "";
String sampleFileName = selfStationData.getSampleFileName();
String detFileName = selfStationData.getDetFileName();
@ -5513,13 +5511,13 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
String qcTmpPath = selfStationData.getQcTmpPath();
//根据sample文件名称模糊查询sampleId
if (StringUtils.isBlank(sampleFilePathName) && StringUtils.isNotBlank(sampleFileName)) {
if (StringUtils.isNotBlank(sampleFileName)) {
sampleFilePathName = phdFileUtil.NameStandardBy(sampleFileName, sampleStruct.system_type, sampleStruct.data_type);
}
if (StringUtils.isBlank(detFilePathName) && StringUtils.isNotBlank(detFileName)) {
if (StringUtils.isNotBlank(detFileName)) {
detFilePathName = phdFileUtil.NameStandardBy(detFileName, detStruct.system_type, detStruct.data_type);
}
if (StringUtils.isBlank(qcFilePathName) && StringUtils.isNotBlank(qcFileName)) {
if (StringUtils.isNotBlank(qcFileName)) {
qcFilePathName = phdFileUtil.NameStandardBy(qcFileName, qcStruct.system_type, qcStruct.data_type);
}
@ -5560,16 +5558,37 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
// 根据sampleId 查询idAnalysis
String idAnalysisStr = spectrumAnalysisMapper.getIdAnalysisByIdAnalyst(sampleId.toString(), userName);
Integer idAnalysis = StrUtil.isBlank(idAnalysisStr) ? null : Integer.valueOf(idAnalysisStr);
//如果分析过就修改原记录--GARDS_ANALYSES
GardsAnalysesSpectrum gardsAnalyses = new GardsAnalysesSpectrum();
gardsAnalyses.setSampleId(sampleId);
gardsAnalyses.setAnalysisBeginStr(phd.getAnaly_start_time());
gardsAnalyses.setAnalysisEndStr(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
gardsAnalyses.setType(AnalysesType.REVIEWED.value);
gardsAnalyses.setSoftware("BetaGammaAnalyser");
gardsAnalyses.setSwVersion("1.0.1");
gardsAnalyses.setCategory(1);
gardsAnalyses.setComments(StrUtil.isBlank(comment) ? "" : comment);
if (null != detId) {
gardsAnalyses.setUseddetphd(detFilePathName);
gardsAnalyses.setUseddetphdId(detId);
}
gardsAnalyses.setAnalyst(userName);
gardsAnalyses.setLogPath("");
gardsAnalyses.setReportPath("");
// 写入 RNMAN数据库
// 判断idAnalysis是否为空
if (ObjectUtil.isNull(idAnalysis)) {
// RNMAN.GARDS_ANALYSES 表插入数据
idAnalysis = analysesSpectrumService.saveAnalyses(sampleId, phd.getAnaly_start_time(), userName);
// idAnalysis = analysesSpectrumService.saveAnalyses(sampleId, phd.getAnaly_start_time(), userName);
spectrumAnalysisMapper.insertGardsAnalyses(gardsAnalyses);
GardsAnalysesSpectrum analysis = spectrumAnalysisMapper.getAnalysis("RNMAN.GARDS_ANALYSES", sampleId, userName);
idAnalysis = analysis.getIdAnalysis();
// 修改sample_data状态
spectrumAnalysisMapper.updateAnalysesStatus(sampleInputFileName);
} else {
// 更新 RNMAN.GARDS_ANALYSES 表数据
analysesSpectrumService.updateAnalyses(phd.getAnaly_start_time(), userName, idAnalysis);
spectrumAnalysisMapper.updateGardsAnalyses(gardsAnalyses);
// analysesSpectrumService.updateAnalyses(phd.getAnaly_start_time(), userName, idAnalysis);
// 删除 RNMAN.GARDS_ANALYSES_ROI 表数据
analysisManService.deleteAnalysisROI(idAnalysis);
// 删除GARDS_CALIBRATION_PAIRS_ROI表数据