From 9112726e9a543cd4bea2612ec43d2cc8c81202eb Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 6 Nov 2023 14:31:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5):?= =?UTF-8?q?=20=E8=A1=A5=E5=85=85=E5=9B=9E=E5=A4=8D=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/service/FunctionalCaseNoticeService.java | 5 ++++- .../case-management/src/main/resources/permission.json | 2 +- .../controller/FunctionalCaseCommentControllerTests.java | 2 +- .../src/test/resources/dml/init_case_comment.sql | 7 +++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java index f4d1ca5a40..ad53dce419 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java @@ -64,9 +64,12 @@ public class FunctionalCaseNoticeService { if (!notifierList.contains(replyUser)) { functionalCaseDTO.setRelatedUsers(replyUser); } + } else { + functionalCaseDTO.setRelatedUsers(replyUser); } } - } else { + } + else { if (StringUtils.isNotBlank(replyUser)) { StringBuilder notifierStr = new StringBuilder(); if (StringUtils.isNotBlank(notifier)) { diff --git a/backend/services/case-management/src/main/resources/permission.json b/backend/services/case-management/src/main/resources/permission.json index 2cda48a377..a12dd20b3d 100644 --- a/backend/services/case-management/src/main/resources/permission.json +++ b/backend/services/case-management/src/main/resources/permission.json @@ -2,7 +2,7 @@ { "id": "CASE_MANAGEMENT", "name": "permission.case_management.name", - "type": "CASE_MANAGEMENT", + "type": "PROJECT", "children": [ { "id": "FUNCTIONAL_CASE", diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseCommentControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseCommentControllerTests.java index cb68adc9b2..a42cc82979 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseCommentControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseCommentControllerTests.java @@ -282,7 +282,7 @@ public class FunctionalCaseCommentControllerTests { FunctionalCaseCommentRequest functionalCaseCommentRequest = new FunctionalCaseCommentRequest(); functionalCaseCommentRequest.setCaseId("xiaomeinvGTestOne"); functionalCaseCommentRequest.setContent("评论你好"); - functionalCaseCommentRequest.setReplyUser("default-project-member-user-guo"); + functionalCaseCommentRequest.setReplyUser("default-project-member-user-guo-5"); functionalCaseCommentRequest.setParentId(functionalCaseComment1.getId()); functionalCaseCommentRequest.setEvent(NoticeConstants.Event.REPLY); FunctionalCaseComment functionalCaseComment = getFunctionalCaseComment(functionalCaseCommentRequest,SAVE_URL); diff --git a/backend/services/case-management/src/test/resources/dml/init_case_comment.sql b/backend/services/case-management/src/test/resources/dml/init_case_comment.sql index 29feea3f05..3243f6aa24 100644 --- a/backend/services/case-management/src/test/resources/dml/init_case_comment.sql +++ b/backend/services/case-management/src/test/resources/dml/init_case_comment.sql @@ -30,6 +30,9 @@ VALUES ('default-project-member-user-guo', 'default-project-member-user1', 'proj ('default-project-member-user-guo-4', 'default-project-member-user5', 'project-member-guo5@metersphere.io', MD5('metersphere'), UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, NULL, NUll, '', 'LOCAL', NULL, 'admin', 'admin', 0), + ('default-project-member-user-guo-5', 'default-project-member-user6', 'project-member-guo6@metersphere.io', + MD5('metersphere'), UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, NULL, NUll, '', 'LOCAL', NULL, 'admin', + 'admin', 0), ('default-project-member-user-guo-del', 'default-project-member-userDel', 'project-member-guo-del@metersphere.io', MD5('metersphere'), UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, NULL, NUll, '', 'LOCAL', NULL, 'admin', 'admin', 1), @@ -46,6 +49,8 @@ VALUES (UUID(), 'default-project-member-user-guo', 'org_member', '100001', '1000 'admin'), (UUID(), 'default-project-member-user-guo-4', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, 'admin'), + (UUID(), 'default-project-member-user-guo-5', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, + 'admin'), (UUID(), 'default-project-member-user-guo-del', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, 'admin'), (UUID(), 'gyq', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, @@ -62,6 +67,8 @@ VALUES (UUID(), 'default-project-member-user-guo', 'project_admin', '10000110000 'admin'), (UUID(), 'default-project-member-user-guo-4', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, 'admin'), + (UUID(), 'default-project-member-user-guo-5', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, + 'admin'), (UUID(), 'default-project-member-user-guo-del', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, 'admin'), (UUID(), 'gyq', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000,