Skip to content

Commit a552619

Browse files
author
S00003829
committed
update
1 parent 799d357 commit a552619

4 files changed

Lines changed: 62 additions & 2 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.chery.gb.realtime.algorithm.rule.config;
2+
3+
4+
import com.chery.gb.realtime.algorithm.anotation.RuleConfig;
5+
import com.chery.gb.realtime.algorithm.bo.RuleConditionBO;
6+
import com.chery.gb.realtime.algorithm.bo.RuleConfigBO;
7+
import com.chery.gb.realtime.algorithm.bo.RuleDetailBO;
8+
import com.chery.gb.realtime.algorithm.enums.NewGbRuleCodeEnum;
9+
import com.chery.gb.realtime.algorithm.enums.RuleRelationEnum;
10+
import com.chery.gb.realtime.algorithm.enums.RuleSymbolEnum;
11+
import com.chery.gb.realtime.algorithm.enums.SignalEnum;
12+
13+
import java.util.ArrayList;
14+
15+
/**
16+
* 车辆状态非 1 启动且非 2 熄火
17+
* 车辆状态既不是启动也不是熄火
18+
*
19+
* @author wugaoyang
20+
* @date 2025/11/4 星期二
21+
*
22+
*/
23+
@RuleConfig(rule = NewGbRuleCodeEnum.RULE_CODE_259)
24+
public class RuleConfig_259 extends BaseConfig {
25+
26+
public RuleConfig_259() {
27+
ruleConfigBO = new RuleConfigBO();
28+
RuleConditionBO condition = new RuleConditionBO();
29+
ArrayList<RuleDetailBO> conditions = new ArrayList<>();
30+
conditions.add(RuleDetailBO.builder().signalId(SignalEnum.SIGNAL_220C.getCode()).signalRule(RuleSymbolEnum.NE.name()).signalValue("1").detailRelation(RuleRelationEnum.AND.name()).build());
31+
conditions.add(RuleDetailBO.builder().signalId(SignalEnum.SIGNAL_220C.getCode()).signalRule(RuleSymbolEnum.NE.name()).signalValue("2").detailRelation(RuleRelationEnum.AND.name()).build());
32+
condition.setConditions(conditions);
33+
condition.setReturn(true);
34+
condition.setRuleCode("259");
35+
condition.setDesc("车辆状态非 1 启动且非 2 熄火");
36+
ruleConfigBO.setCondition(condition);
37+
}
38+
39+
}

‎src/main/java/com/chery/gb/realtime/algorithm/workflow/WorkFlowEnum.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum WorkFlowEnum {
1919
VEHICLE_STATE_IS_NULL("2-1", "车辆状态为null检测", "车辆状态为null检测", false, 0, PRE_STATE),
2020
VEHICLE_STATE_IS_ERROR_OR_INVALID("2-2", "车辆状态为异常或无效检测", "车辆状态为异常或无效检测", false, 0, PRE_STATE),
2121
VEHICLE_STATE_IS_NOT_IN_RANGE("2-3", "车辆状态未定义检测", "车辆状态未定义检测", false, 0, PRE_STATE),
22-
VEHICLE_STATE_IS_NOT_1_2("2-4", "车辆状态非1启动且非2熄火检测", "车辆状态非1启动且非2熄火检测", false, 0, PRE_STATE),
22+
VEHICLE_STATE_IS_NOT_1_2("2-4", "车辆状态非1启动且非2熄火检测", "车辆状态非1启动且非2熄火检测", true , 0, PRE_STATE),
2323
VEHICLE_STATE_IS_2_SPEED_GT_5("2-5", "车辆状态为2熄火车速不为0", "车辆状态为2熄火车速不为0", false, 0, PRE_STATE),
2424
//充电状态
2525
CHARGING_STATE_IS_NULL("2-6", "充电状态为空", "充电状态为空", true, 0, PRE_STATE),
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.chery.gb.realtime.algorithm.workflow.config;
2+
3+
4+
import com.chery.gb.realtime.algorithm.anotation.WorkFlowConfig;
5+
import com.chery.gb.realtime.algorithm.enums.NewGbRuleCodeEnum;
6+
import com.chery.gb.realtime.algorithm.workflow.WorkFlowEnum;
7+
8+
import java.util.Arrays;
9+
10+
/**
11+
* @author wugaoyang
12+
* @date 2025/11/10 星期一
13+
*
14+
*/
15+
@WorkFlowConfig(WorkFlowEnum.VEHICLE_STATE_IS_NOT_1_2)
16+
public class WorkFlowConfig_VEHICLE_STATE_IS_NOT_1_2 extends BaseWorkFlowConfig {
17+
public WorkFlowConfig_VEHICLE_STATE_IS_NOT_1_2() {
18+
setRuleConditionBO(null);
19+
setRuleCodeList(Arrays.asList(NewGbRuleCodeEnum.RULE_CODE_259));
20+
}
21+
}

‎src/test/java/RuleValidateTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void test4() throws IOException {
8484
JSONArray retData = new JSONArray();
8585
SignalBO tmpl = BaseDataTest.getTmpl();
8686
// tmpl = new SignalBO();
87-
// tmpl.set_220C(null);
87+
tmpl.set_220C(3);
8888
tmpl.set_21AA(2);
8989
tmpl.set_2001(65535);
9090
tmpl.set_2009(65535);

0 commit comments

Comments
 (0)