fix(测试跟踪): 删除缺陷未删除关联关系

This commit is contained in:
shiziyuan9527 2021-03-16 11:01:48 +08:00
parent 0ab8899820
commit 25e2cdc2c9
4 changed files with 23 additions and 10 deletions

View File

@ -37,9 +37,9 @@ public class TestCaseIssuesController {
issuesService.closeLocalIssue(id);
}
@GetMapping("/delete/{id}")
public void deleteIssue(@PathVariable String id) {
issuesService.deleteIssue(id);
@PostMapping("/delete")
public void deleteIssue(@RequestBody IssuesRequest request) {
issuesService.deleteIssue(request);
}
@GetMapping("/tapd/user/{caseId}")

View File

@ -21,4 +21,10 @@ public class IssuesRequest {
* zentao bug 影响版本
*/
private List<String> zentaoBuilds;
/**
* issues id
*/
private String id;
private String caseId;
}

View File

@ -1,10 +1,8 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.Issues;
import io.metersphere.base.domain.Project;
import io.metersphere.base.domain.ServiceIntegration;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.IssuesMapper;
import io.metersphere.base.mapper.TestCaseIssuesMapper;
import io.metersphere.commons.constants.IssuesManagePlatform;
import io.metersphere.commons.constants.NoticeConstants;
import io.metersphere.commons.user.SessionUser;
@ -43,6 +41,8 @@ public class IssuesService {
private IssuesMapper issuesMapper;
@Resource
private NoticeSendService noticeSendService;
@Resource
private TestCaseIssuesMapper testCaseIssuesMapper;
public void testAuth(String platform) {
AbstractIssuePlatform abstractPlatform = IssueFactory.createPlatform(platform, new IssuesRequest());
@ -202,8 +202,14 @@ public class IssuesService {
return platform.getPlatformUser();
}
public void deleteIssue(String id) {
public void deleteIssue(IssuesRequest request) {
String caseId = request.getCaseId();
String id = request.getId();
issuesMapper.deleteByPrimaryKey(id);
TestCaseIssuesExample example = new TestCaseIssuesExample();
example.createCriteria().andTestCaseIdEqualTo(caseId).andIssuesIdEqualTo(id);
testCaseIssuesMapper.deleteByExample(example);
}
private static String getIssuesContext(SessionUser user, IssuesRequest issuesRequest, String type) {

View File

@ -664,8 +664,9 @@ export default {
}
},
deleteIssue(row) {
this.result = this.$get("/issues/delete/" + row.id, () => {
this.getIssues(this.testCase.caseId);
let caseId = this.testCase.caseId;
this.result = this.$post("/issues/delete", {id: row.id, caseId: caseId}, () => {
this.getIssues(caseId);
this.$success(this.$t('commons.delete_success'));
})
},