[测评系统]--测评系统核心代码库
linzhijie
2023-05-17 ce7c778150b82b7106e9edebbb6d69036bd389f3
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.MAQ.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 lombok.extern.slf4j.Slf4j;
import java.util.Map;
@Setter
@Getter
@Slf4j
public class ScoreCharacteristics extends BaseCondition {
    private final String conditionKey;
    private Double conditionValue;
    private String name;
    public ScoreCharacteristics(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;
    }
}