yeg
2026-09-05 92f32acd847ea1700590bc669750f23ef499840e
battery-business/src/main/java/com/battery/business/service/impl/TestWarningExceptionService.java
File was renamed from ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestWarningExceptionService.java
@@ -1,14 +1,14 @@
package com.ruoyi.system.service.impl;
package com.battery.business.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.fastjson2.JSON;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.system.domain.TTest;
import com.ruoyi.system.domain.TTestWarningException;
import com.ruoyi.system.domain.TTestWarningThreshold;
import com.ruoyi.system.mapper.TTestMapper;
import com.battery.business.domain.TTest;
import com.battery.business.domain.TTestWarningException;
import com.battery.business.domain.TTestWarningThreshold;
import com.battery.business.mapper.TTestMapper;
/** 对成功接收的测量值执行测试阈值判断;设备状态和缺失数据不经过此服务。 */
@Service
@@ -26,16 +26,12 @@
        }
    }
    /** 由测试负责人关闭开放异常,并在同一事务追加不可变的测试审计事实。 */
    /** 由测试负责人关闭开放异常,处理内容保存在异常事实中。 */
    @Transactional(rollbackFor = Exception.class)
    public int close(Long exceptionId, Long actorId, String actorName, String handlingNote) {
        TTestWarningException exception = mapper.selectWarningExceptionById(exceptionId);
        if (exception == null) return 0;
        int rows = mapper.closeWarningException(exceptionId, actorId, actorName, new Date(), handlingNote);
        if (rows == 1) {
            mapper.insertTestAudit(exception.getTestId(), "WARNING_EXCEPTION_CLOSED", actorId, actorName, null,
                    JSON.toJSONString(java.util.Map.of("exceptionId", exceptionId, "handlingNote", handlingNote)));
        }
        return rows;
    }
    private boolean outside(BigDecimal value, BigDecimal min, BigDecimal max) { return (min != null && value.compareTo(min) < 0) || (max != null && value.compareTo(max) > 0); }