Эх сурвалжийг харах

fix: 修复查询串码问题
1. 修复人脸识别与烟雾的查询出现类型混乱问题

kindring 1 жил өмнө
parent
commit
a7ca72c4a5

+ 6 - 6
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java

@@ -781,20 +781,20 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
 				}
 
 				String info = "";
-				if (itemArithmetic.equals("1")) {
+				if (itemArithmetic.equals("01")) {
 					info = "人脸识别";
-				} else if (itemArithmetic.equals("2")) {
+				} else if (itemArithmetic.equals("02")) {
 					info = id;
 					track_id = itemArithmetic;
 					similarity = scoreStr;
 				} else {
-					if (itemArithmetic.equals("6")) {
+					if (itemArithmetic.equals("06")) {
 						info = "吊车";
-					} else if (itemArithmetic.equals("7")) {
+					} else if (itemArithmetic.equals("07")) {
 						info = "塔吊";
-					} else if (itemArithmetic.equals("8")) {
+					} else if (itemArithmetic.equals("08")) {
 						info = "火焰";
-					} else if (itemArithmetic.equals("9")) {
+					} else if (itemArithmetic.equals("09")) {
 						info = "施工机械";
 					} else if (itemArithmetic.equals("10")) {
 						info = "吊线异物";

+ 12 - 13
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/aiLib/AiControl.java

@@ -258,7 +258,7 @@ public class AiControl {
         if (ai_info == null) {
             // 判断是否是车牌识别
             ai_info = JSON.parseObject(bodyAiAlarm.getReco_info()).getJSONArray("plates");
-            arithmetic.add("2");
+            arithmetic.add("02");
             is_plates = true;
         }
         // 判断是否为空数组
@@ -270,29 +270,29 @@ public class AiControl {
             JSONObject jsonObject = ai_info.getJSONObject(i);
             // 车牌类型
             if (is_plates) {
-                jsonObject.put("arithmetic", "2");
+                jsonObject.put("arithmetic", "02");
                 break;
             }
             // 人脸类型
             if (jsonObject.containsKey("msgid")) {
-                arithmetic.add("1");
-                jsonObject.put("arithmetic", "1");
+                arithmetic.add("01");
+                jsonObject.put("arithmetic", "01");
                 break;
             }
             // 识别类型
             String id = jsonObject.getString("id");
             if (id.equals("DiaoChe")) {
-                arithmetic.add("6");
-                jsonObject.put("arithmetic", "6");
+                arithmetic.add("06");
+                jsonObject.put("arithmetic", "06");
             } else if (id.equals("TaDiao")) {
-                arithmetic.add("7");
-                jsonObject.put("arithmetic", "7");
+                arithmetic.add("07");
+                jsonObject.put("arithmetic", "07");
             } else if (id.equals("fire")) {
-                arithmetic.add("8");
-                jsonObject.put("arithmetic", "8");
+                arithmetic.add("08");
+                jsonObject.put("arithmetic", "08");
             } else if (id.equals("ShiGongJiXie")) {
-                arithmetic.add("9");
-                jsonObject.put("arithmetic", "9");
+                arithmetic.add("09");
+                jsonObject.put("arithmetic", "09");
             } else if (id.equals("DaoXianYiWu")) {
                 arithmetic.add("10");
                 jsonObject.put("arithmetic", "10");
@@ -300,7 +300,6 @@ public class AiControl {
                 arithmetic.add("11");
                 jsonObject.put("arithmetic", "11");
             }
-
         }
         logger.info("arithmetic distinctArray:{}", arithmetic);
         // 算法存储的数据去除重复项

+ 14 - 37
web_src/src/map/ai.js

@@ -1,37 +1,14 @@
 import {toNumber} from "../until/typeTool";
 
 export const arithmeticEnum = {
-    face: {
-        val: 1,
-        text: '人脸识别',
-    },
-    fire: {
-        val: 8,
-        text: '火情'
-    },
-    carPlate: {
-        val: 2,
-        text: '车牌'
-  },
-  DiaoChe: {
-    val: 6, text: '吊车'
-  },
-  TaDiao: {
-    val: 7,
-    text: '塔吊'
-  },
-  ShiGongJiXie: {
-    val: 9,
-    text: '施工机械'
-  },
-  DaoXianYiWu: {
-    val: 10,
-    text: '吊线异物'
-  },
-  smoke: {
-    val: 11,
-    text: '烟雾'
-  },
+    face: {val: "01", text: '人脸识别'},
+    fire: {val: "08", text: '火情'},
+    carPlate: {val: "02", text: '车牌'},
+    DiaoChe: {val: "06", text: '吊车'},
+    TaDiao: {val: "07", text: '塔吊'},
+    ShiGongJiXie: {val: "09", text: '施工机械'},
+    DaoXianYiWu: {val: "10", text: '吊线异物'},
+    smoke: {val: "11", text: '烟雾'},
 }
 
 const triggerTypeEnum = {
@@ -69,15 +46,15 @@ const alarmStateEnum = {
  * @type {{unlimited: number, blackList: number, whiteList: number}}
  */
 export const triggerTypes = {
-  unlimited:triggerTypeEnum.unlimited.val,
-  whiteList:triggerTypeEnum.whiteList.val,
-  blackList:triggerTypeEnum.blackList.val,
+    unlimited: triggerTypeEnum.unlimited.val,
+    whiteList: triggerTypeEnum.whiteList.val,
+    blackList: triggerTypeEnum.blackList.val,
 }
 
 export const alarmStates = {
-  unread:alarmStateEnum.unread.val,
-  noAlarm:alarmStateEnum.noAlarm.val,
-  read:alarmStateEnum.read.val,
+    unread: alarmStateEnum.unread.val,
+    noAlarm: alarmStateEnum.noAlarm.val,
+    read: alarmStateEnum.read.val,
 }
 
 const aiTypes = {