Commit aa87faa5946acc8fd2134673482d08bee2612bfa

Authored by xp.Huang
2 parents c9d83aa2 1effd083

Merge branch 'master_dev' into 'master'

Master dev

See merge request yunteng/thingskit!366
@@ -275,21 +275,8 @@ public class TKXmlUtil { @@ -275,21 +275,8 @@ public class TKXmlUtil {
275 deviceChannel.setStatus(StatusEnum.ONLINE); 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 int code = Integer.parseInt(channelId.substring(10, 13)); 281 int code = Integer.parseInt(channelId.substring(10, 13));
295 deviceChannel.setHasAudio(code == 136 || code == 137 || code == 138); 282 deviceChannel.setHasAudio(code == 136 || code == 137 || code == 138);
@@ -595,6 +582,15 @@ public class TKXmlUtil { @@ -595,6 +582,15 @@ public class TKXmlUtil {
595 deviceChannel.setTenantId(tenantId); 582 deviceChannel.setTenantId(tenantId);
596 break; 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 return deviceChannel; 596 return deviceChannel;