This commit is contained in:
ls
2025-02-23 21:59:07 +08:00
parent 891a9398c2
commit 42f1eae4e8

View File

@@ -319,11 +319,12 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
if (oConvertUtils.isEmpty(username)) { if (oConvertUtils.isEmpty(username)) {
return Result.error("用户未登录!"); return Result.error("用户未登录!");
} }
Experiment experiment = experimentService.getById(experimentReport.getExperimentId()); String reportId = experimentReport.getId();
ExperimentReport report = experimentReportService.getById(reportId);
Experiment experiment = experimentService.getById(report.getExperimentId());
if (!(StringUtils.equals(experimentReport.getCreateBy(), username) || StringUtils.equals(experiment.getCreateBy(), username))) { if (!(StringUtils.equals(experimentReport.getCreateBy(), username) || StringUtils.equals(experiment.getCreateBy(), username))) {
return Result.error("您无权进行撤回!"); return Result.error("您无权进行撤回!");
} }
ExperimentReport report = experimentReportService.getById(experimentReport.getId());
report.setStatus(ExperimentReportStatus.INIT); report.setStatus(ExperimentReportStatus.INIT);
experimentReportService.updateById(report); experimentReportService.updateById(report);
return Result.OK("撤回成功!"); return Result.OK("撤回成功!");