提交 3d443f82 authored 作者: yangli's avatar yangli

.

上级 a3ada020
......@@ -49,6 +49,9 @@ public class ProgramController {
@Value(value = "${apq.url.upgrade}")
private String upgradeUrl;
@Value(value = "${apq.url.add-program}")
private String addProgramUrl;
private static List<Map<String, String>> programList;
@GetMapping(value = "{type}/list")
......@@ -157,4 +160,14 @@ public class ProgramController {
}
return info;
}
@Scheduled(fixedDelay = 60000)
protected void addProgram2Platform() throws IOException {
if (programList == null) loadProgramListJob();
List<String> programNames = programList.stream().map(p -> p.get("name")).collect(Collectors.toList());
String sn = SysConfigUtil.getProperty("device.sn");
HttpUtil.post(gateway + addProgramUrl,
JSONUtil.createObj().set("snNo", sn).set("programList", programNames).toString());
}
}
......@@ -3,3 +3,4 @@ apq:
url:
install: /ops/install/getList?pageNum={}&pageSize={}
upgrade: /ops/upgrade/getList?pageNum={}&pageSize={}
add-program: /ops/program/addFacProgram
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论