|
|
@@ -2,15 +2,13 @@ package com.inspur.service.partywork.impl;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.inspur.common.config.InspurConfig;
|
|
|
-import com.inspur.common.constant.Constants;
|
|
|
import com.inspur.common.core.domain.AjaxResult;
|
|
|
import com.inspur.common.utils.DateUtils;
|
|
|
-import com.inspur.common.utils.SecurityUtils;
|
|
|
import com.inspur.common.utils.StringUtils;
|
|
|
import com.inspur.common.utils.file.FileUploadUtils;
|
|
|
import com.inspur.common.utils.file.FileUtils;
|
|
|
import com.inspur.domain.PcDevice;
|
|
|
-import com.inspur.domain.partywork.PartyMeetingAudio;
|
|
|
+import com.inspur.domain.partywork.ImageMoveReqVo;
|
|
|
import com.inspur.domain.partywork.PartyMeetingFollow;
|
|
|
import com.inspur.domain.partywork.PartyMeetingImage;
|
|
|
import com.inspur.domain.partywork.PartyMeetingInfo;
|
|
|
@@ -19,10 +17,7 @@ import com.inspur.mapper.PartyMeetingFollowMapper;
|
|
|
import com.inspur.mapper.PartyMeetingImageMapper;
|
|
|
import com.inspur.mapper.PartyMeetingInfoMapper;
|
|
|
import com.inspur.mapper.PcDeviceMapper;
|
|
|
-import com.inspur.netty.message.push.FileControl;
|
|
|
-import com.inspur.netty.message.push.PushMessage;
|
|
|
-import com.inspur.netty.message.push.PushMessageType;
|
|
|
-import com.inspur.netty.message.push.UrlControl;
|
|
|
+import com.inspur.netty.message.push.*;
|
|
|
import com.inspur.netty.server.PushMessageUtil;
|
|
|
import com.inspur.service.partywork.IRemoteControlService;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -30,7 +25,6 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
@@ -81,12 +75,75 @@ public class RemoteControlServiceImpl implements IRemoteControlService {
|
|
|
String controlParam = JSON.toJSONString(pushMessage);
|
|
|
// 推送消息
|
|
|
PcDevice pcDevice = pcDeviceMapper.selectPcDeviceById(deviceId.longValue());
|
|
|
- PushMessageUtil.remoteMeetingControl(pcDevice.getWiredMac(),pcDevice.getWirelessMac(),controlUrl,controlParam);
|
|
|
- log.info("远程控制开始,参数:{}",controlParam);
|
|
|
+ PushMessageUtil.remoteMeetingControl(pcDevice.getWiredMac(), pcDevice.getWirelessMac(), controlUrl, controlParam);
|
|
|
+ log.info("远程控制开始,参数:{}", controlParam);
|
|
|
String msg = "";
|
|
|
if (0 == index) {
|
|
|
msg = "远程控制开始";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
+ msg = "切换成功";
|
|
|
+ }
|
|
|
+ return AjaxResult.success(msg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult imageMove(ImageMoveReqVo reqParam) {
|
|
|
+ Integer index = reqParam.getImageIndex() - 1;
|
|
|
+ List<PartyMeetingFollow> imageList = partyMeetingFollowMapper.selectPartyMeetingFollowByMId(reqParam.getMeetingId(), 2);
|
|
|
+ String imageUrl = imageList.get(index).getFileUrl();
|
|
|
+
|
|
|
+ ImageMoveControl nettyMessage = new ImageMoveControl();
|
|
|
+ nettyMessage.setIndex(index);
|
|
|
+ nettyMessage.setMeetingId(reqParam.getMeetingId());
|
|
|
+ nettyMessage.setDirection(reqParam.getDirection());
|
|
|
+ nettyMessage.setImageUrl(imageUrl);
|
|
|
+ nettyMessage.setDistance(reqParam.getDistance());
|
|
|
+ String reqParamJson = JSON.toJSONString(nettyMessage);
|
|
|
+
|
|
|
+ PushMessage pushMessage = new PushMessage();
|
|
|
+ pushMessage.setMessageType(PushMessageType.CONTROL_IMAGE_MOVE.getValue());
|
|
|
+ pushMessage.setMessageData(reqParamJson);
|
|
|
+ String controlParam = JSON.toJSONString(pushMessage);
|
|
|
+
|
|
|
+ // 推送消息
|
|
|
+ PcDevice pcDevice = pcDeviceMapper.selectPcDeviceById(reqParam.getDeviceId());
|
|
|
+ PushMessageUtil.remoteMeetingControl(pcDevice.getWiredMac(), pcDevice.getWirelessMac(), controlUrl, controlParam);
|
|
|
+ log.info("远程控制开始,参数:{}", reqParamJson);
|
|
|
+ String msg = "";
|
|
|
+ if (0 == index) {
|
|
|
+ msg = "远程控制开始";
|
|
|
+ } else {
|
|
|
+ msg = "切换成功";
|
|
|
+ }
|
|
|
+ return AjaxResult.success(msg);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult imageScale(ImageMoveReqVo reqParam) {
|
|
|
+ Integer index = reqParam.getImageIndex() - 1;
|
|
|
+ List<PartyMeetingFollow> imageList = partyMeetingFollowMapper.selectPartyMeetingFollowByMId(reqParam.getMeetingId(), 2);
|
|
|
+ String imageUrl = imageList.get(index).getFileUrl();
|
|
|
+
|
|
|
+ ImageScaleControl nettyMessage = new ImageScaleControl();
|
|
|
+ nettyMessage.setIndex(index);
|
|
|
+ nettyMessage.setMeetingId(reqParam.getMeetingId());
|
|
|
+ nettyMessage.setScale(reqParam.getScale());
|
|
|
+ nettyMessage.setImageUrl(imageUrl);
|
|
|
+ String reqParamJson = JSON.toJSONString(nettyMessage);
|
|
|
+
|
|
|
+ PushMessage pushMessage = new PushMessage();
|
|
|
+ pushMessage.setMessageType(PushMessageType.CONTROL_IMAGE_SCALE.getValue());
|
|
|
+ pushMessage.setMessageData(reqParamJson);
|
|
|
+ String controlParam = JSON.toJSONString(pushMessage);
|
|
|
+
|
|
|
+ // 推送消息
|
|
|
+ PcDevice pcDevice = pcDeviceMapper.selectPcDeviceById(reqParam.getDeviceId());
|
|
|
+ PushMessageUtil.remoteMeetingControl(pcDevice.getWiredMac(), pcDevice.getWirelessMac(), controlUrl, controlParam);
|
|
|
+ log.info("远程控制开始,参数:{}", reqParamJson);
|
|
|
+ String msg = "";
|
|
|
+ if (0 == index) {
|
|
|
+ msg = "远程控制开始";
|
|
|
+ } else {
|
|
|
msg = "切换成功";
|
|
|
}
|
|
|
return AjaxResult.success(msg);
|