yeg
2026-08-31 9bd8e752b5d7ba7177fa16d74565b741699f5c22
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;
 
/** 完整性查询只返回持久化问题事实,不把实时快照当作历史结果。 */
@Service
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;
    }
}