fix(项目报告): 修复创建项目报告选择用户组时查询出了所有系统用户的问题

--bug=1014134 --user=宋天阳
【项目报告】在创建项目报告时,收件人选择“项目管理员”角色时,人员为非指定项目的管理员也包含进来了。
https://www.tapd.cn/55049933/s/1186568
This commit is contained in:
song-tianyang 2022-06-20 15:34:40 +08:00 committed by TIanyang
parent 66a5ada1b6
commit 053a1229e0
7 changed files with 92 additions and 64 deletions

View File

@ -29,7 +29,7 @@ public interface ExtUserGroupMapper {
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);
}

View File

@ -17,7 +17,8 @@
from workspace w
join user_group ur on w.id = ur.source_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 id="getMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
@ -29,8 +30,11 @@
order by user_group.update_time desc) temp
</select>
<select id="getProjectMemberList" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT `user`.* FROM user_group JOIN `user` ON user_group.user_id = `user`.id
SELECT DISTINCT *
FROM (
SELECT `user`.*
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>
@ -39,7 +43,8 @@
from project p
join user_group ur on p.id = ur.source_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 id="getRelatedSource" resultType="io.metersphere.dto.RelatedSource">
SELECT workspace_id, project.id
@ -74,15 +79,26 @@
AND ug.group_id = #{groupId}
</select>
<select id="getUserGroupInfo" 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
from user INNER JOIN user_group ug on user.id = ug.user_id
<select id="getUserGroupInfoByProjectId" resultType="io.metersphere.dto.UserGroupInfoDTO">
select distinct user.id AS userId,
user.name AS userName,
user.email AS userEmail,
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
order by ug.create_time ASC;
WHERE g.type = 'PROJECT'
AND ug.source_id = #{0}
order by g.create_time ASC;
</select>
<select id="getProjectMemberOption" resultType="io.metersphere.base.domain.User">
SELECT DISTINCT * FROM (
SELECT u.id, u.name, u.email FROM user_group JOIN `user` u ON user_group.user_id = u.id
SELECT DISTINCT *
FROM (
SELECT u.id, u.name, u.email
FROM user_group
JOIN `user` u ON user_group.user_id = u.id
WHERE user_group.source_id = #{projectId}
order by user_group.update_time desc
) temp

View File

@ -11,4 +11,5 @@ public class UserGroupInfoDTO {
private String userEmail;
private String groupId;
private String groupName;
private String sourceId;
}

View File

@ -88,6 +88,7 @@ export default {
}
},
addNew(e) {
this.$emit("onblur");
if (e && (!this.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
return
}
@ -125,8 +126,12 @@ export default {
return false
},
remove(index) {
this.innerTags.splice(index, 1)
this.tagChange()
this.innerTags.splice(index, 1);
this.tagChange();
this.$nextTick(() => {
//tagonblur
this.$emit("onblur");
});
},
removeLastTag() {
if (this.newTag) {

View File

@ -2797,6 +2797,8 @@ export default {
mail_subject: "Subject ",
mail_addressee: "To ",
mail_duplicate: "Cc ",
enter_mail_addressee: "Enter to add email",
enter_mail_duplicate: "Enter to add email",
},
notice: {
operation: {

View File

@ -2806,6 +2806,8 @@ export default {
mail_subject: "邮件主题",
mail_addressee: "收件人",
mail_duplicate: "抄送人",
enter_mail_addressee: "输入回车添加邮箱",
enter_mail_duplicate: "输入回车添加邮箱",
},
notice: {
operation: {

View File

@ -2800,6 +2800,8 @@ export default {
mail_subject: "郵件主題",
mail_addressee: "收件人",
mail_duplicate: "抄送人",
enter_mail_addressee: "輸入回車添加郵箱",
enter_mail_duplicate: "輸入回車添加郵箱",
},
notice: {
operation: {