调整检测报告

This commit is contained in:
2025-10-21 15:07:49 +08:00
parent 51fdf6bf59
commit dddffe43cb
2 changed files with 41 additions and 3 deletions

View File

@@ -1983,9 +1983,9 @@ public class ResultServiceImpl implements IResultService {
if (isZeroFiltered) {
zeroFilteredPoints++; // 统计双零点
// 双零情况,记录但不加入结果判定
zeroFilteredPhases.add(phase.toUpperCase() + "");
// 将结果改为特殊标记,不参与整体结论判定
singlePhaseData.put(ItemReportKeyEnum.RESULT.getKey(), "双零过滤");
zeroFilteredPhases.add(phase.toUpperCase() + "");
// 将结果改为特殊标记,不参与整体结论判定
singlePhaseData.put(ItemReportKeyEnum.RESULT.getKey(), "/");
} else {
// 有非双零数据
hasNonZeroData = true;

View File

@@ -7,6 +7,7 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.LogUtil;
import com.njcn.gather.system.log.service.ISysLogAuditService;
import com.njcn.gather.system.pojo.enums.SystemResponseEnum;
import com.njcn.web.utils.HttpResultUtil;
import com.njcn.web.utils.HttpServletUtil;
import com.njcn.web.utils.ReflectCommonUtil;
@@ -24,6 +25,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.io.IOException;
import java.nio.file.NoSuchFileException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
@@ -115,6 +118,41 @@ public class GlobalBusinessExceptionHandler {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.INDEX_OUT_OF_BOUNDS_EXCEPTION, null, ReflectCommonUtil.getMethodDescribeByException(indexOutOfBoundsException));
}
/**
* 文件未找到异常捕捉
*
* @param noSuchFileException 文件未找到异常
*/
@ExceptionHandler(NoSuchFileException.class)
public HttpResult<String> handleNoSuchFileException(NoSuchFileException noSuchFileException) {
String filePath = noSuchFileException.getFile();
// 日志记录详细路径,用于后端排查
log.warn("文件未找到异常 - 文件路径: {}", filePath, noSuchFileException);
recodeBusinessExceptionLog(noSuchFileException, SystemResponseEnum.FILE_NOT_FOUND.getMessage());
return HttpResultUtil.assembleResult(SystemResponseEnum.FILE_NOT_FOUND.getCode(), null,
StrFormatter.format("{}{}{}", ReflectCommonUtil.getMethodDescribeByException(noSuchFileException),
StrUtil.C_COMMA, SystemResponseEnum.FILE_NOT_FOUND.getMessage()));
}
/**
* 文件IO异常捕捉通用IOException排除NoSuchFileException
*
* @param ioException IO异常
*/
@ExceptionHandler(IOException.class)
public HttpResult<String> handleIOException(IOException ioException) {
// 排除 NoSuchFileException已由专门的处理器处理
if (ioException instanceof NoSuchFileException) {
return handleNoSuchFileException((NoSuchFileException) ioException);
}
// 日志记录详细异常信息,用于后端排查
LogUtil.logExceptionStackInfo(SystemResponseEnum.FILE_IO_ERROR.getMessage(), ioException);
recodeBusinessExceptionLog(ioException, SystemResponseEnum.FILE_IO_ERROR.getMessage());
return HttpResultUtil.assembleResult(SystemResponseEnum.FILE_IO_ERROR.getCode(), null,
StrFormatter.format("{}{}{}", ReflectCommonUtil.getMethodDescribeByException(ioException),
StrUtil.C_COMMA, SystemResponseEnum.FILE_IO_ERROR.getMessage()));
}
/**
* 前端请求后端,请求中参数的媒体方式不支持异常
*