Code.java
2.57 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
package com.viontech.integration.jiaoguansuo.entity;
import cn.hutool.core.util.XmlUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
* .
*
* @author 谢明辉
* @date 2022/2/23
*/
@SuppressWarnings("ALL")
public enum Code {
C_1003("大货车禁行","开启"),
C_1005("逆行","启用"),
C_1006("压导流带","启用算法"),
C_1007("跨线变道","启用"),
C_1009("异常停车","启用"),
C_1012("超速","启用"),
C_1013("隧道车灯","启用"),
C_1016("车辆超限","启用"),
C_1017("货车载人","启用"),
C_0001("行人上高速事件","启用"),
C_0005("拥堵检测","启用"),
C_0006("事故","启用"),
C_0007("隧道烟雾","启用"),
C_0009("路面湿滑","启用"),
C_0011("道路破损","启用"){
@Override
public String modifyConfig(String xml) {
Document document = XmlUtil.parseXml(xml);
Element element = XmlUtil.getElementByXPath("//root//功能配置//抓拍参数配置//路口电警", document);
Element zongzhi = XmlUtil.appendChild(element, "综治");
Element paramNode = XmlUtil.appendChild(zongzhi, paramName);
Element open = XmlUtil.appendChild(paramNode, openName);
XmlUtil.appendText(open, "1");
return XmlUtil.toStr(document);
}
},
C_0013("抛洒物检测","启用"),
C_0015("施工占道","启用"){
@Override
public String modifyConfig(String xml) {
Document document = XmlUtil.parseXml(xml);
Element element = XmlUtil.getElementByXPath("//root//功能配置//抓拍参数配置//路口电警", document);
Element zongzhi = XmlUtil.appendChild(element, "综治");
Element paramNode = XmlUtil.appendChild(zongzhi, paramName);
Element open = XmlUtil.appendChild(paramNode, openName);
XmlUtil.appendText(open, "1");
return XmlUtil.toStr(document);
}
};
public String paramName;
public String openName;
Code(String paramName, String openName) {
this.paramName = paramName;
this.openName = openName;
}
public String modifyConfig(String xml) {
Document document = XmlUtil.parseXml(xml);
Element element = XmlUtil.getElementByXPath("//root//功能配置//抓拍参数配置//路口电警", document);
Element paramNode = XmlUtil.appendChild(element, paramName);
Element open = XmlUtil.appendChild(paramNode, openName);
XmlUtil.appendText(open, "1");
return XmlUtil.toStr(document);
}
}