Repository navigation
Expand file tree
/
Copy pathMyTest.java
More file actions
73 lines (65 loc) · 2.48 KB
/
Copy pathMyTest.java
File metadata and controls
73 lines (65 loc) · 2.48 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import cn.hutool.core.util.StrUtil;
import com.chery.gb.realtime.algorithm.enums.NewGbRuleCodeEnum;
import com.chery.gb.realtime.algorithm.enums.SignalEnum;
import com.chery.gb.realtime.algorithm.workflow.GbWorkFlowEnum;
import com.chery.gb.realtime.algorithm.workflow.config.BaseWorkFlowConfig;
import com.chery.gb.realtime.algorithm.workflow.factory.WorkFlowConfigFactory;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Test;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author wugaoyang
* @date 2025/11/3 星期一
*
*/
public class MyTest {
@Test
public void test1() {
List<NewGbRuleCodeEnum> byGroup = NewGbRuleCodeEnum.getByGroup("整车数据");
for (NewGbRuleCodeEnum newGbRuleCodeEnum : byGroup) {
System.out.println(newGbRuleCodeEnum.getDesc());
}
}
@Test
public void test3() {
for (GbWorkFlowEnum value : GbWorkFlowEnum.values()) {
BaseWorkFlowConfig workFlowConfig = WorkFlowConfigFactory.getByCode(value.getCode());
String CODE = "\"" + value.getCode() + "\"";
List<NewGbRuleCodeEnum> ruleCodeList;
System.out.println("#" + value.getName());
if (workFlowConfig != null) {
ruleCodeList = workFlowConfig.getRuleCodeList();
if (CollectionUtils.isNotEmpty(ruleCodeList)) {
List<String> collect = ruleCodeList.stream().map(NewGbRuleCodeEnum::getCode).collect(Collectors.toList());
String join = String.join(",", collect);
System.out.println(CODE + ": " + join);
} else {
System.out.println(CODE + ": null");
}
} else {
System.out.println(CODE + ": null");
}
}
}
@Test
public void test5() {
for (int i = 77; i <= 94; i++) {
System.out.print(i + ",");
}
}
@Test
public void test6() {
for (GbWorkFlowEnum value : GbWorkFlowEnum.values()) {
System.out.println("WF_" + value.getCode() + "(" + getDesc(value.getCode()) + "," + getDesc(value.getName()) + "," + getDesc(value.getDesc()) + "," + value.isReturn() + "," + value.getSkip() + "," + value.getParent() + " ),");
}
}
private String getDesc(String code) {
if (StrUtil.isBlank(code)) {
return code;
}
return "\"" + code + "\"";
}
}