fix(项目报告): 修复创建项目报告选择用户组时查询出了所有系统用户的问题
--bug=1014134 --user=宋天阳 【项目报告】在创建项目报告时,收件人选择“项目管理员”角色时,人员为非指定项目的管理员也包含进来了。 https://www.tapd.cn/55049933/s/1186568
This commit is contained in:
parent
66a5ada1b6
commit
053a1229e0
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
public interface ExtUserGroupMapper {
|
public interface ExtUserGroupMapper {
|
||||||
|
|
||||||
List<UserGroupDTO> getUserGroup(@Param("userId") String userId , @Param("projectId") String projectId);
|
List<UserGroupDTO> getUserGroup(@Param("userId") String userId, @Param("projectId") String projectId);
|
||||||
|
|
||||||
List<Group> getWorkspaceMemberGroups(@Param("workspaceId") String workspaceId, @Param("userId") String userId);
|
List<Group> getWorkspaceMemberGroups(@Param("workspaceId") String workspaceId, @Param("userId") String userId);
|
||||||
|
|
||||||
|
@ -21,15 +21,15 @@ public interface ExtUserGroupMapper {
|
||||||
|
|
||||||
List<User> getProjectMemberList(@Param("request") QueryMemberRequest request);
|
List<User> getProjectMemberList(@Param("request") QueryMemberRequest request);
|
||||||
|
|
||||||
List<Group> getProjectMemberGroups(@Param("projectId") String projectId,@Param("userId") String userId);
|
List<Group> getProjectMemberGroups(@Param("projectId") String projectId, @Param("userId") String userId);
|
||||||
|
|
||||||
List<RelatedSource> getRelatedSource(@Param("userId") String userId);
|
List<RelatedSource> getRelatedSource(@Param("userId") String userId);
|
||||||
|
|
||||||
List<User> getGroupUser(@Param("request")EditGroupRequest request);
|
List<User> getGroupUser(@Param("request") EditGroupRequest request);
|
||||||
|
|
||||||
int checkSourceRole(@Param("sourceId") String sourceId, @Param("userId") String userId, @Param("groupId") String groupId);
|
int checkSourceRole(@Param("sourceId") String sourceId, @Param("userId") String userId, @Param("groupId") String groupId);
|
||||||
|
|
||||||
List<UserGroupInfoDTO> getUserGroupInfo();
|
List<UserGroupInfoDTO> getUserGroupInfoByProjectId(String projectId);
|
||||||
|
|
||||||
List<User> getProjectMemberOption(@Param("projectId") String projectId);
|
List<User> getProjectMemberOption(@Param("projectId") String projectId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
from workspace w
|
from workspace w
|
||||||
join user_group ur on w.id = ur.source_id
|
join user_group ur on w.id = ur.source_id
|
||||||
join `group` r on r.id = ur.group_id
|
join `group` r on r.id = ur.group_id
|
||||||
where w.id = #{workspaceId} and ur.user_id = #{userId}
|
where w.id = #{workspaceId}
|
||||||
|
and ur.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getMemberList" resultType="io.metersphere.base.domain.User">
|
<select id="getMemberList" resultType="io.metersphere.base.domain.User">
|
||||||
SELECT DISTINCT * FROM (
|
SELECT DISTINCT * FROM (
|
||||||
|
@ -29,17 +30,21 @@
|
||||||
order by user_group.update_time desc) temp
|
order by user_group.update_time desc) temp
|
||||||
</select>
|
</select>
|
||||||
<select id="getProjectMemberList" resultType="io.metersphere.base.domain.User">
|
<select id="getProjectMemberList" resultType="io.metersphere.base.domain.User">
|
||||||
SELECT DISTINCT * FROM (
|
SELECT DISTINCT *
|
||||||
SELECT `user`.* FROM user_group JOIN `user` ON user_group.user_id = `user`.id
|
FROM (
|
||||||
WHERE user_group.source_id = #{request.projectId}
|
SELECT `user`.*
|
||||||
order by `user`.update_time desc) temp
|
FROM user_group
|
||||||
|
JOIN `user` ON user_group.user_id = `user`.id
|
||||||
|
WHERE user_group.source_id = #{request.projectId}
|
||||||
|
order by `user`.update_time desc) temp
|
||||||
</select>
|
</select>
|
||||||
<select id="getProjectMemberGroups" resultType="io.metersphere.base.domain.Group">
|
<select id="getProjectMemberGroups" resultType="io.metersphere.base.domain.Group">
|
||||||
select r.id, r.name
|
select r.id, r.name
|
||||||
from project p
|
from project p
|
||||||
join user_group ur on p.id = ur.source_id
|
join user_group ur on p.id = ur.source_id
|
||||||
join `group` r on r.id = ur.group_id
|
join `group` r on r.id = ur.group_id
|
||||||
where p.id = #{projectId} and ur.user_id = #{userId}
|
where p.id = #{projectId}
|
||||||
|
and ur.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getRelatedSource" resultType="io.metersphere.dto.RelatedSource">
|
<select id="getRelatedSource" resultType="io.metersphere.dto.RelatedSource">
|
||||||
SELECT workspace_id, project.id
|
SELECT workspace_id, project.id
|
||||||
|
@ -48,15 +53,15 @@
|
||||||
JOIN workspace w ON project.workspace_id = w.id
|
JOIN workspace w ON project.workspace_id = w.id
|
||||||
WHERE user_id = #{userId} -- project_admin project_member read_only bb
|
WHERE user_id = #{userId} -- project_admin project_member read_only bb
|
||||||
UNION
|
UNION
|
||||||
SELECT w.id, ''
|
SELECT w.id, ''
|
||||||
FROM user_group
|
FROM user_group
|
||||||
JOIN workspace w ON user_group.source_id = w.id
|
JOIN workspace w ON user_group.source_id = w.id
|
||||||
WHERE user_id = #{userId} -- workspace_admin workspace_member ccc
|
WHERE user_id = #{userId} -- workspace_admin workspace_member ccc
|
||||||
</select>
|
</select>
|
||||||
<select id="getGroupUser" resultType="io.metersphere.base.domain.User">
|
<select id="getGroupUser" resultType="io.metersphere.base.domain.User">
|
||||||
select distinct user.id, user.name, user.email, user.phone, user.create_time
|
select distinct user.id, user.name, user.email, user.phone, user.create_time
|
||||||
from user join user_group ug on user.id = ug.user_id
|
from user join user_group ug on user.id = ug.user_id
|
||||||
where ug.group_id = #{request.userGroupId}
|
where ug.group_id = #{request.userGroupId}
|
||||||
<if test="request.name != null and request.name !=''">
|
<if test="request.name != null and request.name !=''">
|
||||||
and user.name like concat('%', #{request.name},'%')
|
and user.name like concat('%', #{request.name},'%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -70,21 +75,32 @@
|
||||||
SELECT COUNT(id)
|
SELECT COUNT(id)
|
||||||
FROM user_group ug
|
FROM user_group ug
|
||||||
WHERE ug.user_id = #{userId}
|
WHERE ug.user_id = #{userId}
|
||||||
AND ug.source_id = #{sourceId}
|
AND ug.source_id = #{sourceId}
|
||||||
AND ug.group_id = #{groupId}
|
AND ug.group_id = #{groupId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUserGroupInfo" resultType="io.metersphere.dto.UserGroupInfoDTO">
|
<select id="getUserGroupInfoByProjectId" resultType="io.metersphere.dto.UserGroupInfoDTO">
|
||||||
select distinct user.id AS userId, user.name AS userName, user.email AS userEmail, g.`name` AS groupName, g.id AS groupId
|
select distinct user.id AS userId,
|
||||||
from user INNER JOIN user_group ug on user.id = ug.user_id
|
user.name AS userName,
|
||||||
INNER JOIN `group` g ON ug.group_id = g.id
|
user.email AS userEmail,
|
||||||
order by ug.create_time ASC;
|
ug.source_id AS sourceId,
|
||||||
|
g.`name` AS groupName,
|
||||||
|
g.id AS groupId
|
||||||
|
from user
|
||||||
|
INNER JOIN user_group ug on user.id = ug.user_id
|
||||||
|
INNER JOIN `group` g ON ug.group_id = g.id
|
||||||
|
WHERE g.type = 'PROJECT'
|
||||||
|
AND ug.source_id = #{0}
|
||||||
|
order by g.create_time ASC;
|
||||||
</select>
|
</select>
|
||||||
<select id="getProjectMemberOption" resultType="io.metersphere.base.domain.User">
|
<select id="getProjectMemberOption" resultType="io.metersphere.base.domain.User">
|
||||||
SELECT DISTINCT * FROM (
|
SELECT DISTINCT *
|
||||||
SELECT u.id, u.name, u.email FROM user_group JOIN `user` u ON user_group.user_id = u.id
|
FROM (
|
||||||
WHERE user_group.source_id = #{projectId}
|
SELECT u.id, u.name, u.email
|
||||||
order by user_group.update_time desc
|
FROM user_group
|
||||||
) temp
|
JOIN `user` u ON user_group.user_id = u.id
|
||||||
|
WHERE user_group.source_id = #{projectId}
|
||||||
|
order by user_group.update_time desc
|
||||||
|
) temp
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -11,4 +11,5 @@ public class UserGroupInfoDTO {
|
||||||
private String userEmail;
|
private String userEmail;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
private String groupName;
|
private String groupName;
|
||||||
|
private String sourceId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="el-input-tag input-tag-wrapper"
|
class="el-input-tag input-tag-wrapper"
|
||||||
:class="[size ? 'el-input-tag--' + size : '']"
|
:class="[size ? 'el-input-tag--' + size : '']"
|
||||||
style="height: auto"
|
style="height: auto"
|
||||||
@click="foucusTagInput">
|
@click="foucusTagInput">
|
||||||
|
|
||||||
<el-tag
|
<el-tag
|
||||||
class="ms-top"
|
class="ms-top"
|
||||||
v-for="(tag, idx) in innerTags"
|
v-for="(tag, idx) in innerTags"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
type="info"
|
type="info"
|
||||||
:key="tag"
|
:key="tag"
|
||||||
:size="size"
|
:size="size"
|
||||||
:closable="!readOnly"
|
:closable="!readOnly"
|
||||||
:disable-transitions="false"
|
:disable-transitions="false"
|
||||||
@close="remove(idx)">
|
@close="remove(idx)">
|
||||||
{{ tag && tag.length > 10 ? tag.substring(0, 10) + "..." : tag }}
|
{{ tag && tag.length > 10 ? tag.substring(0, 10) + "..." : tag }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<input
|
<input
|
||||||
:disabled="readOnly"
|
:disabled="readOnly"
|
||||||
class="tag-input el-input"
|
class="tag-input el-input"
|
||||||
v-model="newTag"
|
v-model="newTag"
|
||||||
:placeholder=defaultPlaceHolder
|
:placeholder=defaultPlaceHolder
|
||||||
@keydown.delete.stop="removeLastTag"
|
@keydown.delete.stop="removeLastTag"
|
||||||
@keydown="addNew"
|
@keydown="addNew"
|
||||||
@blur="addNew"/>
|
@blur="addNew"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ export default {
|
||||||
this.currentScenario[this.prop] = this.innerTags;
|
this.currentScenario[this.prop] = this.innerTags;
|
||||||
},
|
},
|
||||||
'currentScenario.tags'() {
|
'currentScenario.tags'() {
|
||||||
if(this.prop==='tags'){
|
if (this.prop === 'tags') {
|
||||||
if(!this.currentScenario[this.prop]||this.currentScenario[this.prop]===''||this.currentScenario[this.prop].length===0){
|
if (!this.currentScenario[this.prop] || this.currentScenario[this.prop] === '' || this.currentScenario[this.prop].length === 0) {
|
||||||
if(this.innerTags.length!==0){
|
if (this.innerTags.length !== 0) {
|
||||||
this.innerTags=[];
|
this.innerTags = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addNew(e) {
|
addNew(e) {
|
||||||
|
this.$emit("onblur");
|
||||||
if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
|
if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -125,8 +126,12 @@ export default {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
remove(index) {
|
remove(index) {
|
||||||
this.innerTags.splice(index, 1)
|
this.innerTags.splice(index, 1);
|
||||||
this.tagChange()
|
this.tagChange();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
//删除tag元素操作是在输入框中去掉元素,也应当触发onblur操作
|
||||||
|
this.$emit("onblur");
|
||||||
|
});
|
||||||
},
|
},
|
||||||
removeLastTag() {
|
removeLastTag() {
|
||||||
if (this.newTag) {
|
if (this.newTag) {
|
||||||
|
|
|
@ -2797,6 +2797,8 @@ export default {
|
||||||
mail_subject: "Subject ",
|
mail_subject: "Subject ",
|
||||||
mail_addressee: "To ",
|
mail_addressee: "To ",
|
||||||
mail_duplicate: "Cc ",
|
mail_duplicate: "Cc ",
|
||||||
|
enter_mail_addressee: "Enter to add email",
|
||||||
|
enter_mail_duplicate: "Enter to add email",
|
||||||
},
|
},
|
||||||
notice: {
|
notice: {
|
||||||
operation: {
|
operation: {
|
||||||
|
@ -3189,7 +3191,7 @@ export default {
|
||||||
error_report_library: {
|
error_report_library: {
|
||||||
name: "Error report",
|
name: "Error report",
|
||||||
assertion: "Error code assertion",
|
assertion: "Error code assertion",
|
||||||
tips:"Tips: Use error report in \"Project Settings - Project environment-Assertions\"",
|
tips: "Tips: Use error report in \"Project Settings - Project environment-Assertions\"",
|
||||||
use_error_report: "Use error code",
|
use_error_report: "Use error code",
|
||||||
use_desc: "In case of conflict between error code and error assertions, it is treated as error code",
|
use_desc: "In case of conflict between error code and error assertions, it is treated as error code",
|
||||||
conflict_with_success: "If request has error report and success assertion:",
|
conflict_with_success: "If request has error report and success assertion:",
|
||||||
|
|
|
@ -2806,6 +2806,8 @@ export default {
|
||||||
mail_subject: "邮件主题",
|
mail_subject: "邮件主题",
|
||||||
mail_addressee: "收件人",
|
mail_addressee: "收件人",
|
||||||
mail_duplicate: "抄送人",
|
mail_duplicate: "抄送人",
|
||||||
|
enter_mail_addressee: "输入回车添加邮箱",
|
||||||
|
enter_mail_duplicate: "输入回车添加邮箱",
|
||||||
},
|
},
|
||||||
notice: {
|
notice: {
|
||||||
operation: {
|
operation: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export default {
|
export default {
|
||||||
commons: {
|
commons: {
|
||||||
project_permission: '請先添加該項目權限',
|
project_permission: '請先添加該項目權限',
|
||||||
no_permission:'暫無權限',
|
no_permission: '暫無權限',
|
||||||
failure_continues: "失敗繼續",
|
failure_continues: "失敗繼續",
|
||||||
full_screen_editing: "全屏編輯",
|
full_screen_editing: "全屏編輯",
|
||||||
trash: "回收站",
|
trash: "回收站",
|
||||||
|
@ -51,7 +51,7 @@ export default {
|
||||||
project: '項目',
|
project: '項目',
|
||||||
about_us: '關於',
|
about_us: '關於',
|
||||||
current_project: '當前項目',
|
current_project: '當前項目',
|
||||||
not_exist:"不存在",
|
not_exist: "不存在",
|
||||||
name: '名稱',
|
name: '名稱',
|
||||||
description: '描述',
|
description: '描述',
|
||||||
annotation: '註釋',
|
annotation: '註釋',
|
||||||
|
@ -252,8 +252,8 @@ export default {
|
||||||
cancel_follow_success: "取消關註成功",
|
cancel_follow_success: "取消關註成功",
|
||||||
type: "類型",
|
type: "類型",
|
||||||
type_of_integer: "請輸入整數類型",
|
type_of_integer: "請輸入整數類型",
|
||||||
type_of_num:"請輸入數字類型",
|
type_of_num: "請輸入數字類型",
|
||||||
validity_period:'有效期',
|
validity_period: '有效期',
|
||||||
please_select_a_deadline: "請選擇截止時間",
|
please_select_a_deadline: "請選擇截止時間",
|
||||||
relationship: {
|
relationship: {
|
||||||
name: '依賴關系',
|
name: '依賴關系',
|
||||||
|
@ -1193,14 +1193,14 @@ export default {
|
||||||
rule: {
|
rule: {
|
||||||
input_code: "請輸入 HTTP Code"
|
input_code: "請輸入 HTTP Code"
|
||||||
},
|
},
|
||||||
range_type:{
|
range_type: {
|
||||||
value_eq: "值-等於[value=]",
|
value_eq: "值-等於[value=]",
|
||||||
value_not_eq: "值-不等於[value!=]",
|
value_not_eq: "值-不等於[value!=]",
|
||||||
value_contain:"值-包含[include=]",
|
value_contain: "值-包含[include=]",
|
||||||
length_eq: "長度-等于[length=]",
|
length_eq: "長度-等于[length=]",
|
||||||
length_not_eq: "長度-不等於[length!=]",
|
length_not_eq: "長度-不等於[length!=]",
|
||||||
length_large_than:"長度-大於[length>]",
|
length_large_than: "長度-大於[length>]",
|
||||||
length_shot_than:"長度-小於[length<]",
|
length_shot_than: "長度-小於[length<]",
|
||||||
regular_match: "正則匹配",
|
regular_match: "正則匹配",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2800,6 +2800,8 @@ export default {
|
||||||
mail_subject: "郵件主題",
|
mail_subject: "郵件主題",
|
||||||
mail_addressee: "收件人",
|
mail_addressee: "收件人",
|
||||||
mail_duplicate: "抄送人",
|
mail_duplicate: "抄送人",
|
||||||
|
enter_mail_addressee: "輸入回車添加郵箱",
|
||||||
|
enter_mail_duplicate: "輸入回車添加郵箱",
|
||||||
},
|
},
|
||||||
notice: {
|
notice: {
|
||||||
operation: {
|
operation: {
|
||||||
|
@ -3170,8 +3172,8 @@ export default {
|
||||||
delete: "刪除",
|
delete: "刪除",
|
||||||
read: "查看腳本",
|
read: "查看腳本",
|
||||||
},
|
},
|
||||||
personal_information:{
|
personal_information: {
|
||||||
name:'設置',
|
name: '設置',
|
||||||
personal_setting: '個人設置',
|
personal_setting: '個人設置',
|
||||||
api_keys: 'API Keys',
|
api_keys: 'API Keys',
|
||||||
edit_password: "修改密碼",
|
edit_password: "修改密碼",
|
||||||
|
@ -3193,7 +3195,7 @@ export default {
|
||||||
error_report_library: {
|
error_report_library: {
|
||||||
name: "誤報庫",
|
name: "誤報庫",
|
||||||
assertion: "誤報斷言",
|
assertion: "誤報斷言",
|
||||||
tips:"注:在\"項目設置-設置環境-全局斷言\"中啟用誤報將進行以下規則匹配",
|
tips: "注:在\"項目設置-設置環境-全局斷言\"中啟用誤報將進行以下規則匹配",
|
||||||
use_error_report: "啟用誤報",
|
use_error_report: "啟用誤報",
|
||||||
use_desc: "失敗斷言與誤報規則衝突時統一處理為誤報",
|
use_desc: "失敗斷言與誤報規則衝突時統一處理為誤報",
|
||||||
conflict_with_success: "請求同時包含誤報和成功斷言,請求結果處理為:",
|
conflict_with_success: "請求同時包含誤報和成功斷言,請求結果處理為:",
|
||||||
|
|
Loading…
Reference in New Issue