[1078] 临时提交
This commit is contained in:
@@ -423,7 +423,7 @@ public class JT1078Controller {
|
||||
public JTDeviceConfig config(String phoneNumber, String[] params){
|
||||
|
||||
log.info("[JT-查询终端参数] phoneNumber:{}", phoneNumber);
|
||||
return service.queryConfig(phoneNumber, params, null);
|
||||
return service.queryConfig(phoneNumber, params);
|
||||
}
|
||||
|
||||
@Operation(summary = "JT-设置终端参数", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.genersoft.iot.vmp.jt1078.event;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.JTDevice;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
@@ -18,14 +20,7 @@ public class RegisterEvent extends ApplicationEvent {
|
||||
super(source);
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private JTDevice device;
|
||||
|
||||
public JTDevice getDevice() {
|
||||
return device;
|
||||
}
|
||||
|
||||
public void setDevice(JTDevice device) {
|
||||
this.device = device;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.genersoft.iot.vmp.jt1078.event.eventListener;
|
||||
|
||||
import com.genersoft.iot.vmp.jt1078.event.RegisterEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class RegisterEventListener implements ApplicationListener<RegisterEvent> {
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(RegisterEvent event) {
|
||||
System.out.println("收到设备注册: "+ event.getDevice().getTerminalId());
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public interface Ijt1078Service {
|
||||
|
||||
void wiper(String phoneNumber, Integer channelId, String command);
|
||||
|
||||
JTDeviceConfig queryConfig(String phoneNumber, String[] params, CommonCallback<WVPResult<StreamInfo>> callback);
|
||||
JTDeviceConfig queryConfig(String phoneNumber, String[] params);
|
||||
|
||||
void setConfig(String phoneNumber, JTDeviceConfig config);
|
||||
|
||||
|
||||
@@ -11,9 +11,13 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.*;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.common.ConfigAttribute;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.config.JTAloneChanel;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.config.JTChannelListParam;
|
||||
import com.genersoft.iot.vmp.jt1078.bean.config.JTChannelParam;
|
||||
import com.genersoft.iot.vmp.jt1078.cmd.JT1078Template;
|
||||
import com.genersoft.iot.vmp.jt1078.dao.JTChannelMapper;
|
||||
import com.genersoft.iot.vmp.jt1078.dao.JTTerminalMapper;
|
||||
import com.genersoft.iot.vmp.jt1078.event.RegisterEvent;
|
||||
import com.genersoft.iot.vmp.jt1078.proc.response.*;
|
||||
import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service;
|
||||
import com.genersoft.iot.vmp.jt1078.session.FtpDownloadManager;
|
||||
@@ -94,6 +98,30 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备注册的通知
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
@EventListener
|
||||
public void onApplicationEvent(RegisterEvent event) {
|
||||
// 首次注册设备根据终端参数获取
|
||||
JTDevice device = event.getDevice();
|
||||
List<JTChannel> channelList = jtChannelMapper.selectAllByDevicePhoneNumber(device.getPhoneNumber());
|
||||
if (!channelList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
JTDeviceConfig jtDeviceConfig = queryConfig(device.getPhoneNumber(), null);
|
||||
JTChannelParam channelParam = jtDeviceConfig.getChannelParam();
|
||||
if (channelParam != null && channelParam.getJtAloneChanelList() != null && !channelParam.getJtAloneChanelList().isEmpty()) {
|
||||
// 写入通道
|
||||
List<JTAloneChanel> jtAloneChanelList = channelParam.getJtAloneChanelList();
|
||||
for (JTAloneChanel jtAloneChanel : jtAloneChanelList) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验流是否是属于部标的
|
||||
@@ -201,7 +229,6 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
||||
@Override
|
||||
public void ptzControl(String phoneNumber, Integer channelId, String command, int speed) {
|
||||
// 发送停止命令
|
||||
|
||||
switch (command) {
|
||||
case "left":
|
||||
case "right":
|
||||
@@ -297,7 +324,7 @@ public class jt1078ServiceImpl implements Ijt1078Service {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JTDeviceConfig queryConfig(String phoneNumber, String[] params, CommonCallback<WVPResult<StreamInfo>> callback) {
|
||||
public JTDeviceConfig queryConfig(String phoneNumber, String[] params) {
|
||||
if (phoneNumber == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user