refactor(系统设置): 组织列表查询成员添加排序
This commit is contained in:
parent
e02e799fc5
commit
1ec641ea0f
|
@ -11,6 +11,7 @@ import io.metersphere.sdk.log.constants.OperationLogType;
|
|||
import io.metersphere.sdk.util.PageUtils;
|
||||
import io.metersphere.sdk.util.Pager;
|
||||
import io.metersphere.sdk.util.SessionUtils;
|
||||
import io.metersphere.system.domain.User;
|
||||
import io.metersphere.system.dto.UserExtend;
|
||||
import io.metersphere.system.request.ProjectAddMemberBatchRequest;
|
||||
import io.metersphere.system.request.ProjectAddMemberRequest;
|
||||
|
@ -145,8 +146,8 @@ public class SystemProjectController {
|
|||
@GetMapping("/user-list")
|
||||
@Operation(summary = "系统-组织及项目, 获取管理员下拉选项")
|
||||
@RequiresPermissions(PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_READ)
|
||||
public List<OptionDTO> getUserList() {
|
||||
return userService.getMemberOption();
|
||||
public List<User> getUserList() {
|
||||
return userService.getUserList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,9 @@ import java.time.LocalDate;
|
|||
import java.time.ZoneId;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author song-cc-rock
|
||||
*/
|
||||
@Component
|
||||
public class CleanOrganizationJob {
|
||||
|
||||
|
@ -45,8 +48,6 @@ public class CleanOrganizationJob {
|
|||
return;
|
||||
}
|
||||
|
||||
organizations.forEach(organization -> {
|
||||
organizationService.deleteOrganization(organization.getId());
|
||||
});
|
||||
organizations.forEach(organization -> organizationService.deleteOrganization(organization.getId()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
order by u.update_time desc
|
||||
) temp
|
||||
group by temp.id
|
||||
order by adminFlag desc
|
||||
</select>
|
||||
|
||||
<select id="listMemberByOrg" resultType="io.metersphere.system.dto.OrgUserExtend">
|
||||
|
|
|
@ -123,11 +123,11 @@ public class OrganizationService {
|
|||
userRolePermissionExample.createCriteria().andRoleIdIn(roleIds);
|
||||
userRolePermissionMapper.deleteByExample(userRolePermissionExample);
|
||||
}
|
||||
|
||||
// 删除组织和插件的关联关系
|
||||
pluginOrganizationService.deleteByOrgId(organizationId);
|
||||
|
||||
// TODO: 删除环境组, 删除定时任务
|
||||
|
||||
// 删除组织
|
||||
organizationMapper.deleteByPrimaryKey(organizationId);
|
||||
// 操作记录
|
||||
|
|
|
@ -317,18 +317,6 @@ public class UserService {
|
|||
return extUserMapper.getMemberOption(sourceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统用户选项
|
||||
*
|
||||
* @return 系统用户选项
|
||||
*/
|
||||
public List<OptionDTO> getMemberOption() {
|
||||
UserExample example = new UserExample();
|
||||
example.setOrderByClause("update_time desc");
|
||||
List<User> users = userMapper.selectByExample(example);
|
||||
return users.stream().map(user -> new OptionDTO(user.getId(), user.getName())).toList();
|
||||
}
|
||||
|
||||
public TableBatchProcessResponse resetPassword(TableBatchProcessDTO request, String operator) {
|
||||
request.setSelectIds(this.getBatchUserIds(request));
|
||||
this.checkUserInDb(request.getSelectIds());
|
||||
|
|
Loading…
Reference in New Issue