fix(测试跟踪): 编辑缺陷时没显示tapd处理人

--bug=1023054 --user=李玉号 【测试跟踪】缺陷管理,关联tapd平台,编辑缺陷时没显示tapd处理人
https://www.tapd.cn/55049933/s/1338472
This commit is contained in:
shiziyuan9527 2023-02-20 16:44:07 +08:00 committed by lyh
parent 5d9aa83ad3
commit 68b3486e70
4 changed files with 35 additions and 1 deletions

View File

@ -151,6 +151,11 @@ public class IssuesController {
return issuesService.getTapdProjectUsers(request);
}
@GetMapping("/tapd/current_owner/{id}")
public List<String> getTapdIssueCurrentOwner(@PathVariable String id) {
return issuesService.getTapdIssueCurrentOwner(id);
}
@GetMapping("/sync/{projectId}")
public boolean syncThirdPartyIssues(@PathVariable String projectId) {
return issuesService.syncThirdPartyIssues(projectId);

View File

@ -1900,4 +1900,21 @@ public class IssuesService {
syncAllIssuesRequest.setHandleSyncFunc(issueSyncRequest.getHandleSyncFunc());
platform.syncAllIssues(syncAllIssuesRequest);
}
public List<String> getTapdIssueCurrentOwner(String id) {
IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(id);
if (issuesWithBLOBs == null) {
return null;
}
IssuesRequest issuesRequest = new IssuesRequest();
Project project = baseProjectService.getProjectById(issuesWithBLOBs.getProjectId());
issuesRequest.setWorkspaceId(project.getWorkspaceId());
issuesRequest.setProjectId(issuesWithBLOBs.getProjectId());
TapdPlatform tapdPlatform = (TapdPlatform) IssueFactory.createPlatform(IssuesManagePlatform.Tapd.name(), issuesRequest);
List<String> tapdUsers = new ArrayList<>();
if (tapdPlatform != null) {
tapdUsers = tapdPlatform.getTapdUsers(issuesWithBLOBs.getProjectId(), issuesWithBLOBs.getPlatformId());
}
return tapdUsers;
}
}

View File

@ -60,6 +60,10 @@ export function getTapdUser(param) {
return post(BASE_URL + "tapd/user", param);
}
export function getTapdCurrentOwner(id) {
return get(BASE_URL + "tapd/current_owner/" + id);
}
export function getDashboardIssues(page) {
return post('issues/dashboard/list/' + page.currentPage + '/' + page.pageSize, page.condition)
.then((response) => {

View File

@ -207,7 +207,7 @@ import {
saveFollow,
getFollow,
getComments,
getTapdUser, getPlatformTransitions, getPlatformFormOption
getTapdUser, getPlatformTransitions, getPlatformFormOption, getTapdCurrentOwner
} from "@/api/issue";
import {
uploadIssueAttachment,
@ -401,6 +401,13 @@ export default {
});
});
},
getTapdCurrentOwner() {
getTapdCurrentOwner(this.form.id).then(res => {
if (res && res.data && res.data[0]) {
this.form.tapdUsers = res.data[0].split(';');
}
})
},
getDataInfoAsync(data) {
if (data && data.id) {
getFollow(data.id).then((response) => {
@ -450,6 +457,7 @@ export default {
}
if (platform === 'Tapd') {
this.hasTapdId = true;
this.getTapdCurrentOwner();
getTapdUser(data)
.then((response) => {
this.tapdUsers = response.data;