From 4b2e924355566af1cfd544b1452656705b05484d Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 20 Jan 2022 21:09:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Jira=E7=BC=BA=E9=99=B7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=85=8D=E7=BD=AE=E6=94=B9=E5=88=B0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/base/domain/Project.java | 10 +- .../base/domain/ProjectExample.java | 260 +++++++++--------- .../base/mapper/ProjectMapper.java | 6 + .../metersphere/base/mapper/ProjectMapper.xml | 185 ++++++++++--- .../base/mapper/ext/ExtProjectMapper.xml | 3 +- .../track/controller/IssuesController.java | 6 + .../track/issue/AbstractIssuePlatform.java | 25 +- .../metersphere/track/issue/JiraPlatform.java | 119 ++++---- .../issue/client/JiraAbstractClient.java | 29 ++ .../issue/domain/ProjectIssueConfig.java | 12 + .../issue/domain/jira/JiraIssueProject.java | 12 + .../issue/domain/jira/JiraIssueType.java | 12 + .../track/issue/domain/jira/JiraUser.java | 1 + .../request/issues/JiraIssueTypeRequest.java | 12 + .../track/service/DemandService.java | 1 + .../track/service/IssuesService.java | 24 +- .../db/migration/V106__v1.17_release.sql | 3 + frontend/src/assets/jira-type.png | Bin 12082 -> 0 bytes .../components/project/menu/EditProject.vue | 19 +- .../menu/components/ProjectJiraConfig.vue | 61 ++++ .../workspace/components/JiraSetting.vue | 16 -- frontend/src/network/Issue.js | 4 + 22 files changed, 564 insertions(+), 256 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/track/issue/domain/ProjectIssueConfig.java create mode 100644 backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueProject.java create mode 100644 backend/src/main/java/io/metersphere/track/issue/domain/jira/JiraIssueType.java create mode 100644 backend/src/main/java/io/metersphere/track/request/issues/JiraIssueTypeRequest.java delete mode 100644 frontend/src/assets/jira-type.png create mode 100644 frontend/src/business/components/project/menu/components/ProjectJiraConfig.vue diff --git a/backend/src/main/java/io/metersphere/base/domain/Project.java b/backend/src/main/java/io/metersphere/base/domain/Project.java index d16edf6e4f..a5b4dedbc9 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Project.java +++ b/backend/src/main/java/io/metersphere/base/domain/Project.java @@ -45,14 +45,14 @@ public class Project implements Serializable { private String azureFilterId; - private String apiQuick; - - private Boolean casePublic; - private String platform; private Boolean thirdPartTemplate; + private Boolean casePublic; + + private String apiQuick; + private Boolean versionEnable; private Boolean cleanTrackReport; @@ -67,5 +67,7 @@ public class Project implements Serializable { private String cleanLoadReportExpr; + private String issueConfig; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ProjectExample.java b/backend/src/main/java/io/metersphere/base/domain/ProjectExample.java index 7d6f78a2de..0fd26d8e6c 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ProjectExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/ProjectExample.java @@ -1434,136 +1434,6 @@ public class ProjectExample { return (Criteria) this; } - public Criteria andApiQuickIsNull() { - addCriterion("api_quick is null"); - return (Criteria) this; - } - - public Criteria andApiQuickIsNotNull() { - addCriterion("api_quick is not null"); - return (Criteria) this; - } - - public Criteria andApiQuickEqualTo(String value) { - addCriterion("api_quick =", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickNotEqualTo(String value) { - addCriterion("api_quick <>", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickGreaterThan(String value) { - addCriterion("api_quick >", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickGreaterThanOrEqualTo(String value) { - addCriterion("api_quick >=", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickLessThan(String value) { - addCriterion("api_quick <", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickLessThanOrEqualTo(String value) { - addCriterion("api_quick <=", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickLike(String value) { - addCriterion("api_quick like", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickNotLike(String value) { - addCriterion("api_quick not like", value, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickIn(List values) { - addCriterion("api_quick in", values, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickNotIn(List values) { - addCriterion("api_quick not in", values, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickBetween(String value1, String value2) { - addCriterion("api_quick between", value1, value2, "apiQuick"); - return (Criteria) this; - } - - public Criteria andApiQuickNotBetween(String value1, String value2) { - addCriterion("api_quick not between", value1, value2, "apiQuick"); - return (Criteria) this; - } - - public Criteria andCasePublicIsNull() { - addCriterion("case_public is null"); - return (Criteria) this; - } - - public Criteria andCasePublicIsNotNull() { - addCriterion("case_public is not null"); - return (Criteria) this; - } - - public Criteria andCasePublicEqualTo(Boolean value) { - addCriterion("case_public =", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicNotEqualTo(Boolean value) { - addCriterion("case_public <>", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicGreaterThan(Boolean value) { - addCriterion("case_public >", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicGreaterThanOrEqualTo(Boolean value) { - addCriterion("case_public >=", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicLessThan(Boolean value) { - addCriterion("case_public <", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicLessThanOrEqualTo(Boolean value) { - addCriterion("case_public <=", value, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicIn(List values) { - addCriterion("case_public in", values, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicNotIn(List values) { - addCriterion("case_public not in", values, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicBetween(Boolean value1, Boolean value2) { - addCriterion("case_public between", value1, value2, "casePublic"); - return (Criteria) this; - } - - public Criteria andCasePublicNotBetween(Boolean value1, Boolean value2) { - addCriterion("case_public not between", value1, value2, "casePublic"); - return (Criteria) this; - } - public Criteria andPlatformIsNull() { addCriterion("platform is null"); return (Criteria) this; @@ -1694,6 +1564,136 @@ public class ProjectExample { return (Criteria) this; } + public Criteria andCasePublicIsNull() { + addCriterion("case_public is null"); + return (Criteria) this; + } + + public Criteria andCasePublicIsNotNull() { + addCriterion("case_public is not null"); + return (Criteria) this; + } + + public Criteria andCasePublicEqualTo(Boolean value) { + addCriterion("case_public =", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicNotEqualTo(Boolean value) { + addCriterion("case_public <>", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicGreaterThan(Boolean value) { + addCriterion("case_public >", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicGreaterThanOrEqualTo(Boolean value) { + addCriterion("case_public >=", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicLessThan(Boolean value) { + addCriterion("case_public <", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicLessThanOrEqualTo(Boolean value) { + addCriterion("case_public <=", value, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicIn(List values) { + addCriterion("case_public in", values, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicNotIn(List values) { + addCriterion("case_public not in", values, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicBetween(Boolean value1, Boolean value2) { + addCriterion("case_public between", value1, value2, "casePublic"); + return (Criteria) this; + } + + public Criteria andCasePublicNotBetween(Boolean value1, Boolean value2) { + addCriterion("case_public not between", value1, value2, "casePublic"); + return (Criteria) this; + } + + public Criteria andApiQuickIsNull() { + addCriterion("api_quick is null"); + return (Criteria) this; + } + + public Criteria andApiQuickIsNotNull() { + addCriterion("api_quick is not null"); + return (Criteria) this; + } + + public Criteria andApiQuickEqualTo(String value) { + addCriterion("api_quick =", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickNotEqualTo(String value) { + addCriterion("api_quick <>", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickGreaterThan(String value) { + addCriterion("api_quick >", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickGreaterThanOrEqualTo(String value) { + addCriterion("api_quick >=", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickLessThan(String value) { + addCriterion("api_quick <", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickLessThanOrEqualTo(String value) { + addCriterion("api_quick <=", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickLike(String value) { + addCriterion("api_quick like", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickNotLike(String value) { + addCriterion("api_quick not like", value, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickIn(List values) { + addCriterion("api_quick in", values, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickNotIn(List values) { + addCriterion("api_quick not in", values, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickBetween(String value1, String value2) { + addCriterion("api_quick between", value1, value2, "apiQuick"); + return (Criteria) this; + } + + public Criteria andApiQuickNotBetween(String value1, String value2) { + addCriterion("api_quick not between", value1, value2, "apiQuick"); + return (Criteria) this; + } + public Criteria andVersionEnableIsNull() { addCriterion("version_enable is null"); return (Criteria) this; diff --git a/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.java index fa96414ac9..52ee87a9fe 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.java @@ -16,15 +16,21 @@ public interface ProjectMapper { int insertSelective(Project record); + List selectByExampleWithBLOBs(ProjectExample example); + List selectByExample(ProjectExample example); Project selectByPrimaryKey(String id); int updateByExampleSelective(@Param("record") Project record, @Param("example") ProjectExample example); + int updateByExampleWithBLOBs(@Param("record") Project record, @Param("example") ProjectExample example); + int updateByExample(@Param("record") Project record, @Param("example") ProjectExample example); int updateByPrimaryKeySelective(Project record); + int updateByPrimaryKeyWithBLOBs(Project record); + int updateByPrimaryKey(Project record); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.xml index 8b32f9fccd..4bbf4c9c11 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ProjectMapper.xml @@ -22,10 +22,10 @@ - - + + @@ -34,6 +34,9 @@ + + + @@ -96,10 +99,29 @@ id, workspace_id, `name`, description, create_time, update_time, tapd_id, jira_key, zentao_id, azure_devops_id, `repeatable`, case_template_id, issue_template_id, custom_num, scenario_custom_num, create_user, system_id, mock_tcp_port, is_mock_tcp_open, azure_filter_id, - api_quick, case_public, platform, third_part_template, version_enable, clean_track_report, + platform, third_part_template, case_public, api_quick, version_enable, clean_track_report, clean_track_report_expr, clean_api_report, clean_api_report_expr, clean_load_report, clean_load_report_expr + + issue_config + + - select + , + from project where id = #{id,jdbcType=VARCHAR} @@ -137,22 +161,22 @@ azure_devops_id, `repeatable`, case_template_id, issue_template_id, custom_num, scenario_custom_num, create_user, system_id, mock_tcp_port, - is_mock_tcp_open, azure_filter_id, api_quick, - case_public, platform, third_part_template, + is_mock_tcp_open, azure_filter_id, platform, + third_part_template, case_public, api_quick, version_enable, clean_track_report, clean_track_report_expr, clean_api_report, clean_api_report_expr, clean_load_report, - clean_load_report_expr) + clean_load_report_expr, issue_config) values (#{id,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{tapdId,jdbcType=VARCHAR}, #{jiraKey,jdbcType=VARCHAR}, #{zentaoId,jdbcType=VARCHAR}, #{azureDevopsId,jdbcType=VARCHAR}, #{repeatable,jdbcType=BIT}, #{caseTemplateId,jdbcType=VARCHAR}, #{issueTemplateId,jdbcType=VARCHAR}, #{customNum,jdbcType=BIT}, #{scenarioCustomNum,jdbcType=BIT}, #{createUser,jdbcType=VARCHAR}, #{systemId,jdbcType=VARCHAR}, #{mockTcpPort,jdbcType=INTEGER}, - #{isMockTcpOpen,jdbcType=BIT}, #{azureFilterId,jdbcType=VARCHAR}, #{apiQuick,jdbcType=VARCHAR}, - #{casePublic,jdbcType=BIT}, #{platform,jdbcType=VARCHAR}, #{thirdPartTemplate,jdbcType=BIT}, + #{isMockTcpOpen,jdbcType=BIT}, #{azureFilterId,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, + #{thirdPartTemplate,jdbcType=BIT}, #{casePublic,jdbcType=BIT}, #{apiQuick,jdbcType=VARCHAR}, #{versionEnable,jdbcType=BIT}, #{cleanTrackReport,jdbcType=BIT}, #{cleanTrackReportExpr,jdbcType=VARCHAR}, #{cleanApiReport,jdbcType=BIT}, #{cleanApiReportExpr,jdbcType=VARCHAR}, #{cleanLoadReport,jdbcType=BIT}, - #{cleanLoadReportExpr,jdbcType=VARCHAR}) + #{cleanLoadReportExpr,jdbcType=VARCHAR}, #{issueConfig,jdbcType=LONGVARCHAR}) insert into project @@ -217,18 +241,18 @@ azure_filter_id, - - api_quick, - - - case_public, - platform, third_part_template, + + case_public, + + + api_quick, + version_enable, @@ -250,6 +274,9 @@ clean_load_report_expr, + + issue_config, + @@ -312,18 +339,18 @@ #{azureFilterId,jdbcType=VARCHAR}, - - #{apiQuick,jdbcType=VARCHAR}, - - - #{casePublic,jdbcType=BIT}, - #{platform,jdbcType=VARCHAR}, #{thirdPartTemplate,jdbcType=BIT}, + + #{casePublic,jdbcType=BIT}, + + + #{apiQuick,jdbcType=VARCHAR}, + #{versionEnable,jdbcType=BIT}, @@ -345,6 +372,9 @@ #{cleanLoadReportExpr,jdbcType=VARCHAR}, + + #{issueConfig,jdbcType=LONGVARCHAR}, +