fix: 修复提交缺陷时可能出现主键冲突的问题

This commit is contained in:
shiziyuan9527 2020-11-19 16:16:48 +08:00
parent c9bc42bacc
commit ad685b5a0e
1 changed files with 10 additions and 5 deletions

View File

@ -172,11 +172,16 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
testCaseIssues.setTestCaseId(testCaseId); testCaseIssues.setTestCaseId(testCaseId);
testCaseIssuesMapper.insert(testCaseIssues); testCaseIssuesMapper.insert(testCaseIssues);
// 插入缺陷表 IssuesExample issuesExample = new IssuesExample();
Issues issues = new Issues(); issuesExample.createCriteria().andIdEqualTo(id)
issues.setId(id); .andPlatformEqualTo(IssuesManagePlatform.Zentao.toString());
issues.setPlatform(IssuesManagePlatform.Zentao.toString()); if (issuesMapper.selectByExample(issuesExample).size() <= 0) {
issuesMapper.insert(issues); // 插入缺陷表
Issues issues = new Issues();
issues.setId(id);
issues.setPlatform(IssuesManagePlatform.Zentao.toString());
issuesMapper.insert(issues);
}
} }
} }
} }