package com.supServer.common.utils;

import java.math.BigDecimal;

/**
 * 等级评价
 * @author zmy
 * date 2022-04-15
 */
public class LevelUtil {
    public static String getLevel(BigDecimal sumScore,boolean lowLevel){
        String scoreLevel = null;
        if (lowLevel){
            return scoreLevel = "C";
        }
        if (sumScore.compareTo(new BigDecimal(90)) > -1) {
            scoreLevel = "AAA";
        }
        if (sumScore.compareTo(new BigDecimal(90)) == -1 && sumScore.compareTo(new BigDecimal(80)) > -1) {
            scoreLevel = "AA";
        }
        if (sumScore.compareTo(new BigDecimal(80)) == -1 && sumScore.compareTo(new BigDecimal(70)) > -1) {
            scoreLevel = "A";
        }
        if (sumScore.compareTo(new BigDecimal(70)) == -1 && sumScore.compareTo(new BigDecimal(60)) > -1) {
            scoreLevel = "BBB";
        }
        if (sumScore.compareTo(new BigDecimal(60)) == -1 && sumScore.compareTo(new BigDecimal(50)) > -1) {
            scoreLevel = "BB";
        }
        if (sumScore.compareTo(new BigDecimal(50)) == -1 && sumScore.compareTo(new BigDecimal(35)) > -1) {
            scoreLevel = "B";
        }
        if (sumScore.compareTo(new BigDecimal(35)) == -1 && sumScore.compareTo(new BigDecimal(20)) > -1) {
            scoreLevel = "CCC";
        }
        if (sumScore.compareTo(new BigDecimal(20)) == -1 && sumScore.compareTo(new BigDecimal(10)) > -1) {
            scoreLevel = "CC";
        }
        if (sumScore.compareTo(new BigDecimal(10)) == -1 && sumScore.compareTo(new BigDecimal(0)) > -1) {
            scoreLevel = "C";
        }
        return scoreLevel;
    }
}
