fix(测试跟踪): 修复公共用例库全部删除只删除10条的缺陷

--bug=1012662 --user=王孝刚 【测试跟踪】github#12933. 公共用例库全选数据,每页显示 10
条,批量删除全部,结果只删除 10 条 https://www.tapd.cn/55049933/s/1146199
This commit is contained in:
wxg0103 2022-04-25 09:41:42 +08:00 committed by 刘瑞斌
parent 250ba80af1
commit 13988078d1
3 changed files with 10 additions and 7 deletions

View File

@ -332,8 +332,8 @@ public class TestCaseController {
@MsAuditLog(module = OperLogModule.TRACK_TEST_CASE, type = OperLogConstants.BATCH_DEL, beforeEvent = "#msClass.getLogDetails(#request.ids)", msClass = TestCaseService.class)
@SendNotice(taskType = NoticeConstants.TaskType.TRACK_TEST_CASE_TASK, target = "#targetClass.findByBatchRequest(#request)", targetClass = TestCaseService.class,
event = NoticeConstants.Event.DELETE, mailTemplate = "track/TestCaseDelete", subject = "测试用例通知")
public void deleteToGcBatchPublic(@RequestBody List<String> ids) {
testCaseService.deleteToGcBatchPublic(ids);
public void deleteToGcBatchPublic(@RequestBody TestCaseBatchRequest request) {
testCaseService.deleteToGcBatchPublic(request);
}
@PostMapping("/reduction")

View File

@ -2197,7 +2197,10 @@ public class TestCaseService {
}
}
public void deleteToGcBatchPublic(List<String> ids) {
public void deleteToGcBatchPublic(TestCaseBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(),
(query) -> extTestCaseMapper.selectPublicIds(query));
List<String> ids = request.getIds();
if (CollectionUtils.isNotEmpty(ids)) {
for (String id : ids) {
TestCase testCase = testCaseMapper.selectByPrimaryKey(id);

View File

@ -1094,8 +1094,8 @@ export default {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let ids = this.$refs.table.selectIds;
this.$post('/test/case/batch/movePublic/deleteToGc', ids, () => {
let param = buildBatchParam(this, this.$refs.table.selectIds);
this.$post('/test/case/batch/movePublic/deleteToGc', param, () => {
this.$refs.table.clear();
this.$emit("refresh");
this.$success(this.$t('commons.delete_success'));
@ -1132,8 +1132,8 @@ export default {
//
else {
if (this.publicEnable) {
let ids = [testCase.id];
this.$post('/test/case/batch/movePublic/deleteToGc', ids, () => {
let param = buildBatchParam(this, this.$refs.table.selectIds);
this.$post('/test/case/batch/movePublic/deleteToGc', param, () => {
this.$success(this.$t('commons.delete_success'));
// this.initTable();
this.$refs.apiDeleteConfirm.close();