refactor: 组织默认配置通知
This commit is contained in:
parent
c376d92947
commit
981c035306
|
@ -1,6 +1,5 @@
|
|||
package io.metersphere.base.mapper.ext;
|
||||
|
||||
import io.metersphere.base.domain.Organization;
|
||||
import io.metersphere.dto.OrganizationMemberDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -11,4 +10,6 @@ public interface ExtOrganizationMapper {
|
|||
int checkSourceRole(@Param("sourceId") String sourceId,@Param("userId") String userId,@Param("groupId") String groupId);
|
||||
|
||||
List<OrganizationMemberDTO> findIdAndNameByOrganizationId(@Param("organizationId")String organizationID);
|
||||
|
||||
void setDefaultMessageTask(@Param("orgId") String orgId);
|
||||
}
|
||||
|
|
|
@ -19,4 +19,95 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="setDefaultMessageTask">
|
||||
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, organization_id,
|
||||
test_id, create_time, template)
|
||||
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
|
||||
'ce692111-166b-491a-ae69-f047c31de971', 0,
|
||||
#{orgId}, NULL, 1629686472659, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
|
||||
'',
|
||||
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, #{orgId}, NULL, 1629697096803,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
|
||||
'ceb0aeb5-f194-4183-a995-3607a769c61d',
|
||||
0, #{orgId}, NULL, 1629705930753, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
|
||||
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
|
||||
#{orgId}, NULL, 1629446356866, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
|
||||
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, #{orgId}, NULL, 1629446379928,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
|
||||
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
|
||||
#{orgId}, NULL, 1629446330438, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
|
||||
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, #{orgId}, NULL, 1629705939795,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
|
||||
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, #{orgId}, NULL, 1629446346104,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
|
||||
'019de091-1a19-4b30-bd5e-23b83bc820fb',
|
||||
0, #{orgId}, NULL, 1629618010742, NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'a6a3979a-bd80-414c-a253-06f0364c434f',
|
||||
0, #{orgId}, NULL, 1629446346104, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
|
||||
#{orgId}, NULL, 1629446306675, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
|
||||
'ce692111-166b-491a-ae69-f047c31de971', 0, #{orgId}, NULL, 1629686472659,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
|
||||
#{orgId}, NULL, 1629699608062, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
|
||||
'7ca324cd-7113-412b-8714-5cbe1bffa535',
|
||||
0, #{orgId}, NULL, 1629706088088, NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
|
||||
0, #{orgId}, NULL, 1629446334332, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
|
||||
0,
|
||||
#{orgId}, NULL, 1629446364391, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
|
||||
#{orgId}, NULL, 1629446247833, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
|
||||
#{orgId}, NULL, 1629446338557, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
|
||||
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
|
||||
0, #{orgId}, NULL, 1629446384995, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
|
||||
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
|
||||
#{orgId}, NULL, 1629618010742, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
|
||||
0,
|
||||
#{orgId}, NULL, 1629446286106, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
|
||||
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
|
||||
#{orgId}, NULL, 1629446379928, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
|
||||
#{orgId}, NULL, 1629705939795, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
|
||||
#{orgId}, NULL, 1629706088088, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
|
||||
#{orgId}, NULL, 1629446289522, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
|
||||
#{orgId}, NULL, 1629446276516, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
|
||||
0,
|
||||
#{orgId}, NULL, 1629283758941, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
|
||||
#{orgId}, NULL, 1629446272477, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
|
||||
#{orgId}, NULL, 1629446251939, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
|
||||
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, #{orgId}, NULL, 1629446251939,
|
||||
NULL)
|
||||
</insert>
|
||||
</mapper>
|
|
@ -5,7 +5,6 @@ import io.metersphere.base.domain.*;
|
|||
import io.metersphere.base.mapper.*;
|
||||
import io.metersphere.base.mapper.ext.ExtOrganizationMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtUserGroupMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtUserRoleMapper;
|
||||
import io.metersphere.commons.constants.UserGroupConstants;
|
||||
import io.metersphere.commons.constants.UserGroupType;
|
||||
import io.metersphere.commons.exception.MSException;
|
||||
|
@ -39,12 +38,6 @@ public class OrganizationService {
|
|||
@Resource
|
||||
private OrganizationMapper organizationMapper;
|
||||
@Resource
|
||||
private UserRoleMapper userRoleMapper;
|
||||
@Resource
|
||||
private ExtUserRoleMapper extUserRoleMapper;
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
@Resource
|
||||
private ExtOrganizationMapper extOrganizationMapper;
|
||||
@Resource
|
||||
private WorkspaceMapper workspaceMapper;
|
||||
|
@ -79,6 +72,9 @@ public class OrganizationService {
|
|||
userGroup.setGroupId(UserGroupConstants.ORG_ADMIN);
|
||||
userGroup.setSourceId(organization.getId());
|
||||
userGroupMapper.insert(userGroup);
|
||||
|
||||
// 设置默认的通知
|
||||
extOrganizationMapper.setDefaultMessageTask(organization.getId());
|
||||
return organization;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,3 +102,125 @@ DROP TABLE test_plan_report_resource;
|
|||
-- 统一接口案例未执行的状态字段
|
||||
update api_test_case SET `status` = '' WHERE `status` = 'Underway';
|
||||
update api_test_case SET `original_status` = '' WHERE `original_status` = 'Underway';
|
||||
|
||||
-- 设置默认的通知
|
||||
|
||||
DROP PROCEDURE IF EXISTS set_notice;
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE set_notice()
|
||||
BEGIN
|
||||
DECLARE orgId VARCHAR(64);
|
||||
DECLARE done INT DEFAULT 0;
|
||||
DECLARE cursor1 CURSOR FOR (SELECT id
|
||||
FROM organization);
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
||||
OPEN cursor1;
|
||||
outer_loop:
|
||||
LOOP
|
||||
FETCH cursor1 INTO orgId;
|
||||
IF done
|
||||
THEN
|
||||
LEAVE outer_loop;
|
||||
END IF;
|
||||
--
|
||||
|
||||
|
||||
INSERT INTO message_task (id, type, event, user_id, task_type, webhook, identification, is_set, organization_id,
|
||||
test_id, create_time, template)
|
||||
VALUES (UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
|
||||
'ce692111-166b-491a-ae69-f047c31de971', 0,
|
||||
orgId, NULL, 1629686472659, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'REVIEW_TASK',
|
||||
'',
|
||||
'72836b2d-4c2f-4185-95aa-1894c6f0d1c3', 0, orgId, NULL, 1629697096803,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'TRACK_HOME_TASK', '',
|
||||
'ceb0aeb5-f194-4183-a995-3607a769c61d',
|
||||
0, orgId, NULL, 1629705930753, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_AUTOMATION_TASK', '',
|
||||
'e2865464-0da3-42bc-a041-7d21bd70d339', 0,
|
||||
orgId, NULL, 1629446356866, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
|
||||
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0, orgId, NULL, 1629446379928,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CLOSE_SCHEDULE', 'CREATOR', 'API_HOME_TASK', '',
|
||||
'dbe5dfcd-927f-4065-93cf-22f33d9570ac', 0,
|
||||
orgId, NULL, 1629446330438, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
|
||||
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0, orgId, NULL, 1629705939795,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
|
||||
'a6a3979a-bd80-414c-a253-06f0364c434f', 0, orgId, NULL, 1629446346104,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_AUTOMATION_TASK', '',
|
||||
'019de091-1a19-4b30-bd5e-23b83bc820fb',
|
||||
0, orgId, NULL, 1629618010742, NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'a6a3979a-bd80-414c-a253-06f0364c434f',
|
||||
0, orgId, NULL, 1629446346104, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'DEFECT_TASK', '', '66568b56-4f9e-4bf6-8621-7402403368b9', 0,
|
||||
orgId, NULL, 1629446306675, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'PERFORMANCE_TEST_TASK', '',
|
||||
'ce692111-166b-491a-ae69-f047c31de971', 0, orgId, NULL, 1629686472659,
|
||||
NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'DEFECT_TASK', '', '3a913f72-7cee-4e36-ae1d-0443c7cb5f97', 0,
|
||||
orgId, NULL, 1629699608062, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'FOLLOW_PEOPLE', 'API_DEFINITION_TASK', '',
|
||||
'7ca324cd-7113-412b-8714-5cbe1bffa535',
|
||||
0, orgId, NULL, 1629706088088, NULL),
|
||||
(UUID(), 'IN_SITE', 'CASE_DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'aeb9d21a-855c-44d3-a715-dfb1bba8ad6c',
|
||||
0, orgId, NULL, 1629446334332, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_REPORT_TASK', '', '4d3309f3-7ab2-492e-b9c9-1127c3e005d1',
|
||||
0,
|
||||
orgId, NULL, 1629446364391, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMMENT', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'2e8db54f-2d39-42a6-9832-43bb3384e7d5', 0,
|
||||
orgId, NULL, 1629446247833, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'90f2be5d-0a71-44f0-a750-f16bf39d690b', 0,
|
||||
orgId, NULL, 1629446338557, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'PERFORMANCE_REPORT_TASK', '',
|
||||
'4c1bfa4a-b02b-4e8e-bc09-b13613723a11',
|
||||
0, orgId, NULL, 1629446384995, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_AUTOMATION_TASK', '',
|
||||
'019de091-1a19-4b30-bd5e-23b83bc820fb', 0,
|
||||
orgId, NULL, 1629618010742, NULL),
|
||||
(UUID(), 'IN_SITE', 'COMPLETE', 'CREATOR', 'TEST_PLAN_TASK', '', '86b42beb-a86f-4ff3-a73c-d25112c2f104',
|
||||
0,
|
||||
orgId, NULL, 1629446286106, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'PERFORMANCE_TEST_TASK', '',
|
||||
'79d7dcdc-68a2-47a2-9ef5-21fdf9bde65c', 0,
|
||||
orgId, NULL, 1629446379928, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'3a632784-c73b-4f5f-824c-bdf4fccf6f4d', 0,
|
||||
orgId, NULL, 1629705939795, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'API_DEFINITION_TASK', '',
|
||||
'7ca324cd-7113-412b-8714-5cbe1bffa535', 0,
|
||||
orgId, NULL, 1629706088088, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TEST_PLAN_TASK', '', '04ea4fbd-a392-4f80-a61c-51d31a302cac', 0,
|
||||
orgId, NULL, 1629446289522, NULL),
|
||||
(UUID(), 'IN_SITE', 'UPDATE', 'CREATOR', 'REVIEW_TASK', '', 'db515209-f864-46d3-a2e5-63db6d1339c3', 0,
|
||||
orgId, NULL, 1629446276516, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_REPORT_TASK', '', 'ea2fee85-8a44-413a-a128-16bfa01ada0d',
|
||||
0,
|
||||
orgId, NULL, 1629283758941, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'REVIEW_TASK', '', 'f9b1f60b-6dee-48af-8217-0428b27dcbab', 0,
|
||||
orgId, NULL, 1629446272477, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'CREATOR', 'TRACK_TEST_CASE_TASK', '',
|
||||
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0,
|
||||
orgId, NULL, 1629446251939, NULL),
|
||||
(UUID(), 'IN_SITE', 'DELETE', 'FOLLOW_PEOPLE', 'TRACK_TEST_CASE_TASK', '',
|
||||
'7c26254e-85e9-4269-be13-a2ffcfe0b9f5', 0, orgId, NULL, 1629446251939,
|
||||
NULL);
|
||||
|
||||
--
|
||||
SET done = 0;
|
||||
END LOOP;
|
||||
CLOSE cursor1;
|
||||
END //
|
||||
DELIMITER ;
|
||||
|
||||
CALL set_notice();
|
||||
DROP PROCEDURE IF EXISTS set_notice;
|
Loading…
Reference in New Issue