fix(项目管理): 报告清理报错问题
--bug=1049022 --user=宋昌昌 【任务中心】-系统任务保留时间不生效,超出保留时间的任务没有被清理 https://www.tapd.cn/55049933/s/1618815
This commit is contained in:
parent
53cf2d2d82
commit
82fc924888
|
@ -6,6 +6,7 @@ import io.metersphere.sdk.constants.ProjectApplicationType;
|
||||||
import io.metersphere.sdk.util.LogUtils;
|
import io.metersphere.sdk.util.LogUtils;
|
||||||
import io.metersphere.system.service.BaseCleanUpReport;
|
import io.metersphere.system.service.BaseCleanUpReport;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
@ -59,7 +60,9 @@ public class CleanupApiReportServiceImpl implements BaseCleanUpReport {
|
||||||
// 任务执行结果存在报告,明细做保留
|
// 任务执行结果存在报告,明细做保留
|
||||||
List<String> taskReportIds = getTaskReportIds(ids);
|
List<String> taskReportIds = getTaskReportIds(ids);
|
||||||
ids.removeAll(taskReportIds);
|
ids.removeAll(taskReportIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
deleteApiReport(ids);
|
deleteApiReport(ids);
|
||||||
|
}
|
||||||
apiReportCount = extApiReportMapper.countApiReportByTime(timeMills, projectId);
|
apiReportCount = extApiReportMapper.countApiReportByTime(timeMills, projectId);
|
||||||
}
|
}
|
||||||
int scenarioReportCount = extApiScenarioReportMapper.countScenarioReportByTime(timeMills, projectId);
|
int scenarioReportCount = extApiScenarioReportMapper.countScenarioReportByTime(timeMills, projectId);
|
||||||
|
@ -73,7 +76,9 @@ public class CleanupApiReportServiceImpl implements BaseCleanUpReport {
|
||||||
// 任务执行结果存在报告,明细做保留
|
// 任务执行结果存在报告,明细做保留
|
||||||
List<String> taskReportIds = getTaskReportIds(ids);
|
List<String> taskReportIds = getTaskReportIds(ids);
|
||||||
ids.removeAll(taskReportIds);
|
ids.removeAll(taskReportIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
deleteScenarioReport(ids);
|
deleteScenarioReport(ids);
|
||||||
|
}
|
||||||
scenarioReportCount = extApiScenarioReportMapper.countScenarioReportByTime(timeMills, projectId);
|
scenarioReportCount = extApiScenarioReportMapper.countScenarioReportByTime(timeMills, projectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,10 @@ public class TestPlanReportService {
|
||||||
testPlanReportMapper.updateByExampleSelective(testPlanReport, example);
|
testPlanReportMapper.updateByExampleSelective(testPlanReport, example);
|
||||||
// 任务执行结果存在报告,明细做保留
|
// 任务执行结果存在报告,明细做保留
|
||||||
subList.removeAll(taskReportIds);
|
subList.removeAll(taskReportIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(subList)) {
|
||||||
this.deleteTestPlanReportBlobs(subList);
|
this.deleteTestPlanReportBlobs(subList);
|
||||||
|
}
|
||||||
|
subList.clear();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue