diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMemberMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMemberMapper.xml
index 97913694d4..0e722f32fc 100644
--- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMemberMapper.xml
+++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectMemberMapper.xml
@@ -14,7 +14,7 @@
- order by u.name
+ order by urr.create_time desc
diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml
index ab66126b06..200fc76fb1 100644
--- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml
+++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtProjectUserRoleMapper.xml
@@ -35,6 +35,7 @@
or u.phone like concat('%', #{request.keyword}, '%')
)
+ order by urr.create_time desc
diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectMemberService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectMemberService.java
index 3ed9e5d8f6..d7e30cd213 100644
--- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectMemberService.java
+++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectMemberService.java
@@ -71,6 +71,7 @@ public class ProjectMemberService {
UserRoleRelationExample relationExample = new UserRoleRelationExample();
relationExample.createCriteria().andSourceIdEqualTo(request.getProjectId()).andUserIdIn(members);
List userRoleRelates = userRoleRelationMapper.selectByExample(relationExample);
+ userRoleRelates.sort(Comparator.comparing(UserRoleRelation::getCreateTime).reversed());
Map> userRoleRelateMap = userRoleRelates.stream().collect(Collectors.groupingBy(UserRoleRelation::getUserId,
Collectors.mapping(UserRoleRelation::getRoleId, Collectors.toList())));
// 查询所有项目类型用户组
@@ -100,7 +101,6 @@ public class ProjectMemberService {
User user = userMap.get(projectUser.getId());
BeanUtils.copyBean(projectUser, user);
});
- projectUsers.sort(Comparator.comparing(ProjectUserDTO::getName));
return projectUsers;
}
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationProjectController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationProjectController.java
index f4961f6a9b..dd5b79d258 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationProjectController.java
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/OrganizationProjectController.java
@@ -121,8 +121,7 @@ public class OrganizationProjectController {
@RequiresPermissions(PermissionConstants.ORGANIZATION_PROJECT_READ)
@Operation(summary = "系统设置-组织-项目-成员列表")
public Pager> getProjectMember(@Validated @RequestBody ProjectMemberRequest request) {
- Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
- StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc");
+ Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize());
return PageUtils.setPageInfo(page, organizationProjectService.getProjectMember(request));
}
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemProjectController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemProjectController.java
index f76f87eb93..5fd0726238 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemProjectController.java
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/SystemProjectController.java
@@ -126,8 +126,7 @@ public class SystemProjectController {
@Operation(summary = "系统设置-系统-组织与项目-项目-成员列表")
@CheckOwner(resourceId = "#request.projectId", resourceType = "project")
public Pager> getProjectMember(@Validated @RequestBody ProjectMemberRequest request) {
- Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
- StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc");
+ Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize());
return PageUtils.setPageInfo(page, systemProjectService.getProjectMember(request));
}
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtOrganizationMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtOrganizationMapper.xml
index c7484aac95..5cd46e2ed6 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtOrganizationMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtOrganizationMapper.xml
@@ -57,9 +57,9 @@
- select temp.*, max(if(temp.role_id = 'org_admin', true, false)) as adminFlag
+ select temp.*, max(if(temp.role_id = 'org_admin', true, false)) as adminFlag, min(temp.memberTime) as groupTime
from (
- select u.*, urr.role_id
+ select u.*, urr.role_id, urr.create_time as memberTime
from user_role_relation urr
join `user` u on urr.user_id = u.id
@@ -71,10 +71,10 @@
and u.name like concat('%', #{request.keyword},'%')
- order by u.update_time desc
+ order by urr.create_time desc
) temp
group by temp.id
- order by adminFlag desc
+ order by adminFlag desc, groupTime desc
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtSystemProjectMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtSystemProjectMapper.xml
index e0b667b309..2a9084dd97 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtSystemProjectMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtSystemProjectMapper.xml
@@ -4,9 +4,9 @@
- SELECT temp.* , MAX( if (temp.role_id = 'project_admin', true, false)) as adminFlag
+ SELECT temp.* , MAX( if (temp.role_id = 'project_admin', true, false)) as adminFlag, MIN(temp.memberTime) as groupTime
FROM (
- SELECT `user`.* , user_role_relation.role_id
+ SELECT `user`.* , user_role_relation.role_id, user_role_relation.create_time as memberTime
FROM user_role_relation
LEFT JOIN `user` ON user_role_relation.user_id = `user`.id
@@ -20,7 +20,7 @@
or user.phone like CONCAT('%', #{request.keyword},'%'))
- ORDER BY `user`.update_time DESC) temp GROUP BY temp.id ORDER BY adminFlag DESC
+ ORDER BY `user_role_relation`.create_time DESC) temp GROUP BY temp.id ORDER BY adminFlag DESC, groupTime DESC
select p.id,
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml
index ab28b69184..24e545e95b 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml
@@ -25,5 +25,6 @@
or u.phone like concat('%', #{request.keyword}, '%')
)
+ order by urr.create_time desc
\ No newline at end of file
diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleRelationMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleRelationMapper.xml
index 0a282a3bed..6c8c895ede 100644
--- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleRelationMapper.xml
+++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleRelationMapper.xml
@@ -35,5 +35,6 @@
or u.email like concat('%', #{request.keyword},'%')
)
+ order by urr.create_time desc
\ No newline at end of file