| | |
| | | return null;
|
| | | }
|
| | | deviceChannel.setChannelId(channelId);
|
| | | int channelTypeCode = Integer.parseInt(channelId.substring(10, 13));
|
| | | if (channelTypeCode == 136 || channelTypeCode == 137 || channelTypeCode == 138) {
|
| | | deviceChannel.setHasAudio(true);
|
| | | }else {
|
| | | deviceChannel.setHasAudio(false);
|
| | | }
|
| | | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) {
|
| | | // 除了ADD和update情况下需要识别全部内容,
|
| | | return deviceChannel;
|
| | |
| | | ChannelType channelType = ChannelType.Other;
|
| | | if (channelId.length() <= 8) {
|
| | | channelType = ChannelType.CivilCode;
|
| | | deviceChannel.setHasAudio(false);
|
| | | }else {
|
| | | if (channelId.length() == 20) {
|
| | | int code = Integer.parseInt(channelId.substring(10, 13));
|
| | | switch (code){
|
| | | case 215:
|
| | | channelType = ChannelType.BusinessGroup;
|
| | | deviceChannel.setHasAudio(false);
|
| | | break;
|
| | | case 216:
|
| | | channelType = ChannelType.VirtualOrganization;
|
| | | deviceChannel.setHasAudio(false);
|
| | | break;
|
| | | case 136:
|
| | | case 137:
|
| | | case 138:
|
| | | deviceChannel.setHasAudio(true);
|
| | | break;
|
| | | default:
|
| | | deviceChannel.setHasAudio(false);
|
| | | break;
|
| | |
|
| | | }
|
| | |
| | | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| | | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| | | "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + |
| | | "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " + |
| | | "longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " + |
| | | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| | | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| | | "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " + |
| | | "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')") |
| | | "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84}, ${hasAudio}, '${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')") |
| | | int add(DeviceChannel channel); |
| | | |
| | | @Update(value = {" <script>" + |
| | |
| | | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| | | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| | | } |
| | | |
| | | channels.add(deviceChannel); |
| | | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| | | if (subContMap.get(deviceChannel.getParentId()) == null) { |