Browse Source

feat(bd): 北斗能力中心方案

- 更新页面标题为北斗能力中心方案
- 添加设备定位和轨迹模拟功能
-优化地图加载和显示
- 新增 WebSocket 通信支持
-重构部分代码结构以支持新功能
chen.cheng 9 months ago
parent
commit
5f934fb3ae

+ 23 - 0
bd-location/Dockerfile

@@ -0,0 +1,23 @@
+# 使用官方的 OpenJDK 8 镜像作为基础镜像
+FROM openjdk:8-jdk-alpine
+# author
+MAINTAINER hs-bd
+
+# 创建存放上传文件的目录
+RUN mkdir -p /opt/project/ruoyi/ruoyi-backend/upload-file-path
+# 创建存放日志的目录
+RUN mkdir -p /opt/project/ruoyi/ruoyi-backend/logs
+# 安装字体文件
+RUN mkdir -p /etc/apk/
+RUN touch /etc/apk/repositories
+RUN echo -e 'https://mirrors.aliyun.com/alpine/v3.6/main/\nhttps://mirrors.aliyun.com/alpine/v3.6/community/' > /etc/apk/repositories
+RUN set -xe && apk --no-cache add ttf-dejavu fontconfig
+
+# 设置工作目录
+WORKDIR /opt/project/ruoyi/ruoyi-backend
+# 将构建好的 JAR 文件复制到容器中
+COPY ./target/bd-location.jar bd-location.jar
+# 暴露应用程序端口
+EXPOSE 8080
+# 启动应用程序
+CMD ["nohup","java","-jar","/opt/project/ruoyi/ruoyi-backend/bd-location.jar", "--spring.profiles.active=k8s" , ">", "/dev/null","2>&1" ,"&"]

+ 108 - 0
bd-location/src/main/resources/application-k8s.yml

@@ -0,0 +1,108 @@
+server:
+  servlet:
+    # 应用的访问路径
+    context-path: /prod-api
+# 数据源配置
+spring:
+  # redis 配置
+  redis:
+    # 地址
+    host: 200.200.19.121
+    # 端口,默认为6379
+    port: 31001
+    # 数据库索引
+    database: 3
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3s
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://200.200.19.121:31000/hs_cps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: root
+      # 从库数据源
+      slave:
+        # 从数据源开关/默认关闭
+        enabled: false
+        url:
+        username:
+        password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置连接超时时间
+      connectTimeout: 30000
+      # 配置网络超时时间
+      socketTimeout: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+mqtt:
+  client:
+    enabled: true
+    ip: xt.wenhq.top
+    port: 8581
+    name: uwb-location-client
+    client-id: uwb-000001
+    global-subscribe:
+    timeout: 5
+    reconnect: true
+    re-interval: 5000
+    version: mqtt_3_1_1
+    read-buffer-size: 8KB
+    max-bytes-in-message: 10MB
+    keep-alive-secs: 60
+    clean-session: true
+    ssl:
+      enabled: false
+bd:
+  mqtt:
+    enabled: true

+ 1 - 1
bd-location/src/main/resources/application.yml

@@ -7,7 +7,7 @@ ruoyi:
   # 版权年份
   copyrightYear: 2024
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: D:/ruoyi/uploadPath
+  profile: /opt/project/ruoyi/ruoyi-backend/upload-file-path
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证

+ 1 - 1
bd-location/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/ruoyi/logs" />
+	<property name="log.path" value="/opt/project/ruoyi/ruoyi-backend/logs" />
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 6 - 0
pom.xml

@@ -35,6 +35,7 @@
         <cffu.version>1.0.0-Alpha19</cffu.version>
         <jts.version>1.18.2</jts.version>
         <mqttstarter.version>2.3.7</mqttstarter.version>
+        <math.version>3.6.1</math.version>
     </properties>
 
     <!-- 依赖声明 -->
@@ -206,6 +207,11 @@
                 <artifactId>mica-mqtt-client-spring-boot-starter</artifactId>
                 <version>${mqttstarter.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-math3</artifactId>
+                <version>${math.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 4 - 1
ruoyi-common/pom.xml

@@ -123,7 +123,10 @@
             <groupId>org.locationtech.jts</groupId>
             <artifactId>jts-core</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-math3</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 72 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/geo/CoordinateConverter.java

@@ -0,0 +1,72 @@
+package com.ruoyi.common.utils.geo;
+
+import org.apache.commons.math3.linear.Array2DRowRealMatrix;
+import org.apache.commons.math3.linear.ArrayRealVector;
+import org.apache.commons.math3.linear.DecompositionSolver;
+import org.apache.commons.math3.linear.QRDecomposition;
+import org.apache.commons.math3.linear.RealMatrix;
+import org.apache.commons.math3.linear.RealVector;
+
+public class CoordinateConverter {
+    // WGS84椭球体参数
+    private static final double A = 6378137.0; // 长半轴(米)
+    private static final double F = 1 / 298.257223563; // 扁率
+    private static final double B = A * (1 - F); // 短半轴
+    private static final double E = Math.sqrt(1 - (B * B) / (A * A)); // 第一偏心率
+
+    // 将经纬度转换为平面坐标(墨卡托投影)
+    public static double[] latLonToXY(double latitude, double longitude) {
+        double x = A * Math.toRadians(longitude);
+        double y = A * Math.log(Math.tan(Math.PI / 4 + Math.toRadians(latitude) / 2));
+        return new double[]{x, y};
+    }
+
+    // 将平面坐标转换为经纬度(墨卡托投影逆变换)
+    public static double[] xyToLatLon(double x, double y) {
+        double lon = Math.toDegrees(x / A);
+        double lat = Math.toDegrees(2 * Math.atan(Math.exp(y / A)) - Math.PI / 2);
+        return new double[]{lat, lon};
+    }
+
+    // 计算基准经度和比例因子
+    public static double[] calculateParameters(double[] pointA, double[] pointB) {
+        double lambda0 = (pointA[0] + pointB[0]) / (2 * A);
+        double scaleFactor = (pointA[1] - pointB[1]) / (A * Math.log(Math.tan(Math.PI / 4 + Math.toRadians(90) / 2) / Math.tan(Math.PI / 4 + Math.toRadians(-90) / 2)));
+        return new double[]{lambda0, scaleFactor};
+    }
+
+    public static void main(String[] args) {
+        // 定义已知的平面坐标和对应的经纬度
+        double[][] points = {{8, 14.63, 118.86839482667, 32.0131180416999}, {6, 0, 118.869042069359, 32.0131156239015}, {0, 15.3, 118.868399686907, 32.0133391503578}};
+
+        // 提取x, y和对应的经纬度
+        double[] x = new double[points.length];
+        double[] y = new double[points.length];
+        double[] lon = new double[points.length];
+        double[] lat = new double[points.length];
+
+        for (int i = 0; i < points.length; i++) {
+            x[i] = points[i][0];
+            y[i] = points[i][1];
+            lon[i] = points[i][2];
+            lat[i] = points[i][3];
+        }
+
+        // 构建线性方程组Ax=B
+        RealMatrix A = new Array2DRowRealMatrix(new double[][]{x, y,new double[]{1,1,1}});
+        DecompositionSolver solverLon = new QRDecomposition(A).getSolver();
+        DecompositionSolver solverLat = new QRDecomposition(A).getSolver();
+
+        // 解线性方程组得到系数
+        RealVector coeffsLon = solverLon.solve(new ArrayRealVector(lon));
+        RealVector coeffsLat = solverLat.solve(new ArrayRealVector(lat));
+
+        // 计算第四点的经纬度
+        double xNew = 4;
+        double yNew = 4;
+        double lonNew = coeffsLon.getEntry(0) * xNew + coeffsLon.getEntry(1) * yNew + coeffsLon.getEntry(2);
+        double latNew = coeffsLat.getEntry(0) * xNew + coeffsLat.getEntry(1) * yNew + coeffsLat.getEntry(2);
+
+        System.out.println("第四点的经纬度为: " + lonNew + ", " + latNew);
+    }
+}

+ 1 - 0
ruoyi-ui/.env.development

@@ -13,6 +13,7 @@ VUE_APP_WS_URL = 'ws://127.0.0.1:28080/bd-api'
 
 VUE_APP_DOMAIN_BASE_URL = 'http://127.0.0.1'
 
+
 VUE_APP_BD_BASE_API = '/dev-db-api'
 
 VUE_APP_BD_BASE_URL = 'http://200.200.19.253:31838/bdgis'

+ 5 - 1
ruoyi-ui/.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = 交通强国工作台
+VUE_APP_TITLE = 北斗能力中心方案
 
 BABEL_ENV = production
 
@@ -10,4 +10,8 @@ VUE_APP_BASE_API = '/prod-api'
 
 VUE_APP_BD_BASE_API = '/prod-bd-api'
 
+VUE_APP_WS_URL = '/prod-api'
+
 VUE_APP_BASE_URL = 'http://172.192.13.80:8080/tfc'
+
+VUE_APP_DOMAIN_BASE_URL = 'http://200.200.19.254:31080'

+ 15 - 0
ruoyi-ui/Dockerfile

@@ -0,0 +1,15 @@
+# 基础镜像
+FROM nginx
+# author
+MAINTAINER ruoyi
+
+# 挂载目录
+VOLUME /home/ruoyi/projects/ruoyi-ui
+# 创建目录
+RUN mkdir -p /home/ruoyi/projects/ruoyi-ui
+# 指定路径
+WORKDIR /home/ruoyi/projects/ruoyi-ui
+# 复制conf文件到路径
+COPY ./docker/conf/nginx.conf /etc/nginx/nginx.conf
+# 复制html文件到路径
+COPY ./dist /home/ruoyi/projects/ruoyi-ui

+ 35 - 0
ruoyi-ui/deploy.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# 设置变量
+PROJECT_NAME="bd-app"
+DOCKER_IMAGE_NAME="bd-app"
+DOCKER_IMAGE_TAG="1.0"
+REMOTE_REGISTRY="docker.xt.wenhq.top:8083/bd"
+VERSION_FILE="version"
+# 读取当前版本号
+CURRENT_VERSION=$(cat $VERSION_FILE)
+if [ -z "$CURRENT_VERSION" ]; then
+  CURRENT_VERSION=0
+fi
+
+# 增加版本号
+NEXT_VERSION=$((CURRENT_VERSION + 1))
+
+# 更新版本文件
+echo $NEXT_VERSION > $VERSION_FILE
+# 1. 编译Vue项目
+echo "开始编译Vue项目..."
+yarn run build:prod
+echo "Vue项目编译完成"
+
+# 2. 构建Docker镜像
+echo "开始构建Docker镜像..."
+docker build -t ${REMOTE_REGISTRY}/${DOCKER_IMAGE_NAME}:v${DOCKER_IMAGE_TAG}.${NEXT_VERSION} .
+echo "Docker镜像构建完成"
+
+# 3. 推送Docker镜像到远程仓库
+echo "开始推送Docker镜像到远程仓库..."
+docker push ${REMOTE_REGISTRY}/${DOCKER_IMAGE_NAME}:v${DOCKER_IMAGE_TAG}.${NEXT_VERSION}
+echo "Docker镜像推送完成"
+
+echo "所有任务完成"

+ 41 - 0
ruoyi-ui/docker/conf/nginx.conf

@@ -0,0 +1,41 @@
+worker_processes  1;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    include       mime.types;
+    default_type  application/octet-stream;
+    sendfile        on;
+    keepalive_timeout  65;
+
+    server {
+        listen       80;
+        server_name  localhost;
+
+		location / {
+            root   /home/ruoyi/projects/ruoyi-ui;
+            try_files $uri $uri/ /index.html;
+            index  index.html index.htm;
+        }
+
+        location /prod-api/ws {
+            proxy_pass http://200.200.19.254:31280;
+            proxy_http_version 1.1;
+            proxy_set_header Upgrade $http_upgrade;
+            proxy_set_header Connection "Upgrade";
+        }
+
+		location /prod-api {
+			proxy_pass http://200.200.19.254:31280;
+		}
+	    location ~ ^/prod-bd-api/(.*)$ {
+			proxy_pass http://200.200.19.253:31838/bdgis/$1;
+		}
+        error_page   500 502 503 504  /50x.html;
+        location = /50x.html {
+            root   html;
+        }
+    }
+}

+ 0 - 0
ruoyi-ui/public/bd/BDLayers.js → ruoyi-ui/public/bdjs/BDLayers.js


+ 0 - 0
ruoyi-ui/public/bd/jquery-2.2.4.min.js → ruoyi-ui/public/bdjs/jquery-2.2.4.min.js


+ 2 - 2
ruoyi-ui/public/index.html

@@ -7,8 +7,8 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= webpackConfig.name %></title>
-    <script src="<%= BASE_URL %>bd/jquery-2.2.4.min.js" crossorigin="anonymous"></script>
-    <script type="text/javascript" src="<%= BASE_URL %>bd/BDLayers.js"></script>
+    <script src="<%= BASE_URL %>bdjs/jquery-2.2.4.min.js" crossorigin="anonymous"></script>
+    <script type="text/javascript" src="<%= BASE_URL %>bdjs/BDLayers.js"></script>
     <!--[if lt IE 11]>
     <script>window.location.href = '/html/ie.html';</script><![endif]-->
     <style>

+ 9 - 1
ruoyi-ui/src/api/bd/fenceInfo.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request from '@/utils/request';
 
 // 查询围栏基础信息列表
 export function listFenceInfo(query) {
@@ -42,3 +42,11 @@ export function delFenceInfo(id) {
     method: 'delete'
   })
 }
+
+export const pushDevcLocation = (params, config = {}) => {
+  return request({
+    url: 'https://www.lj-info.com:8090/bd-api/bd/devcTrailUwb/point',
+    method: 'post',
+    data: params,
+  });
+};

+ 1 - 0
ruoyi-ui/src/views/bd/fence/index.vue

@@ -310,6 +310,7 @@ export default {
         this.$confirm('检测到选中了围栏,请选择操作类型?', '提示', {
           confirmButtonText: '编辑围栏',
           cancelButtonText: '删除围栏',
+          distinguishCancelAndClose: true,
           type: 'warning',
         }).then(() => {
           // 开始编辑围栏

+ 3 - 3
ruoyi-ui/src/views/bd/fenceEvt/index.vue

@@ -13,14 +13,14 @@
       <div class="location-list">
         <template v-for="evt in evtList">
           <div :key="`evt_${evt.id}`" class="list-item">
-          <span class="over-flow-hidden" style="width: 40%">
+          <span class="over-flow-hidden" style="width: 60%">
             {{ evt.evtDesc }}
           </span>
             <span class="over-flow-hidden" style="width: 40%">
            {{ dayjs(evt.evtTime).format('YYYY-MM-DD HH:mm') }}
           </span>
-            <span class="over-flow-hidden" style="width: 20%">
-          </span>
+<!--            <span class="over-flow-hidden" style="width: 20%">-->
+<!--          </span>-->
           </div>
         </template>
         <socket-message :onMessage="onMessage" :ws="ws"></socket-message>

+ 4 - 2
ruoyi-ui/src/views/bd/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="bd-container">
     <bd-map :loaded="loaded" />
-    <div class="header">北斗定位融合</div>
+    <div class="header">北斗能力中心方案</div>
     <div class="menus">
       <template v-for="item in Object.keys(menus)">
         <div
@@ -91,6 +91,8 @@ export default {
   methods: {
     loaded(map) {
       window.map = map;
+      const protocolAndHost = window.location.protocol + '//' + window.location.host;
+      // map.setPitch(0)
       const d3tiles = new BDLayers.Lib.Layer.CB3DtilesLayer('3dtiles', {
         offet: {
           from: 'GCJ02',
@@ -101,7 +103,7 @@ export default {
         maxCacheSize: 10000,
         services: [
           {
-            url: `${process.env.VUE_APP_DOMAIN_BASE_URL}${process.env.VUE_APP_BD_BASE_API}/folder/zy9/tileset.json`, //"http://resource.dvgis.cn/data/3dtiles/dayanta/tileset.json",
+            url: `${protocolAndHost}${process.env.VUE_APP_BD_BASE_API}/folder/zy9/tileset.json`, //"http://resource.dvgis.cn/data/3dtiles/dayanta/tileset.json",
             maximumScreenSpaceError: 16.0,
             heightOffset: -48, //-420,
           },

+ 1 - 0
ruoyi-ui/src/views/bd/location/index.vue

@@ -164,6 +164,7 @@ export default {
         [118.868557462941, 32.0139175038812],
         [118.868474555524, 32.013913750075],
       ];
+      // 19FB03
       let playLine = bdmap.comp.Trajectory.loadTrajectory({
         mapView: window.map,
         latlons: coordinates,

BIN
ruoyi-ui/src/views/bd/realtimeLocation/icon/position.png


+ 87 - 0
ruoyi-ui/src/views/bd/realtimeLocation/index.vue

@@ -25,6 +25,11 @@
                   title="查看设备定位"
                   @click="()=>showLocation(device)"
               />
+               <i
+                   class="el-icon-circle-close"
+                   title="查看设备定位"
+                   @click="()=>play(device)"
+               />
             </span>
           </div>
         </template>
@@ -39,6 +44,7 @@
 
 <script>
 
+import { pushDevcLocation } from '@/api/bd/fenceInfo';
 import SocketMessage from '@/components/WebsocketMessage/index.vue';
 import item from '@/layout/components/Sidebar/Item.vue';
 import Pannel from '@/views/bd/pannel/index.vue';
@@ -70,11 +76,13 @@ export default {
       markLayer: null,
       locationMarkers: {},
       selectedDevice: [],
+      playInterval: null,
     };
   },
   // 组件卸载前清空图层信息
   beforeDestroy() {
     this.markLayer && window.map.removeLayersById('markerLayer');
+    this.playInterval && clearInterval(this.playInterval);
   },
   created() {
     this.markLayer = new BDLayers.Lib.Layer.CBVectorLayer('markerLayer', true);
@@ -139,6 +147,85 @@ export default {
       }
       this.locationMarkers[deviceId].moveMarker([longitude, latitude], 2000, false);
     },
+    play() {
+      const gps = [
+        [118.868474555524, 32.013913750075],
+        [118.868459917135, 32.0138560330253],
+        [118.868460650064, 32.0137600494265],
+        [118.868469791963, 32.0135491295906],
+        [118.868450597046, 32.0135969285238],
+        [118.868451821878, 32.0134372342673],
+        [118.868369085172, 32.0134271059761],
+        [118.868229813542, 32.0134261784667],
+        [118.868037844538, 32.0134249000077],
+        [118.867988911263, 32.013424574126],
+        [118.867990212059, 32.0132809893746],
+        [118.867986825628, 32.0132395072755],
+        [118.867987028075, 32.0132171885197],
+        [118.867987432888, 32.0131725599655],
+        [118.867984539806, 32.0130769425047],
+        [118.867977454441, 32.0130291167663],
+        [118.86797791828, 32.0129781711549],
+        [118.867978150146, 32.0129527041872],
+        [118.867974855578, 32.0129017568948],
+        [118.868046176274, 32.0129117791912],
+        [118.868121507934, 32.0128931867922],
+        [118.868117943319, 32.0128708893801],
+        [118.868126616248, 32.012737367597],
+        [118.868127634971, 32.0126197858525],
+        [118.868127662494, 32.0126166091195],
+        [118.868165320753, 32.0126041528561],
+        [118.868173101262, 32.0125724412675],
+        [118.868240681514, 32.0125728913369],
+        [118.868308235972, 32.0125765173023],
+        [118.868334874981, 32.0125322352762],
+        [118.868324305199, 32.012446455205],
+        [118.868361835438, 32.0124467051483],
+        [118.868364679658, 32.0125610134717],
+        [118.868492254263, 32.0125713907483],
+        [118.868541014618, 32.0125780675563],
+        [118.868732580782, 32.012566639437],
+        [118.868841456955, 32.0125673645282],
+        [118.868976574771, 32.0125746162152],
+        [118.869070453844, 32.0125720654824],
+        [118.869096734551, 32.0125722405062],
+        [118.869156822422, 32.0125694647922],
+        [118.869179313588, 32.0125759664106],
+        [118.869201684821, 32.0126047016424],
+        [118.869186178487, 32.0126935647542],
+        [118.869193065594, 32.0128080658432],
+        [118.869192510216, 32.0129098661745],
+        [118.86919198924, 32.0130053604978],
+        [118.869179854563, 32.0131613771548],
+        [118.869190250492, 32.0133240705021],
+        [118.869185964264, 32.0134197772962],
+        [118.86917071489, 32.0134547924615],
+        [118.869159014503, 32.0135281642937],
+        [118.869166174307, 32.0135953030259],
+        [118.869165521059, 32.0137135723353],
+        [118.869187426642, 32.0138416759025],
+        [118.869153188005, 32.0138990608231],
+        [118.868990969654, 32.0139203908971],
+        [118.868768561862, 32.0139189097324],
+        [118.868572541435, 32.0139176042992],
+        [118.868557462941, 32.0139175038812],
+        [118.868474555524, 32.013913750075],
+      ];
+      let i = 0;
+      this.playInterval = setInterval(() => {
+        pushDevcLocation({
+          devcKey: 'uwb001',
+          lat: gps[i][1],
+          lng: gps[i][0],
+        });
+        if (i === gps.length - 1) {
+          i = 0;
+          return;
+        }
+        i++;
+      }, 2000);
+
+    },
   },
 };
 </script>

+ 101 - 4
ruoyi-ui/src/views/bd/roomlocation/roommap/index.vue

@@ -1,10 +1,10 @@
 <template>
   <el-dialog
-      title="室内定位"
+      title="室内定位融合"
       :visible.sync="centerDialogVisible"
-      width="60%"
+      width="70vw"
       center>
-    <div style="width: 100%;height: 50vh;">
+    <div style="width: 100%;height: 70vh;">
       <bd-map :loaded="loaded" map-id="room-map" />
       <socket-message
           v-if="centerDialogVisible"
@@ -17,6 +17,7 @@
 
 <script>
 
+import { pushDevcLocation } from '@/api/bd/fenceInfo';
 import SocketMessage from '@/components/WebsocketMessage/index.vue';
 import BdMap from '@/views/bd/map/index.vue';
 import maphandle from '@/views/bd/map/maphandle';
@@ -35,16 +36,19 @@ export default {
       centerDialogVisible: false,
       locationMarkers: {},
       mapIns: null,
+      playInterval: null,
     };
   },
   // 组件卸载前清空图层信息
   beforeDestroy() {
     this.markLayer && window.map.removeLayersById('markerLayer');
+    this.playInterval && clearInterval(this.playInterval);
   },
   created() {
 
   },
   mounted() {
+    this.play();
   },
   methods: {
     dayjs,
@@ -76,7 +80,7 @@ export default {
           [longitude, latitude],
           {
             imgurl: position,
-            iconSize: [60, 45],
+            iconSize: [25, 30],
             symbol: {
               'textName': 'm4',
               'textSize': 14,
@@ -103,6 +107,99 @@ export default {
       }
       this.locationMarkers[deviceId].moveMarker([longitude, latitude], 2000, false);
     },
+    play() {
+      const gps = [
+        [118.869125003231, 32.0132579193923],
+        [118.869114609672, 32.0132582036815],
+        [118.869115950776, 32.013238303438],
+        [118.869116286052, 32.0132195403474],
+        [118.869116286052, 32.0132144231402],
+        [118.869113939119, 32.0132064630396],
+        [118.869105557216, 32.0132021986996],
+        [118.869093822552, 32.0132021986996],
+        [118.869086111201, 32.0132021986996],
+        [118.869077394021, 32.0132021986996],
+        [118.869073370708, 32.0132021986996],
+        [118.869070688499, 32.0132044730143],
+        [118.869070353223, 32.013218118901],
+        [118.869070353223, 32.0132323333641],
+        [118.869071359051, 32.0132479692711],
+        [118.869069012118, 32.0132536550547],
+        [118.869064988805, 32.0132579193923],
+        [118.869048224998, 32.0132570665248],
+        [118.869028778983, 32.0132570665248],
+        [118.869008327139, 32.0132525178981],
+        [118.868998939408, 32.0132579193923],
+        [118.868995586647, 32.0132604779947],
+        [118.868992233885, 32.0132604779947],
+        [118.868991228057, 32.0132621837296],
+        [118.868982510878, 32.0132601937055],
+        [118.868976140631, 32.0132601937055],
+        [118.868968764556, 32.0132607622839],
+        [118.868963735414, 32.0132607622839],
+        [118.868965411795, 32.0132525178981],
+        [118.868965747071, 32.0132394405949],
+        [118.868965747071, 32.0132334705211],
+        [118.868966082347, 32.0132127174044],
+        [118.868965747071, 32.0132036201463],
+        [118.868976811183, 32.0132002086742],
+        [118.868985193087, 32.0132056101716],
+        [118.868987204743, 32.0132175503224],
+        [118.86898485781, 32.0132354605458],
+        [118.868985528363, 32.0132402934625],
+        [118.868999274684, 32.0132445578007],
+        [118.869013021005, 32.0132439892223],
+        [118.869029784811, 32.0132454106683],
+        [118.869033472849, 32.0132431363547],
+        [118.869036155058, 32.0132391563057],
+        [118.869036155058, 32.0132320490749],
+        [118.869037160886, 32.0132215303724],
+        [118.869035484506, 32.0132067473289],
+        [118.869035484506, 32.0132002086742],
+        [118.86902039708, 32.0131987872275],
+        [118.869002962721, 32.0131993558062],
+        [118.868989551676, 32.0131993558062],
+        [118.868975805355, 32.0131982186489],
+        [118.86896239431, 32.0131976500702],
+        [118.868952336026, 32.0131976500702],
+        [118.868940266086, 32.0131996400956],
+        [118.868936913324, 32.0131996400956],
+        [118.868934231115, 32.0131996400956],
+        [118.868921155346, 32.0131999243849],
+        [118.868917132033, 32.0132010615423],
+        [118.868910091234, 32.013200777253],
+        [118.868910091234, 32.0132138545616],
+        [118.868909085406, 32.0132272161577],
+        [118.868909755958, 32.0132391563057],
+        [118.868910091234, 32.0132488221386],
+        [118.868910761786, 32.013257350814],
+        [118.868909755958, 32.0132636051754],
+        [118.868942277742, 32.0132627523079],
+        [118.868973123146, 32.0132644580428],
+        [118.869001621617, 32.0132638894645],
+        [118.869058618558, 32.0132636051754],
+        [118.869081082059, 32.0132624680188],
+        [118.869094157828, 32.0132624680188],
+        [118.869112933291, 32.0132624680188],
+        [118.869124332679, 32.0132604779947],
+        [118.869125003231, 32.0132579193923],
+      ];
+      let i = 0;
+      this.playInterval && clearInterval(this.playInterval);
+      this.playInterval = setInterval(() => {
+        pushDevcLocation({
+          devcKey: 'uwb001',
+          lat: gps[i][1],
+          lng: gps[i][0],
+        });
+        if (i === gps.length - 1) {
+          i = 0;
+          return;
+        }
+        i++;
+      }, 2000);
+
+    },
   },
 };
 </script>

+ 1 - 0
ruoyi-ui/version

@@ -0,0 +1 @@
+9