package com.ots.project.tool.report.MAQNEW.condition; import com.ots.common.enums.LangTypeEnum; import com.ots.project.exam.domain.TLibraryCode; import com.ots.project.tool.report.MAQNEW.base.BaseCondition_V2; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import java.util.Map; @Setter @Getter @Slf4j public class ScoreCharacteristics_V2 extends BaseCondition_V2 { private final String conditionKey; private Double conditionValue; private String name; public ScoreCharacteristics_V2(String conditionKey) { this.conditionKey = conditionKey; } @Override public TLibraryCode calculate(Map map, LangTypeEnum langType) { String keyValue = map.get(conditionKey); if (checkParamsIsNull(keyValue)) { return null; } conditionValue = Double.valueOf(keyValue); if (conditionValue <= 5) { name = conditionKey + "_XX1"; } else if (6 <= conditionValue && conditionValue <= 30) { name = conditionKey + "_XX2"; } else if (31 <= conditionValue && conditionValue <= 49) { name = conditionKey + "_XX3"; } else if (50 <= conditionValue && conditionValue <= 69) { name = conditionKey + "_XX4"; } else if (70 <= conditionValue && conditionValue <= 94) { name = conditionKey + "_XX5"; } else if (conditionValue >= 95) { name = conditionKey + "_XX6"; } TLibraryCode libraryCode = new TLibraryCode(); libraryCode.setLangTypeContext(keyValue, langType); return libraryCode; } @Override public Map getMAQwaterDropsImages() { return null; } }