package com.sysu.admin.controller.lz.period;

/**
 * 预警条件
 */
public class WarningCondition {



    public static String getWarningColor(Integer period, Double whitePoint){
        //春梢预警色 大红色
        if(period.intValue() == 2){
            return "#DA1B6E";
        }
        //白点期 无白点预警 黄色
        if(period.intValue() == 1 && whitePoint <= 0.3){
            return "#DA1B6E";
        }
        return "";
    }

    public static Integer getWarning(Integer period, Double whitePoint){
        //春梢预警色
        if(period.intValue() == 2){
            return 1;
        }
        //有冬梢 无白点预警
        if(period.intValue() == 1 && whitePoint <= 0.3){
            return 1;
        }
        return 0;
    }

}
