diff --git a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java index ca0be92e3..6ca7d9611 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java +++ b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java @@ -75,6 +75,16 @@ public class VideoManagerConstants { */ public static final String VM_MSG_PUSH_STREAM_LIST_CHANGE = "VM_MSG_PUSH_STREAM_LIST_CHANGE"; + /** + * 请求同步三方组织结构 + */ + public static final String VM_MSG_GROUP_LIST_REQUEST = "VM_MSG_GROUP_LIST_REQUEST"; + + /** + * 同步三方组织结构回复 + */ + public static final String VM_MSG_GROUP_LIST_RESPONSE = "VM_MSG_GROUP_LIST_RESPONSE"; + /** * redis 消息通知设备推流到平台 */ diff --git a/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisTemplateConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisTemplateConfig.java index 2dc66b38f..f36a4d555 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisTemplateConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/redis/RedisTemplateConfig.java @@ -42,4 +42,5 @@ public class RedisTemplateConfig { redisTemplate.setConnectionFactory(redisConnectionFactory); return redisTemplate; } + } diff --git a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java index dc667daf2..fb10eb033 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/security/JwtAuthenticationFilter.java @@ -83,7 +83,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { // TODO 处理各个状态 switch (jwtUser.getStatus()){ case EXPIRED: - response.setStatus(400); + response.setStatus(401); chain.doFilter(request, response); // 异常 return; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java index 865521ca3..def18a0bb 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java @@ -122,7 +122,6 @@ public class DeviceChannel extends CommonGBChannel { @Schema(description = "经度 WGS-84坐标系") private Double longitude; - @MessageElementForCatalog("Latitude") @Schema(description = ",纬度 WGS-84坐标系") private Double latitude; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RedisGroupMessage.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RedisGroupMessage.java new file mode 100644 index 000000000..e4ec0b701 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/RedisGroupMessage.java @@ -0,0 +1,48 @@ +package com.genersoft.iot.vmp.gb28181.bean; + +import com.alibaba.fastjson2.JSON; +import lombok.Data; + +@Data +public class RedisGroupMessage { + + /** + * 分组国标ID + */ + private String groupGbId; + + /** + * 分组别名 + */ + private String groupAlias; + + /** + * 分组名称 + */ + private String groupName; + + /** + * 分组所属的行政区划 + */ + private String groupCivilCode; + + /** + * 分组所属父分组国标ID + */ + private String parentGroupGbId; + + /** + * 分组所属父分组别名 + */ + private String parentGAlias; + + + public static void main(String[] args) { + RedisGroupMessage redisGroupMessage = new RedisGroupMessage(); + redisGroupMessage.setGroupAlias("100000001"); + redisGroupMessage.setGroupName("消防大队"); + System.out.println(JSON.toJSONString(redisGroupMessage)); + } + + +} diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java index 0dcf7ef2c..64bb2915b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceChannelServiceImpl.java @@ -24,6 +24,7 @@ import com.genersoft.iot.vmp.gb28181.utils.SipUtils; import com.genersoft.iot.vmp.service.bean.ErrorCallback; import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; +import com.genersoft.iot.vmp.utils.Coordtransform; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; @@ -434,6 +435,17 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService { @Override public void updateChannelGPS(Device device, DeviceChannel deviceChannel, MobilePosition mobilePosition) { + + if (device.getGeoCoordSys().equalsIgnoreCase("GCJ02")) { + Double[] wgs84Position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude()); + mobilePosition.setLongitude(wgs84Position[0]); + mobilePosition.setLatitude(wgs84Position[1]); + + Double[] wgs84PositionForChannel = Coordtransform.GCJ02ToWGS84(deviceChannel.getLongitude(), deviceChannel.getLatitude()); + deviceChannel.setGbLongitude(wgs84PositionForChannel[0]); + deviceChannel.setGbLatitude(wgs84PositionForChannel[1]); + } + if (userSetting.getSavePositionHistory()) { deviceMobilePositionMapper.insertNewPosition(mobilePosition); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/IMapService.java b/src/main/java/com/genersoft/iot/vmp/service/IMapService.java new file mode 100644 index 000000000..3029ca3b9 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/IMapService.java @@ -0,0 +1,9 @@ +package com.genersoft.iot.vmp.service; + +import com.genersoft.iot.vmp.vmanager.bean.MapConfig; + +import java.util.List; + +public interface IMapService { + List getConfig(); +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MapServiceImplForSy.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MapServiceImplForSy.java new file mode 100644 index 000000000..1704d3279 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MapServiceImplForSy.java @@ -0,0 +1,76 @@ +package com.genersoft.iot.vmp.service.impl; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.genersoft.iot.vmp.service.IMapService; +import com.genersoft.iot.vmp.vmanager.bean.MapConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 第三方地图适配 + */ +@Service +public class MapServiceImplForSy implements IMapService { + + @Autowired + private RedisTemplate redisTemplate; + + + @Override + public List getConfig() { + List configList = new ArrayList<>(); + JSONObject configObject = (JSONObject)redisTemplate.opsForValue().get("interfaceConfig1"); + if (configObject == null) { + return configList; + } + // 浅色地图 + MapConfig mapConfigForDefault = readConfig("FRAGMENTIMG_SERVER", configObject); + if (mapConfigForDefault != null) { + mapConfigForDefault.setName("浅色地图"); + configList.add(mapConfigForDefault); + } + + // 深色地图 + MapConfig mapConfigForDark = readConfig("POLARNIGHTBLUE_FRAGMENTIMG_SERVER", configObject); + if (mapConfigForDark != null) { + mapConfigForDark.setName("深色地图"); + configList.add(mapConfigForDark); + } + + // 卫星地图 + MapConfig mapConfigForSatellited = readConfig("FRAGMENTIMG_SERVER", configObject); + if (mapConfigForSatellited != null) { + mapConfigForSatellited.setName("卫星地图"); + configList.add(mapConfigForSatellited); + } + return configList; + } + + private MapConfig readConfig(String key, JSONObject jsonObject) { + JSONArray fragmentimgServerArray = jsonObject.getJSONArray(key); + if (fragmentimgServerArray == null || fragmentimgServerArray.isEmpty()) { + return null; + } + JSONObject fragmentimgServer = fragmentimgServerArray.getJSONObject(0); + // 坐标系 + String geoCoordSys = fragmentimgServer.getString("csysType").toUpperCase(); + // 获取地址 + String path = fragmentimgServer.getString("path"); + String ip = fragmentimgServer.getString("ip"); + JSONObject portJson = fragmentimgServer.getJSONObject("port"); + JSONObject httpPortJson = portJson.getJSONObject("httpPort"); + String protocol = httpPortJson.getString("portType"); + Integer port = httpPortJson.getInteger("port"); + String tileUrl = String.format("%s://%s:%s%s", protocol, ip, port, path); + MapConfig mapConfig = new MapConfig(); + mapConfig.setCoordinateSystem(geoCoordSys); + mapConfig.setTilesUrl(tileUrl); + return mapConfig; + + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/streamPush/bean/RedisPushStreamMessage.java b/src/main/java/com/genersoft/iot/vmp/streamPush/bean/RedisPushStreamMessage.java index 6d12fb489..2dbe0b3a9 100644 --- a/src/main/java/com/genersoft/iot/vmp/streamPush/bean/RedisPushStreamMessage.java +++ b/src/main/java/com/genersoft/iot/vmp/streamPush/bean/RedisPushStreamMessage.java @@ -10,6 +10,10 @@ public class RedisPushStreamMessage { private String stream; private String name; private boolean status; + // 终端所属的虚拟组织 + private String groupGbId; + // 终端所属的虚拟组织别名 可选,可作为地方同步组织结构到wvp时的关联关系 + private String groupAlias; public StreamPush buildstreamPush() { StreamPush push = new StreamPush(); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/MapConfig.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/MapConfig.java new file mode 100644 index 000000000..a9d90689e --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/MapConfig.java @@ -0,0 +1,16 @@ +package com.genersoft.iot.vmp.vmanager.bean; + +import lombok.Data; + +@Data +public class MapConfig { + + private String name; + private String coordinateSystem; + private String tilesUrl; + private Integer tileSize; + private Integer zoom; + private Double[] center; + private Integer maxZoom; + private Integer minZoom; +} diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java index d4f6de168..138db17e3 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java @@ -16,18 +16,17 @@ import com.genersoft.iot.vmp.media.bean.MediaInfo; import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent; import com.genersoft.iot.vmp.media.service.IMediaServerService; +import com.genersoft.iot.vmp.service.IMapService; import com.genersoft.iot.vmp.service.bean.MediaServerLoad; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService; import com.genersoft.iot.vmp.streamPush.service.IStreamPushService; -import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; -import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; -import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo; -import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo; +import com.genersoft.iot.vmp.vmanager.bean.*; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +41,6 @@ import oshi.hardware.HardwareAbstractionLayer; import oshi.hardware.NetworkIF; import oshi.software.os.OperatingSystem; -import jakarta.servlet.http.HttpServletRequest; import java.io.File; import java.text.DecimalFormat; import java.util.ArrayList; @@ -85,6 +83,10 @@ public class ServerController { @Autowired private IStreamProxyService proxyService; + + @Autowired + private IMapService mapService; + @Value("${server.port}") private int serverPort; @@ -362,4 +364,11 @@ public class ServerController { double tbNumber = gbNumber / FORMAT; return new DecimalFormat("#.##TB").format(tbNumber); } + + @GetMapping(value = "/map/config") + @ResponseBody + @Operation(summary = "获取地图配置", security = @SecurityRequirement(name = JwtUtils.HEADER)) + public List getMapConfig() { + return mapService.getConfig(); + } } diff --git a/web/public/static/js/config.js b/web/public/static/js/config.js index 94a105690..43329f722 100644 --- a/web/public/static/js/config.js +++ b/web/public/static/js/config.js @@ -5,8 +5,8 @@ window.baseUrl = "" window.mapParam = { // 开启/关闭地图功能 enable: true, - // 坐标系 GCJ-02 WGS-84, - coordinateSystem: "GCJ-02", + // 坐标系 GCJ02 WGS84, + coordinateSystem: "GCJ02", // 地图瓦片地址 tilesUrl: "http://webrd0{1-4}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8", // 瓦片大小 diff --git a/web/src/api/server.js b/web/src/api/server.js index 2e2d98f67..ab36a452f 100644 --- a/web/src/api/server.js +++ b/web/src/api/server.js @@ -115,3 +115,10 @@ export function info() { }) } +export function getMapConfig() { + return request({ + method: 'get', + url: `/api/server/map/config` + }) +} + diff --git a/web/src/store/modules/server.js b/web/src/store/modules/server.js index 026e16502..7f02f5166 100644 --- a/web/src/store/modules/server.js +++ b/web/src/store/modules/server.js @@ -1,6 +1,6 @@ import { checkMediaServer, - checkMediaServerRecord, deleteMediaServer, getMediaInfo, + checkMediaServerRecord, deleteMediaServer, getMapConfig, getMediaInfo, getMediaServer, getMediaServerList, getMediaServerLoad, getOnlineMediaServerList, getResourceInfo, getSystemConfig, getSystemInfo, info, saveMediaServer @@ -136,6 +136,16 @@ const actions = { reject(error) }) }) + }, + getMapConfig({ commit }) { + return new Promise((resolve, reject) => { + getMapConfig().then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) } } diff --git a/web/src/styles/iconfont.scss b/web/src/styles/iconfont.scss index 646f3aa00..5f661da1e 100644 --- a/web/src/styles/iconfont.scss +++ b/web/src/styles/iconfont.scss @@ -1,6 +1,6 @@ @font-face { font-family: "iconfont"; /* Project id 1291092 */ - src: url('iconfont.woff2?t=1758456390170') format('woff2') + src: url('iconfont.woff2?t=1758784486763') format('woff2') } .iconfont { @@ -11,6 +11,158 @@ -moz-osx-font-smoothing: grayscale; } +.icon-mti-duobianxingxuan:before { + content: "\e9e7"; +} + +.icon-mti-fengwotu:before { + content: "\e9e8"; +} + +.icon-mti-fangda:before { + content: "\e9e9"; +} + +.icon-mti-huizhi:before { + content: "\e9ea"; +} + +.icon-mti-guijihuifang:before { + content: "\e9eb"; +} + +.icon-mti-huodongguiji:before { + content: "\e9ed"; +} + +.icon-mti-juliceliang:before { + content: "\e9ee"; +} + +.icon-mti-jutai:before { + content: "\e9ef"; +} + +.icon-mti-kuangxuan:before { + content: "\e9f0"; +} + +.icon-mti-lukuang:before { + content: "\e9f1"; +} + +.icon-a-mti-qiehuanshijiaomti-sanwei:before { + content: "\e9f2"; +} + +.icon-mti-mianjiceliang:before { + content: "\e9f3"; +} + +.icon-mti-lukuang2:before { + content: "\e9f4"; +} + +.icon-mti-sandian:before { + content: "\e9f7"; +} + +.icon-mti-relitu:before { + content: "\e9f8"; +} + +.icon-mti-sanwei:before { + content: "\e9f9"; +} + +.icon-mti-quanxuan:before { + content: "\e9fa"; +} + +.icon-mti-suoxiao:before { + content: "\e9fb"; +} + +.icon-mti-tucengfenlei:before { + content: "\e9fc"; +} + +.icon-mti-tianjiadingweiquyu:before { + content: "\e9fd"; +} + +.icon-mti-tianjiadingwei:before { + content: "\e9fe"; +} + +.icon-mti-tujingdian:before { + content: "\e9ff"; +} + +.icon-mti-xinzengdian:before { + content: "\ea00"; +} + +.icon-mti-xianxuan:before { + content: "\ea01"; +} + +.icon-mti-xuanze:before { + content: "\ea02"; +} + +.icon-mti-xinzengxian:before { + content: "\ea03"; +} + +.icon-mti-yangshi:before { + content: "\ea04"; +} + +.icon-mti-yingyantu:before { + content: "\ea05"; +} + +.icon-mti-yunhangguiji:before { + content: "\ea06"; +} + +.icon-mti-ziyuanbukong:before { + content: "\ea08"; +} + +.icon-mti-zhongdianquyu:before { + content: "\ea09"; +} + +.icon-mti-zongheceliang:before { + content: "\ea0a"; +} + +.icon-mti-POIxinxi:before { + content: "\e9e2"; +} + +.icon-mti-celiang:before { + content: "\e9e3"; +} + +.icon-mti-dituqiehuan:before { + content: "\e9e4"; +} + +.icon-mti-diliweilan:before { + content: "\e9e5"; +} + +.icon-mti-erwei:before { + content: "\e9e6"; +} + +.icon-tuceng:before { + content: "\e7f2"; +} + .icon-a-bofangqi1:before { content: "\ec17"; } diff --git a/web/src/styles/iconfont.woff2 b/web/src/styles/iconfont.woff2 index 6af37da81..a64c51707 100644 Binary files a/web/src/styles/iconfont.woff2 and b/web/src/styles/iconfont.woff2 differ diff --git a/web/src/views/common/MapComponent.vue b/web/src/views/common/MapComponent.vue index cb2570938..5f8f2ed9b 100755 --- a/web/src/views/common/MapComponent.vue +++ b/web/src/views/common/MapComponent.vue @@ -36,15 +36,16 @@ export default { data() { return { overlayId: null, - dragInteraction: new DragInteraction() + dragInteraction: new DragInteraction(), + mapTileList: [], + mapTileIndex: 0 } }, created() { this.$nextTick(() => { - setTimeout(() => { - this.init() - }, 100) + this.init() }) + }, mounted() { @@ -53,6 +54,23 @@ export default { }, methods: { init() { + this.$store.dispatch('server/getMapConfig') + .then(mapConfigList => { + console.log(mapConfigList.length) + if (mapConfigList.length === 0) { + if (window.mapParam.tilesUrl) { + this.mapTileList.push({ + tilesUrl: window.mapParam.tilesUrl, + coordinateSystem: window.mapParam.coordinateSystem + }) + } + }else { + this.mapTileList = mapConfigList + } + this.initMap() + }) + }, + initMap(){ let center = fromLonLat([116.41020, 39.915119]) if (window.mapParam.center) { center = fromLonLat(window.mapParam.center) @@ -65,13 +83,13 @@ export default { minZoom: window.mapParam.minZoom || 1 }) let tileLayer = null - if (window.mapParam.tilesUrl) { + if (this.mapTileList.length > 0 && this.mapTileList[this.mapTileIndex].tilesUrl) { tileLayer = new Tile({ source: new XYZ({ projection: getProj('EPSG:3857'), wrapX: false, tileSize: 256 || window.mapParam.tileSize, - url: window.mapParam.tilesUrl + url: this.mapTileList[this.mapTileIndex].tilesUrl }) }) } else { @@ -179,7 +197,6 @@ export default { }, openInfoBox(position, content, offset) { if (this.overlayId !== null) { - console.log(this.overlayId) this.closeInfoBox(this.overlayId) this.overlayId = null } @@ -354,6 +371,9 @@ export default { olMap.addLayer(vectorLayer) return vectorLayer } + }, + getCurrentCoordinateSystem() { + return this.mapTileList[this.mapTileIndex].coordinateSystem } } } diff --git a/web/src/views/dialog/deviceEdit.vue b/web/src/views/device/edit.vue similarity index 92% rename from web/src/views/dialog/deviceEdit.vue rename to web/src/views/device/edit.vue index 27e2ad3cb..3b7f8484b 100755 --- a/web/src/views/dialog/deviceEdit.vue +++ b/web/src/views/device/edit.vue @@ -44,6 +44,12 @@ + + + + + + diff --git a/web/src/views/device/list.vue b/web/src/views/device/list.vue index 8c6ab0bf3..d78d8656f 100755 --- a/web/src/views/device/list.vue +++ b/web/src/views/device/list.vue @@ -169,7 +169,7 @@