feiyu02
2024-01-09 c1becf4cbd2e99601ce011c14b8742427249cfb4
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/ScoreUtil.kt
@@ -2,11 +2,13 @@
import cn.flightfeather.supervision.business.Info
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import org.apache.poi.hssf.util.HSSFColor
import kotlin.math.abs
/**
@@ -63,4 +65,24 @@
            value = itemRule.extension1 ?: "0"
            extension1 = (itemRule.extension1 != null).toString()
        }
    /**
     * 分数转换环信码
     */
    fun scoreToCredit(s: Int?): Pair<Int?, String?> {
        return when (s) {
            in 0..59 -> Pair(2, "红码")
            in 60..89 -> Pair(1, "黄码")
            in 90..100 -> Pair(0, "绿码")
            null -> Pair(null, null)
            else -> Pair(-1, "超出范围")
        }
    }
    /**
     * 分数转换规范等级
     */
    fun scoreToStandard() {
    }
}