Compare commits

...

2 Commits

Author SHA1 Message Date
wangliwen bb8e2e5759 西海岸的处理 2022-06-24 15:01:40 +08:00
wangliwen ce43a9fced 西海岸接口ip调整 2022-06-24 14:04:02 +08:00
2 changed files with 20 additions and 43 deletions

View File

@ -291,11 +291,11 @@ public class CensusControllerV2 {
});
});
CompletableFuture<Void> allKnowledgeVisitsAmount = CompletableFuture.supplyAsync(() -> { // 获取平台知识库浏览量
return jdbcTemplate.queryForObject("SELECT SUM(visits)visits FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
return jdbcTemplate.queryForObject("SELECT SUM(visits) visits FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {
{
put("amount", sum);
put("amount", sum == null ? 0L : sum);
put("type", "知识库总浏览量");
}
});
@ -336,45 +336,22 @@ public class CensusControllerV2 {
case TSINGTAO_XHA: { // 青岛西海岸
allAmount = CompletableFuture.supplyAsync(() -> { // 获取平台总基础设施数目
List<Long> result_ = new CopyOnWriteArrayList<>();
CompletableFuture cloud =
CompletableFuture.runAsync(() -> { // 云脑专网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getCloudcam(), "", 1, 10);
logger.info(url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
if (jsonObject.containsKey("data")) {
result_.add(jsonObject.getJSONObject("data").getLongValue("total"));
}
} else {
logger.error("青岛西海岸获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
}
});
CompletableFuture local =
CompletableFuture.runAsync(() -> { // 金宏网
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getLocalcam(), "", 1, 10);
logger.info(url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
if (jsonObject.containsKey("data")) {
result_.add(jsonObject.getJSONObject("data").getLongValue("total"));
}
} else {
logger.error("青岛西海岸获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
}
});
CompletableFuture.allOf(cloud, local);
OkHttpClient client = new OkHttpClient();
String url = String.format(tsingtao_xhaProperties.getCloudcam(), "", 1, 10);
logger.info(url);
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
JSONObject jsonObject = JSON.parseObject(response.body().string());
if (jsonObject.containsKey("data")) {
result_.add(jsonObject.getJSONObject("data").getLongValue("total"));
}
} else {
logger.error("青岛西海岸获取失败");
}
} catch (Exception exception) {
logger.error("青岛西海岸失败", exception);
}
return result_.stream().filter(index -> index != null).findAny().orElse(0l);
}).thenAccept(sum -> {
result.add(new HashMap<String, Object>() {

View File

@ -2,6 +2,6 @@ tsingtao-xha.cloudhls=http://10.10.30.9:8001/hx-weatherwarning/camera/getCameraL
tsingtao-xha.localhls=http://10.134.135.9:8001/hx-weatherwarning/camera/getCameraLiveStreamByCode?cameraCode=%s&protocol=hls
tsingtao-xha.cloudcam=http://10.10.30.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.localcam=http://10.134.135.9:8001/hx-weather-warning/camera/getCameraListByName?name=%s&pageNo=%d&pageSize=%d
tsingtao-xha.resourcecount=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=&type=&orderField=requestNum&orderType=desc&pageNum=1&pageSize=10&serviceType=data&rq=1655106309671.43
tsingtao-xha.resourcecount=http://10.10.30.24:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=&type=&orderField=requestNum&orderType=desc&pageNum=1&pageSize=10&serviceType=data&rq=1655106309671.43
tsingtao-xha.resourceapplyinfo=http://10.134.135.24:30058/shareportal/platform/index/abilityMarket/count
tsingtao-xha.sjzy=http://10.16.3.224:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=%s&type=&orderField=%s&orderType=%s&pageNum=%s&pageSize=%s&serviceType=data&rq=1655106309671.43
tsingtao-xha.sjzy=http://10.10.30.24:30090/api/share-portal/platform/catalogue/query?catalogueId=&departmentId=&serviceName=%s&type=&orderField=%s&orderType=%s&pageNum=%s&pageSize=%s&serviceType=data&rq=1655106309671.43