fix: i2导出拆分替换sensorId局部编码

main
huangfeng 6 months ago
parent 3f1d8eab84
commit e596b56222

@ -96,8 +96,22 @@ public class I2DataTransformer {
node.setEquipmentid(sensor.getEquipmentId()); node.setEquipmentid(sensor.getEquipmentId());
} else { } else {
attr.setValue(""); attr.setValue("");
node.setSensorid(sensor.getSensorCode() + attach); String code = sensor.getSensorCode();
node.setEquipmentid(sensor.getEquipmentId() + attach); node.setSensorid(code);
if (code != null && code.length() > attach.length() + 2) {
int len = code.length() - 2;
String tail = code.substring(len);
String first = code.substring(0, len - attach.length());
node.setSensorid(first + attach + tail);
}
String equipmentid = sensor.getEquipmentId();
node.setEquipmentid(equipmentid);
if (equipmentid != null && equipmentid.length() > attach.length() + 2) {
int len = equipmentid.length() - 2;
String tail = equipmentid.substring(len);
String first = equipmentid.substring(0, len - attach.length());
node.setEquipmentid(first + attach + tail);
}
} }
return node; return node;
} }

Loading…
Cancel
Save