diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtProjectMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtProjectMapper.xml index 8fdc44d60d..66bb7c3588 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtProjectMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtProjectMapper.xml @@ -37,6 +37,9 @@ tapd_id = null + + zentao_id = null + where project.id in (select id from (select id from project diff --git a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java index caafdc3a94..1d0196651e 100644 --- a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java @@ -87,31 +87,39 @@ public class ZentaoPlatform extends AbstractIssuePlatform { String session = login(); HttpEntity requestEntity = new HttpEntity<>(new HttpHeaders()); RestTemplate restTemplate = new RestTemplate(); - ResponseEntity responseEntity = restTemplate.exchange(url + "api-getModel-bug-getById-bugID={bugId}?zentaosid=" + session, - HttpMethod.POST, requestEntity, String.class, bugId); - String body = responseEntity.getBody(); - JSONObject obj = JSONObject.parseObject(body); - if (obj != null) { - JSONObject bug = obj.getJSONObject("data"); - String id = bug.getString("id"); - String title = bug.getString("title"); - String description = bug.getString("steps"); - Long createTime = bug.getLong("openedDate"); - String status = bug.getString("status"); - String reporter = bug.getString("openedBy"); - int deleted = bug.getInteger("deleted"); - if (deleted == 1) { - return new Issues(); + try { + ResponseEntity responseEntity = restTemplate.exchange(url + "api-getModel-bug-getById-bugID={bugId}?zentaosid=" + session, + HttpMethod.POST, requestEntity, String.class, bugId); + String body = responseEntity.getBody(); + JSONObject obj = JSONObject.parseObject(body); + + LogUtil.info("bug id is " + bugId + obj); + + if (obj != null) { + JSONObject bug = obj.getJSONObject("data"); + String id = bug.getString("id"); + String title = bug.getString("title"); + String description = bug.getString("steps"); + Long createTime = bug.getLong("openedDate"); + String status = bug.getString("status"); + String reporter = bug.getString("openedBy"); + int deleted = bug.getInteger("deleted"); + if (deleted == 1) { + return new Issues(); + } + Issues issues = new Issues(); + issues.setId(id); + issues.setTitle(title); + issues.setDescription(description); + issues.setCreateTime(createTime); + issues.setStatus(status); + issues.setReporter(reporter); + return issues; } - Issues issues = new Issues(); - issues.setId(id); - issues.setTitle(title); - issues.setDescription(description); - issues.setCreateTime(createTime); - issues.setStatus(status); - issues.setReporter(reporter); - return issues; + } catch (Exception e) { + LogUtil.error("get zentao bug fail " + e.getMessage()); } + return new Issues(); } @@ -150,6 +158,9 @@ public class ZentaoPlatform extends AbstractIssuePlatform { ResponseEntity responseEntity = restTemplate.exchange(url + "api-getModel-bug-create.json?zentaosid=" + session, HttpMethod.POST, requestEntity, String.class); String body = responseEntity.getBody(); JSONObject obj = JSONObject.parseObject(body); + + LogUtil.info("add zentao bug " + obj); + if (obj != null) { JSONObject data = obj.getJSONObject("data"); String id = data.getString("id"); @@ -161,11 +172,16 @@ public class ZentaoPlatform extends AbstractIssuePlatform { testCaseIssues.setTestCaseId(testCaseId); testCaseIssuesMapper.insert(testCaseIssues); - // 插入缺陷表 - Issues issues = new Issues(); - issues.setId(id); - issues.setPlatform(IssuesManagePlatform.Zentao.toString()); - issuesMapper.insert(issues); + IssuesExample issuesExample = new IssuesExample(); + issuesExample.createCriteria().andIdEqualTo(id) + .andPlatformEqualTo(IssuesManagePlatform.Zentao.toString()); + if (issuesMapper.selectByExample(issuesExample).size() <= 0) { + // 插入缺陷表 + Issues issues = new Issues(); + issues.setId(id); + issues.setPlatform(IssuesManagePlatform.Zentao.toString()); + issuesMapper.insert(issues); + } } } } @@ -235,6 +251,9 @@ public class ZentaoPlatform extends AbstractIssuePlatform { HttpMethod.GET, requestEntity, String.class); String body = responseEntity.getBody(); JSONObject obj = JSONObject.parseObject(body); + + LogUtil.info("zentao user " + obj); + JSONArray data = obj.getJSONArray("data"); List users = new ArrayList<>(); @@ -260,6 +279,9 @@ public class ZentaoPlatform extends AbstractIssuePlatform { HttpMethod.GET, requestEntity, String.class, projectId); String body = responseEntity.getBody(); JSONObject obj = JSONObject.parseObject(body); + + LogUtil.info("zentao builds" + obj); + JSONObject data = obj.getJSONObject("data"); Map maps = data.getInnerMap(); diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 57d6f78efa..419c75bca6 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 57d6f78efa4b0300be188e8b024511ceef0873ed +Subproject commit 419c75bca64b7c5bfbd1194d7f0fd9919f0caa04 diff --git a/backend/src/main/resources/db/migration/V45__modify_issues.sql b/backend/src/main/resources/db/migration/V45__modify_issues.sql new file mode 100644 index 0000000000..0617627ced --- /dev/null +++ b/backend/src/main/resources/db/migration/V45__modify_issues.sql @@ -0,0 +1,4 @@ +alter table issues drop primary key; +alter table issues + add constraint issues_pk + primary key (id, platform); \ No newline at end of file diff --git a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue index 0ebcb221fd..096146e3d3 100644 --- a/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue +++ b/frontend/src/business/components/performance/report/components/PerformancePressureConfig.vue @@ -129,7 +129,11 @@ export default { this.threadGroups[i].rampUpTime = item.value; break; case DURATION: - this.threadGroups[i].duration = item.value; + if (item.unit) { + this.threadGroups[i].duration = item.value; + } else { + this.threadGroups[i].duration = item.value * 60; + } break; case STEPS: this.threadGroups[i].step = item.value; @@ -154,7 +158,11 @@ export default { this.threadGroups[0].rampUpTime = d.value; break; case DURATION: - this.threadGroups[0].duration = d.value; + if (d.unit) { + this.threadGroups[0].duration = d.value; + } else { + this.threadGroups[0].duration = d.value * 60; + } break; case STEPS: this.threadGroups[0].step = d.value; diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 71d57ae5d7..33bbdb3f52 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 71d57ae5d7f8bb5c93a29504ac6f2300dc189ce9 +Subproject commit 33bbdb3f528c914bf333b2c1839dd6d3bbd9b569 diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index a8a0157b33..7d64c7b9f8 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -27,7 +27,7 @@ export default { operating: 'Operating', input_limit: 'Within {0} and {1} characters', login: 'Sign In', - welcome: 'Welcome back, please enter username and password to log in to MeterSphere', + welcome: 'Welcome back, please enter username and password to log in', username: 'Username', password: 'Password', input_username: 'Please enter username', diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 9e282ac46b..d237a3a018 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -27,7 +27,7 @@ export default { operating: '操作', input_limit: '长度在 {0} 到 {1} 个字符', login: '登录', - welcome: '欢迎回来,请输入用户名和密码登录MeterSphere', + welcome: '欢迎回来,请输入用户名和密码登录', username: '姓名', password: '密码', input_username: '请输入用户姓名', diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index e36925782d..7b78e3a37b 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -27,7 +27,7 @@ export default { operating: '操作', input_limit: '長度在 {0} 到 {1} 個字符', login: '登錄', - welcome: '歡迎回來,請輸入用戶名和密碼登錄MeterSphere', + welcome: '歡迎回來,請輸入用戶名和密碼登錄', username: '姓名', password: '密碼', input_username: '請輸入用戶姓名', diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue index 20f80ad73c..02f61856a8 100644 --- a/frontend/src/login/Login.vue +++ b/frontend/src/login/Login.vue @@ -8,8 +8,7 @@
- {{ $t('commons.login') }} - MeterSphere + {{ loginTitle }}
@@ -89,6 +88,7 @@ export default { openLdap: false, loginLogoId: '_blank', loginImageId: '_blank', + loginTitle: this.$t("commons.login") + " MeterSphere" } }, beforeCreate() {