fix: 更新场景时,创建人保持不变

This commit is contained in:
wenyann 2021-05-11 14:41:52 +08:00 committed by 刘瑞斌
parent a9262201bc
commit 7345c0546a
1 changed files with 6 additions and 1 deletions

View File

@ -320,7 +320,12 @@ public class ApiAutomationService {
} else {
scenario.setStatus(ScenarioStatus.Underway.name());
}
scenario.setUserId(SessionUtils.getUserId());
if (StringUtils.isNotEmpty(request.getUserId())) {
scenario.setUserId(request.getUserId());
} else {
scenario.setUserId(SessionUtils.getUserId());
}
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || "default-module".equals(request.getApiScenarioModuleId())) {
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
example.createCriteria().andProjectIdEqualTo(request.getProjectId()).andNameEqualTo("默认模块");