history
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="videoRoomContainer">
|
<div class="videoRoomContainer">
|
||||||
<div class="wrapper">
|
<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-container">
|
||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
<template v-for="(item,index) in videoRoomSteamList">
|
<template v-for="(item,index) in videoRoomSteamList">
|
||||||
@@ -94,9 +94,12 @@ export default {
|
|||||||
callSessionId: "",
|
callSessionId: "",
|
||||||
callStatus: "0",//房间状态 1 未开始等待 2已开始 3已关闭
|
callStatus: "0",//房间状态 1 未开始等待 2已开始 3已关闭
|
||||||
callRoomInfoRequetTimes:0,//房间拉取次数
|
callRoomInfoRequetTimes:0,//房间拉取次数
|
||||||
|
client:"",
|
||||||
|
uuid:""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.uuid=uuidv4,
|
||||||
console.log(location.href)
|
console.log(location.href)
|
||||||
console.log(location.href)
|
console.log(location.href)
|
||||||
console.log(location.href)
|
console.log(location.href)
|
||||||
@@ -114,6 +117,7 @@ export default {
|
|||||||
this.showInviteConfirmDialog = getUrlParam("showInviteConfirmDialog");
|
this.showInviteConfirmDialog = getUrlParam("showInviteConfirmDialog");
|
||||||
this.hasVideo = getUrlParam("hasVideo");
|
this.hasVideo = getUrlParam("hasVideo");
|
||||||
this.isForce = getUrlParam("isForce");
|
this.isForce = getUrlParam("isForce");
|
||||||
|
this.client = getUrlParam("client");
|
||||||
|
|
||||||
|
|
||||||
this.voiceImg = getStatisFileUrl("/media/voice_open.png")
|
this.voiceImg = getStatisFileUrl("/media/voice_open.png")
|
||||||
@@ -130,9 +134,12 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.token = this.$route.query.token || "";
|
this.token = getUrlParam("token");
|
||||||
if (this.token > 10) {
|
console.log("token" + this.token)
|
||||||
|
if (this.token!=null) {
|
||||||
localStorage.setItem("hd_token", this.token)
|
localStorage.setItem("hd_token", this.token)
|
||||||
|
}else {
|
||||||
|
console.warn("url中未获取到token")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.showConfirmDialog == 1) {
|
if (this.showConfirmDialog == 1) {
|
||||||
@@ -226,9 +233,11 @@ export default {
|
|||||||
}
|
}
|
||||||
if (this.isPlayer == 1) {
|
if (this.isPlayer == 1) {
|
||||||
this.getRoomVideoList();
|
this.getRoomVideoList();
|
||||||
|
|
||||||
this.roomTimer = setInterval(() => {
|
this.roomTimer = setInterval(() => {
|
||||||
this.getRoomVideoList();
|
this.getRoomVideoList();
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
|
||||||
}
|
}
|
||||||
this.swiperInstance = new Swiper('.swiper-container', {
|
this.swiperInstance = new Swiper('.swiper-container', {
|
||||||
slidesPerView: 4,
|
slidesPerView: 4,
|
||||||
@@ -438,18 +447,28 @@ export default {
|
|||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if(this.isPublish==1){
|
if(this.isPublish==1){
|
||||||
if(res.data.data.length==2){
|
if(res.data.data.length==2){
|
||||||
|
if(this.callStatus==1){
|
||||||
|
this.callBegin();
|
||||||
|
}
|
||||||
this.callStatus=2
|
this.callStatus=2
|
||||||
this.callBegin();
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if(res.data.data.length==1){
|
if(res.data.data.length==1){
|
||||||
|
if(this.callStatus==1){
|
||||||
|
this.callBegin();
|
||||||
|
}
|
||||||
this.callStatus=2
|
this.callStatus=2
|
||||||
this.callBegin();
|
}
|
||||||
|
}
|
||||||
|
this.generateVideoRoomStream(res.data.data)
|
||||||
|
if(this.client=="app"){
|
||||||
|
try {
|
||||||
|
location.href = "uniwebview://action?function=domMockClick¶ms1=300¶ms2=300";
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.generateVideoRoomStream(res.data.data)
|
|
||||||
}else {
|
}else {
|
||||||
this.generateVideoRoomStream([])
|
this.generateVideoRoomStream([])
|
||||||
}
|
}
|
||||||
@@ -497,10 +516,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
callHangUp() {
|
callHangUp() {
|
||||||
|
if(this.callStatus==3){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let roomInfo = {
|
let roomInfo = {
|
||||||
sessionId: this.roomId,
|
sessionId: this.roomId,
|
||||||
roomId:this.roomId
|
roomId:this.roomId,
|
||||||
|
_uuid:this.uuid,
|
||||||
}
|
}
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
@@ -519,13 +542,15 @@ export default {
|
|||||||
cmd: "hangUp",
|
cmd: "hangUp",
|
||||||
msgTxt: this.uname || ""
|
msgTxt: this.uname || ""
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status == 200) {
|
try {
|
||||||
|
this.publishSdk.close();
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.callStatus=3;
|
||||||
|
clearInterval(this.roomTimer)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
console.log(res)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
joinRoom() {
|
joinRoom() {
|
||||||
@@ -649,6 +674,12 @@ export default {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
//videoSteamList
|
//videoSteamList
|
||||||
},
|
},
|
||||||
|
videoClick(){
|
||||||
|
this.videoRoomSteamList.map(item=>{
|
||||||
|
var video = eval('this.$refs.videoStream' + item.publishId)[0]
|
||||||
|
video.play();
|
||||||
|
})
|
||||||
|
},
|
||||||
videoClickAction(publishId) {
|
videoClickAction(publishId) {
|
||||||
this.topVideo = publishId;
|
this.topVideo = publishId;
|
||||||
var video = eval('this.$refs.videoStream' + publishId)[0]
|
var video = eval('this.$refs.videoStream' + publishId)[0]
|
||||||
|
|||||||
@@ -388,6 +388,93 @@ export default {
|
|||||||
this.addPoints(e.coordinate);
|
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() {
|
planningPathFoot() {
|
||||||
const startPoint = ol.proj.transform(this.navigationStartPoint, 'EPSG:4326', 'EPSG:3857');
|
const startPoint = ol.proj.transform(this.navigationStartPoint, 'EPSG:4326', 'EPSG:3857');
|
||||||
@@ -998,12 +1085,22 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
alarmClickAction(index) {
|
alarmClickAction(index) {
|
||||||
if (index == 1) {
|
try {
|
||||||
location.href = "uniwebview://action?function=alarmConfirmAction¶ms1=" + this.alarmDetailsData.id;
|
if (index == 1) {
|
||||||
}
|
location.href = "uniwebview://action?function=alarmConfirmAction¶ms1=" + this.alarmDetailsData.id;
|
||||||
if (index == 2) {
|
}
|
||||||
location.href = "uniwebview://action?function=alarmPlanningAction¶ms1=" + this.alarmDetailsData.id + "¶ms2=" + this.alarmDetailsData.location;
|
if (index == 2) {
|
||||||
|
location.href = "uniwebview://action?function=alarmPlanningAction¶ms1=" + this.alarmDetailsData.id + "¶ms2=" + this.alarmDetailsData.location;
|
||||||
|
}
|
||||||
|
}catch (e) {
|
||||||
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.alarmDetailsOverlay=false
|
||||||
|
},1000)
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getAlarmDetails(id) {
|
getAlarmDetails(id) {
|
||||||
service.get(`/api/alarm/queryById`, {
|
service.get(`/api/alarm/queryById`, {
|
||||||
@@ -1017,7 +1114,7 @@ export default {
|
|||||||
this.addPointWidthCoordinate(res.data.result.location, "alarm", res.data.result)
|
this.addPointWidthCoordinate(res.data.result.location, "alarm", res.data.result)
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (this.routeType == "car") {
|
if (this.routeType == "car") {
|
||||||
this.planningPath()
|
this.planningPathCar()
|
||||||
}
|
}
|
||||||
if (this.routeType == "foot") {
|
if (this.routeType == "foot") {
|
||||||
this.planningPathFoot()
|
this.planningPathFoot()
|
||||||
|
|||||||
@@ -1151,7 +1151,7 @@ export default {
|
|||||||
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
|
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
|
||||||
setInterval(()=>{
|
setInterval(()=>{
|
||||||
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
|
this.getPatrolInstanceRealyPath(res.data.result.actualStartTime,res.data.result.actualEndTime);
|
||||||
},50000)
|
},2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -1175,6 +1175,7 @@ export default {
|
|||||||
|
|
||||||
service.get(`/sys/equipment/trajectory`, {
|
service.get(`/sys/equipment/trajectory`, {
|
||||||
params: {
|
params: {
|
||||||
|
pageSize:1000,
|
||||||
uerId: this.moveUserId,
|
uerId: this.moveUserId,
|
||||||
startTime:dayjs().startOf('day').format('YYYY-MM-DD HH:mm'),
|
startTime:dayjs().startOf('day').format('YYYY-MM-DD HH:mm'),
|
||||||
endTime:dayjs().endOf('day').format('YYYY-MM-DD HH:mm'),
|
endTime:dayjs().endOf('day').format('YYYY-MM-DD HH:mm'),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.lld.im.service.call.controller;
|
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.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -63,7 +64,8 @@ public class ImCallHistoryController {
|
|||||||
|
|
||||||
@PostMapping("/callBegin")
|
@PostMapping("/callBegin")
|
||||||
public ResponseVO callBegin(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
|
public ResponseVO callBegin(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
|
||||||
|
log.info("===========callBegin ");
|
||||||
|
log.info(JSONObject.toJSONString(imCallHistoryEntity));
|
||||||
//判断当前房间是否有通话
|
//判断当前房间是否有通话
|
||||||
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("session_id",imCallHistoryEntity.getSessionId());
|
queryWrapper.eq("session_id",imCallHistoryEntity.getSessionId());
|
||||||
@@ -100,6 +102,8 @@ public class ImCallHistoryController {
|
|||||||
|
|
||||||
@PostMapping("/callHangUp")
|
@PostMapping("/callHangUp")
|
||||||
public ResponseVO callHangUp(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
|
public ResponseVO callHangUp(@RequestBody ImCallHistoryEntity imCallHistoryEntity) {
|
||||||
|
log.info("===========callHangUp ");
|
||||||
|
log.info(JSONObject.toJSONString(imCallHistoryEntity));
|
||||||
imCallHistoryEntity.setStatus("1");
|
imCallHistoryEntity.setStatus("1");
|
||||||
|
|
||||||
callHistoryService.updateBySessionId(imCallHistoryEntity);
|
callHistoryService.updateBySessionId(imCallHistoryEntity);
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class ImCallHistoryService {
|
|||||||
|
|
||||||
|
|
||||||
public void closeCallRoomWithError(ImCallHistoryEntity callHistory){
|
public void closeCallRoomWithError(ImCallHistoryEntity callHistory){
|
||||||
|
log.info("closeCallRoomWithError");
|
||||||
|
log.info(JSONObject.toJSONString(callHistory));
|
||||||
Date _now=new Date();
|
Date _now=new Date();
|
||||||
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImCallHistoryEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("session_id",callHistory.getSessionId());
|
queryWrapper.eq("session_id",callHistory.getSessionId());
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.lld.im.service.room.controller;
|
package com.lld.im.service.room.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lld.im.common.ResponseVO;
|
import com.lld.im.common.ResponseVO;
|
||||||
import com.lld.im.service.message.model.req.SendMessageReq;
|
import com.lld.im.service.message.model.req.SendMessageReq;
|
||||||
import com.lld.im.service.message.service.P2PMessageService;
|
import com.lld.im.service.message.service.P2PMessageService;
|
||||||
@@ -29,11 +30,15 @@ public class RoomController {
|
|||||||
|
|
||||||
@PostMapping("/createRoom")
|
@PostMapping("/createRoom")
|
||||||
public ResponseVO createRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
public ResponseVO createRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
||||||
|
log.info("===========createRoom ");
|
||||||
|
log.info(JSONObject.toJSONString(roomEntity));
|
||||||
return ResponseVO.successResponse(roomService.createRoom(roomEntity));
|
return ResponseVO.successResponse(roomService.createRoom(roomEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/joinRoom")
|
@PostMapping("/joinRoom")
|
||||||
public ResponseVO joinRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
public ResponseVO joinRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
||||||
|
log.info("===========joinRoom");
|
||||||
|
log.info(roomEntity.toString());
|
||||||
return ResponseVO.successResponse(roomService.joinRoom(roomEntity));
|
return ResponseVO.successResponse(roomService.joinRoom(roomEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +49,15 @@ public class RoomController {
|
|||||||
|
|
||||||
@PostMapping("/leaveRoom")
|
@PostMapping("/leaveRoom")
|
||||||
public ResponseVO leaveRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
public ResponseVO leaveRoom(@RequestBody ImRoomEntity roomEntity, Integer appId) {
|
||||||
|
log.info("===========leaveRoom");
|
||||||
roomService.leaveRoom(roomEntity);
|
roomService.leaveRoom(roomEntity);
|
||||||
return ResponseVO.successResponse(roomEntity.getPublishName()+"离开视频房间");
|
return ResponseVO.successResponse(roomEntity.getPublishName()+"离开视频房间");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/unpublish")
|
@PostMapping("/unpublish")
|
||||||
public ResponseVO unpublish(@RequestBody SRSCallBackReq callBackReq) {
|
public ResponseVO unpublish(@RequestBody SRSCallBackReq callBackReq) {
|
||||||
log.info(callBackReq.toString());
|
log.info("===========srs 回调");
|
||||||
|
log.info(JSONObject.toJSONString(callBackReq));
|
||||||
try {
|
try {
|
||||||
ImRoomEntity roomEntity = new ImRoomEntity();
|
ImRoomEntity roomEntity = new ImRoomEntity();
|
||||||
roomEntity.setRoomId(callBackReq.getApp());
|
roomEntity.setRoomId(callBackReq.getApp());
|
||||||
|
|||||||
@@ -1,18 +1,23 @@
|
|||||||
package com.lld.im.service.room.service;
|
package com.lld.im.service.room.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.lld.im.common.enums.DelFlagEnum;
|
import com.lld.im.common.enums.DelFlagEnum;
|
||||||
import com.lld.im.service.message.dao.mapper.ImMessageBodyMapper;
|
import com.lld.im.service.message.dao.mapper.ImMessageBodyMapper;
|
||||||
import com.lld.im.service.room.dao.ImRoomEntity;
|
import com.lld.im.service.room.dao.ImRoomEntity;
|
||||||
import com.lld.im.service.room.dao.mapper.ImRoomMapper;
|
import com.lld.im.service.room.dao.mapper.ImRoomMapper;
|
||||||
import com.lld.im.service.user.dao.ImUserDataEntity;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class ImRoomService {
|
public class ImRoomService {
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -20,12 +25,17 @@ public class ImRoomService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ImRoomEntity createRoom(ImRoomEntity entity) {
|
public ImRoomEntity createRoom(ImRoomEntity entity) {
|
||||||
|
log.info("createRoom");
|
||||||
|
log.info(JSONObject.toJSONString(entity));
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("room_id",entity.getRoomId());
|
queryWrapper.eq("room_id",entity.getRoomId());
|
||||||
queryWrapper.eq("publish_id",entity.getPublishId());
|
queryWrapper.eq("publish_id",entity.getPublishId());
|
||||||
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
|
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
|
||||||
if(roomEntityList.size()>0){
|
if(roomEntityList.size()>0){
|
||||||
imRoomMapper.delete(queryWrapper);
|
ImRoomEntity roomEntity = roomEntityList.get(0);
|
||||||
|
roomEntity.setWebrtcUrl(entity.getWebrtcUrl());
|
||||||
|
imRoomMapper.updateById(roomEntity);
|
||||||
|
return roomEntity;
|
||||||
}
|
}
|
||||||
imRoomMapper.insert(entity);
|
imRoomMapper.insert(entity);
|
||||||
return entity;
|
return entity;
|
||||||
@@ -33,15 +43,26 @@ public class ImRoomService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ImRoomEntity joinRoom(ImRoomEntity entity) {
|
public ImRoomEntity joinRoom(ImRoomEntity entity) {
|
||||||
|
log.info("joinRoom");
|
||||||
|
log.info(JSONObject.toJSONString(entity));
|
||||||
|
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("room_id",entity.getRoomId());
|
queryWrapper.eq("room_id",entity.getRoomId());
|
||||||
queryWrapper.eq("publish_id",entity.getPublishId());
|
queryWrapper.eq("publish_id",entity.getPublishId());
|
||||||
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
|
List<ImRoomEntity> roomEntityList = imRoomMapper.selectList(queryWrapper);
|
||||||
if(roomEntityList.size()>0){
|
if(roomEntityList.size()>0){
|
||||||
roomEntityList.get(0).setIsOver(0);
|
log.info("=============joinRoom:{}",entity.getWebrtcUrl());
|
||||||
roomEntityList.get(0).setOffline(0);
|
if(StringUtils.isBlank(entity.getWebrtcUrl())){
|
||||||
roomEntityList.get(0).setWebrtcUrl(entity.getWebrtcUrl());
|
return roomEntityList.get(0);
|
||||||
imRoomMapper.updateById(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 {
|
}else {
|
||||||
entity.setOffline(0);
|
entity.setOffline(0);
|
||||||
entity.setIsOver(0);
|
entity.setIsOver(0);
|
||||||
@@ -52,6 +73,9 @@ public class ImRoomService {
|
|||||||
|
|
||||||
|
|
||||||
public void deleteUserFromRoom(ImRoomEntity entity){
|
public void deleteUserFromRoom(ImRoomEntity entity){
|
||||||
|
log.info("deleteUserFromRoom");
|
||||||
|
log.info(JSONObject.toJSONString(entity));
|
||||||
|
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("room_id",entity.getRoomId());
|
queryWrapper.eq("room_id",entity.getRoomId());
|
||||||
queryWrapper.eq("publish_id",entity.getPublishId());
|
queryWrapper.eq("publish_id",entity.getPublishId());
|
||||||
@@ -62,12 +86,18 @@ public class ImRoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void deleteRoomById(Integer id){
|
public void deleteRoomById(Integer id){
|
||||||
|
log.info("deleteRoomById");
|
||||||
|
log.info(id.toString());
|
||||||
|
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("id",id);
|
queryWrapper.eq("id",id);
|
||||||
imRoomMapper.delete(queryWrapper);
|
imRoomMapper.delete(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAllUserFromRoom(String roomId){
|
public void deleteAllUserFromRoom(String roomId){
|
||||||
|
log.info("deleteAllUserFromRoom");
|
||||||
|
log.info(roomId);
|
||||||
|
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("room_id",roomId);
|
queryWrapper.eq("room_id",roomId);
|
||||||
imRoomMapper.delete(queryWrapper);
|
imRoomMapper.delete(queryWrapper);
|
||||||
@@ -98,6 +128,9 @@ public class ImRoomService {
|
|||||||
return roomEntityList;
|
return roomEntityList;
|
||||||
}
|
}
|
||||||
public void leaveRoom (ImRoomEntity entity){
|
public void leaveRoom (ImRoomEntity entity){
|
||||||
|
log.info("leaveRoom");
|
||||||
|
log.info(JSONObject.toJSONString(entity));
|
||||||
|
|
||||||
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ImRoomEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("room_id",entity.getRoomId());
|
queryWrapper.eq("room_id",entity.getRoomId());
|
||||||
queryWrapper.eq("publish_id",entity.getPublishId());
|
queryWrapper.eq("publish_id",entity.getPublishId());
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class CallHistoryTask {
|
|||||||
if(serviceRoomInfo.size()==0){
|
if(serviceRoomInfo.size()==0){
|
||||||
log.info("{}房间里面没有流,关掉全部视频流并且设置状态为异常中断",callHistoryEntity.getSessionId());
|
log.info("{}房间里面没有流,关掉全部视频流并且设置状态为异常中断",callHistoryEntity.getSessionId());
|
||||||
//房间里面没有流,关掉全部视频流并且判断异常中断
|
//房间里面没有流,关掉全部视频流并且判断异常中断
|
||||||
// closeAll(callHistoryEntity,serviceRoomInfo);
|
closeAll(callHistoryEntity,serviceRoomInfo);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
callHistoryEntity.setCheckTimes(callHistoryEntity.getCheckTimes()+1);
|
callHistoryEntity.setCheckTimes(callHistoryEntity.getCheckTimes()+1);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class SRSStreamTask {
|
|||||||
ImRoomService roomService;
|
ImRoomService roomService;
|
||||||
|
|
||||||
|
|
||||||
@Scheduled(cron="0/2 * * * * ? ")
|
@Scheduled(cron="0/200 * * * * ? ")
|
||||||
public void executeTask() throws Exception {
|
public void executeTask() throws Exception {
|
||||||
log.info("====================== 执行定时任务 SRSStreamTask");
|
log.info("====================== 执行定时任务 SRSStreamTask");
|
||||||
String _url = "http://"+host+":1985/api/v1/streams";
|
String _url = "http://"+host+":1985/api/v1/streams";
|
||||||
@@ -53,6 +53,7 @@ public class SRSStreamTask {
|
|||||||
List<ImRoomEntity> roomList = roomService.getAllRoomList();
|
List<ImRoomEntity> roomList = roomService.getAllRoomList();
|
||||||
for (ImRoomEntity roomEntity:roomList){
|
for (ImRoomEntity roomEntity:roomList){
|
||||||
if(StringUtils.isBlank(roomEntity.getWebrtcUrl())){
|
if(StringUtils.isBlank(roomEntity.getWebrtcUrl())){
|
||||||
|
log.info("webRTC地址为空,移除房间{}",roomEntity.getRoomId());
|
||||||
roomService.deleteRoomById(roomEntity.getId());
|
roomService.deleteRoomById(roomEntity.getId());
|
||||||
}else {
|
}else {
|
||||||
Boolean hasStream=false;
|
Boolean hasStream=false;
|
||||||
@@ -72,7 +73,7 @@ public class SRSStreamTask {
|
|||||||
if(!hasStream){
|
if(!hasStream){
|
||||||
roomService.addCheckTimes(roomEntity,roomEntity.getCheckTimes()+1);
|
roomService.addCheckTimes(roomEntity,roomEntity.getCheckTimes()+1);
|
||||||
if(roomEntity.getCheckTimes()>4){
|
if(roomEntity.getCheckTimes()>4){
|
||||||
// roomService.deleteRoomById(roomEntity.getId());
|
roomService.deleteRoomById(roomEntity.getId());
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
roomService.addCheckTimes(roomEntity,0);
|
roomService.addCheckTimes(roomEntity,0);
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ mqQueueName: 123
|
|||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 会正常输出日志
|
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 会正常输出日志
|
||||||
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
mapper-locations: classpath*:mapper/*.xml
|
mapper-locations: classpath*:mapper/*.xml
|
||||||
global-config:
|
global-config:
|
||||||
db-config:
|
db-config:
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ spring:
|
|||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
|
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: prod
|
||||||
|
|||||||
@@ -555,7 +555,9 @@ const store = new Vuex.Store({
|
|||||||
getAddressList(context) {
|
getAddressList(context) {
|
||||||
//获取通讯录,存储通讯录数据到本地
|
//获取通讯录,存储通讯录数据到本地
|
||||||
customHttp.customHttp.get('/api/im/app/addressList', {
|
customHttp.customHttp.get('/api/im/app/addressList', {
|
||||||
params: {},
|
params: {
|
||||||
|
pageSize:1000
|
||||||
|
},
|
||||||
/* 会加在url上 */
|
/* 会加在url上 */
|
||||||
header: {},
|
header: {},
|
||||||
/* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
/* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<view v-if="showtool || showEmojitool" :style="'height:558rpx'"></view>
|
<view v-if="showtool || showEmojitool" :style="'height:558rpx'"></view>
|
||||||
<view class="zfb-tk-send-tool" :style="'transform: translateY(-' + keyboardHeight + 'px)'">
|
<view class="zfb-tk-send-tool" :style="'transform: translateY(-' + keyboardHeight + 'px)'">
|
||||||
<view class="zfb-tk-send-tool-c">
|
<view class="zfb-tk-send-tool-c">
|
||||||
<!-- <view class="zfb-tk-send-tool-icon wxfont" @click="changeShowVice"
|
<!-- <view class="zfb-tk-send-tool-icon wxfont" @click="changeShowVice"
|
||||||
:class="showVice ? 'jianpan' : 'yuyin2'"></view> -->
|
:class="showVice ? 'jianpan' : 'yuyin2'"></view> -->
|
||||||
<view class="zfb-tk-send-tool-vioce" v-if="showVice">
|
<view class="zfb-tk-send-tool-vioce" v-if="showVice">
|
||||||
<!-- <view class="zfb-tk-send-tool-vioce-item" @longpress="startRecord" @touchend="endRecord">按住说话</view> -->
|
<!-- <view class="zfb-tk-send-tool-vioce-item" @longpress="startRecord" @touchend="endRecord">按住说话</view> -->
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
发送</view>
|
发送</view>
|
||||||
</template>
|
</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>
|
||||||
<view v-if="showtool" class="zfb-tk-send-tools">
|
<view v-if="showtool" class="zfb-tk-send-tools">
|
||||||
<template v-for="(v, i) in toolist">
|
<template v-for="(v, i) in toolist">
|
||||||
@@ -1012,7 +1012,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.zfb-tk-main {
|
.zfb-tk-main {
|
||||||
padding: 55rpx 12px;
|
padding: 80rpx 12px;
|
||||||
padding-bottom: 112rpx;
|
padding-bottom: 112rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,9 @@
|
|||||||
|
|
||||||
// 局部修改配置,局部配置优先级高于全局配置
|
// 局部修改配置,局部配置优先级高于全局配置
|
||||||
customHttp.customHttp.get('/api/im/app/addressList', {
|
customHttp.customHttp.get('/api/im/app/addressList', {
|
||||||
params: {}, /* 会加在url上 */
|
params: {
|
||||||
|
pageSize:1000
|
||||||
|
}, /* 会加在url上 */
|
||||||
header: {}, /* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
header: {}, /* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
// 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部)
|
// 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部)
|
||||||
|
|||||||
Reference in New Issue
Block a user