|
@@ -310,24 +310,29 @@ public class IotDeviceServiceImpl implements IotDeviceService {
|
|
|
List<String> identifiers = rows.stream().map(ThingsModelDTO::getIdentifier).collect(Collectors.toList());
|
|
List<String> identifiers = rows.stream().map(ThingsModelDTO::getIdentifier).collect(Collectors.toList());
|
|
|
//有数采
|
|
//有数采
|
|
|
List<String> carCodes = zhbdmapper.carList().stream().map(DeviceZHBDDO::getDeviceCode).collect(Collectors.toList());
|
|
List<String> carCodes = zhbdmapper.carList().stream().map(DeviceZHBDDO::getDeviceCode).collect(Collectors.toList());
|
|
|
- if (!identifiers.contains(zhbds.get(2))||!identifiers.contains(zhbds.get(4))&&carCodes.contains(iotDeviceDO.getDeviceCode())) {
|
|
|
|
|
|
|
+ if (carCodes.contains(iotDeviceDO.getDeviceCode())) {
|
|
|
for (String s : split1) {
|
|
for (String s : split1) {
|
|
|
String[] split = s.split("~~");
|
|
String[] split = s.split("~~");
|
|
|
- Object o = redisTemplate.opsForHash().get("TSLV:" + iotDeviceDO.getDeviceCode(), split[0]);
|
|
|
|
|
- if (Objects.nonNull(o)) {
|
|
|
|
|
- JSONObject jsonObject = JSON.parseObject(o.toString());
|
|
|
|
|
- ThingsModelDTO modelDTO = new ThingsModelDTO();
|
|
|
|
|
- modelDTO.setIdentifier(split[0]);
|
|
|
|
|
- modelDTO.setModelName(split[1]);
|
|
|
|
|
- if ("online".equals(split[0])){
|
|
|
|
|
- String value = String.valueOf(jsonObject.get("value"));
|
|
|
|
|
- modelDTO.setValue("true".equals(value)?"是":"否");
|
|
|
|
|
- } else {
|
|
|
|
|
- String value = String.valueOf(jsonObject.get("value"));
|
|
|
|
|
- modelDTO.setValue(value);
|
|
|
|
|
- }
|
|
|
|
|
- rows.add(modelDTO);
|
|
|
|
|
|
|
+// if (!identifiers.contains(zhbds.get(2))||!identifiers.contains(zhbds.get(4))){
|
|
|
|
|
+ if (split[0].equals(zhbds.get(2))) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ Object o = redisTemplate.opsForHash().get("TSLV:" + iotDeviceDO.getDeviceCode(), split[0]);
|
|
|
|
|
+ if (Objects.nonNull(o)) {
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(o.toString());
|
|
|
|
|
+ ThingsModelDTO modelDTO = new ThingsModelDTO();
|
|
|
|
|
+ modelDTO.setIdentifier(split[0]);
|
|
|
|
|
+ modelDTO.setModelName(split[1]);
|
|
|
|
|
+ if ("online".equals(split[0])){
|
|
|
|
|
+ String value = String.valueOf(jsonObject.get("value"));
|
|
|
|
|
+ modelDTO.setValue("true".equals(value)?"是":"否");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String value = String.valueOf(jsonObject.get("value"));
|
|
|
|
|
+ modelDTO.setValue(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ rows.add(modelDTO);
|
|
|
|
|
+ }
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
rows.forEach(e ->{
|
|
rows.forEach(e ->{
|