Compare commits

..

1 Commits

Author SHA1 Message Date
樊冲
4b89db9f53
Pre Merge pull request !42 from 樊冲/fix-bug-fanchong 2026-05-07 02:10:07 +00:00
10 changed files with 48 additions and 33 deletions

View File

@ -23,6 +23,7 @@ import java.nio.file.Files;
*/
@Slf4j
@Configuration
@Order(value=15)
public class CivilCodeFileConf implements CommandLineRunner {
@Autowired

View File

@ -8,9 +8,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.ISIPProcessorObserver;
import com.genersoft.iot.vmp.utils.EnvUtil;
import gov.nist.javax.sip.SipProviderImpl;
import gov.nist.javax.sip.SipStackImpl;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
@ -23,7 +24,8 @@ import java.util.concurrent.ConcurrentHashMap;
@Slf4j
@Component
public class SipLayer{
@Order(value=10)
public class SipLayer implements CommandLineRunner {
@Autowired
private SipConfig sipConfig;
@ -38,8 +40,8 @@ public class SipLayer{
private final Map<String, SipProviderImpl> udpSipProviderMap = new ConcurrentHashMap<>();
private final List<String> monitorIps = new ArrayList<>();
@PostConstruct
public void onApplicationReady(){
@Override
public void run(String... args) {
if (ObjectUtils.isEmpty(sipConfig.getIp())) {
try {
// 获得本机的所有网络接口

View File

@ -43,8 +43,9 @@ import gov.nist.javax.sip.message.SIPResponse;
import jakarta.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@ -64,7 +65,8 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Service
public class DeviceServiceImpl implements IDeviceService {
@Order(value=16)
public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
@Autowired
private ISIPCommander sipCommander;
@ -127,8 +129,8 @@ public class DeviceServiceImpl implements IDeviceService {
return deviceMapper.getDeviceByDeviceId(deviceId);
}
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
@Override
public void run(String... args) throws Exception {
// 清理数据库不存在但是 redis 中存在的数据
List<Device> devicesInDb = getAll();

View File

@ -34,8 +34,7 @@ import org.locationtech.jts.geom.Point;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -50,7 +49,7 @@ import java.util.concurrent.atomic.AtomicReference;
@Slf4j
@Service
public class GbChannelServiceImpl implements IGbChannelService {
public class GbChannelServiceImpl implements IGbChannelService, CommandLineRunner {
@Autowired
private EventPublisher eventPublisher;
@ -82,8 +81,8 @@ public class GbChannelServiceImpl implements IGbChannelService {
private final GeometryFactory geometryFactory = new GeometryFactory();
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady() {
@Override
public void run(String... args) throws Exception {
// 启动时重新发布抽稀图层
List<CommonGBChannel> channelList = commonGBChannelMapper.queryAllWithPosition();
Map<Integer, List<CommonGBChannel>> zoomCameraMap = new ConcurrentHashMap<>();

View File

@ -39,8 +39,9 @@ import com.github.pagehelper.PageInfo;
import gov.nist.javax.sip.message.SIPResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@ -61,7 +62,8 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Service
public class PlatformServiceImpl implements IPlatformService {
@Order(value=15)
public class PlatformServiceImpl implements IPlatformService, CommandLineRunner {
@Autowired
private PlatformMapper platformMapper;
@ -114,8 +116,8 @@ public class PlatformServiceImpl implements IPlatformService {
@Autowired
private PlatformStatusTaskRunner statusTaskRunner;
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
@Override
public void run(String... args) throws Exception {
// 查找国标推流
List<SendRtpInfo> sendRtpItems = redisCatchStorage.queryAllSendRTPServer();

View File

@ -6,8 +6,7 @@ import com.genersoft.iot.vmp.gb28181.service.IGroupService;
import com.genersoft.iot.vmp.gb28181.service.IRegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -22,7 +21,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Component
public class CatalogDataManager{
public class CatalogDataManager implements CommandLineRunner {
@Autowired
private IDeviceChannelService deviceChannelService;
@ -210,8 +209,8 @@ public class CatalogDataManager{
return false;
}
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
@Override
public void run(String... args) throws Exception {
// 启动时清理旧的数据
redisTemplate.delete(key);
}

View File

@ -18,7 +18,13 @@ import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.timeout.IdleStateHandler;
import io.netty.util.concurrent.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.TimeUnit;

View File

@ -30,12 +30,12 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.PostConstruct;
import jakarta.servlet.ServletOutputStream;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
@ -89,9 +89,9 @@ public class jt1078ServiceImpl implements Ijt1078Service {
@Autowired
private FtpDownloadManager downloadManager;
// 服务启动后五分钟内没有连接的设备设置为离线
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 服务启动后五分钟内没有尽量连接的设备设置为离线
@PostConstruct
public void init(){
// 检查session与在线终端是是否对应 不对应则设置终端离线
List<JTDevice> deviceList = jtDeviceMapper.getDeviceList(null, true);
if (deviceList.isEmpty()) {

View File

@ -7,9 +7,9 @@ import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.List;
@ -19,7 +19,8 @@ import java.util.List;
*/
@Slf4j
@Component
public class MediaServerConfig{
@Order(value=12)
public class MediaServerConfig implements CommandLineRunner {
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
@ -34,8 +35,8 @@ public class MediaServerConfig{
private UserSetting userSetting;
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
@Override
public void run(String... strings) throws Exception {
// 清理所有在线节点的缓存信息
mediaServerService.clearMediaServerForOnline();
MediaServer mediaSerItemInConfig = mediaConfig.buildMediaSer();

View File

@ -255,8 +255,11 @@ export default {
},
stopPlay: function(row) {
this.$store.dispatch('streamProxy/stopPlay', row.id)
.then(() => {
this.getStreamProxyList()
.then((data) => {
this.$refs.devicePlayer.openDialog('streamPlay', null, null, {
streamInfo: data,
hasAudio: true
})
})
.catch((error) => {
this.$message({