Explorar o código

Merge branch 'master' of http://git.xt.wenhq.top:8083/wenhongquan/iotc

liwei19941102 %!s(int64=2) %!d(string=hai) anos
pai
achega
1c778486b6

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/data/service/impl/MqttServiceImpl.java

@@ -81,7 +81,7 @@ public class MqttServiceImpl implements MqttService {
         websocketService.sendMessageAll(mqttStr);
         if(saveAndForward) {
             JSONObject jsonObject = new JSONObject(mqttStr);
-            Long sensorId = Long.valueOf((String) jsonObject.get("sensorId"));
+            Long sensorId = jsonObject.getLong("sensorId");
             TblSensor tblSensor = tblSensorMapper.selectById(sensorId);
             Long deviceId = tblSensor.getDeviceId();
             SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

+ 5 - 0
ruoyi-ui-vue3/src/views/device/sensordash/index.vue

@@ -256,6 +256,11 @@
               <span>{{scope.row.name}}</span>
             </template>
           </el-table-column>
+          <el-table-column label="名称" prop="name">
+            <template #default="scope">
+              <span>{{scope.row.label}}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="数值" prop="name">
             <template #default="scope">
               <span>{{ (useWSStore().getMessage()[currentsensor.id])?(useWSStore().getMessage()[currentsensor.id][scope.row.name]?.value):'-' }}</span>