|
|
|
@ -8,7 +8,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class MntnStatus {
|
|
|
|
@ -60,6 +59,14 @@ public class MntnStatus {
|
|
|
|
|
*/
|
|
|
|
|
private Long rawReportTime;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This field was generated by MyBatis Generator.
|
|
|
|
|
* This field corresponds to the database column mntn_status.comment
|
|
|
|
|
*
|
|
|
|
|
* @mbg.generated
|
|
|
|
|
*/
|
|
|
|
|
private String comment;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This field was generated by MyBatis Generator.
|
|
|
|
|
* This field corresponds to the database column mntn_status.create_time
|
|
|
|
@ -216,6 +223,28 @@ public class MntnStatus {
|
|
|
|
|
this.rawReportTime = rawReportTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method was generated by MyBatis Generator.
|
|
|
|
|
* This method returns the value of the database column mntn_status.comment
|
|
|
|
|
*
|
|
|
|
|
* @return the value of mntn_status.comment
|
|
|
|
|
* @mbg.generated
|
|
|
|
|
*/
|
|
|
|
|
public String getComment() {
|
|
|
|
|
return comment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method was generated by MyBatis Generator.
|
|
|
|
|
* This method sets the value of the database column mntn_status.comment
|
|
|
|
|
*
|
|
|
|
|
* @param comment the value for mntn_status.comment
|
|
|
|
|
* @mbg.generated
|
|
|
|
|
*/
|
|
|
|
|
public void setComment(String comment) {
|
|
|
|
|
this.comment = comment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This method was generated by MyBatis Generator.
|
|
|
|
|
* This method returns the value of the database column mntn_status.create_time
|
|
|
|
@ -282,7 +311,17 @@ public class MntnStatus {
|
|
|
|
|
this.lastRawReport = lastRawReport;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HashMap<String, Object> makeRawReport() {
|
|
|
|
|
private HashMap<String, Object> reportMap;
|
|
|
|
|
|
|
|
|
|
public HashMap<String, Object> getReportMap() {
|
|
|
|
|
return reportMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setReportMap(HashMap<String, Object> reportMap) {
|
|
|
|
|
this.reportMap = reportMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void makeRawReport() {
|
|
|
|
|
if (StringUtils.isNotBlank(lastRawReport)) {
|
|
|
|
|
try {
|
|
|
|
|
HashMap<String, Object> map = JSONUtil.json2Object(lastRawReport, HashMap.class);
|
|
|
|
@ -290,83 +329,80 @@ public class MntnStatus {
|
|
|
|
|
if (msg != null) {
|
|
|
|
|
String[] strs = ((String) msg).split(",");
|
|
|
|
|
for (String str : strs) {
|
|
|
|
|
String[] vs = str.split(":");
|
|
|
|
|
if (vs.length == 2) {
|
|
|
|
|
if (vs[0].equals("i1服务器")) {
|
|
|
|
|
map.put("cma", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("i1")) {
|
|
|
|
|
map.put("i1Version", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("yw")) {
|
|
|
|
|
map.put("maintainVersion", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("心跳间隔")) {
|
|
|
|
|
map.put("heartbeatDuration", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("电池")) {
|
|
|
|
|
map.put("battery", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("系统重启")) {
|
|
|
|
|
map.put("rebootTimes", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("重启")) {
|
|
|
|
|
map.put("rebootTimes", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("i1重启")) {
|
|
|
|
|
map.put("i1RebootTimes", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("收")) {
|
|
|
|
|
map.put("recv", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("拍")) {
|
|
|
|
|
map.put("photoTimes", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("成")) {
|
|
|
|
|
map.put("success", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("败")) {
|
|
|
|
|
map.put("failure", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("传")) {
|
|
|
|
|
map.put("uploads", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("心跳累计")) {
|
|
|
|
|
map.put("numberOfHb", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("心跳")) {
|
|
|
|
|
map.put("numberOfHb", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("网络异常")) {
|
|
|
|
|
map.put("networkError", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("网络")) {
|
|
|
|
|
map.put("networkError", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("信号1")) {
|
|
|
|
|
map.put("signature1", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("信号2")) {
|
|
|
|
|
map.put("signature2", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("卡1")) {
|
|
|
|
|
map.put("simcard1", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("卡2")) {
|
|
|
|
|
map.put("simcard2", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("mcu")) {
|
|
|
|
|
map.put("mcu", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("ai")) {
|
|
|
|
|
map.put("aiVersion", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("cam")) {
|
|
|
|
|
map.put("cameraService", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("主板温度")) {
|
|
|
|
|
map.put("mainBoardTmp", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("电池温度")) {
|
|
|
|
|
map.put("batteryTmp", vs[1]);
|
|
|
|
|
} else if (vs[0].equals("剩余存储空间")) {
|
|
|
|
|
map.put("freeROM", vs[1]);
|
|
|
|
|
}
|
|
|
|
|
str = str.trim();
|
|
|
|
|
if (str.startsWith("i1服务器:")) {
|
|
|
|
|
map.put("cma", str.replaceFirst("i1服务器:", ""));
|
|
|
|
|
} else if (str.startsWith("i1:")) {
|
|
|
|
|
map.put("i1Version", str.replaceFirst("i1:", ""));
|
|
|
|
|
} else if (str.startsWith("yw:")) {
|
|
|
|
|
map.put("maintainVersion", str.replaceFirst("yw:", ""));
|
|
|
|
|
} else if (str.startsWith("心跳间隔:")) {
|
|
|
|
|
map.put("heartbeatDuration", str.replaceFirst("心跳间隔:", ""));
|
|
|
|
|
} else if (str.startsWith("电池:")) {
|
|
|
|
|
map.put("battery", str.replaceFirst("电池:", ""));
|
|
|
|
|
} else if (str.startsWith("系统重启:")) {
|
|
|
|
|
map.put("rebootTimes", str.replaceFirst("系统重启:", ""));
|
|
|
|
|
} else if (str.startsWith("重启:")) {
|
|
|
|
|
map.put("rebootTimes", str.replaceFirst("重启:", ""));
|
|
|
|
|
} else if (str.startsWith("i1重启:")) {
|
|
|
|
|
map.put("i1RebootTimes", str.replaceFirst("i1重启:", ""));
|
|
|
|
|
} else if (str.startsWith("收:")) {
|
|
|
|
|
map.put("recv", str.replaceFirst("收:", ""));
|
|
|
|
|
} else if (str.startsWith("拍:")) {
|
|
|
|
|
map.put("photoTimes", str.replaceFirst("拍:", ""));
|
|
|
|
|
} else if (str.startsWith("成:")) {
|
|
|
|
|
map.put("success", str.replaceFirst("成:", ""));
|
|
|
|
|
} else if (str.startsWith("败:")) {
|
|
|
|
|
map.put("failure", str.replaceFirst("败:", ""));
|
|
|
|
|
} else if (str.startsWith("传:")) {
|
|
|
|
|
map.put("uploads", str.replaceFirst("传:", ""));
|
|
|
|
|
} else if (str.startsWith("心跳累计:")) {
|
|
|
|
|
map.put("numberOfHb", str.replaceFirst("心跳累计:", ""));
|
|
|
|
|
} else if (str.startsWith("心跳:")) {
|
|
|
|
|
map.put("numberOfHb", str.replaceFirst("心跳:", ""));
|
|
|
|
|
} else if (str.startsWith("网络异常:")) {
|
|
|
|
|
map.put("networkError", str.replaceFirst("网络异常:", ""));
|
|
|
|
|
} else if (str.startsWith("网络:")) {
|
|
|
|
|
map.put("networkError", str.replaceFirst("网络:", ""));
|
|
|
|
|
} else if (str.startsWith("信号1:")) {
|
|
|
|
|
map.put("signature1", str.replaceFirst("信号1:", ""));
|
|
|
|
|
} else if (str.startsWith("信号2:")) {
|
|
|
|
|
map.put("signature2", str.replaceFirst("信号2:", ""));
|
|
|
|
|
} else if (str.startsWith("卡1:")) {
|
|
|
|
|
map.put("simcard1", str.replaceFirst("卡1:", ""));
|
|
|
|
|
} else if (str.startsWith("卡2:")) {
|
|
|
|
|
map.put("simcard2", str.replaceFirst("卡2:", ""));
|
|
|
|
|
} else if (str.startsWith("mcu:")) {
|
|
|
|
|
map.put("mcu", str.replaceFirst("mcu", ""));
|
|
|
|
|
} else if (str.startsWith("ai:")) {
|
|
|
|
|
map.put("aiVersion", str.replaceFirst("ai:", ""));
|
|
|
|
|
} else if (str.startsWith("cam:")) {
|
|
|
|
|
map.put("cameraService", str.replaceFirst("cam:", ""));
|
|
|
|
|
} else if (str.startsWith("主板温度:")) {
|
|
|
|
|
map.put("mainBoardTmp", str.replaceFirst("主板温度:", ""));
|
|
|
|
|
} else if (str.startsWith("电池温度:")) {
|
|
|
|
|
map.put("batteryTmp", str.replaceFirst("电池温度:", ""));
|
|
|
|
|
} else if (str.startsWith("剩余存储空间:")) {
|
|
|
|
|
map.put("freeROM", str.replaceFirst("剩余存储空间:", ""));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
reportMap = map;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("makeRawReport error, lastRawReport=" + lastRawReport, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public HashMap<String, Object> match(TerminalSelectVo vo) {
|
|
|
|
|
HashMap<String, Object> map = this.makeRawReport();
|
|
|
|
|
if (map != null) {
|
|
|
|
|
public boolean match(TerminalSelectVo vo) {
|
|
|
|
|
this.makeRawReport();
|
|
|
|
|
if (reportMap != null) {
|
|
|
|
|
if (StringUtils.isNotBlank(vo.getVersion())) {
|
|
|
|
|
int v = 0;
|
|
|
|
|
Iterator<String> it = map.keySet().iterator();
|
|
|
|
|
Iterator<String> it = reportMap.keySet().iterator();
|
|
|
|
|
while (it.hasNext()) {
|
|
|
|
|
String key = it.next();
|
|
|
|
|
Object value = map.get(key);
|
|
|
|
|
Object value = reportMap.get(key);
|
|
|
|
|
if (key.toLowerCase().contains("version")) {
|
|
|
|
|
if (value.toString().contains(vo.getVersion())) {
|
|
|
|
|
v = 1;
|
|
|
|
@ -376,20 +412,20 @@ public class MntnStatus {
|
|
|
|
|
}
|
|
|
|
|
if (vo.getVersionExclude()) {
|
|
|
|
|
if (v == 0) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (v == 1) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(vo.getCma())) {
|
|
|
|
|
int c = 0;
|
|
|
|
|
Iterator<String> it = map.keySet().iterator();
|
|
|
|
|
Iterator<String> it = reportMap.keySet().iterator();
|
|
|
|
|
while (it.hasNext()) {
|
|
|
|
|
String key = it.next();
|
|
|
|
|
Object value = map.get(key);
|
|
|
|
|
Object value = reportMap.get(key);
|
|
|
|
|
if (key.toLowerCase().contains("cma")) {
|
|
|
|
|
if (value.toString().contains(vo.getCma())) {
|
|
|
|
|
c = 1;
|
|
|
|
@ -399,20 +435,20 @@ public class MntnStatus {
|
|
|
|
|
}
|
|
|
|
|
if (vo.getCmaExclude()) {
|
|
|
|
|
if (c == 0) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (c == 1) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(vo.getOid())) {
|
|
|
|
|
int d = 0;
|
|
|
|
|
Iterator<String> it = map.keySet().iterator();
|
|
|
|
|
Iterator<String> it = reportMap.keySet().iterator();
|
|
|
|
|
while (it.hasNext()) {
|
|
|
|
|
String key = it.next();
|
|
|
|
|
Object value = map.get(key);
|
|
|
|
|
Object value = reportMap.get(key);
|
|
|
|
|
if (key.toLowerCase().contains("oid")) {
|
|
|
|
|
if (value.toString().contains(vo.getCma())) {
|
|
|
|
|
d = 1;
|
|
|
|
@ -422,15 +458,16 @@ public class MntnStatus {
|
|
|
|
|
}
|
|
|
|
|
if (vo.getOidExclude()) {
|
|
|
|
|
if (d == 0) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (d == 1) {
|
|
|
|
|
return map;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|