diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml index 7a1e2cfbb4..5c67c15487 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml @@ -28,7 +28,7 @@ and test_case.name like CONCAT('%', #{request.name},'%') - and test_plan_test_case.node_id in + and test_case.node_id in #{nodeId} diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index 3c4f7e7182..3c6d2153db 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -53,7 +53,7 @@ public class WorkspaceController { @PostMapping("special/update") @RequiresRoles(RoleConstants.ADMIN) public void updateWorkspaceByAdmin(@RequestBody Workspace workspace) { - workspaceService.updateWorkspacebyAdmin(workspace); + workspaceService.updateWorkspaceByAdmin(workspace); } @GetMapping("special/delete/{workspaceId}") diff --git a/backend/src/main/java/io/metersphere/service/OrganizationService.java b/backend/src/main/java/io/metersphere/service/OrganizationService.java index c54b4860d1..be619c75bb 100644 --- a/backend/src/main/java/io/metersphere/service/OrganizationService.java +++ b/backend/src/main/java/io/metersphere/service/OrganizationService.java @@ -109,12 +109,8 @@ public class OrganizationService { } public void updateOrgMember(OrganizationMemberDTO memberDTO) { - User user = new User(); - BeanUtils.copyProperties(memberDTO, user); - userMapper.updateByPrimaryKeySelective(user); - // String orgId = memberDTO.getOrganizationId(); - String userId = user.getId(); + String userId = memberDTO.getId(); // 已有角色 List memberRoles = extUserRoleMapper.getOrganizationMemberRoles(orgId, userId); // 修改后的角色 diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index e883d48ea2..18d03b6dd0 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -52,9 +52,10 @@ public class UserService { String id = user.getId(); User user1 = userMapper.selectByPrimaryKey(id); if (user1 != null) { - MSException.throwException("user_id_already_exists"); + MSException.throwException(Translator.get("user_id_already_exists")); + }else{ + createUser(user); } - createUser(user); return getUserDTO(user.getId()); } @@ -299,7 +300,7 @@ public class UserService { return user; } } - MSException.throwException("password_modification_failed"); + MSException.throwException(Translator.get("password_modification_failed")); } return null; } diff --git a/backend/src/main/java/io/metersphere/service/WorkspaceService.java b/backend/src/main/java/io/metersphere/service/WorkspaceService.java index a17cfd8855..69e0e32e47 100644 --- a/backend/src/main/java/io/metersphere/service/WorkspaceService.java +++ b/backend/src/main/java/io/metersphere/service/WorkspaceService.java @@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; + import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -200,12 +201,8 @@ public class WorkspaceService { } public void updateWorkspaceMember(WorkspaceMemberDTO memberDTO) { - User user = new User(); - BeanUtils.copyProperties(memberDTO, user); - userMapper.updateByPrimaryKeySelective(user); - // String workspaceId = memberDTO.getWorkspaceId(); - String userId = user.getId(); + String userId = memberDTO.getId(); // 已有角色 List memberRoles = extUserRoleMapper.getWorkspaceMemberRoles(workspaceId, userId); // 修改后的角色 @@ -234,11 +231,11 @@ public class WorkspaceService { } } - public Integer checkSourceRole(String orgId, String userId, String roleId) { - return extOrganizationMapper.checkSourceRole(orgId, userId, roleId); + public Integer checkSourceRole(String workspaceId, String userId, String roleId) { + return extOrganizationMapper.checkSourceRole(workspaceId, userId, roleId); } - public void updateWorkspacebyAdmin(Workspace workspace) { + public void updateWorkspaceByAdmin(Workspace workspace) { workspace.setCreateTime(null); workspace.setUpdateTime(System.currentTimeMillis()); workspaceMapper.updateByPrimaryKeySelective(workspace);