// 根据学界获取年级名称 private String getGrade(int y) { Date now = new Date(); int pastHalf = isPastHalf(now) ? 1 : 0; int currentYear = DateUtil.getYear(now); int year = currentYear + pastHalf - y; return NumberUtil.getSimpleNumber(year) + "年级"; }
// 根据年份获取年级号 private int getGradeNum(int year) { Date now = new Date(); int pastHalf = isPastHalf(now) ? 1 : 0; int currentYear = DateUtil.getYear(now); return currentYear + pastHalf - year; }