提交 36d2c045 authored 作者: yangli's avatar yangli

.

上级 647b1cab
...@@ -682,7 +682,7 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -682,7 +682,7 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
return null; return null;
} }
deviceInfo = StrUtil.format(deviceInfo, "5a:a0:23:67:0e:a2"); deviceInfo = StrUtil.format(deviceInfo, mac);
String remoteDeviceVoJson = HttpUtil.get(gateway + deviceInfo); String remoteDeviceVoJson = HttpUtil.get(gateway + deviceInfo);
RemoteDeviceVoResult remoteDeviceVo = JSONUtil.toBean(remoteDeviceVoJson, RemoteDeviceVoResult.class); RemoteDeviceVoResult remoteDeviceVo = JSONUtil.toBean(remoteDeviceVoJson, RemoteDeviceVoResult.class);
MqttClientSecurityConfiguration mqttClientSecurityConfiguration = new MqttClientSecurityConfiguration(); MqttClientSecurityConfiguration mqttClientSecurityConfiguration = new MqttClientSecurityConfiguration();
......
...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.PostConstruct;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
...@@ -81,4 +82,11 @@ public class ConfigController { ...@@ -81,4 +82,11 @@ public class ConfigController {
} }
return R.success(); return R.success();
} }
@PostConstruct
public void init() throws IOException {
// 初始化自动保存一次数据上报设置
saveDataReporting(getDataReporting().getData());
}
} }
...@@ -86,7 +86,7 @@ public class ProgramController { ...@@ -86,7 +86,7 @@ public class ProgramController {
.build()) .build())
.peek(m -> programs.stream() .peek(m -> programs.stream()
.collect(Collectors.toMap(p -> StrUtil.similar(p.get("name").toLowerCase(), m.get("name").toLowerCase()), .collect(Collectors.toMap(p -> StrUtil.similar(p.get("name").toLowerCase(), m.get("name").toLowerCase()),
p -> StrUtil.nullToEmpty(p.get("version")), (l, r) -> r)) p -> p.getOrDefault("version", ""), (l, r) -> r))
.entrySet() .entrySet()
.stream() .stream()
.max(Map.Entry.comparingByKey()) .max(Map.Entry.comparingByKey())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论