mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 14:07:50 +08:00
增加图标信息
This commit is contained in:
parent
08206ca824
commit
d76d0483e3
@ -1,9 +1,13 @@
|
|||||||
package com.genersoft.iot.vmp.service;
|
package com.genersoft.iot.vmp.service;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.MapConfig;
|
import com.genersoft.iot.vmp.vmanager.bean.MapConfig;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.MapModelIcon;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IMapService {
|
public interface IMapService {
|
||||||
|
|
||||||
List<MapConfig> getConfig();
|
List<MapConfig> getConfig();
|
||||||
|
|
||||||
|
List<MapModelIcon> getModelList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.genersoft.iot.vmp.vmanager.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MapModelIcon {
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "别名")
|
||||||
|
private String alias;
|
||||||
|
|
||||||
|
@Schema(description = "路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
|
||||||
|
public static MapModelIcon getInstance(String name, String alias, String path) {
|
||||||
|
MapModelIcon mapModelIcon = new MapModelIcon();
|
||||||
|
mapModelIcon.setAlias(alias);
|
||||||
|
mapModelIcon.setName(name);
|
||||||
|
mapModelIcon.setPath(path);
|
||||||
|
return mapModelIcon;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -371,4 +371,14 @@ public class ServerController {
|
|||||||
}
|
}
|
||||||
return mapService.getConfig();
|
return mapService.getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/map/model-icon/list")
|
||||||
|
@ResponseBody
|
||||||
|
@Operation(summary = "获取地图配置图标", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
public List<MapModelIcon> getMapModelIconList() {
|
||||||
|
if (mapService == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return mapService.getModelList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] 缺少关键参数:sign/appKey/accessToken/timestamp, 请求地址: {} ", requestURI);
|
log.info("[SY-接口验签] 缺少关键参数:sign/appKey/accessToken/timestamp, 请求地址: {} ", requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6017, "缺少关键参数"));
|
out.println(getErrorResult(1, "参数非法"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] appKey {} 对应的 secret 不存在, 请求地址: {} ", appKey, requestURI);
|
log.info("[SY-接口验签] appKey {} 对应的 secret 不存在, 请求地址: {} ", appKey, requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6017, "缺少关键参数"));
|
out.println(getErrorResult(1, "参数非法"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] 失败,加密前内容: {}, 请求地址: {} ", beforeSign, requestURI);
|
log.info("[SY-接口验签] 失败,加密前内容: {}, 请求地址: {} ", beforeSign, requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6017, "接口鉴权失败"));
|
out.println(getErrorResult(2, "签名错误"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] 时间戳已经过期, 请求时间戳:{}, 当前时间: {}, 过期时间: {}, 请求地址: {} ", timestamp, currentTimeMillis, timestamp + SyTokenManager.INSTANCE.expires * 60 * 1000, requestURI);
|
log.info("[SY-接口验签] 时间戳已经过期, 请求时间戳:{}, 当前时间: {}, 过期时间: {}, 请求地址: {} ", timestamp, currentTimeMillis, timestamp + SyTokenManager.INSTANCE.expires * 60 * 1000, requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6016, "接口过期"));
|
out.println(getErrorResult(3, "接口己过期"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] accessToken解密失败, 请求地址: {} ", requestURI);
|
log.info("[SY-接口验签] accessToken解密失败, 请求地址: {} ", requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6017, "接口鉴权失败"));
|
out.println(getErrorResult(2, "签名错误"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
log.info("[SY-接口验签] accessToken 已经过期, 请求地址: {} ", requestURI);
|
log.info("[SY-接口验签] accessToken 已经过期, 请求地址: {} ", requestURI);
|
||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6018, "Token已过期"));
|
out.println(getErrorResult(4, "token已过期或错误"));
|
||||||
out.close();
|
out.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ public class SignAuthenticationFilter extends OncePerRequestFilter {
|
|||||||
response.setStatus(Response.OK);
|
response.setStatus(Response.OK);
|
||||||
if (!response.isCommitted()) {
|
if (!response.isCommitted()) {
|
||||||
PrintWriter out = response.getWriter();
|
PrintWriter out = response.getWriter();
|
||||||
out.println(getErrorResult(6017, "接口鉴权异常"));
|
out.println(getErrorResult(2, "签名错误"));
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -353,7 +353,7 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
// 读取redis 图标信息
|
// 读取redis 图标信息
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
"brand": "三永",
|
"brand": "WVP",
|
||||||
"createdTime": 1715845840000,
|
"createdTime": 1715845840000,
|
||||||
"displayInSelect": true,
|
"displayInSelect": true,
|
||||||
"id": 12,
|
"id": 12,
|
||||||
@ -553,21 +553,21 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
// 参数坐标系列转换
|
// 参数坐标系列转换
|
||||||
if (geoCoordSys != null) {
|
if (geoCoordSys != null) {
|
||||||
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
||||||
Double[] minPosition = Coordtransform.WGS84ToGCJ02(minLongitude, minLatitude);
|
Double[] minPosition = Coordtransform.GCJ02ToWGS84(minLongitude, minLatitude);
|
||||||
minLongitude = minPosition[0];
|
minLongitude = minPosition[0];
|
||||||
minLatitude = minPosition[1];
|
minLatitude = minPosition[1];
|
||||||
|
|
||||||
Double[] maxPosition = Coordtransform.WGS84ToGCJ02(maxLongitude, maxLatitude);
|
Double[] maxPosition = Coordtransform.GCJ02ToWGS84(maxLongitude, maxLatitude);
|
||||||
maxLongitude = maxPosition[0];
|
maxLongitude = maxPosition[0];
|
||||||
maxLatitude = maxPosition[1];
|
maxLatitude = maxPosition[1];
|
||||||
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
||||||
Double[] gcj02MinPosition = Coordtransform.WGS84ToGCJ02(minLongitude, minLatitude);
|
Double[] gcj02MinPosition = Coordtransform.BD09ToGCJ02(minLongitude, minLatitude);
|
||||||
Double[] minPosition = Coordtransform.GCJ02ToBD09(gcj02MinPosition[0], gcj02MinPosition[1]);
|
Double[] minPosition = Coordtransform.GCJ02ToWGS84(gcj02MinPosition[0], gcj02MinPosition[1]);
|
||||||
minLongitude = minPosition[0];
|
minLongitude = minPosition[0];
|
||||||
minLatitude = minPosition[1];
|
minLatitude = minPosition[1];
|
||||||
|
|
||||||
Double[] gcj02MaxPosition = Coordtransform.WGS84ToGCJ02(maxLongitude, maxLatitude);
|
Double[] gcj02MaxPosition = Coordtransform.BD09ToGCJ02(maxLongitude, maxLatitude);
|
||||||
Double[] maxPosition = Coordtransform.GCJ02ToBD09(gcj02MaxPosition[0], gcj02MaxPosition[1]);
|
Double[] maxPosition = Coordtransform.GCJ02ToWGS84(gcj02MaxPosition[0], gcj02MaxPosition[1]);
|
||||||
maxLongitude = maxPosition[0];
|
maxLongitude = maxPosition[0];
|
||||||
maxLatitude = maxPosition[1];
|
maxLatitude = maxPosition[1];
|
||||||
}
|
}
|
||||||
@ -588,13 +588,13 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
// 参数坐标系列转换
|
// 参数坐标系列转换
|
||||||
if (geoCoordSys != null) {
|
if (geoCoordSys != null) {
|
||||||
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
||||||
Double[] position = Coordtransform.WGS84ToGCJ02(centerLongitude, centerLatitude);
|
Double[] position = Coordtransform.GCJ02ToWGS84(centerLongitude, centerLatitude);
|
||||||
centerLongitude = position[0];
|
centerLongitude = position[0];
|
||||||
centerLatitude = position[1];
|
centerLatitude = position[1];
|
||||||
|
|
||||||
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
||||||
Double[] gcj02Position = Coordtransform.WGS84ToGCJ02(centerLongitude, centerLatitude);
|
Double[] gcj02Position = Coordtransform.BD09ToGCJ02(centerLongitude, centerLatitude);
|
||||||
Double[] position = Coordtransform.GCJ02ToBD09(gcj02Position[0], gcj02Position[1]);
|
Double[] position = Coordtransform.GCJ02ToWGS84(gcj02Position[0], gcj02Position[1]);
|
||||||
centerLongitude = position[0];
|
centerLongitude = position[0];
|
||||||
centerLatitude = position[1];
|
centerLatitude = position[1];
|
||||||
}
|
}
|
||||||
@ -616,12 +616,12 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
if (geoCoordSys != null) {
|
if (geoCoordSys != null) {
|
||||||
for (Point point : pointList) {
|
for (Point point : pointList) {
|
||||||
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
|
||||||
Double[] position = Coordtransform.WGS84ToGCJ02(point.getLng(), point.getLat());
|
Double[] position = Coordtransform.GCJ02ToWGS84(point.getLng(), point.getLat());
|
||||||
point.setLng(position[0]);
|
point.setLng(position[0]);
|
||||||
point.setLat(position[1]);
|
point.setLat(position[1]);
|
||||||
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
|
||||||
Double[] gcj02Position = Coordtransform.WGS84ToGCJ02(point.getLng(), point.getLat());
|
Double[] gcj02Position = Coordtransform.BD09ToGCJ02(point.getLng(), point.getLat());
|
||||||
Double[] position = Coordtransform.GCJ02ToBD09(gcj02Position[0], gcj02Position[1]);
|
Double[] position = Coordtransform.GCJ02ToWGS84(gcj02Position[0], gcj02Position[1]);
|
||||||
point.setLng(position[0]);
|
point.setLng(position[0]);
|
||||||
point.setLat(position[1]);
|
point.setLat(position[1]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.genersoft.iot.vmp.service.IMapService;
|
import com.genersoft.iot.vmp.service.IMapService;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.MapConfig;
|
import com.genersoft.iot.vmp.vmanager.bean.MapConfig;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.MapModelIcon;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
@ -76,4 +77,33 @@ public class SyServiceImpl implements IMapService {
|
|||||||
return mapConfig;
|
return mapConfig;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MapModelIcon> getModelList() {
|
||||||
|
// 读取redis 图标信息
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"brand": "WVP",
|
||||||
|
"createdTime": 1715845840000,
|
||||||
|
"displayInSelect": true,
|
||||||
|
"id": 12,
|
||||||
|
"imagesPath": "images/lt132",
|
||||||
|
"machineName": "图传对讲单兵",
|
||||||
|
"machineType": "LT132"
|
||||||
|
},
|
||||||
|
*/
|
||||||
|
List<MapModelIcon> mapModelIconList = new ArrayList<>();
|
||||||
|
JSONArray jsonArray = (JSONArray) redisTemplate.opsForValue().get("machineInfo");
|
||||||
|
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||||
|
String machineType = jsonObject.getString("machineType");
|
||||||
|
String machineName = jsonObject.getString("machineName");
|
||||||
|
String imagesPath = jsonObject.getString("imagesPath");
|
||||||
|
|
||||||
|
mapModelIconList.add(MapModelIcon.getInstance(machineType, machineName, imagesPath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mapModelIconList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,4 +121,10 @@ export function getMapConfig() {
|
|||||||
url: `/api/server/map/config`
|
url: `/api/server/map/config`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function getModelList() {
|
||||||
|
return request({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/server/map/model-icon/list`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import {
|
|||||||
checkMediaServer,
|
checkMediaServer,
|
||||||
checkMediaServerRecord, deleteMediaServer, getMapConfig, getMediaInfo,
|
checkMediaServerRecord, deleteMediaServer, getMapConfig, getMediaInfo,
|
||||||
getMediaServer,
|
getMediaServer,
|
||||||
getMediaServerList, getMediaServerLoad,
|
getMediaServerList, getMediaServerLoad, getModelList,
|
||||||
getOnlineMediaServerList, getResourceInfo, getSystemConfig, getSystemInfo, info, saveMediaServer
|
getOnlineMediaServerList, getResourceInfo, getSystemConfig, getSystemInfo, info, saveMediaServer
|
||||||
} from '@/api/server'
|
} from '@/api/server'
|
||||||
|
|
||||||
@ -146,6 +146,16 @@ const actions = {
|
|||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getModelList({ commit }) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
getModelList().then(response => {
|
||||||
|
const { data } = response
|
||||||
|
resolve(data)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,17 @@
|
|||||||
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商" />
|
<el-input v-model="form.gbManufacturer" placeholder="请输入设备厂商" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备型号">
|
<el-form-item label="设备型号">
|
||||||
<el-input v-model="form.gbModel" placeholder="请输入设备型号" />
|
<el-autocomplete
|
||||||
|
style="width: 100%;"
|
||||||
|
v-model="form.gbModel"
|
||||||
|
value-key="name"
|
||||||
|
:fetch-suggestions="queryModel"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
>
|
||||||
|
<template slot-scope="{ item }">
|
||||||
|
<span class="addr">{{ item.name }}({{ item.alias }})</span>
|
||||||
|
</template>
|
||||||
|
</el-autocomplete>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="行政区域">
|
<el-form-item label="行政区域">
|
||||||
@ -247,9 +257,17 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
modelList: [],
|
||||||
form: {}
|
form: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$store.dispatch('server/getModelList')
|
||||||
|
.then((data) => {
|
||||||
|
console.log(data)
|
||||||
|
this.modelList = data
|
||||||
|
})
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
// 获取完整信息
|
// 获取完整信息
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
@ -263,6 +281,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
queryModel(queryString, callback) {
|
||||||
|
let modelList = this.modelList
|
||||||
|
var results = queryString ? modelList.filter(((state) => {
|
||||||
|
return (state.alias.toLowerCase().indexOf(queryString.toLowerCase()) === 0 || state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
||||||
|
})) : modelList
|
||||||
|
callback(results)
|
||||||
|
},
|
||||||
onSubmit: function() {
|
onSubmit: function() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
if (this.form.gbDownloadSpeedArray) {
|
if (this.form.gbDownloadSpeedArray) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user