yeg
2026-09-02 74f55db1acd945f4860b2d0b4bae48e2b918b32b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ruoyi.system.service.impl;
 
import java.util.List;
import org.springframework.stereotype.Service;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.domain.TTestIntegrityIssue;
import com.ruoyi.system.mapper.TTestMapper;
import com.ruoyi.system.service.ITTestService;
import com.ruoyi.system.service.ITestIntegrityService;
 
/** 完整性查询只返回持久化问题事实,不把实时快照当作历史结果。 */
public class TestIntegrityServiceImpl implements ITestIntegrityService
{
    private final TTestMapper mapper;
    private final ITTestService tests;
 
    public TestIntegrityServiceImpl(TTestMapper mapper, ITTestService tests)
    { this.mapper = mapper; this.tests = tests; }
 
    /** 返回持久化完整性问题和历史异常事实,不把实时快照当作最终结果。 */
    @Override
    public List<TTestIntegrityIssue> selectIssues(Long testId)
    {
        if (testId == null) throw new ServiceException("测试ID不能为空");
        tests.selectTestById(testId);
        List<TTestIntegrityIssue> issues = new java.util.ArrayList<>();
        List<TTestIntegrityIssue> integrity = mapper.selectIntegrityIssues(testId);
        if (integrity != null) issues.addAll(integrity);
        List<TTestIntegrityIssue> exceptions = mapper.selectTestExceptionFacts(testId);
        if (exceptions != null) issues.addAll(exceptions);
        return issues;
    }
}