ソースを参照

更新了烟感的数据

wuweihao 5 年 前
コミット
42c07f6a38

+ 8 - 0
README.md

@@ -16,6 +16,14 @@
     web-ui:
     http://192.168.0.44:2001/admin/index
     admin 123456
+    
+    一平方公里前端ui:
+    http://map.4dage.com/jiangmen/
+    
+    后端-ui
+    http://face3d.4dage.com:2001/admin/index
+    
+    
      
  tomcat:
  <Context path="" docBase="/root/user/java/tomcat_jm_smart_city_2001/webapps/jmSmartCity" debug="0" reloadable="true" crossContext="true"/>

+ 6 - 2
wsm-admin-web/src/main/java/com/wsm/admin/api/ApiDeviceController.java

@@ -9,6 +9,7 @@ import com.wsm.admin.service.IDeviceService;
 import com.wsm.common.api.BaseController;
 import com.wsm.common.constant.ConstantType;
 import com.wsm.common.util.AjaxJson;
+import com.wsm.common.util.FileUtils;
 import com.wsm.common.util.PasswordUtils;
 import com.wsm.common.util.RedisUtil;
 import org.slf4j.Logger;
@@ -46,14 +47,15 @@ public class ApiDeviceController extends BaseController {
 
     /**
      * 获取所有的设备信息
+     * 提供给产品展示页用
      * @return
      */
     @RequestMapping(value = {"/list"})
     public AjaxJson list() {
         List<Device> list = (List) redisTemplate.opsForValue().get(MsgCode.REDIS_CYCLE_DEVICE_LIST);
         if (list == null) {
-            logger.info("list size: ");
             list = deviceService.findAll();
+            logger.info("list size: {}", list.size());
             redisTemplate.opsForValue().set(MsgCode.REDIS_CYCLE_DEVICE_LIST, list, 24, TimeUnit.HOURS);
 
         }
@@ -126,7 +128,7 @@ public class ApiDeviceController extends BaseController {
 
             JSONObject reportedJaon = jsonObject.getJSONObject("reported");
             String batteryPower = reportedJaon.getString("batteryPower");
-            String replace = batteryPower.replace(batteryPower, "%");
+            String replace = batteryPower.replace("%", "");
             Integer power = Integer.valueOf(replace);
 
 
@@ -246,4 +248,6 @@ public class ApiDeviceController extends BaseController {
 
 
     }
+
+
 }

+ 23 - 0
wsm-admin-web/src/main/resources/data/smokeing.json

@@ -0,0 +1,23 @@
+{
+  "devid": "610617128",
+  "b_name": null,
+  "pname": "YD100N烟感",
+  "lid": null,
+  "l_name": null,
+  "pid": "NP-FDY100-N",
+  "payload": null,
+  "reported": {
+    "Temperature": null,
+    "rssi": null,
+    "dirtyPercent": "0%",
+    "signalStrength": null,
+    "signalSNR": 20,
+    "rsrp": -46,
+    "batteryPower": "100%",
+    "smokeScope": "0%",
+    "signalECL": 0
+  },
+  "time": "2020-07-19 16:51:26",
+  "bid": null,
+  "a_name": "港湾1号港11栋"
+}

+ 1 - 1
wsm-admin-web/src/main/resources/templates/admin/deviceEvent/form.html

@@ -27,7 +27,7 @@
 <div class="layui-col-md12">
     <div class="layui-card">
         <div class="layui-card-header">查看设备告警</div>
-        <input id="deviceEventId" name="id" th:value="${device}">
+        <!--<input id="deviceEventId" name="id" th:value="${device}">-->
 
         <div class="layui-card-body">
             <form class="layui-form" action="/admin/deviceEvent/save" method="post">