This commit is contained in:
2023-12-10 14:33:58 +08:00
parent 2cc4c82cbd
commit e1e98de4b2
14 changed files with 216 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="videoRoomContainer">
<div class="wrapper">
<video ref="videoStreamtopVideo" width="100%" autoplay></video>
<video @click="videoClick" ref="videoStreamtopVideo" width="100%" autoplay></video>
<div class="swiper-container">
<div class="swiper-wrapper">
<template v-for="(item,index) in videoRoomSteamList">
@@ -94,9 +94,12 @@ export default {
callSessionId: "",
callStatus: "0",//房间状态 1 未开始等待 2已开始 3已关闭
callRoomInfoRequetTimes:0,//房间拉取次数
client:"",
uuid:""
};
},
mounted() {
this.uuid=uuidv4,
console.log(location.href)
console.log(location.href)
console.log(location.href)
@@ -114,6 +117,7 @@ export default {
this.showInviteConfirmDialog = getUrlParam("showInviteConfirmDialog");
this.hasVideo = getUrlParam("hasVideo");
this.isForce = getUrlParam("isForce");
this.client = getUrlParam("client");
this.voiceImg = getStatisFileUrl("/media/voice_open.png")
@@ -130,9 +134,12 @@ export default {
}
this.token = this.$route.query.token || "";
if (this.token > 10) {
this.token = getUrlParam("token");
console.log("token" + this.token)
if (this.token!=null) {
localStorage.setItem("hd_token", this.token)
}else {
console.warn("url中未获取到token")
}
if (this.showConfirmDialog == 1) {
@@ -226,9 +233,11 @@ export default {
}
if (this.isPlayer == 1) {
this.getRoomVideoList();
this.roomTimer = setInterval(() => {
this.getRoomVideoList();
}, 2000)
}
this.swiperInstance = new Swiper('.swiper-container', {
slidesPerView: 4,
@@ -438,18 +447,28 @@ export default {
if (res.status == 200) {
if(this.isPublish==1){
if(res.data.data.length==2){
this.callStatus=2
if(this.callStatus==1){
this.callBegin();
}
this.callStatus=2
}
}else {
if(res.data.data.length==1){
this.callStatus=2
if(this.callStatus==1){
this.callBegin();
}
this.callStatus=2
}
}
this.generateVideoRoomStream(res.data.data)
if(this.client=="app"){
try {
location.href = "uniwebview://action?function=domMockClick&params1=300&params2=300";
}catch (e) {
}
}
this.generateVideoRoomStream(res.data.data)
}else {
this.generateVideoRoomStream([])
}
@@ -497,10 +516,14 @@ export default {
})
},
callHangUp() {
if(this.callStatus==3){
return false;
}
let roomInfo = {
sessionId: this.roomId,
roomId:this.roomId
roomId:this.roomId,
_uuid:this.uuid,
}
axios({
@@ -519,13 +542,15 @@ export default {
cmd: "hangUp",
msgTxt: this.uname || ""
}).then((res) => {
if (res.status == 200) {
try {
this.publishSdk.close();
}catch (e) {
}
this.callStatus=3;
clearInterval(this.roomTimer)
})
console.log(res)
})
},
joinRoom() {
@@ -649,6 +674,12 @@ export default {
}, 1000)
//videoSteamList
},
videoClick(){
this.videoRoomSteamList.map(item=>{
var video = eval('this.$refs.videoStream' + item.publishId)[0]
video.play();
})
},
videoClickAction(publishId) {
this.topVideo = publishId;
var video = eval('this.$refs.videoStream' + publishId)[0]

View File

@@ -388,6 +388,93 @@ export default {
this.addPoints(e.coordinate);
}
});
},
planningPathCar() {
const startPoint = ol.proj.transform(this.navigationStartPoint, 'EPSG:4326', 'EPSG:3857');
const endPoint = ol.proj.transform(this.navigationEndPoint, 'EPSG:4326', 'EPSG:3857');
let _url = "https://172.16.3.18/route/v0/driving/"
_url = _url + this.navigationStartPoint[0] + ","
_url = _url + this.navigationStartPoint[1] + ";"
_url = _url + this.navigationEndPoint[0] + ","
_url = _url + this.navigationEndPoint[1]
_url = _url + "?" + "alternatives=true&steps=true&geometries=geojson";
axios({
method: "get",
url: _url,
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
}).then(res => {
console.log("================================获取到了导航结果")
res = res.data;
/*
console.log(res)
if (res.code != "OK") {
return false;
}else {
console.log("================================获取到了导航结果,开始步行导航")
}
*/
let pathList = [startPoint];
const coordinates = res.routes[0].geometry.coordinates
coordinates.map(item1 => {
const _point = ol.proj.transform(item1, 'EPSG:4326', 'EPSG:3857');
pathList.push(_point)
})
// let _list=res.route[0].legs[0].steps[0].intersections
//
// _list.map((item, index) => {
//
// })
pathList.push(endPoint)
console.log("==============================pathList")
console.log(pathList)
const route = new LineString(pathList)
const geometryMove = new Point(route.getFirstCoordinate());
const featureMove = new Feature({
type: "featureMove",
geometry: geometryMove,
});
// this.planningVectorLayer.set('id', 'planningVectorLayer');
//先清空 再清除
this.map.removeLayer(this.planningVectorLayer)
this.planningVectorLayer = new VectorLayer({
source: new VectorSource({
features: [
new Feature({
type: "route",
geometry: route,
}),
featureMove,
new Feature({
type: "icon",
geometry: new Point(route.getFirstCoordinate()),
}),
new Feature({
type: "icon",
geometry: new Point(route.getLastCoordinate()),
}),
],
}),
style: (feature) => {
return this.styles[feature.get("type")];
},
});
this.map.addLayer(this.planningVectorLayer)
})
},
planningPathFoot() {
const startPoint = ol.proj.transform(this.navigationStartPoint, 'EPSG:4326', 'EPSG:3857');
@@ -998,12 +1085,22 @@ export default {
},
alarmClickAction(index) {
try {
if (index == 1) {
location.href = "uniwebview://action?function=alarmConfirmAction&params1=" + this.alarmDetailsData.id;
}
if (index == 2) {
location.href = "uniwebview://action?function=alarmPlanningAction&params1=" + this.alarmDetailsData.id + "&params2=" + this.alarmDetailsData.location;
}
}catch (e) {
console.log(e)
}
setTimeout(()=>{
this.alarmDetailsOverlay=false
},1000)
},
getAlarmDetails(id) {
service.get(`/api/alarm/queryById`, {
@@ -1017,7 +1114,7 @@ export default {
this.addPointWidthCoordinate(res.data.result.location, "alarm", res.data.result)
setInterval(() => {
if (this.routeType == "car") {
this.planningPath()
this.planningPathCar()
}
if (this.routeType == "foot") {
this.planningPathFoot()

View File

@@ -1151,7 +1151,7 @@ export default {
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
setInterval(()=>{
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
},50000)
},2000)
}
})
@@ -1175,6 +1175,7 @@ export default {
service.get(`/sys/equipment/trajectory`, {
params: {
pageSize:1000,
uerId: this.moveUserId,
startTime:dayjs().startOf('day').format('YYYY-MM-DD HH:mm'),
endTime:dayjs().endOf('day').format('YYYY-MM-DD HH:mm'),

View File

@@ -1,6 +1,7 @@
package com.lld.im.service.call.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -63,7 +64,8 @@ public class ImCallHistoryController {
@PostMapping("/callBegin")
public ResponseVO callBegin(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
log.info("===========callBegin ");
log.info(JSONObject.toJSONString(imCallHistoryEntity));
//判断当前房间是否有通话
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("session_id",imCallHistoryEntity.getSessionId());
@@ -100,6 +102,8 @@ public class ImCallHistoryController {
@PostMapping("/callHangUp")
public ResponseVO callHangUp(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
log.info("===========callHangUp ");
log.info(JSONObject.toJSONString(imCallHistoryEntity));
imCallHistoryEntity.setStatus("1");
callHistoryService.updateBySessionId(imCallHistoryEntity);

View File

@@ -64,6 +64,8 @@ public class ImCallHistoryService {
public void closeCallRoomWithError(ImCallHistoryEntity callHistory){
log.info("closeCallRoomWithError");
log.info(JSONObject.toJSONString(callHistory));
Date _now=new Date();
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("session_id",callHistory.getSessionId());

View File

@@ -1,6 +1,7 @@
package com.lld.im.service.room.controller;
import com.alibaba.fastjson.JSONObject;
import com.lld.im.common.ResponseVO;
import com.lld.im.service.message.model.req.SendMessageReq;
import com.lld.im.service.message.service.P2PMessageService;
@@ -29,11 +30,15 @@ public class RoomController {
@PostMapping("/createRoom")
public ResponseVO createRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
log.info("===========createRoom ");
log.info(JSONObject.toJSONString(roomEntity));
return ResponseVO.successResponse(roomService.createRoom(roomEntity));
}
@PostMapping("/joinRoom")
public ResponseVO joinRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
log.info("===========joinRoom");
log.info(roomEntity.toString());
return ResponseVO.successResponse(roomService.joinRoom(roomEntity));
}
@@ -44,14 +49,15 @@ public class RoomController {
@PostMapping("/leaveRoom")
public ResponseVO leaveRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
log.info("===========leaveRoom");
roomService.leaveRoom(roomEntity);
return ResponseVO.successResponse(roomEntity.getPublishName()+"离开视频房间");
}
@PostMapping("/unpublish")
public ResponseVO unpublish(@RequestBody SRSCallBackReq callBackReq) {
log.info(callBackReq.toString());
log.info("===========srs 回调");
log.info(JSONObject.toJSONString(callBackReq));
try {
ImRoomEntity roomEntity = new ImRoomEntity();
roomEntity.setRoomId(callBackReq.getApp());

View File

@@ -1,18 +1,23 @@
package com.lld.im.service.room.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lld.im.common.enums.DelFlagEnum;
import com.lld.im.service.message.dao.mapper.ImMessageBodyMapper;
import com.lld.im.service.room.dao.ImRoomEntity;
import com.lld.im.service.room.dao.mapper.ImRoomMapper;
import com.lld.im.service.user.dao.ImUserDataEntity;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Slf4j
@Service
public class ImRoomService {
@Autowired
@@ -20,12 +25,17 @@ public class ImRoomService {
@Transactional
public ImRoomEntity createRoom(ImRoomEntity entity) {
log.info("createRoom");
log.info(JSONObject.toJSONString(entity));
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("room_id",entity.getRoomId());
queryWrapper.eq("publish_id",entity.getPublishId());
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
if(roomEntityList.size()>0){
imRoomMapper.delete(queryWrapper);
ImRoomEntity roomEntity = roomEntityList.get(0);
roomEntity.setWebrtcUrl(entity.getWebrtcUrl());
imRoomMapper.updateById(roomEntity);
return roomEntity;
}
imRoomMapper.insert(entity);
return entity;
@@ -33,15 +43,26 @@ public class ImRoomService {
@Transactional
public ImRoomEntity joinRoom(ImRoomEntity entity) {
log.info("joinRoom");
log.info(JSONObject.toJSONString(entity));
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("room_id",entity.getRoomId());
queryWrapper.eq("publish_id",entity.getPublishId());
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
if(roomEntityList.size()>0){
log.info("=============joinRoom:{}",entity.getWebrtcUrl());
if(StringUtils.isBlank(entity.getWebrtcUrl())){
return roomEntityList.get(0);
}else {
roomEntityList.get(0).setIsOver(0);
roomEntityList.get(0).setOffline(0);
roomEntityList.get(0).setWebrtcUrl(entity.getWebrtcUrl());
imRoomMapper.updateById(roomEntityList.get(0));
return roomEntityList.get(0);
}
}else {
entity.setOffline(0);
entity.setIsOver(0);
@@ -52,6 +73,9 @@ public class ImRoomService {
public void deleteUserFromRoom(ImRoomEntity entity){
log.info("deleteUserFromRoom");
log.info(JSONObject.toJSONString(entity));
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("room_id",entity.getRoomId());
queryWrapper.eq("publish_id",entity.getPublishId());
@@ -62,12 +86,18 @@ public class ImRoomService {
}
public void deleteRoomById(Integer id){
log.info("deleteRoomById");
log.info(id.toString());
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
imRoomMapper.delete(queryWrapper);
}
public void deleteAllUserFromRoom(String roomId){
log.info("deleteAllUserFromRoom");
log.info(roomId);
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("room_id",roomId);
imRoomMapper.delete(queryWrapper);
@@ -98,6 +128,9 @@ public class ImRoomService {
return roomEntityList;
}
public void leaveRoom (ImRoomEntity entity){
log.info("leaveRoom");
log.info(JSONObject.toJSONString(entity));
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("room_id",entity.getRoomId());
queryWrapper.eq("publish_id",entity.getPublishId());

View File

@@ -41,7 +41,7 @@ public class CallHistoryTask {
if(serviceRoomInfo.size()==0){
log.info("{}房间里面没有流,关掉全部视频流并且设置状态为异常中断",callHistoryEntity.getSessionId());
//房间里面没有流,关掉全部视频流并且判断异常中断
// closeAll(callHistoryEntity,serviceRoomInfo);
closeAll(callHistoryEntity,serviceRoomInfo);
}
}else {
callHistoryEntity.setCheckTimes(callHistoryEntity.getCheckTimes()+1);

View File

@@ -35,7 +35,7 @@ public class SRSStreamTask {
ImRoomService roomService;
@Scheduled(cron="0/2 * * * * ? ")
@Scheduled(cron="0/200 * * * * ? ")
public void executeTask() throws Exception {
log.info("====================== 执行定时任务 SRSStreamTask");
String _url = "http://"+host+":1985/api/v1/streams";
@@ -53,6 +53,7 @@ public class SRSStreamTask {
List<ImRoomEntity> roomList = roomService.getAllRoomList();
for (ImRoomEntity roomEntity:roomList){
if(StringUtils.isBlank(roomEntity.getWebrtcUrl())){
log.info("webRTC地址为空移除房间{}",roomEntity.getRoomId());
roomService.deleteRoomById(roomEntity.getId());
}else {
Boolean hasStream=false;
@@ -72,7 +73,7 @@ public class SRSStreamTask {
if(!hasStream){
roomService.addCheckTimes(roomEntity,roomEntity.getCheckTimes()+1);
if(roomEntity.getCheckTimes()>4){
// roomService.deleteRoomById(roomEntity.getId());
roomService.deleteRoomById(roomEntity.getId());
}
}else {
roomService.addCheckTimes(roomEntity,0);

View File

@@ -101,8 +101,8 @@ mqQueueName: 123
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 会正常输出日志
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 会正常输出日志
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
mapper-locations: classpath*:mapper/*.xml
global-config:
db-config:

View File

@@ -3,4 +3,4 @@ spring:
time-zone: GMT+8
profiles:
active: dev
active: prod

View File

@@ -555,7 +555,9 @@ const store = new Vuex.Store({
getAddressList(context) {
//获取通讯录,存储通讯录数据到本地
customHttp.customHttp.get('/api/im/app/addressList', {
params: {},
params: {
pageSize:1000
},
/* 会加在url上 */
header: {},
/* 会与全局header合并如有同名属性局部覆盖全局 */

View File

@@ -49,7 +49,7 @@
发送</view>
</template>
<view v-else @click="changeTool" class="zfb-tk-send-tool-more wxfont gengduo"></view>
<view @click="changeTool" class="zfb-tk-send-tool-more wxfont gengduo"></view>
</view>
<view v-if="showtool" class="zfb-tk-send-tools">
<template v-for="(v, i) in toolist">
@@ -1012,7 +1012,7 @@
}
.zfb-tk-main {
padding: 55rpx 12px;
padding: 80rpx 12px;
padding-bottom: 112rpx;
}

View File

@@ -72,7 +72,9 @@
// 局部修改配置,局部配置优先级高于全局配置
customHttp.customHttp.get('/api/im/app/addressList', {
params: {}, /* 会加在url上 */
params: {
pageSize:1000
}, /* 会加在url上 */
header: {}, /* 会与全局header合并如有同名属性局部覆盖全局 */
dataType: 'json',
// 注如果局部custom与全局custom有同名属性则后面的属性会覆盖前面的属性相当于Object.assign(全局,局部)