fix(测试用例): 查询禅道需求失败的问题

This commit is contained in:
shiziyuan9527 2021-07-14 16:47:36 +08:00 committed by 刘瑞斌
parent 42cfd23d12
commit 32313df96b
3 changed files with 9 additions and 11 deletions

View File

@ -14,10 +14,10 @@ import java.util.List;
@RestController
public class TestCaseDemandController {
@Resource
private DemandService DemandService;
private DemandService demandService;
@GetMapping("/list/{projectId}")
public List<DemandDTO> getDemandList(@PathVariable String projectId) {
return DemandService.getDemandList(projectId);
return demandService.getDemandList(projectId);
}
}

View File

@ -1,12 +1,10 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.Issues;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.Workspace;
import io.metersphere.base.mapper.ProjectMapper;
import io.metersphere.base.mapper.WorkspaceMapper;
import io.metersphere.commons.constants.IssuesManagePlatform;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.service.ProjectService;
import io.metersphere.track.dto.DemandDTO;
import io.metersphere.track.issue.AbstractIssuePlatform;
import io.metersphere.track.issue.IssueFactory;
@ -23,7 +21,7 @@ import java.util.List;
@Transactional(rollbackFor = Exception.class)
public class DemandService {
@Resource
private ProjectService projectService;
private WorkspaceMapper workspaceMapper;
@Resource
private IssuesService issuesService;
@Resource
@ -31,9 +29,8 @@ public class DemandService {
public List<DemandDTO> getDemandList(String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
SessionUser user = SessionUtils.getUser();
String orgId = user.getLastOrganizationId();
Workspace workspace = workspaceMapper.selectByPrimaryKey(project.getWorkspaceId());
String orgId = workspace.getOrganizationId();
boolean tapd = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Tapd.toString());
boolean jira = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Jira.toString());
boolean zentao = issuesService.isIntegratedPlatform(orgId, IssuesManagePlatform.Zentao.toString());
@ -62,6 +59,7 @@ public class DemandService {
}
}
issueRequest.setOrganizationId(orgId);
List<AbstractIssuePlatform> platformList = IssueFactory.createPlatforms(platforms, issueRequest);
platformList.forEach(platform -> {
List<DemandDTO> demand = platform.getDemandList(projectId);

View File

@ -86,7 +86,7 @@
<form-rich-text-item :label-width="formLabelWidth" v-if="testCase.stepModel === 'TEXT'" :disabled="true" :title="$t('test_track.case.expected_results')" :data="testCase" prop="expectedResult"/>
<form-rich-text-item :label-width="formLabelWidth" v-if="testCase.stepModel === 'TEXT'" :title="$t('test_track.plan_view.actual_result')" :data="testCase" prop="actualResult"/>
<test-case-edit-other-info :plan-id="testCase.planId" v-if="otherInfoActive" @openTest="openTest" :read-only="true" :is-test-plan="true" :project-id="projectId" :form="testCase" :case-id="testCase.caseId" ref="otherInfo"/>
<test-case-edit-other-info :plan-id="testCase.planId" v-if="otherInfoActive" @openTest="openTest" :read-only="true" :is-test-plan="true" :project-id="testCase.projectId" :form="testCase" :case-id="testCase.caseId" ref="otherInfo"/>
</el-form>
</div>