Merge remote-tracking branch 'origin/master'

This commit is contained in:
wenyann 2020-11-20 14:58:11 +08:00
commit 6d3b3ccfa4
10 changed files with 74 additions and 37 deletions

View File

@ -37,6 +37,9 @@
<if test="platform == 'Tapd'">
tapd_id = null
</if>
<if test="platform == 'Zentao'">
zentao_id = null
</if>
</set>
where project.id in (select id from (select id
from project

View File

@ -87,31 +87,39 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
String session = login();
HttpEntity<MultiValueMap> requestEntity = new HttpEntity<>(new HttpHeaders());
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> 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<String> 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<String> 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<PlatformUser> 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<String,Object> maps = data.getInnerMap();

@ -1 +1 @@
Subproject commit 57d6f78efa4b0300be188e8b024511ceef0873ed
Subproject commit 419c75bca64b7c5bfbd1194d7f0fd9919f0caa04

View File

@ -0,0 +1,4 @@
alter table issues drop primary key;
alter table issues
add constraint issues_pk
primary key (id, platform);

View File

@ -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;

@ -1 +1 @@
Subproject commit 71d57ae5d7f8bb5c93a29504ac6f2300dc189ce9
Subproject commit 33bbdb3f528c914bf333b2c1839dd6d3bbd9b569

View File

@ -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',

View File

@ -27,7 +27,7 @@ export default {
operating: '操作',
input_limit: '长度在 {0} 到 {1} 个字符',
login: '登录',
welcome: '欢迎回来,请输入用户名和密码登录MeterSphere',
welcome: '欢迎回来,请输入用户名和密码登录',
username: '姓名',
password: '密码',
input_username: '请输入用户姓名',

View File

@ -27,7 +27,7 @@ export default {
operating: '操作',
input_limit: '長度在 {0} 到 {1} 個字符',
login: '登錄',
welcome: '歡迎回來,請輸入用戶名和密碼登錄MeterSphere',
welcome: '歡迎回來,請輸入用戶名和密碼登錄',
username: '姓名',
password: '密碼',
input_username: '請輸入用戶姓名',

View File

@ -8,8 +8,7 @@
<img v-else src="../assets/logo-dark-MeterSphere.svg" style="width: 224px; " alt="">
</div>
<div class="title">
<span id="s1">{{ $t('commons.login') }}</span>
<span id="s2">MeterSphere</span>
<span id="s1">{{ loginTitle }}</span>
</div>
<div class="border"></div>
<div class="welcome">
@ -89,6 +88,7 @@ export default {
openLdap: false,
loginLogoId: '_blank',
loginImageId: '_blank',
loginTitle: this.$t("commons.login") + " MeterSphere"
}
},
beforeCreate() {