fix(测试跟踪): 测试用例关联创建缺陷报错问题
--bug=1032241 --user=宋昌昌 【测试跟踪】测试用例-创建缺陷-保存报500 https://www.tapd.cn/55049933/s/1429059
This commit is contained in:
parent
d1b4b29139
commit
8851d099a6
|
@ -10,13 +10,13 @@ import io.metersphere.dto.TestCaseDTO;
|
|||
import io.metersphere.i18n.Translator;
|
||||
import io.metersphere.log.vo.OperatingLogDetails;
|
||||
import io.metersphere.request.issues.IssuesRelevanceRequest;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
@ -144,26 +144,30 @@ public class TestCaseIssueService {
|
|||
public String getIssueLogDetails(String caseResourceId, String issuesId) {
|
||||
TestCaseWithBLOBs bloBs = testCaseService.getTestCase(caseResourceId);
|
||||
if (bloBs != null) {
|
||||
IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(issuesId);
|
||||
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(issuesId), bloBs.getProjectId(), bloBs.getName() + " 关联 " + issuesWithBLOBs.getTitle(), bloBs.getCreateUser(), new LinkedList<>());
|
||||
IssuesWithBLOBs issue = issuesMapper.selectByPrimaryKey(issuesId);
|
||||
if (issue != null) {
|
||||
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(issuesId), bloBs.getProjectId(), bloBs.getName() + " 关联 " + issue.getTitle(), bloBs.getCreateUser(), new LinkedList<>());
|
||||
return JSON.toJSONString(details);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getIssueLogDetails(String caseResourceId, String refId, String issuesId) {
|
||||
TestCaseWithBLOBs issue = null;
|
||||
TestCaseWithBLOBs testCase = null;
|
||||
if (StringUtils.isNotBlank(refId)) {
|
||||
issue = testCaseService.getTestCase(refId);
|
||||
testCase = testCaseService.getTestCase(refId);
|
||||
}
|
||||
if (issue == null) {
|
||||
issue = testCaseService.getTestCase(caseResourceId);
|
||||
if (testCase == null) {
|
||||
testCase = testCaseService.getTestCase(caseResourceId);
|
||||
}
|
||||
if (testCase != null) {
|
||||
IssuesWithBLOBs issue = issuesMapper.selectByPrimaryKey(issuesId);
|
||||
if (issue != null) {
|
||||
IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(issuesId);
|
||||
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(issuesId), issue.getProjectId(), issue.getName() + Translator.get("relate_resource") + issuesWithBLOBs.getTitle(), issue.getCreateUser(), new LinkedList<>());
|
||||
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(issuesId), testCase.getProjectId(), testCase.getName() + Translator.get("relate_resource") + issue.getTitle(), testCase.getCreateUser(), new LinkedList<>());
|
||||
return JSON.toJSONString(details);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue