fix:仿真策划版本记录
This commit is contained in:
@@ -2637,14 +2637,12 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
if (CollectionUtils.isNotEmpty(designVersions)) {
|
||||
// 根据最新版本升版
|
||||
SimulationDesignVersions latestVersion = designVersions.stream().sorted(Comparator.comparing(SimulationDesignVersions::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
|
||||
simulationDesignVersionsService.lambdaUpdate()
|
||||
.eq(SimulationDesignVersions::getProjectId, req.getProjectNodeId())
|
||||
.eq(SimulationDesignVersions::getPhaseId, req.getPhaseNodeId())
|
||||
.eq(SimulationDesignVersions::getCurrentVersion, latestVersion)
|
||||
.set(SimulationDesignVersions::getVersionContents, viewContents)
|
||||
.set(SimulationDesignVersions::getBeforeContents, beforeContents)
|
||||
.set(ObjectUtils.isNotEmpty(req.getCidFlowId()), SimulationDesignVersions::getCidFlowId, req.getCidFlowId())
|
||||
.update();
|
||||
SimulationDesignVersions newVersion = new SimulationDesignVersions();
|
||||
BeanUtils.copyProperties(latestVersion, newVersion);
|
||||
newVersion.setVersionContents(viewContents);
|
||||
newVersion.setBeforeContents(beforeContents);
|
||||
newVersion.setCidFlowId(ObjectUtils.isNotEmpty(req.getCidFlowId()) ? req.getCidFlowId() : latestVersion.getCidFlowId());
|
||||
simulationDesignVersionsService.updateById(newVersion);
|
||||
} else {
|
||||
addNewVersion(req.getProjectNodeId(), req.getPhaseNodeId(),"V1.0", viewContents, userId, req.getCidFlowId());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user