fix(修改系统参数): #1007539 解决修改系统参数时报错的问题

解决修改系统参数时报错的问题
This commit is contained in:
song-tianyang 2021-10-27 22:48:51 +08:00 committed by BugKing
parent 5912500560
commit 4a18fee706
2 changed files with 9 additions and 8 deletions

View File

@ -382,9 +382,8 @@ public class ApiTestEnvironmentService {
private String getSystemIdByProjectId(String projectId){ private String getSystemIdByProjectId(String projectId){
ProjectService projectService = CommonBeanFactory.getBean(ProjectService.class); ProjectService projectService = CommonBeanFactory.getBean(ProjectService.class);
Project project = projectService.getProjectById(projectId);
if(projectService != null){ if(project != null){
Project project = projectService.getProjectById(projectId);
project = projectService.checkSystemId(project); project = projectService.checkSystemId(project);
return projectService.getSystemIdByProjectId(projectId); return projectService.getSystemIdByProjectId(projectId);
}else { }else {

View File

@ -412,11 +412,13 @@ public class ProjectService {
public Project getProjectById(String id) { public Project getProjectById(String id) {
Project project = projectMapper.selectByPrimaryKey(id); Project project = projectMapper.selectByPrimaryKey(id);
String createUser = project.getCreateUser(); if(project != null){
if (StringUtils.isNotBlank(createUser)) { String createUser = project.getCreateUser();
User user = userMapper.selectByPrimaryKey(createUser); if (StringUtils.isNotBlank(createUser)) {
if (user != null) { User user = userMapper.selectByPrimaryKey(createUser);
project.setCreateUser(user.getName()); if (user != null) {
project.setCreateUser(user.getName());
}
} }
} }
return project; return project;