[测评系统]--测评系统核心代码库
zhijie
2021-06-08 56c8bc18def3992259da50948119259f571d04ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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<String, String> 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<String, String> getMAQwaterDropsImages() {
        return null;
    }
}