fix: 用户下拉列表

This commit is contained in:
shiziyuan9527 2021-05-27 18:40:40 +08:00 committed by 刘瑞斌
parent a5a2b0b473
commit c1b6e40d6b
27 changed files with 98 additions and 42 deletions

View File

@ -49,10 +49,10 @@ public class ApiTestEnvironmentController {
*/
@PostMapping("/list/{goPage}/{pageSize}")
public Pager<List<ApiTestEnvironmentWithBLOBs>> listByCondition(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody EnvironmentRequest environmentRequest) {
List<String> projectIds = environmentRequest.getProjectIds();
for (String projectId : projectIds) {
checkPermissionService.checkProjectOwner(projectId);
}
// List<String> projectIds = environmentRequest.getProjectIds();
// for (String projectId : projectIds) {
// checkPermissionService.checkProjectOwner(projectId);
// }
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, apiTestEnvironmentService.listByConditions(environmentRequest));
}

View File

@ -278,11 +278,11 @@ public class UserController {
}
/**
* 组织成员列表不分页
* 组织下所有相关人员
*/
@PostMapping("/org/member/list/all")
public List<User> getOrgMemberList(@RequestBody QueryOrgMemberRequest request) {
return userService.getOrgMemberList(request);
return userService.getOrgAllMember(request);
}
@GetMapping("/besideorg/list/{orgId}")
@ -314,6 +314,11 @@ public class UserController {
return userService.getTestManagerAndTestUserList(request);
}
@PostMapping("/project/member/tester/list")
public List<User> getProjectMember(@RequestBody QueryMemberRequest request) {
return userService.getProjectMember(request);
}
@GetMapping("/search/{condition}")
public List<User> searchUser(@PathVariable String condition) {
return userService.searchUser(condition);

View File

@ -1307,4 +1307,48 @@ public class UserService {
userGroupMapper.deleteByExample(userGroupExample);
}
public List<User> getProjectMember(QueryMemberRequest request) {
String projectId = request.getProjectId();
if (StringUtils.isBlank(projectId)) {
return new ArrayList<>();
}
return extUserGroupMapper.getProjectMemberList(request);
}
public List<User> getOrgAllMember(QueryOrgMemberRequest request) {
String orgId = request.getOrganizationId();
if (StringUtils.isBlank(orgId)) {
return new ArrayList<>();
}
List<String> sourceIds = new ArrayList<>();
sourceIds.add(orgId);
WorkspaceExample workspaceExample = new WorkspaceExample();
workspaceExample.createCriteria().andOrganizationIdEqualTo(orgId);
List<Workspace> workspaces = workspaceMapper.selectByExample(workspaceExample);
if (CollectionUtils.isNotEmpty(workspaces)) {
List<String> wsIds = workspaces.stream().map(Workspace::getId).collect(Collectors.toList());
sourceIds.addAll(wsIds);
ProjectExample projectExample = new ProjectExample();
projectExample.createCriteria().andWorkspaceIdIn(wsIds);
List<Project> projectList = projectMapper.selectByExample(projectExample);
if (CollectionUtils.isNotEmpty(projectList)) {
List<String> proIds = projectList.stream().map(Project::getId).collect(Collectors.toList());
sourceIds.addAll(proIds);
}
}
UserGroupExample userGroupExample = new UserGroupExample();
userGroupExample.createCriteria().andSourceIdIn(sourceIds);
List<UserGroup> userGroups = userGroupMapper.selectByExample(userGroupExample);
List<String> userIds = userGroups.stream().map(UserGroup::getUserId).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(userIds)) {
return new ArrayList<>();
}
UserExample userExample = new UserExample();
userExample.createCriteria().andIdIn(userIds);
return userMapper.selectByExample(userExample);
}
}

View File

@ -58,7 +58,7 @@
<script>
import {WORKSPACE_ID} from '@/common/js/constants';
import {getCurrentUser, getUUID} from "@/common/js/utils";
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {saveScenario} from "@/business/components/api/automation/api-automation";
@ -126,7 +126,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.userOptions = response.data;
});
},

View File

@ -188,7 +188,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../common/components/MsTag";
import {downloadFile, getUUID, strMapToObj} from "@/common/js/utils";
import {downloadFile, getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../report/ApiReportDetail";
import MsTableMoreBtn from "./TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@ -588,7 +588,7 @@ export default {
},
getPrincipalOptions(option) {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
option.push(...response.data);
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};

View File

@ -253,7 +253,7 @@
import {parseEnvironment} from "../../definition/model/EnvironmentModel";
import {ELEMENT_TYPE, ELEMENTS} from "./Setting";
import MsApiCustomize from "./ApiCustomize";
import {getUUID, objToStrMap, strMapToObj, handleCtrlSEvent} from "@/common/js/utils";
import {getUUID, objToStrMap, strMapToObj, handleCtrlSEvent, getCurrentProjectID} from "@/common/js/utils";
import ApiEnvironmentConfig from "@/business/components/api/test/components/ApiEnvironmentConfig";
import MsInputTag from "./MsInputTag";
import MsRun from "./DebugRun";
@ -784,7 +784,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.maintainerOptions = response.data;
});
},

View File

@ -240,7 +240,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.maintainerOptions = response.data;
});
},

View File

@ -171,6 +171,7 @@
import TableSelectCountBar from "./TableSelectCountBar";
import {_filter, _handleSelect, _handleSelectAll, _sort, buildBatchParam, getLabel,} from "@/common/js/tableUtils";
import {API_LIST, WORKSPACE_ID} from "@/common/js/constants";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "RelevanceApiList",
@ -406,7 +407,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.valueArr.userId = response.data;
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};

View File

@ -32,7 +32,7 @@
import MsEditCompleteSqlApi from "./complete/EditCompleteSQLApi";
import {Body} from "../model/ApiTestModel";
import {getUUID} from "@/common/js/utils";
import {getCurrentProjectID, getUUID} from "@/common/js/utils";
import {createComponent, Request} from "./jmeter/components";
import Sampler from "./jmeter/components/sampler/sampler";
import {WORKSPACE_ID} from '@/common/js/constants';
@ -117,7 +117,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -59,7 +59,7 @@
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import {REQ_METHOD} from "../../model/JsonData";
import {getCurrentUser} from "../../../../../../common/js/utils";
import {getCurrentProjectID, getCurrentUser} from "../../../../../../common/js/utils";
import {createComponent, Request} from "../jmeter/components";
export default {
@ -179,7 +179,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -64,6 +64,7 @@
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
import MsSelectTree from "../../../../common/select-tree/SelectTree";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "MsBasisApi",
@ -107,7 +108,7 @@
methods: {
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.maintainerOptions = response.data;
});
},

View File

@ -128,6 +128,7 @@
import MsJsr233Processor from "../../../automation/scenario/component/Jsr233Processor";
import MsSelectTree from "../../../../common/select-tree/SelectTree";
import MsChangeHistory from "../../../../history/ChangeHistory";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "MsAddCompleteHttpApi",
@ -246,7 +247,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -85,6 +85,7 @@
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
import MsSelectTree from "../../../../common/select-tree/SelectTree";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "MsTcpBasicApi",
@ -133,7 +134,7 @@
methods: {
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -182,7 +182,7 @@ import MsBottomContainer from "../BottomContainer";
import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn";
import MsBatchEdit from "../basis/BatchEdit";
import {API_METHOD_COLOUR, API_STATUS, DUBBO_METHOD, REQ_METHOD, SQL_METHOD, TCP_METHOD} from "../../model/JsonData";
import {downloadFile} from "@/common/js/utils";
import {downloadFile, getCurrentProjectID} from "@/common/js/utils";
import {API_LIST, PROJECT_NAME, WORKSPACE_ID} from '@/common/js/constants';
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus";
@ -557,7 +557,7 @@ export default {
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.valueArr.userId = response.data;
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};

View File

@ -172,7 +172,7 @@ export default {
methods: {
getMaintainerOptions() {
let workspaceId = getCurrentWorkspaceId();
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});

View File

@ -237,7 +237,7 @@ export default {
methods: {
getMaintainerOptions() {
let workspaceId = getCurrentWorkspaceId();
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});

View File

@ -365,7 +365,7 @@ export default {
methods: {
getMaintainerOptions() {
let workspaceId = getCurrentWorkspaceId();
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};
});

View File

@ -90,7 +90,7 @@
<script>
import MsTableColumn from "@/business/components/common/components/table/Ms-table-column";
import {getCurrentWorkspaceId} from "@/common/js/utils";
import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils";
export default {
name: "CustomFiledComponent",
components: {MsTableColumn},
@ -107,7 +107,7 @@ export default {
},
mounted() {
if (this.data.type === 'member' || this.data.type === 'multipleMember') {
this.$post('/user/ws/member/tester/list', {workspaceId: getCurrentWorkspaceId()}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.memberOptions = response.data;
});
}

View File

@ -58,7 +58,7 @@
</template>
<script>
import {getCurrentUser} from "@/common/js/utils";
import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
import {WORKSPACE_ID} from "@/common/js/constants";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
@ -152,7 +152,7 @@ export default {
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.userOptions = response.data;
});
},

View File

@ -122,6 +122,7 @@
import {TokenKey, WORKSPACE_ID} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter'
import {
getCurrentProjectID,
getCurrentUser,
getNodePath,
handleCtrlSEvent, hasPermission,
@ -700,7 +701,7 @@
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.maintainerOptions = response.data;
});
},

View File

@ -199,6 +199,7 @@ import {Track_Test_Case} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import PlanStatusTableItem from "@/business/components/track/common/tableItems/plan/PlanStatusTableItem";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestCaseList",
@ -648,7 +649,7 @@ export default {
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.valueArr.maintainer = response.data;
});
},

View File

@ -125,7 +125,7 @@
import {WORKSPACE_ID} from '@/common/js/constants';
import TestPlanStatusButton from "../common/TestPlanStatusButton";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
export default {
@ -249,7 +249,7 @@ export default {
},
setPrincipalOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.principalOptions = response.data;
});
},

View File

@ -20,6 +20,7 @@
<script>
import {WORKSPACE_ID} from '../../../../../../common/js/constants'
import MsDialogFooter from '../../../../common/components/MsDialogFooter'
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "executorEdit",
@ -39,7 +40,7 @@
methods: {
setMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId:workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.executorOptions = response.data;
});
},

View File

@ -168,7 +168,7 @@ import MsBottomContainer from "../../../../../api/definition/components/BottomCo
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
import BatchEdit from "@/business/components/track/case/components/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData";
import {strMapToObj} from "@/common/js/utils";
import {getCurrentProjectID, strMapToObj} from "@/common/js/utils";
import ApiListContainer from "../../../../../api/definition/components/list/ApiListContainer";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import {getBodyUploadFiles, getUUID} from "../../../../../../../common/js/utils";
@ -342,7 +342,7 @@ export default {
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.valueArr.userId = response.data;
this.userFilters = response.data.map(u => {
return {text: u.name, value: u.id};

View File

@ -266,7 +266,7 @@ import {
TokenKey,
WORKSPACE_ID
} from "@/common/js/constants";
import {hasPermission} from "@/common/js/utils";
import {getCurrentProjectID, hasPermission} from "@/common/js/utils";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import StatusTableItem from "../../../../common/tableItems/planview/StatusTableItem";
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
@ -682,7 +682,7 @@ export default {
},
getMaintainerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.valueArr.executor = response.data;
this.executorFilters = response.data.map(u => {
return {text: u.name, value: u.id};

View File

@ -102,7 +102,7 @@
import TestPlanStatusButton from "../../plan/common/TestPlanStatusButton";
import {WORKSPACE_ID} from "@/common/js/constants";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
export default {
@ -233,7 +233,7 @@ export default {
},
setReviewerOptions() {
let workspaceId = localStorage.getItem(WORKSPACE_ID);
this.result = this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
this.result = this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.reviewerOptions = response.data;
});
},

@ -1 +1 @@
Subproject commit 0af67efb336b3f5f6718c7b2684de4d4985c0aee
Subproject commit 526400764fc45b12dd81f5b89137f8bc5a012f4d