Commit 88721511e76adfc13608636ad5567c584164a695

Authored by 648540858
2 parents 674ab18c 9b62fbe4

Merge branch '2.6.9' into wvp-28181-2.0

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPSender.java
@@ -66,17 +66,17 @@ public class SIPSender { @@ -66,17 +66,17 @@ public class SIPSender {
66 // 添加错误订阅 66 // 添加错误订阅
67 if (errorEvent != null) { 67 if (errorEvent != null) {
68 sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (eventResult -> { 68 sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (eventResult -> {
69 - errorEvent.response(eventResult);  
70 sipSubscribe.removeErrorSubscribe(eventResult.callId); 69 sipSubscribe.removeErrorSubscribe(eventResult.callId);
71 sipSubscribe.removeOkSubscribe(eventResult.callId); 70 sipSubscribe.removeOkSubscribe(eventResult.callId);
  71 + errorEvent.response(eventResult);
72 })); 72 }));
73 } 73 }
74 // 添加订阅 74 // 添加订阅
75 if (okEvent != null) { 75 if (okEvent != null) {
76 sipSubscribe.addOkSubscribe(callIdHeader.getCallId(), eventResult -> { 76 sipSubscribe.addOkSubscribe(callIdHeader.getCallId(), eventResult -> {
77 - okEvent.response(eventResult);  
78 sipSubscribe.removeOkSubscribe(eventResult.callId); 77 sipSubscribe.removeOkSubscribe(eventResult.callId);
79 sipSubscribe.removeErrorSubscribe(eventResult.callId); 78 sipSubscribe.removeErrorSubscribe(eventResult.callId);
  79 + okEvent.response(eventResult);
80 }); 80 });
81 } 81 }
82 if ("TCP".equals(transport)) { 82 if ("TCP".equals(transport)) {
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
@@ -680,6 +680,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -680,6 +680,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
680 }else { 680 }else {
681 channels = deviceChannels.subList(index, deviceChannels.size()); 681 channels = deviceChannels.subList(index, deviceChannels.size());
682 } 682 }
  683 + logger.info("[发送NOTIFY通知]类型: {},发送数量: {}", type, channels.size());
683 Integer finalIndex = index; 684 Integer finalIndex = index;
684 String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, channels, type); 685 String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, channels, type);
685 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { 686 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> {
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -277,7 +277,7 @@ public class DeviceServiceImpl implements IDeviceService { @@ -277,7 +277,7 @@ public class DeviceServiceImpl implements IDeviceService {
277 // 设置最小值为30 277 // 设置最小值为30
278 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30); 278 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30);
279 // 刷新订阅 279 // 刷新订阅
280 - dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, (subscribeCycleForCatalog) * 1000); 280 + dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog * 1000);
281 return true; 281 return true;
282 } 282 }
283 283
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
@@ -77,8 +77,6 @@ public class GbStreamServiceImpl implements IGbStreamService { @@ -77,8 +77,6 @@ public class GbStreamServiceImpl implements IGbStreamService {
77 } 77 }
78 try { 78 try {
79 List<DeviceChannel> deviceChannelList = new ArrayList<>(); 79 List<DeviceChannel> deviceChannelList = new ArrayList<>();
80 -  
81 -  
82 for (int i = 0; i < gbStreams.size(); i++) { 80 for (int i = 0; i < gbStreams.size(); i++) {
83 GbStream gbStream = gbStreams.get(i); 81 GbStream gbStream = gbStreams.get(i);
84 gbStream.setCatalogId(catalogId); 82 gbStream.setCatalogId(catalogId);
@@ -250,16 +248,18 @@ public class GbStreamServiceImpl implements IGbStreamService { @@ -250,16 +248,18 @@ public class GbStreamServiceImpl implements IGbStreamService {
250 if (platform == null) { 248 if (platform == null) {
251 return ; 249 return ;
252 } 250 }
253 - if (platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId) > 0) {  
254 - List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId);  
255 - List<DeviceChannel> deviceChannelList = new ArrayList<>();  
256 - for (GbStream gbStream : gbStreams) {  
257 - DeviceChannel deviceChannel = new DeviceChannel();  
258 - deviceChannel.setChannelId(gbStream.getGbId());  
259 - deviceChannelList.add(deviceChannel);  
260 - }  
261 - eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL); 251 + if (ObjectUtils.isEmpty(catalogId)) {
  252 + catalogId = null;
  253 + }
  254 + List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId);
  255 + List<DeviceChannel> deviceChannelList = new ArrayList<>();
  256 + for (GbStream gbStream : gbStreams) {
  257 + DeviceChannel deviceChannel = new DeviceChannel();
  258 + deviceChannel.setChannelId(gbStream.getGbId());
  259 + deviceChannelList.add(deviceChannel);
262 } 260 }
  261 + eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
  262 + platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId);
263 } 263 }
264 264
265 @Override 265 @Override
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
@@ -165,10 +165,9 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { @@ -165,10 +165,9 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
165 catalogId = null; 165 catalogId = null;
166 } 166 }
167 167
168 - if ((result = platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId)) > 0) {  
169 - List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId);  
170 - eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL);  
171 - }  
172 - return result; 168 + List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId);
  169 + eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL);
  170 +
  171 + return platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId);
173 } 172 }
174 } 173 }
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
@@ -58,7 +58,10 @@ public interface PlatformChannelMapper { @@ -58,7 +58,10 @@ public interface PlatformChannelMapper {
58 @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}") 58 @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
59 List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId); 59 List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
60 60
61 - @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}") 61 + @Select("<script> "+
  62 + "SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} " +
  63 + " <if test='catalogId != null' > and pgc.catalog_id=#{catalogId}</if>" +
  64 + "</script>")
62 List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); 65 List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
63 66
64 @Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " + 67 @Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
@@ -53,11 +53,14 @@ public interface PlatformGbStreamMapper { @@ -53,11 +53,14 @@ public interface PlatformGbStreamMapper {
53 "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}") 53 "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
54 StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId); 54 StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
55 55
56 - @Select("select gs.* \n" +  
57 - "from wvp_gb_stream gs\n" + 56 + @Select("<script> " +
  57 + "select gs.* " +
  58 + " from wvp_gb_stream gs\n" +
58 " left join wvp_platform_gb_stream pgs\n" + 59 " left join wvp_platform_gb_stream pgs\n" +
59 " on gs.gb_stream_id = pgs.gb_stream_id\n" + 60 " on gs.gb_stream_id = pgs.gb_stream_id\n" +
60 - "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") 61 + " where pgs.platform_id=#{platformId} " +
  62 + " <if test='catalogId != null' > and pgs.catalog_id=#{catalogId}</if>" +
  63 + "</script>")
61 List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); 64 List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
62 65
63 @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" + 66 @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" +
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
@@ -86,7 +86,7 @@ public class GbStreamController { @@ -86,7 +86,7 @@ public class GbStreamController {
86 @ResponseBody 86 @ResponseBody
87 public void del(@RequestBody GbStreamParam gbStreamParam){ 87 public void del(@RequestBody GbStreamParam gbStreamParam){
88 88
89 - if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().size() == 0) { 89 + if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().isEmpty()) {
90 if (gbStreamParam.isAll()) { 90 if (gbStreamParam.isAll()) {
91 gbStreamService.delAllPlatformInfo(gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId()); 91 gbStreamService.delAllPlatformInfo(gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId());
92 } 92 }
@@ -105,7 +105,7 @@ public class GbStreamController { @@ -105,7 +105,7 @@ public class GbStreamController {
105 @PostMapping(value = "/add") 105 @PostMapping(value = "/add")
106 @ResponseBody 106 @ResponseBody
107 public void add(@RequestBody GbStreamParam gbStreamParam){ 107 public void add(@RequestBody GbStreamParam gbStreamParam){
108 - if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().size() == 0) { 108 + if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().isEmpty()) {
109 if (gbStreamParam.isAll()) { 109 if (gbStreamParam.isAll()) {
110 List<GbStream> allGBChannels = gbStreamService.getAllGBChannels(gbStreamParam.getPlatformId()); 110 List<GbStream> allGBChannels = gbStreamService.getAllGBChannels(gbStreamParam.getPlatformId());
111 gbStreamService.addPlatformInfo(allGBChannels, gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId()); 111 gbStreamService.addPlatformInfo(allGBChannels, gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId());
web_src/src/components/dialog/deviceEdit.vue
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <el-input v-model="form.name" clearable></el-input> 20 <el-input v-model="form.name" clearable></el-input>
21 </el-form-item> 21 </el-form-item>
22 <el-form-item label="密码" prop="password"> 22 <el-form-item label="密码" prop="password">
23 - <el-input type="password" v-model="form.password" clearable></el-input> 23 + <el-input v-model="form.password" clearable></el-input>
24 </el-form-item> 24 </el-form-item>
25 <el-form-item label="收流IP" prop="sdpIp"> 25 <el-form-item label="收流IP" prop="sdpIp">
26 <el-input type="sdpIp" v-model="form.sdpIp" clearable></el-input> 26 <el-input type="sdpIp" v-model="form.sdpIp" clearable></el-input>