Commit aa87faa5946acc8fd2134673482d08bee2612bfa
Merge branch 'master_dev' into 'master'
Master dev See merge request yunteng/thingskit!366
Showing
1 changed file
with
11 additions
and
15 deletions
... | ... | @@ -275,21 +275,8 @@ public class TKXmlUtil { |
275 | 275 | deviceChannel.setStatus(StatusEnum.ONLINE); |
276 | 276 | } |
277 | 277 | |
278 | - if (channelId.length() <= 8) { | |
279 | - deviceChannel.setHasAudio(false); | |
280 | - String parentCode = getParentCivilCode(channelId); | |
281 | - if (StringUtils.isNotBlank(parentCode)) { | |
282 | -// deviceChannel.parentId(parentCode); | |
283 | - deviceChannel.setCivilCode(parentCode); | |
284 | - } else { | |
285 | - log.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId); | |
286 | - } | |
287 | - return deviceChannel; | |
288 | - } else { | |
289 | - if (channelId.length() != 20) { | |
290 | - log.warn("[xml解析] 失败,编号不符合国标28181定义: {}", channelId); | |
291 | - return null; | |
292 | - } | |
278 | + if (channelId.length() == 20) { | |
279 | + | |
293 | 280 | |
294 | 281 | int code = Integer.parseInt(channelId.substring(10, 13)); |
295 | 282 | deviceChannel.setHasAudio(code == 136 || code == 137 || code == 138); |
... | ... | @@ -595,6 +582,15 @@ public class TKXmlUtil { |
595 | 582 | deviceChannel.setTenantId(tenantId); |
596 | 583 | break; |
597 | 584 | } |
585 | + } else { | |
586 | + deviceChannel.setHasAudio(false); | |
587 | + String parentCode = getParentCivilCode(channelId); | |
588 | + if (StringUtils.isNotBlank(parentCode)) { | |
589 | +// deviceChannel.parentId(parentCode); | |
590 | + deviceChannel.setCivilCode(parentCode); | |
591 | + } else { | |
592 | + log.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId); | |
593 | + } | |
598 | 594 | } |
599 | 595 | |
600 | 596 | return deviceChannel; | ... | ... |