package com.ots.project.tool.report.RuilinMAQ.condition;
|
import com.ots.common.enums.LangTypeEnum;
|
import com.ots.project.exam.domain.TLibraryCode;
|
import com.ots.project.tool.report.MAQ.base.BaseCondition;
|
import lombok.Getter;
|
import lombok.Setter;
|
import java.util.HashMap;
|
import java.util.Map;
|
@Getter
|
@Setter
|
public class NumberOfStars extends BaseCondition {
|
private String conditionKey;
|
private String name;
|
public NumberOfStars(String conditionKey) {
|
this.conditionKey = conditionKey;
|
}
|
@Override
|
public TLibraryCode calculate(Map<String, String> map, LangTypeEnum langType) {
|
this.name = conditionKey + "SS";
|
String conditionValue = map.get(conditionKey);
|
if (checkParamsIsNull(conditionValue)) {
|
return null;
|
}
|
Double aDouble = Double.valueOf(conditionValue);
|
boolean RL000001 = aDouble <= 30;
|
boolean RL000002 = 30 < aDouble && aDouble < 70;
|
boolean RL000003 = aDouble >= 70;
|
Map calculateMap = new HashMap();
|
calculateMap.put(RL000001, "RL000001");
|
calculateMap.put(RL000002, "RL000002");
|
calculateMap.put(RL000003, "RL000003");
|
String codeId = selectTrueObject(calculateMap);
|
|
TLibraryCode maqReportLibrary = getMaqReportLibrary(map, codeId, langType);
|
return maqReportLibrary;
|
}
|
@Override
|
public Map<String, String> getMAQwaterDropsImages() {
|
return null;
|
}
|
}
|