Quellcode durchsuchen

fix: device run info update base field

lihao16 vor 6 Monaten
Ursprung
Commit
59a111cfce

+ 37 - 20
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/SmsbDeviceRunInfo.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 
 import java.io.Serial;
 import java.util.Date;
@@ -14,10 +13,9 @@ import java.util.Date;
  * 设备运行信息对象 smsb_device_run_info
  *
  * @author Hao Li
- * @date 2025-02-28
+ * @date 2025-04-27
  */
 @Data
-@EqualsAndHashCode
 @TableName("smsb_device_run_info")
 public class SmsbDeviceRunInfo {
 
@@ -36,44 +34,64 @@ public class SmsbDeviceRunInfo {
     private Long deviceId;
 
     /**
-     * CPU
+     * 亮度
      */
-    private String cpuInfo;
+    private Long bright;
 
     /**
-     * 内存
+     * 音量
      */
-    private String memoryInfo;
+    private Long volume;
 
     /**
-     * 硬盘
+     * CPU使用率
      */
-    private String diskInfo;
+    private String cpuUsage;
 
     /**
-     * rom版本
+     * 外部存储 总量
      */
-    private String rom;
+    private String externalMemoryTotal;
 
     /**
-     * 系统信息
+     * 外部存储 已使用
      */
-    private String osInfo;
+    private String externalMemoryUsage;
 
     /**
-     * apk版本
+     * 外部存储 使用百分比
      */
-    private String apkVersion;
+    private String externalUsage;
 
     /**
-     * 下载速率
+     * 内存 总量
      */
-    private String download;
+    private String ramTotalOfByte;
 
     /**
-     * 运行列表
+     * 内存 已使用
      */
-    private String appList;
+    private String ramUsageOfByte;
+
+    /**
+     * 系统构建时间
+     */
+    private String systemBuildDate;
+
+    /**
+     * 系统构建版本
+     */
+    private String systemBuildVersion;
+
+    /**
+     * 版本code
+     */
+    private String versionCode;
+
+    /**
+     * 版本名称
+     */
+    private String versionName;
 
     /**
      * 创建时间
@@ -82,5 +100,4 @@ public class SmsbDeviceRunInfo {
     private Date createTime;
 
     private String tenantId;
-
 }

+ 48 - 24
smsb-modules/smsb-device/src/main/java/com/inspur/device/domain/vo/SmsbDeviceRunInfoVo.java

@@ -40,52 +40,76 @@ public class SmsbDeviceRunInfoVo implements Serializable {
     private Long deviceId;
 
     /**
-     * CPU
+     * 亮度
      */
-    @ExcelProperty(value = "CPU")
-    private String cpuInfo;
+    @ExcelProperty(value = "亮度")
+    private Long bright;
 
     /**
-     * 内存
+     * 音量
      */
-    @ExcelProperty(value = "内存")
-    private String memoryInfo;
+    @ExcelProperty(value = "音量")
+    private Long volume;
 
     /**
-     * 硬盘
+     * CPU使用率
      */
-    @ExcelProperty(value = "硬盘")
-    private String diskInfo;
+    @ExcelProperty(value = "CPU使用率")
+    private String cpuUsage;
 
     /**
-     * rom版本
+     * 外部存储 总量
      */
-    @ExcelProperty(value = "rom版本")
-    private String rom;
+    @ExcelProperty(value = "外部存储 总量")
+    private String externalMemoryTotal;
 
     /**
-     * 系统信息
+     * 外部存储 已使用
      */
-    @ExcelProperty(value = "系统信息")
-    private String osInfo;
+    @ExcelProperty(value = "外部存储 已使用")
+    private String externalMemoryUsage;
 
     /**
-     * apk版本
+     * 外部存储 使用百分比
      */
-    @ExcelProperty(value = "apk版本")
-    private String apkVersion;
+    @ExcelProperty(value = "外部存储 使用百分比")
+    private String externalUsage;
 
     /**
-     * 下载速率
+     * 内存 总量
      */
-    @ExcelProperty(value = "下载速率")
-    private String download;
+    @ExcelProperty(value = "内存 总量")
+    private String ramTotalOfByte;
 
     /**
-     * 运行列表
+     * 内存 已使用
      */
-    @ExcelProperty(value = "运行列表")
-    private String appList;
+    @ExcelProperty(value = "内存 已使用")
+    private String ramUsageOfByte;
+
+    /**
+     * 系统构建时间
+     */
+    @ExcelProperty(value = "系统构建时间")
+    private String systemBuildDate;
+
+    /**
+     * 系统构建版本
+     */
+    @ExcelProperty(value = "系统构建版本")
+    private String systemBuildVersion;
+
+    /**
+     * 版本code
+     */
+    @ExcelProperty(value = "版本code")
+    private String versionCode;
+
+    /**
+     * 版本名称
+     */
+    @ExcelProperty(value = "版本名称")
+    private String versionName;
 
     /**
      * 创建时间

+ 1 - 15
smsb-modules/smsb-netty/src/main/java/com/inspur/netty/handler/DeviceRunInfoHandler.java

@@ -44,21 +44,7 @@ public class DeviceRunInfoHandler extends ChannelInboundHandlerAdapter {
     }
 
     private void buildSmsbDeviceRunInfo(SmsbDeviceRunInfo smsbDeviceRunInfo, String[] messageArray, SmsbDeviceVo smsbDeviceVo) {
-        // {identifier}/device/run/info/{cpu}/{memory}/{disk}/{os}/{rom}/{apk}
-        String cpuInfo = messageArray[4];
-        String memoryInfo = messageArray[5];
-        String diskInfo = messageArray[6];
-        String osInfo = messageArray[7];
-        String romInfo = messageArray[8];
-        String apkInfo = messageArray[9];
-        smsbDeviceRunInfo.setCpuInfo(cpuInfo);
-        smsbDeviceRunInfo.setMemoryInfo(memoryInfo);
-        smsbDeviceRunInfo.setDiskInfo(diskInfo);
-        smsbDeviceRunInfo.setOsInfo(osInfo);
-        smsbDeviceRunInfo.setRom(romInfo);
-        smsbDeviceRunInfo.setApkVersion(apkInfo);
-        smsbDeviceRunInfo.setDeviceId(smsbDeviceVo.getId());
-        smsbDeviceRunInfo.setTenantId(smsbDeviceVo.getTenantId());
+
     }
 
 }

+ 167 - 22
smsb-plus-ui/src/api/smsb/device/device_run_type.ts

@@ -1,7 +1,4 @@
-import { DeviceVO } from '@/api/smsb/device/device_type';
-
 export interface DeviceRunInfoVO {
-  deviceBase: DeviceVO;
   /**
    * 主键ID
    */
@@ -13,59 +10,207 @@ export interface DeviceRunInfoVO {
   deviceId: string | number;
 
   /**
-   * CPU
+   * 亮度
+   */
+  bright: number;
+
+  /**
+   * 音量
+   */
+  volume: number;
+
+  /**
+   * CPU使用率
+   */
+  cpuUsage: string;
+
+  /**
+   * 外部存储 总量
    */
-  cpuInfo: number;
+  externalMemoryTotal: string;
 
   /**
-   * 内存
+   * 外部存储 已使用
    */
-  memoryInfo: number;
+  externalMemoryUsage: string;
 
   /**
-   * 硬盘
+   * 外部存储 使用百分比
    */
-  diskInfo: number;
+  externalUsage: string;
 
   /**
-   * rom版本
+   * 内存 总量
    */
-  rom: string;
+  ramTotalOfByte: string;
 
   /**
-   * 系统信息
+   * 内存 已使用
    */
-  osInfo: string;
+  ramUsageOfByte: string;
 
   /**
-   * apk版本
+   * 系统构建时间
    */
-  apkVersion: string;
+  systemBuildDate: string;
 
   /**
-   * 下载速率
+   * 系统构建版本
    */
-  download: string;
+  systemBuildVersion: string;
 
   /**
-   * 运行列表
+   * 版本code
    */
-  appList: string;
+  versionCode: string;
 
   /**
-   * 创建时间
+   * 版本名称
    */
-  createTime: string;
+  versionName: string;
+
 }
 
-export interface DeviceRunInfoForm extends BaseEntity {}
+export interface DeviceRunInfoForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 设备ID
+   */
+  deviceId?: string | number;
+
+  /**
+   * 亮度
+   */
+  bright?: number;
+
+  /**
+   * 音量
+   */
+  volume?: number;
+
+  /**
+   * CPU使用率
+   */
+  cpuUsage?: string;
+
+  /**
+   * 外部存储 总量
+   */
+  externalMemoryTotal?: string;
+
+  /**
+   * 外部存储 已使用
+   */
+  externalMemoryUsage?: string;
+
+  /**
+   * 外部存储 使用百分比
+   */
+  externalUsage?: string;
+
+  /**
+   * 内存 总量
+   */
+  ramTotalOfByte?: string;
+
+  /**
+   * 内存 已使用
+   */
+  ramUsageOfByte?: string;
+
+  /**
+   * 系统构建时间
+   */
+  systemBuildDate?: string;
+
+  /**
+   * 系统构建版本
+   */
+  systemBuildVersion?: string;
+
+  /**
+   * 版本code
+   */
+  versionCode?: string;
+
+  /**
+   * 版本名称
+   */
+  versionName?: string;
+
+}
 
 export interface DeviceRunInfoQuery extends PageQuery {
+
   /**
    * 设备ID
    */
   deviceId?: string | number;
 
+  /**
+   * 亮度
+   */
+  bright?: number;
+
+  /**
+   * 音量
+   */
+  volume?: number;
+
+  /**
+   * CPU使用率
+   */
+  cpuUsage?: string;
+
+  /**
+   * 外部存储 总量
+   */
+  externalMemoryTotal?: string;
+
+  /**
+   * 外部存储 已使用
+   */
+  externalMemoryUsage?: string;
+
+  /**
+   * 外部存储 使用百分比
+   */
+  externalUsage?: string;
+
+  /**
+   * 内存 总量
+   */
+  ramTotalOfByte?: string;
+
+  /**
+   * 内存 已使用
+   */
+  ramUsageOfByte?: string;
+
+  /**
+   * 系统构建时间
+   */
+  systemBuildDate?: string;
+
+  /**
+   * 系统构建版本
+   */
+  systemBuildVersion?: string;
+
+  /**
+   * 版本code
+   */
+  versionCode?: string;
+
+  /**
+   * 版本名称
+   */
+  versionName?: string;
+
   /**
    * 日期范围参数
    */

+ 96 - 61
smsb-plus-ui/src/views/smsb/device/index.vue

@@ -195,45 +195,76 @@
       </template>
     </el-dialog>
     <!--设备详情弹窗-->
-    <el-dialog v-model="viewDialog.visible" :title="viewDialog.title" width="1000px" append-to-body>
-      <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClickTab">
-        <el-tab-pane label="状态检测" name="info">
+    <el-dialog v-model="viewDialog.visible" :title="viewDialog.title" width="1000px" style="height: 800px"
+               append-to-body>
+      <el-tabs v-model="activeName" style="height: 600px" @tab-click="handleClickTab">
+        <el-tab-pane label="设备详情" name="info">
           <div>
-            <div style="display: flex; justify-content: space-around; align-items: center">
-              <div style="text-align: center">
-                <div style="position: relative">
-                  CPU :
-                  <el-progress type="circle" :percentage="deviceRunInfo.cpuInfo"></el-progress>
-                  <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">{{ deviceRunInfo.cpuInfo }}%</div>
-                </div>
-              </div>
-              <div style="text-align: center">
-                <div style="position: relative">
-                  内存 :
-                  <el-progress type="circle" :percentage="deviceRunInfo.memoryInfo"></el-progress>
-                  <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">{{ deviceRunInfo.memoryInfo }}%</div>
-                </div>
-              </div>
-              <div style="text-align: center">
-                <div style="position: relative">
-                  硬盘 :
-                  <el-progress type="circle" :percentage="deviceRunInfo.diskInfo"></el-progress>
-                  <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">{{ deviceRunInfo.diskInfo }}%</div>
-                </div>
-              </div>
-            </div>
-            <div>ROM : {{ deviceRunInfo.rom }}</div>
-            <div>系统信息 : {{ deviceRunInfo.osInfo }}</div>
-            <div>APK版本 : {{ deviceRunInfo.apkVersion }}</div>
+            <span>设备名称:{{ deviceRunInfo.deviceBase.name }}</span>
+            <span style="margin-left: 50px">SN:{{ deviceRunInfo.deviceBase.serialNumber }}</span>
+            <span style="margin-left: 50px">MAC:{{ deviceRunInfo.deviceBase.mac }}</span>
+            <br/>
           </div>
+          <div style="margin-top: 20px">
+            <span>分辨率:{{ deviceRunInfo.deviceBase.width }}*{{ deviceRunInfo.deviceBase.height }}</span>
+            <span style="margin-left: 50px">加密标识:{{ deviceRunInfo.deviceBase.identifier }}</span>
+          </div>
+          <div style="margin-top: 20px">
+            <span>最后一次上线:{{ deviceRunInfo.deviceBase.lastOnline }}</span>
+            <span style="margin-left: 50px">上次离线:{{ deviceRunInfo.deviceBase.offlineTime }}</span>
+            <span style="margin-left: 50px">创建时间:{{ deviceRunInfo.deviceBase.createTime }}</span>
+          </div>
+          <!-- 音量 -->
+          <div style="margin-top: 20px">
+
+          </div>
+          <!-- 亮度 -->
+          <div style="margin-top: 20px; display: flex; align-items: center;">
+            亮度:
+            <el-progress :show-text="false" :stroke-width="26" :percentage="deviceRunInfo.bright"
+                         style="margin-left: 10px;"/>
+          </div>
+          <!--          <div>
+                      <div style="display: flex; justify-content: space-around; align-items: center">
+                        <div style="text-align: center">
+                          <div style="position: relative">
+                            CPU :
+                            <el-progress type="circle" :percentage="deviceRunInfo.cpuUsage"></el-progress>
+                            <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">
+                              {{ deviceRunInfo.cpuUsage }}%
+                            </div>
+                          </div>
+                        </div>
+                        <div style="text-align: center">
+                          <div style="position: relative">
+                            内存 :
+                            <el-progress type="circle" :percentage="deviceRunInfo.ramUsageOfByte"></el-progress>
+                            <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">
+                              {{ deviceRunInfo.ramUsageOfByte }}%
+                            </div>
+                          </div>
+                        </div>
+                        <div style="text-align: center">
+                          <div style="position: relative">
+                            硬盘 :
+                            <el-progress type="circle" :percentage="deviceRunInfo.externalUsage"></el-progress>
+                            <div style="position: absolute; top: -30px; left: 50%; transform: translateX(-50%)">
+                              {{ deviceRunInfo.externalUsage }}%
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div>系统信息 : {{ deviceRunInfo.systemBuildVersion }}</div>
+                      <div>APK版本 : {{ deviceRunInfo.versionName }}</div>
+                    </div>-->
         </el-tab-pane>
         <el-tab-pane label="远程操作" name="control">
           <el-button :loading="buttonLoading" type="primary" @click="handleControl('reboot')">设备重启</el-button>
           <el-button :loading="buttonLoading" type="primary" @click="handleControl('start')">远程开机</el-button>
           <el-button :loading="buttonLoading" type="primary" @click="handleControl('shutdown')">远程关机</el-button>
           <el-button :loading="buttonLoading" type="primary" @click="handleControl('standby')">设备待机</el-button>
-          <el-button :loading="buttonLoading" type="primary" @click="handleVoice">音量调节</el-button>
-          <el-button :loading="buttonLoading" type="primary" @click="handleBrightness">亮度调节</el-button>
+          <!--          <el-button :loading="buttonLoading" type="primary" @click="handleVoice">音量调节</el-button>
+                    <el-button :loading="buttonLoading" type="primary" @click="handleBrightness">亮度调节</el-button>-->
         </el-tab-pane>
         <el-tab-pane label="报警信息" name="alarm">
           <el-table v-loading="loading" :data="alarmList" row-key="id">
@@ -287,40 +318,40 @@
 
 <script setup name="Device" lang="ts">
 import {
-  listDevice,
-  getDevice,
-  delDevice,
   addDevice,
-  updateDevice,
+  delDevice,
+  deviceStatistics,
+  getDevice,
+  getDeviceRunInfo,
+  getDeviceScreenshot,
+  listDevice,
   reboot,
-  start,
-  standby,
   shutdown,
+  standby,
+  start,
   startStream,
-  deviceStatistics,
-  getDeviceRunInfo,
   stopStream,
-  getDeviceScreenshot
+  updateDevice
 } from '@/api/smsb/device/device';
-import { DeviceVO, DeviceQuery, DeviceForm, DeviceStatisticsVo } from '@/api/smsb/device/device_type';
-import { ProductVO } from '@/api/smsb/device/product_types';
-import { listProduct } from '@/api/smsb/device/product';
-import { DeviceManufacturerVO } from '@/api/smsb/device/deviceManufacturer_type';
-import { listDeviceManufacturer } from '@/api/smsb/device/deviceManufacturer';
-import type { TabsPaneContext } from 'element-plus';
-import { ref, onBeforeUnmount } from 'vue';
+import {DeviceForm, DeviceQuery, DeviceStatisticsVo, DeviceVO} from '@/api/smsb/device/device_type';
+import {ProductVO} from '@/api/smsb/device/product_types';
+import {listProduct} from '@/api/smsb/device/product';
+import {DeviceManufacturerVO} from '@/api/smsb/device/deviceManufacturer_type';
+import {listDeviceManufacturer} from '@/api/smsb/device/deviceManufacturer';
+import type {TabsPaneContext} from 'element-plus';
+import {onBeforeUnmount, ref} from 'vue';
 import flvjs from 'flv.js';
-import { DeviceRunInfoVO } from '@/api/smsb/device/device_run_type';
-import { DeviceErrorRecordQuery, DeviceErrorRecordVO } from '@/api/smsb/device/errorRecord_type';
-import { listDeviceErrorRecord } from '@/api/smsb/device/errorRecord';
-import { storeToRefs } from 'pinia';
+import {DeviceRunInfoVO} from '@/api/smsb/device/device_run_type';
+import {DeviceErrorRecordQuery, DeviceErrorRecordVO} from '@/api/smsb/device/errorRecord_type';
+import {listDeviceErrorRecord} from '@/api/smsb/device/errorRecord';
+import {storeToRefs} from 'pinia';
 import useScreenshotStore from '@/store/modules/screenshot';
 
 const screenshotStore = storeToRefs(useScreenshotStore());
 const screenshotImageUrl = ref<string>();
 const alarmList = ref<DeviceErrorRecordVO[]>([]);
-const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { sys_device_online, smsb_yes_no, smsb_device_error_level, smsb_device_error_type } = toRefs<any>(
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
+const {sys_device_online, smsb_yes_no, smsb_device_error_level, smsb_device_error_type} = toRefs<any>(
   proxy?.useDict('sys_device_online', 'smsb_yes_no', 'smsb_device_error_level', 'smsb_device_error_type')
 );
 const deviceList = ref<DeviceVO[]>([]);
@@ -348,14 +379,18 @@ const deviceRunInfo = reactive<DeviceRunInfoVO>({
   deviceBase: undefined,
   id: undefined,
   deviceId: undefined,
-  cpuInfo: undefined,
-  memoryInfo: undefined,
-  diskInfo: undefined,
-  rom: undefined,
-  osInfo: undefined,
-  apkVersion: undefined,
-  download: undefined,
-  appList: undefined,
+  bright: undefined,
+  volume: undefined,
+  cpuUsage: undefined,
+  externalMemoryTotal: undefined,
+  externalMemoryUsage: undefined,
+  externalUsage: undefined,
+  ramTotalOfByte: undefined,
+  ramUsageOfByte: undefined,
+  systemBuildDate: undefined,
+  systemBuildVersion: undefined,
+  versionCode: undefined,
+  versionName: undefined,
   createTime: undefined
 });
 const dialog = reactive<DialogOption>({