瀏覽代碼

物联设备信息模块,接入报警主机传感器数据功能

humingshi-7@163.com 1 年之前
父節點
當前提交
6890f5d32d

+ 15 - 15
project_data/sql/0.1.1/soc/soc.sql

@@ -1065,21 +1065,21 @@ INSERT INTO  `iot_alarm_system_field`(`id`, `source_type`, `source_type_des`, `s
 INSERT INTO  `iot_alarm_system_field`(`id`, `source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (164, 41860002, '24小时回路缺相状态', '41860002', '24小时回路缺相状态', 'status', '{\"0\": \"缺相\",\"1\": \"通电\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
 
 -- 报警主机传感器 --
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '湿度(报警主机)', 'AlarmHostInput_Humidity', '湿度', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '温度(报警主机)', 'AlarmHostInput_Temperature', '温度', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '烟感(报警主机)', 'AlarmHostInput_Smoke', '烟感', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '红外(报警主机)', 'AlarmHostInput_Infrared', '红外', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '水浸(报警主机)', 'AlarmHostInput_Soaking', '水浸', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '门磁(报警主机)', 'AlarmHostInput_DoorSensor', '门磁', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '其他(报警主机)', 'AlarmHostInput_Other', '其他', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '位移(报警主机)', 'AlarmHostInput_Displacement', '位移', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '破碎(报警主机)', 'AlarmHostInput_Broken', '破碎', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '震动(报警主机)', 'AlarmHostInput_Shock', '震动', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '防拆(报警主机)', 'AlarmHostInput_Tamper', '防拆', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '入侵(报警主机)', 'AlarmHostInput_Intrusion', '入侵', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '红外微波双鉴(报警主机)', 'AlarmHostInput_IMDualIdentification', '红外微波双鉴', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '微波(报警主机)', 'AlarmHostInput_Microwave', '微波', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
-INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (500, '紧急按钮(报警主机)', 'AlarmHostInput_EmergencyButton', '紧急按钮', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (501, '湿度传感器', 'Humidity', '湿度', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (502, '温度传感器', 'Temperature', '温度', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (503, '烟感传感器', 'Smoke', '烟感', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (504, '红外传感器', 'Infrared', '红外', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (505, '水浸传感器', 'Soaking', '水浸', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (506, '门磁传感器', 'DoorSensor', '门磁', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (507, '其他传感器', 'Other', '其他', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (508, '位移传感器', 'Displacement', '位移', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (509, '破碎传感器', 'Broken', '破碎', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (510, '震动传感器', 'Shock', '震动', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (511, '防拆传感器', 'Tamper', '防拆', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (512, '入侵传感器', 'Intrusion', '入侵', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (513, '红外微波双鉴传感器', 'IMDualIdentification', '红外微波双鉴', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (514, '微波传感器', 'Microwave', '微波', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
+INSERT INTO  `iot_alarm_system_field`(`source_type`, `source_type_des`, `sys_field_code`, `name`, `property_name`, `specs`, `operators`, `type`, `type_des`, `unit`, `enable`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (515, '紧急按钮传感器', 'EmergencyButton', '紧急按钮', 'status', '{\"alarm\": \"报警\",\"bypassAlarm\": \"旁路报警\",\"bypass\": \"旁路\",\"normal\": \"正常\",\"activity\": \"活动\",\"unknow\": \"未知\"}', '{\"EQUALS\": \"等于\"}', 'ENUM', '枚举', NULL, 1, NULL, NULL, NULL, NULL);
 
 DELIMITER ??
 DROP PROCEDURE IF EXISTS schema_change??

+ 41 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/enums/iot/BaseDeviceTypeEnum.java

@@ -36,6 +36,38 @@ public enum BaseDeviceTypeEnum {
     FSU_DoPowerCollection("21", "FSU回路通电状态"),
     FSU_DoPowerControlBoxButton("22", "DO8小时控电箱按钮"),
 
+
+    AlarmHostInput_Humidity("Humidity","湿度传感器"),
+    AlarmHostInput_Temperature("Temperature","温度传感器"),
+    AlarmHostInput_Smoke("Smoke","烟感传感器"),
+    AlarmHostInput_Infrared("Infrared","红外传感器"),
+    AlarmHostInput_Soaking("Soaking","水浸传感器"),
+    AlarmHostInput_DoorSensor("DoorSensor","门磁传感器"),
+    AlarmHostInput_Other("Other(","其他传感器"),
+    AlarmHostInput_Displacement("Displacement","位移传感器"),
+    AlarmHostInput_Broken("Broken","破碎传感器"),
+    AlarmHostInput_Shock("Shock","震动传感器"),
+    AlarmHostInput_Tamper("Tamper","防拆传感器"),
+    AlarmHostInput_Intrusion("Intrusion","入侵传感器"),
+    AlarmHostInput_IMDualIdentification("IMDualIdentification","红外微波双鉴传感器"),
+    AlarmHostInput_Microwave("Microwave","微波传感器"),
+    AlarmHostInput_EmergencyButton("EmergencyButton","紧急按钮传感器"),
+
+//    AlarmHostInput_Humidity("23","湿度传感器"),
+//    AlarmHostInput_Temperature("24","温度传感器"),
+//    AlarmHostInput_Smoke("25","烟感传感器"),
+//    AlarmHostInput_Infrared("26","红外传感器"),
+//    AlarmHostInput_Soaking("27","水浸传感器"),
+//    AlarmHostInput_DoorSensor("28","门磁传感器"),
+//    AlarmHostInput_Other("29","其他传感器"),
+//    AlarmHostInput_Displacement("30","位移传感器"),
+//    AlarmHostInput_Broken("31","破碎传感器"),
+//    AlarmHostInput_Shock("32","震动传感器"),
+//    AlarmHostInput_Tamper("33","防拆传感器"),
+//    AlarmHostInput_Intrusion("34","入侵传感器"),
+//    AlarmHostInput_IMDualIdentification("35","红外微波双鉴传感器"),
+//    AlarmHostInput_Microwave("36","微波传感器"),
+//    AlarmHostInput_EmergencyButton("37","紧急按钮传感器"),
     ;
     private String code;
     private String desc;
@@ -72,4 +104,13 @@ public enum BaseDeviceTypeEnum {
         return e != null ? e.getDesc() : "";
     }
 
+    public static String getNameByCode(String code) {
+        String name = null ;
+        for (BaseDeviceTypeEnum enumNode : BaseDeviceTypeEnum.values()) {
+            if(code.equals(enumNode.getCode())){
+                name = enumNode.name();
+            }
+        }
+        return name;
+    }
 }

+ 11 - 7
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/protection/service/impl/IotAlarmHostServiceImpl.java

@@ -399,11 +399,11 @@ public class IotAlarmHostServiceImpl implements IIotAlarmHostService, RouterServ
             LogUtils.STATUS_INFO_STATUS_SENSOR.error("接收报警主机传感器状态事件:未查询到报警主机传感器信息,token:{},alarmHostId:{},zoneId:{},inputIndex:{}",token,deviceName,subsystemId,index);
             return;
         }
-        String vipProductName = IotInputSensorTypeEnum.formatterSystemField(input.getSensorType());
+        String sensorType = input.getSensorType();
         Long vipDeviceCode = input.getId();
 
         QueryWrapper<IotAlarmSystemField> fieldWrapper = new QueryWrapper<>();
-        fieldWrapper.eq("sys_field_code",vipProductName);
+        fieldWrapper.eq("sys_field_code",sensorType);
         fieldWrapper.eq("enable",1);
         List<IotAlarmSystemField> fieldList = alarmSystemFieldMapper.selectList(fieldWrapper);
         IotPropertiesRes resParam = new IotPropertiesRes();
@@ -412,7 +412,7 @@ public class IotAlarmHostServiceImpl implements IIotAlarmHostService, RouterServ
 
         JSONArray arr = this.dealStatusData(resParam, fieldList);
         if(arr == null || arr.isEmpty()){
-            LogUtils.STATUS_INFO_STATUS_SENSOR.debug("接收报警主机传感器状态事件: 匹配表iotAlarmSystemField属性失败,productName={},deviceName={}", vipProductName, vipDeviceCode);
+            LogUtils.STATUS_INFO_STATUS_SENSOR.debug("接收报警主机传感器状态事件: 匹配表iotAlarmSystemField属性失败,productName={},deviceName={}", sensorType, vipDeviceCode);
             return;
         }
 
@@ -420,22 +420,26 @@ public class IotAlarmHostServiceImpl implements IIotAlarmHostService, RouterServ
         Long id= IDHelper.id();
         String arrInfo = JSON.toJSONString(arr);
         String displayName = input.getDefenceAreaName();
+        IotAlarmSystemField field = fieldList.get(0);
+        String deviceType = String.valueOf(field.getSourceType());
         //入库状态app附表
         QueryWrapper<IotDeviceStatus> wrapper = new QueryWrapper<>();
-        wrapper.eq("device_product", vipProductName);
+        wrapper.eq("device_type", deviceType);
+        wrapper.eq("device_product", sensorType);
         wrapper.eq("device_id", vipDeviceCode);
         wrapper.last(limitOne);
         IotDeviceStatus status = iotDeviceStatusMapper.selectOne(wrapper);
         if (status == null) {
             status = new IotDeviceStatus();
             status.setId(id);
-            status.setDeviceProduct(vipProductName);
+            status.setDeviceProduct(sensorType);
             status.setDeviceId(vipDeviceCode);
             //todo:
             status.setUniqueCode(token + "_" + vipDeviceCode);
             //status.setUniqueCode();
             status.setDeviceCode(input.getAlarmHostCode());
-            //status.setDeviceType(SensorType.getCodeByProduct(productName));
+            //todo:
+            status.setDeviceType(deviceType);
             status.setDeviceName(displayName);
             status.setInfo(arrInfo);
             status.setCreateTime(now);
@@ -459,7 +463,7 @@ public class IotAlarmHostServiceImpl implements IIotAlarmHostService, RouterServ
         }
         String infos = status.getInfo();
         Map<String, String> dataMap = dealInfos(infos);
-        IotAlarmSystemField field = fieldList.get(0);
+
         String sensorValue = dataMap.get(field.getName());
         if (StringUtils.isBlank(sensorValue)) {
             return ;

+ 5 - 5
soc-modules/soc-modules-host/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 # Tomcat
 server:
-  port: 9910
+  port: 9006
 
 # Spring
 spring: 
@@ -13,13 +13,13 @@ spring:
   cloud:
     nacos:
       discovery:
-        namespace: 117e3851-20f9-45a6-ad96-3413975db93c
+        namespace: c2fe98f1-97c0-4c1a-9df8-4d63e5b625de
         # 服务注册地址
-        server-addr: 10.87.21.103:8847
+        server-addr: 10.87.23.39:8848
       config:
-        namespace: 117e3851-20f9-45a6-ad96-3413975db93c
+        namespace: c2fe98f1-97c0-4c1a-9df8-4d63e5b625de
         # 配置中心地址
-        server-addr: 10.87.21.103:8847
+        server-addr: 10.87.23.39:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 3 - 0
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/dto/sensor/SensorPageDto.java

@@ -35,6 +35,9 @@ public class SensorPageDto extends PageRequest {
     @ApiModelProperty(value = "传感器设备类型")
     private List<String> deviceTypeList;
 
+    @ApiModelProperty(value = "报警主机传感器设备类型")
+    private List<String> inputTypeList;
+
 
 
 }

+ 59 - 1
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotCommonSensorServiceImpl.java

@@ -20,6 +20,7 @@ import com.xunmei.common.core.enums.iot.BaseDeviceTypeEnum;
 import com.xunmei.common.core.enums.iot.DefenceAreaType;
 import com.xunmei.common.core.enums.iot.SensorType;
 import com.xunmei.common.core.exception.ServiceException;
+import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.common.core.utils.bean.BeanUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.redis.utils.RedisUtils;
@@ -90,9 +91,66 @@ public class IotCommonSensorServiceImpl extends ServiceImpl<IotCommonSensorMappe
                     BaseDeviceTypeEnum.FSU_DoPowerControl.getCode(),
                     BaseDeviceTypeEnum.FSU_ThreePhaseACVoltage.getCode(),
                     BaseDeviceTypeEnum.FSU_Theft.getCode(),
-                    BaseDeviceTypeEnum.FSU_DoPowerCollection.getCode()
+                    BaseDeviceTypeEnum.FSU_DoPowerCollection.getCode(),
+
+                    BaseDeviceTypeEnum.AlarmHostInput_Other.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Displacement.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Broken.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Shock.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Tamper.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Intrusion.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_IMDualIdentification.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_Microwave.getCode(),
+                    BaseDeviceTypeEnum.AlarmHostInput_EmergencyButton.getCode()
+
+            );
+
+            List<String> inputList = Lists.newArrayList(
+                    BaseDeviceTypeEnum.AlarmHostInput_Humidity.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Temperature.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Smoke.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Infrared.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Soaking.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_DoorSensor.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Other.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Displacement.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Broken.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Shock.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Tamper.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Intrusion.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_IMDualIdentification.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_Microwave.name().split("_")[1],
+                    BaseDeviceTypeEnum.AlarmHostInput_EmergencyButton.name().split("_")[1]
+
             );
             request.setDeviceTypeList(list);
+            request.setInputTypeList(inputList);
+        }else{
+            List<String> inputList = Lists.newArrayList();
+
+            for(String code:request.getDeviceTypeList()){
+                String typeCode = null;
+                if(code.equals(BaseDeviceTypeEnum.FSU_TemperatureAndHumidity.getCode())){
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_Humidity.name().split("_")[1];
+                    inputList.add(typeCode);
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_Temperature.name().split("_")[1];
+                }else  if(code.equals(BaseDeviceTypeEnum.FSU_Smoke.getCode())){
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_Smoke.name().split("_")[1];
+                }else  if(code.equals(BaseDeviceTypeEnum.FSU_Infrared.getCode())){
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_Infrared.name().split("_")[1];
+                }else  if(code.equals(BaseDeviceTypeEnum.FSU_Water.getCode())){
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_Soaking.name().split("_")[1];
+                }else  if(code.equals(BaseDeviceTypeEnum.FSU_DoorMagnetic.getCode())){
+                    typeCode = BaseDeviceTypeEnum.AlarmHostInput_DoorSensor.name().split("_")[1];
+                }else if(!NumberUtil.isNumber(code)){
+                    typeCode = BaseDeviceTypeEnum.getNameByCode(code).split("_")[1];
+                }
+
+                if(StringUtils.isNotEmpty(typeCode)){
+                    inputList.add(typeCode);
+                }
+            }
+            request.setInputTypeList(inputList);
         }
 
         Page<SensorPageVo> page = sensorMapper.selectPageData(request.getPageRequest(), request);

+ 23 - 18
soc-modules/soc-modules-iot/src/main/resources/mapper/IotSensorMapper.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.iot.mapper.IotCommonSensorMapper">
-    <!--<select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
-        select s.id, org_id, org_name,org_path, device_name, device_type, infos as info,device_code, state_update_time as updateTime,state
-        from iot_sensor s
+
+    <select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
+        ( select s.id,ds.id as deviceStatusId, s.org_id, s.org_name,s.org_path, s.device_name, s.device_type, ds.info as info,s.device_code, ds.state_update_time as updateTime,ds.state
+        from iot_device_info s left join iot_device_status ds on s.id=ds.device_id
         where s.deleted=0
         <if test="request.orgId!= null">
             and s.org_id=#{request.orgId}
@@ -15,21 +16,25 @@
             and s.device_name like CONCAT('%',#{request.deviceName},'%')
         </if>
         <if test="request.state!= null">
-            and s.state = #{request.state}
-        </if>
-        <if test="request.deviceType!= null and request.deviceType!= ''">
-            and s.device_type = #{request.deviceType}
+            and ds.state = #{request.state}
         </if>
         <if test="request.startTime!= null">
-            and s.state_update_time >=#{request.startTime}
+            and ds.state_update_time >=#{request.startTime}
         </if>
         <if test="request.endTime!= null">
-            and s.state_update_time <![CDATA[<=]]>  #{request.endTime}
+            and ds.state_update_time <![CDATA[<=]]>  #{request.endTime}
         </if>
-    </select>-->
-    <select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
-        select s.id,ds.id as deviceStatusId, s.org_id, s.org_name,s.org_path, s.device_name, s.device_type, ds.info as info,s.device_code, ds.state_update_time as updateTime,ds.state
-        from iot_device_info s left join iot_device_status ds on s.id=ds.device_id
+        <if test="request.deviceTypeList!= null and request.deviceTypeList.size() > 0">
+            and s.device_type in
+            <foreach collection="request.deviceTypeList" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        order by state_update_time desc )
+        union all
+        ( select s.id,ds.id as deviceStatusId, s.org_id, s.org_name,s.org_path, concat(s.defence_area_name,'(报警主机)') as device_name,
+        s.sensor_type as device_type, ds.info as info,s.alarm_host_code as device_code, ds.state_update_time as updateTime,ds.state
+        from iot_alarm_defence_area s left join iot_device_status ds on s.id=ds.device_id
         where s.deleted=0
         <if test="request.orgId!= null">
             and s.org_id=#{request.orgId}
@@ -38,7 +43,7 @@
             and s.org_path like CONCAT(#{request.orgPath}, '%')
         </if>
         <if test="request.deviceName != null and request.deviceName!= ''">
-            and s.device_name like CONCAT('%',#{request.deviceName},'%')
+            and s.defence_area_name like CONCAT('%',#{request.deviceName},'%')
         </if>
         <if test="request.state!= null">
             and ds.state = #{request.state}
@@ -49,13 +54,13 @@
         <if test="request.endTime!= null">
             and ds.state_update_time <![CDATA[<=]]>  #{request.endTime}
         </if>
-        <if test="request.deviceTypeList!= null and request.deviceTypeList.size() > 0">
-            and s.device_type in
-            <foreach collection="request.deviceTypeList" index="index" item="item" open="(" separator="," close=")">
+        <if test="request.inputTypeList!= null and request.inputTypeList.size() > 0">
+            and s.sensor_type in
+            <foreach collection="request.inputTypeList" index="index" item="item" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
-        order by state_update_time desc
+        order by ds.state_update_time desc )
     </select>
     <select id="selectAppPageData" resultType="com.xunmei.iot.vo.sensor.SensorAppPageVo">
         select s.id, s.org_id, s.org_name, s.device_name, ds.device_type, ds.info as info, ds.state_update_time,ds.state