优化标签导入
This commit is contained in:
parent
aae6966a60
commit
529e03541b
|
|
@ -60,6 +60,6 @@ public class DeviceTagEntity extends GenericEntity<String> {
|
|||
}
|
||||
|
||||
public static String createTagId(String deviceId,String key){
|
||||
return DigestUtils.md5Hex(deviceId.concat(":").concat(key));
|
||||
return DigestUtils.md5Hex(deviceId + ":" + key);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class DeviceExcelInfo {
|
|||
private long rowNumber;
|
||||
|
||||
|
||||
public void tag(String key, String name, Object value,String type) {
|
||||
public void tag(String key, String name, Object value, String type) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -43,13 +43,15 @@ public class DeviceExcelInfo {
|
|||
entity.setName(name);
|
||||
entity.setDeviceId(id);
|
||||
entity.setType(type);
|
||||
entity.setId(String.valueOf(id).concat(":").concat(key));
|
||||
entity.setId(DeviceTagEntity.createTagId(id,key));
|
||||
tags.add(entity);
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
for (DeviceTagEntity tag : tags) {
|
||||
tag.setId(String.valueOf(id).concat(":").concat(tag.getKey()));
|
||||
tag.setDeviceId(id);
|
||||
tag.setId(DeviceTagEntity.createTagId(tag.getDeviceId(),tag.getKey()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue