1. 修复退火过程不显示样品的问题;

2. 试验暂存功能不判断状态和记录日志。
This commit is contained in:
dengchun
2025-05-03 22:41:20 +08:00
parent d68f865f5b
commit 66522363f3
2 changed files with 6 additions and 14 deletions

View File

@@ -183,23 +183,17 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
if (!StringUtils.startsWith(experimentNo, "KC")) { if (!StringUtils.startsWith(experimentNo, "KC")) {
return Result.error("实验编号格式不正确!"); return Result.error("实验编号格式不正确!");
} }
if (StringUtils.isNotBlank(experiment.getId())) { //0503: 暂存 去掉状态的判断
/*if (StringUtils.isNotBlank(experiment.getId())) {
Experiment dbExp = experimentService.getById(experiment.getId()); Experiment dbExp = experimentService.getById(experiment.getId());
if (!(StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING) || StringUtils.equals(dbExp.getStatus(), if (!(StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING) || StringUtils.equals(dbExp.getStatus(),
ExperimentStatus.PRE_TEST))) { ExperimentStatus.PRE_TEST))) {
return Result.error("实验状态不正确!"); return Result.error("实验状态不正确!");
} }
} }*/
experiment.setStatus(ExperimentStatus.STAGING); experiment.setStatus(ExperimentStatus.STAGING);
experimentService.saveWithDetail(experiment); experimentService.saveWithDetail(experiment);
ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experiment.getId());
experimentLog.setLogContent("暂存实验");
String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog);
return Result.OK("暂存成功!"); return Result.OK("暂存成功!");
} }

View File

@@ -82,19 +82,17 @@ public class ExperimentAnnealProcessServiceImpl extends ServiceImpl<ExperimentAn
@Override @Override
public void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess, String type) { public void saveWithDetails(ExperimentAnnealProcess experimentAnnealProcess, String type) {
// 保存样品信息 // 保存样品信息
// 20250502 - 邓春: 不修改前端 传过来的样品信息列表
/*
List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList(); List<ExperimentSampleInfo> sampleInfoList = experimentAnnealProcess.getSampleInfoList();
List<String> sampleInfoIds = new ArrayList<>(); List<String> sampleInfoIds = new ArrayList<>();
if (CollUtil.isNotEmpty(sampleInfoList)) { if (CollUtil.isNotEmpty(sampleInfoList)) {
for (ExperimentSampleInfo sampleInfo : sampleInfoList) { for (ExperimentSampleInfo sampleInfo : sampleInfoList) {
sampleInfo.setExperimentId(experimentAnnealProcess.getExperimentId()); // 20250502 - 邓春: 不修改前端 传过来的样品信息列表
experimentSampleInfoService.saveOrUpdate(sampleInfo); //sampleInfo.setExperimentId(experimentAnnealProcess.getExperimentId());
// experimentSampleInfoService.saveOrUpdate(sampleInfo);
sampleInfoIds.add(sampleInfo.getId()); sampleInfoIds.add(sampleInfo.getId());
} }
} }
experimentAnnealProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ",")); experimentAnnealProcess.setSampleInfo(StringUtils.join(sampleInfoIds, ","));
*/
// 保存偏置条件信息 // 保存偏置条件信息
// 20250502 - 邓春: 不修改前端 传过来的退火设备大字段 // 20250502 - 邓春: 不修改前端 传过来的退火设备大字段