fix: 定时清理场景报告问题
This commit is contained in:
parent
15a9bdadea
commit
f2102f5288
|
@ -494,6 +494,13 @@ public class ApiScenarioReportService {
|
||||||
public void delete(String id) {
|
public void delete(String id) {
|
||||||
apiScenarioReportDetailMapper.deleteByPrimaryKey(id);
|
apiScenarioReportDetailMapper.deleteByPrimaryKey(id);
|
||||||
apiScenarioReportMapper.deleteByPrimaryKey(id);
|
apiScenarioReportMapper.deleteByPrimaryKey(id);
|
||||||
|
ApiScenarioReportResultExample example = new ApiScenarioReportResultExample();
|
||||||
|
example.createCriteria().andReportIdEqualTo(id);
|
||||||
|
apiScenarioReportResultMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
ApiScenarioReportStructureExample structureExample = new ApiScenarioReportStructureExample();
|
||||||
|
structureExample.createCriteria().andReportIdEqualTo(id);
|
||||||
|
apiScenarioReportStructureMapper.deleteByExample(structureExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteByIds(List<String> ids) {
|
public void deleteByIds(List<String> ids) {
|
||||||
|
@ -503,6 +510,14 @@ public class ApiScenarioReportService {
|
||||||
detailExample.createCriteria().andReportIdIn(ids);
|
detailExample.createCriteria().andReportIdIn(ids);
|
||||||
apiScenarioReportDetailMapper.deleteByExample(detailExample);
|
apiScenarioReportDetailMapper.deleteByExample(detailExample);
|
||||||
apiScenarioReportMapper.deleteByExample(example);
|
apiScenarioReportMapper.deleteByExample(example);
|
||||||
|
|
||||||
|
ApiScenarioReportResultExample reportResultExample = new ApiScenarioReportResultExample();
|
||||||
|
reportResultExample.createCriteria().andReportIdIn(ids);
|
||||||
|
apiScenarioReportResultMapper.deleteByExample(reportResultExample);
|
||||||
|
|
||||||
|
ApiScenarioReportStructureExample structureExample = new ApiScenarioReportStructureExample();
|
||||||
|
structureExample.createCriteria().andReportIdIn(ids);
|
||||||
|
apiScenarioReportStructureMapper.deleteByExample(structureExample);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAPIReportBatch(APIReportBatchRequest reportRequest) {
|
public void deleteAPIReportBatch(APIReportBatchRequest reportRequest) {
|
||||||
|
@ -742,7 +757,10 @@ public class ApiScenarioReportService {
|
||||||
List<ApiScenarioReport> apiScenarioReports = apiScenarioReportMapper.selectByExample(example);
|
List<ApiScenarioReport> apiScenarioReports = apiScenarioReportMapper.selectByExample(example);
|
||||||
List<String> ids = apiScenarioReports.stream().map(ApiScenarioReport::getId).collect(Collectors.toList());
|
List<String> ids = apiScenarioReports.stream().map(ApiScenarioReport::getId).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(ids)) {
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
deleteByIds(ids);
|
APIReportBatchRequest request = new APIReportBatchRequest();
|
||||||
|
request.setIds(ids);
|
||||||
|
request.setSelectAllDate(false);
|
||||||
|
deleteAPIReportBatch(request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue