yeg
2026-08-27 2651949754a60afae6152977a0f83a1b4704cba5
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTestServiceImpl.java
@@ -135,7 +135,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteTestByIds(Long[] testIds, String updateBy)
    public int deleteTestByIds(Long[] testIds, Long operatorId, String updateBy)
    {
        if (testIds == null || testIds.length == 0) throw new ServiceException("请选择要删除的测试");
        int rows = 0;
@@ -144,7 +144,12 @@
            TTest current = testMapper.selectTestByIdForUpdate(testId);
            if (current == null) throw new ServiceException("测试不存在");
            if (!NOT_MONITORED.equals(current.getMonitoringStatus())) throw new ServiceException("开始监测后不能删除测试");
            rows += testMapper.deleteTestById(testId, updateBy);
            loadConfiguration(current);
            int deleted = testMapper.deleteTestById(testId, updateBy);
            if (deleted != 1) throw new ServiceException("测试配置已变更,请刷新后重试");
            testMapper.insertTestAudit(testId, "TEST_DELETED", operatorId, updateBy,
                    JSON.toJSONString(current), null);
            rows += deleted;
        }
        return rows;
    }