From 6293aab5383150da9769353c1c350d9156a9ca55 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期日, 01 九月 2024 14:00:05 +0800
Subject: [PATCH] 考核积分排序
---
ycl-server/src/main/java/com/ycl/task/OsdTask.java | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/task/OsdTask.java b/ycl-server/src/main/java/com/ycl/task/OsdTask.java
index 75443d2..3bde6d8 100644
--- a/ycl-server/src/main/java/com/ycl/task/OsdTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/OsdTask.java
@@ -1,14 +1,9 @@
package com.ycl.task;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mongodb.client.result.DeleteResult;
-import com.ycl.api.DH.module.LoginModule;
import com.ycl.api.DH.utils.DHApi;
import com.ycl.api.HK.HKApi;
-import com.ycl.api.YS.YSApi;
-import com.ycl.api.YS.YSInit;
import com.ycl.platform.domain.entity.TMonitor;
import com.ycl.platform.domain.result.OSDResult;
import com.ycl.platform.domain.result.UY.MonitorQualifyResult;
@@ -62,14 +57,6 @@
@Autowired
private UYErrorTypeCheckService uyErrorTypeCheckService;
- private static final ExecutorService executorService = new ThreadPoolExecutor(8,
- 24,
- 5000,
- TimeUnit.SECONDS,
- new ArrayBlockingQueue<>(1000),
- new ThreadPoolExecutor.CallerRunsPolicy()
- );
-
/**
* 閫氳繃鏌ongoDB姣忔棩涓�鏈轰竴妗f暟鎹幏鍙栬澶噄p
* 閫氳繃璁惧ip銆佸搧鐗岃皟鐢ㄤ笉鍚宎pi鑾峰彇osd淇℃伅
@@ -78,9 +65,7 @@
*/
public void getOSD() {
log.info("寮�濮嬭幏鍙朞SD");
-// YSApi.getOsd("51.95.66.42",YSUserName,YSPassword);
-
- DHApi.getOsd("51.95.67.189",DHUserName,DHPassword);
+// YSApi.getOsd("51.95.66.42",YSUserName,YSPassword);
//鎵归噺淇敼娴峰悍鍝佺墝闆嗗悎
List<String> hkList = new ArrayList<>();
//鎵归噺淇敼澶у崕鍝佺墝闆嗗悎
@@ -94,9 +79,15 @@
//闇�瑕佽�冩牳鐨勬暟鎹�
List<String> serialNumbers = oneMachineFileResults.stream().map(result -> result.getSerialNumber().getValue()).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(serialNumbers)) {
+ ExecutorService executorService = new ThreadPoolExecutor(8,
+ 24,
+ 5000,
+ TimeUnit.SECONDS,
+ new ArrayBlockingQueue<>(1000),
+ new ThreadPoolExecutor.CallerRunsPolicy()
+ );
List<TMonitor> monitors = monitorMapper.selectByNumbers(serialNumbers);
monitors = monitors.stream().filter(monitor -> !StringUtils.isEmpty(monitor.getIp()) && !"127.0.0.1".equals(monitor.getIp())).collect(Collectors.toList());
-// monitors = monitors.stream().filter(monitor -> monitor.getId() < 7000).collect(Collectors.toList());
log.info("澶勭悊鏁版嵁澶у皬{}", monitors.size());
for (TMonitor monitor : monitors) {
executorService.submit(() -> {
@@ -126,6 +117,7 @@
}
});
}
+ //涓嶅啀鎺ユ敹鏂颁换鍔�
executorService.shutdown();
try {
// 绛夊緟鎵�鏈変换鍔″畬鎴愶紝鏈�澶氱瓑寰�10绉掞紙鍙互鏍规嵁闇�瑕佽皟鏁达級
--
Gitblit v1.8.0