Compare commits

...

3 Commits

Author SHA1 Message Date
阿斌
df6c37bb01
Pre Merge pull request !36 from 阿斌/N/A 2026-05-08 01:56:51 +00:00
lin
6c4734ff29 重构启动逻辑,移除CommandLineRunner接口,改为使用ApplicationReadyEvent事件监听器 2026-05-08 09:56:35 +08:00
阿斌
da98101aac
update src/main/resources/civilCode.csv.
行政规划错误。江苏南通海门市,修改为海门区,浙江杭州删除下城区、江干区,新增钱塘区,临平区

Signed-off-by: 阿斌 <38912748@qq.com>
2024-12-15 08:58:42 +00:00
11 changed files with 36 additions and 51 deletions

View File

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

View File

@ -8,10 +8,9 @@ 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;
@ -24,8 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
@Slf4j
@Component
@Order(value=10)
public class SipLayer implements CommandLineRunner {
public class SipLayer{
@Autowired
private SipConfig sipConfig;
@ -40,8 +38,8 @@ public class SipLayer implements CommandLineRunner {
private final Map<String, SipProviderImpl> udpSipProviderMap = new ConcurrentHashMap<>();
private final List<String> monitorIps = new ArrayList<>();
@Override
public void run(String... args) {
@PostConstruct
public void onApplicationReady(){
if (ObjectUtils.isEmpty(sipConfig.getIp())) {
try {
// 获得本机的所有网络接口

View File

@ -43,9 +43,8 @@ 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.CommandLineRunner;
import org.springframework.boot.context.event.ApplicationReadyEvent;
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;
@ -65,8 +64,7 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Service
@Order(value=16)
public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
public class DeviceServiceImpl implements IDeviceService {
@Autowired
private ISIPCommander sipCommander;
@ -129,8 +127,8 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
return deviceMapper.getDeviceByDeviceId(deviceId);
}
@Override
public void run(String... args) throws Exception {
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 清理数据库不存在但是 redis 中存在的数据
List<Device> devicesInDb = getAll();

View File

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

View File

@ -39,9 +39,8 @@ 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.CommandLineRunner;
import org.springframework.boot.context.event.ApplicationReadyEvent;
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;
@ -62,8 +61,7 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Service
@Order(value=15)
public class PlatformServiceImpl implements IPlatformService, CommandLineRunner {
public class PlatformServiceImpl implements IPlatformService {
@Autowired
private PlatformMapper platformMapper;
@ -116,8 +114,8 @@ public class PlatformServiceImpl implements IPlatformService, CommandLineRunner
@Autowired
private PlatformStatusTaskRunner statusTaskRunner;
@Override
public void run(String... args) throws Exception {
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 查找国标推流
List<SendRtpInfo> sendRtpItems = redisCatchStorage.queryAllSendRTPServer();

View File

@ -6,7 +6,8 @@ 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.CommandLineRunner;
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.Scheduled;
import org.springframework.stereotype.Component;
@ -21,7 +22,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Component
public class CatalogDataManager implements CommandLineRunner {
public class CatalogDataManager{
@Autowired
private IDeviceChannelService deviceChannelService;
@ -209,8 +210,8 @@ public class CatalogDataManager implements CommandLineRunner {
return false;
}
@Override
public void run(String... args) throws Exception {
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 启动时清理旧的数据
redisTemplate.delete(key);
}

View File

@ -18,13 +18,7 @@ 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;
// 服务启动后五分钟内没有尽量连接的设备设置为离线
@PostConstruct
public void init(){
// 服务启动后五分钟内没有连接的设备设置为离线
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 检查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.CommandLineRunner;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.annotation.Order;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import java.util.List;
@ -19,8 +19,7 @@ import java.util.List;
*/
@Slf4j
@Component
@Order(value=12)
public class MediaServerConfig implements CommandLineRunner {
public class MediaServerConfig{
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
@ -35,8 +34,8 @@ public class MediaServerConfig implements CommandLineRunner {
private UserSetting userSetting;
@Override
public void run(String... strings) throws Exception {
@EventListener(ApplicationReadyEvent.class)
public void onApplicationReady(){
// 清理所有在线节点的缓存信息
mediaServerService.clearMediaServerForOnline();
MediaServer mediaSerItemInConfig = mediaConfig.buildMediaSer();

View File

@ -861,7 +861,7 @@
320623,如东县,3206
320681,启东市,3206
320682,如皋市,3206
320684,海门,3206
320684,海门,3206
320685,海安市,3206
3207,连云港市,32
320703,连云区,3207
@ -918,8 +918,6 @@
33,浙江省,
3301,杭州市,33
330102,上城区,3301
330103,下城区,3301
330104,江干区,3301
330105,拱墅区,3301
330106,西湖区,3301
330108,滨江区,3301
@ -927,6 +925,8 @@
330110,余杭区,3301
330111,富阳区,3301
330112,临安区,3301
330113,临平区,3301
330114,钱塘区,3301
330122,桐庐县,3301
330127,淳安县,3301
330182,建德市,3301

1 编号 名称 上级
861 320623 如东县 3206
862 320681 启东市 3206
863 320682 如皋市 3206
864 320684 海门市 海门区 3206
865 320685 海安市 3206
866 3207 连云港市 32
867 320703 连云区 3207
918 33 浙江省
919 3301 杭州市 33
920 330102 上城区 3301
330103 下城区 3301
330104 江干区 3301
921 330105 拱墅区 3301
922 330106 西湖区 3301
923 330108 滨江区 3301
925 330110 余杭区 3301
926 330111 富阳区 3301
927 330112 临安区 3301
928 330113 临平区 3301
929 330114 钱塘区 3301
930 330122 桐庐县 3301
931 330127 淳安县 3301
932 330182 建德市 3301

View File

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