fix: 编辑用例点击关联缺陷缺少数据
This commit is contained in:
parent
0089fd34dd
commit
f4537b5bbc
|
@ -25,13 +25,13 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getRelateIssues" resultType="io.metersphere.base.domain.IssuesDao">
|
<select id="getRelateIssues" resultType="io.metersphere.base.domain.IssuesDao">
|
||||||
select issues.id, issues.num, issues.title, issues.project_id, issues.create_time, issues.update_time,
|
select issues.id, issues.num, issues.title, issues.project_id, issues.create_time, issues.update_time,
|
||||||
issues.description, issues.status, issues.platform, issues.custom_fields,
|
issues.description, issues.status, issues.platform, issues.custom_fields,test_case_issues.test_case_id,
|
||||||
issues.lastmodify
|
issues.lastmodify
|
||||||
from issues
|
from issues
|
||||||
left join
|
left join
|
||||||
test_case_issues on issues.id = test_case_issues.issues_id
|
test_case_issues on issues.id = test_case_issues.issues_id
|
||||||
<include refid="queryWhereCondition"/>
|
<include refid="queryWhereCondition"/>
|
||||||
and test_case_issues.issues_id is null
|
and (test_case_issues.test_case_id is null or test_case_issues.test_case_id != #{request.caseId})
|
||||||
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
|
||||||
</select>
|
</select>
|
||||||
<select id="getIssueForSync" resultType="io.metersphere.base.domain.IssuesDao">
|
<select id="getIssueForSync" resultType="io.metersphere.base.domain.IssuesDao">
|
||||||
|
|
|
@ -76,6 +76,11 @@ public class IssuesController {
|
||||||
issuesService.deleteIssue(request);
|
issuesService.deleteIssue(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delete/relate")
|
||||||
|
public void deleteRelate(@RequestBody IssuesRequest request) {
|
||||||
|
issuesService.deleteIssueRelate(request);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/delete/{id}")
|
@GetMapping("/delete/{id}")
|
||||||
@MsAuditLog(module = "track_bug", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class)
|
@MsAuditLog(module = "track_bug", type = OperLogConstants.DELETE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = IssuesService.class)
|
||||||
public void delete(@PathVariable String id) {
|
public void delete(@PathVariable String id) {
|
||||||
|
|
|
@ -287,10 +287,13 @@ public class IssuesService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteIssue(IssuesRequest request) {
|
public void deleteIssue(IssuesRequest request) {
|
||||||
|
issuesMapper.deleteByPrimaryKey(request.getId());
|
||||||
|
deleteIssueRelate(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteIssueRelate(IssuesRequest request) {
|
||||||
String caseId = request.getCaseId();
|
String caseId = request.getCaseId();
|
||||||
String id = request.getId();
|
String id = request.getId();
|
||||||
issuesMapper.deleteByPrimaryKey(id);
|
|
||||||
|
|
||||||
TestCaseIssuesExample example = new TestCaseIssuesExample();
|
TestCaseIssuesExample example = new TestCaseIssuesExample();
|
||||||
example.createCriteria().andTestCaseIdEqualTo(caseId).andIssuesIdEqualTo(id);
|
example.createCriteria().andTestCaseIdEqualTo(caseId).andIssuesIdEqualTo(id);
|
||||||
testCaseIssuesMapper.deleteByExample(example);
|
testCaseIssuesMapper.deleteByExample(example);
|
||||||
|
|
|
@ -87,6 +87,7 @@ export default {
|
||||||
},
|
},
|
||||||
getIssues() {
|
getIssues() {
|
||||||
this.page.condition.projectId = this.projectId;
|
this.page.condition.projectId = this.projectId;
|
||||||
|
this.page.condition.caseId = this.caseId;
|
||||||
this.page.result = getRelateIssues(this.page);
|
this.page.result = getRelateIssues(this.page);
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
@click="closeIssue(scope.row)"
|
@click="closeIssue(scope.row)"
|
||||||
/>
|
/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip :content="$t('test_track.issue.delete')"
|
<el-tooltip :content="$t('test_track.case.unlink')"
|
||||||
placement="top" :enterable="false">
|
placement="top" :enterable="false">
|
||||||
<el-button type="danger" icon="el-icon-delete" size="mini"
|
<el-button type="danger" icon="el-icon-delete" size="mini"
|
||||||
circle :disabled="scope.row.platform !== 'Local'"
|
circle :disabled="scope.row.platform !== 'Local'"
|
||||||
|
@ -127,7 +127,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteIssue(row) {
|
deleteIssue(row) {
|
||||||
this.page.result = this.$post("/issues/delete", {id: row.id, caseId: this.caseId}, () => {
|
this.page.result = this.$post("/issues/delete/relate", {id: row.id, caseId: this.caseId}, () => {
|
||||||
this.getIssues();
|
this.getIssues();
|
||||||
this.$success(this.$t('commons.delete_success'));
|
this.$success(this.$t('commons.delete_success'));
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue