|
|
|
@ -181,6 +181,7 @@ public class BasedataEqpBookServiceImpl implements IBasedataEqpBookService { |
|
|
|
channelTreeVo.setAddress(channel.getAddress()); |
|
|
|
channelTreeVo.setHost(channel.getHost()); |
|
|
|
channelTreeVo.setPort(channel.getPort()); |
|
|
|
channelTreeVo.setUseMode(channel.getUseMode()); |
|
|
|
areaEquVos.add(channelTreeVo); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -255,25 +256,33 @@ public class BasedataEqpBookServiceImpl implements IBasedataEqpBookService { |
|
|
|
} |
|
|
|
|
|
|
|
List<BasedataEqpBook> eqpBooks = this.basedataEqpbookMapper.selectBasedataEqpBookOnlineList(queryFilterVo); |
|
|
|
if (!eqpBooks.isEmpty()) { |
|
|
|
// 只返回有子节点(通道/摄像头)的数据:没有通道的设备不展示,其所在区域分支也随之为空 |
|
|
|
List<BasedataEqpBook> eqpBooksWithChannel = new ArrayList<>(); |
|
|
|
Map<Long, List<BasedataEqpBookChannel>> channelListMap = new LinkedHashMap<>(); |
|
|
|
for (BasedataEqpBook eqpbook : eqpBooks) { |
|
|
|
BasedataEqpBookChannel eqpBookChannel = new BasedataEqpBookChannel(); |
|
|
|
eqpBookChannel.setEqpBookId(eqpbook.getEqpBookId()); |
|
|
|
List<BasedataEqpBookChannel> channelList = this.basedataEqpbookChannelMapper.selectBasedataEqpBookChannelList(eqpBookChannel); |
|
|
|
if (null != channelList && !channelList.isEmpty()) { |
|
|
|
eqpBooksWithChannel.add(eqpbook); |
|
|
|
channelListMap.put(eqpbook.getEqpBookId(), channelList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!eqpBooksWithChannel.isEmpty()) { |
|
|
|
HashMap<Long, Long> allAreaIdHashMap = new HashMap<>(); |
|
|
|
LinkedHashMap<Long, Long> hashMap = new LinkedHashMap<>(); |
|
|
|
Iterator<BasedataEqpBook> iterator = eqpBooks.iterator(); |
|
|
|
|
|
|
|
BasedataEqpBook eqpbook; |
|
|
|
Long eqpbookId; |
|
|
|
while (iterator.hasNext()) { |
|
|
|
eqpbook = iterator.next(); |
|
|
|
eqpbookId = eqpbook.getAreaId(); |
|
|
|
hashMap.put(eqpbookId, eqpbookId); |
|
|
|
|
|
|
|
for (BasedataEqpBook eqpbook : eqpBooksWithChannel) { |
|
|
|
Long areaId = eqpbook.getAreaId(); |
|
|
|
hashMap.put(areaId, areaId); |
|
|
|
} |
|
|
|
|
|
|
|
if (!hashMap.isEmpty()) { |
|
|
|
List<Long> areaList = new LinkedList<>(); |
|
|
|
|
|
|
|
for (Long aLong : hashMap.keySet()) { |
|
|
|
eqpbookId = aLong; |
|
|
|
this.recursionFnHandAreaForAreaList(areaList, allAreaIdHashMap, eqpbookId); |
|
|
|
this.recursionFnHandAreaForAreaList(areaList, allAreaIdHashMap, aLong); |
|
|
|
} |
|
|
|
|
|
|
|
if (!areaList.isEmpty()) { |
|
|
|
@ -281,46 +290,29 @@ public class BasedataEqpBookServiceImpl implements IBasedataEqpBookService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
iterator = eqpBooks.iterator(); |
|
|
|
|
|
|
|
label87: |
|
|
|
while (true) { |
|
|
|
BasedataAreaEquTreeVo areaEquBookTreeVo; |
|
|
|
List channelList; |
|
|
|
do { |
|
|
|
if (!iterator.hasNext()) { |
|
|
|
break label87; |
|
|
|
} |
|
|
|
|
|
|
|
eqpbook = iterator.next(); |
|
|
|
eqpbookId = eqpbook.getEqpBookId(); |
|
|
|
areaEquBookTreeVo = new BasedataAreaEquTreeVo(); |
|
|
|
areaEquBookTreeVo.setEqpBookId(eqpbookId); |
|
|
|
areaEquBookTreeVo.setLabel(eqpbook.getPatrolDeviceName()); |
|
|
|
areaEquBookTreeVo.setId(eqpbook.getAreaId() + "-" + eqpbookId); |
|
|
|
areaEquBookTreeVo.setParentId(String.valueOf(eqpbook.getAreaId())); |
|
|
|
areaEquBookTreeVo.setAreaId(eqpbook.getAreaId()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceCode(eqpbook.getPatrolDeviceCode()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceName(eqpbook.getPatrolDeviceName()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceType(eqpbook.getType()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceFlag("Yes"); |
|
|
|
areaEquBookTreeVo.setType(eqpbook.getType()); |
|
|
|
if (onlineStatusMap.containsKey(eqpbookId)) { |
|
|
|
areaEquBookTreeVo.setPatrolDeviceOnlineStatus((String) onlineStatusMap.get(eqpbookId)); |
|
|
|
} else { |
|
|
|
areaEquBookTreeVo.setPatrolDeviceOnlineStatus("0"); |
|
|
|
} |
|
|
|
for (BasedataEqpBook eqpbook : eqpBooksWithChannel) { |
|
|
|
Long eqpbookId = eqpbook.getEqpBookId(); |
|
|
|
BasedataAreaEquTreeVo areaEquBookTreeVo = new BasedataAreaEquTreeVo(); |
|
|
|
areaEquBookTreeVo.setEqpBookId(eqpbookId); |
|
|
|
areaEquBookTreeVo.setLabel(eqpbook.getPatrolDeviceName()); |
|
|
|
areaEquBookTreeVo.setId(eqpbook.getAreaId() + "-" + eqpbookId); |
|
|
|
areaEquBookTreeVo.setParentId(String.valueOf(eqpbook.getAreaId())); |
|
|
|
areaEquBookTreeVo.setAreaId(eqpbook.getAreaId()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceCode(eqpbook.getPatrolDeviceCode()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceName(eqpbook.getPatrolDeviceName()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceType(eqpbook.getType()); |
|
|
|
areaEquBookTreeVo.setPatrolDeviceFlag("Yes"); |
|
|
|
areaEquBookTreeVo.setType(eqpbook.getType()); |
|
|
|
if (onlineStatusMap.containsKey(eqpbookId)) { |
|
|
|
areaEquBookTreeVo.setPatrolDeviceOnlineStatus((String) onlineStatusMap.get(eqpbookId)); |
|
|
|
} else { |
|
|
|
areaEquBookTreeVo.setPatrolDeviceOnlineStatus("0"); |
|
|
|
} |
|
|
|
|
|
|
|
areaEquVos.add(areaEquBookTreeVo); |
|
|
|
BasedataEqpBookChannel eqpBookChannel = new BasedataEqpBookChannel(); |
|
|
|
eqpBookChannel.setEqpBookId(eqpbookId); |
|
|
|
channelList = this.basedataEqpbookChannelMapper.selectBasedataEqpBookChannelList(eqpBookChannel); |
|
|
|
} while (channelList.isEmpty()); |
|
|
|
areaEquVos.add(areaEquBookTreeVo); |
|
|
|
|
|
|
|
BasedataAreaEquTreeVo channelTreeVo; |
|
|
|
for (Iterator iterator1 = channelList.iterator(); iterator1.hasNext(); areaEquVos.add(channelTreeVo)) { |
|
|
|
BasedataEqpBookChannel channel = (BasedataEqpBookChannel) iterator1.next(); |
|
|
|
channelTreeVo = new BasedataAreaEquTreeVo(); |
|
|
|
for (BasedataEqpBookChannel channel : channelListMap.get(eqpbookId)) { |
|
|
|
BasedataAreaEquTreeVo channelTreeVo = new BasedataAreaEquTreeVo(); |
|
|
|
channelTreeVo.setId(areaEquBookTreeVo.getId() + "-" + channel.getChannelId()); |
|
|
|
channelTreeVo.setPatrolDeviceCode(areaEquBookTreeVo.getPatrolDeviceCode()); |
|
|
|
channelTreeVo.setPatrolDeviceName(areaEquBookTreeVo.getPatrolDeviceName()); |
|
|
|
@ -336,6 +328,7 @@ public class BasedataEqpBookServiceImpl implements IBasedataEqpBookService { |
|
|
|
channelTreeVo.setHost(channel.getHost()); |
|
|
|
channelTreeVo.setPort(channel.getPort()); |
|
|
|
channelTreeVo.setChannelType(channel.getChannelType()); |
|
|
|
channelTreeVo.setUseMode(channel.getUseMode()); |
|
|
|
// 功能能力:解析不出来按未知处理(前端按可用),避免误置灰。 |
|
|
|
channelTreeVo.setCapabilities(parseCapabilities(channel.getCapabilities())); |
|
|
|
boolean hasKey = this.redisService.hasKey("mont_patrol_device_channel_online_status:" + channel.getChannelCode()).booleanValue(); |
|
|
|
@ -344,6 +337,8 @@ public class BasedataEqpBookServiceImpl implements IBasedataEqpBookService { |
|
|
|
} else { |
|
|
|
channelTreeVo.setPatrolDeviceOnlineStatus("0"); |
|
|
|
} |
|
|
|
|
|
|
|
areaEquVos.add(channelTreeVo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|