fuliqi
2025-02-06 7c23177f6a10c43479e0fb77ac53664ba0c0f9f3
节前发版代码
5个文件已修改
47 ■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/PlatformTask.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/UYTask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/api/DH/module/LoginModule.java
@@ -274,16 +274,16 @@
                if(StringUtils.isNotEmpty(name) && name.contains("|")){
                    String[] osdNames = name.split("\\|");
                    //剔除掉空串
                    List<String> nonEmptyList = new ArrayList<>();
                    for (String osd : osdNames) {
                        if (StringUtils.isNotEmpty(osd)) {
                            nonEmptyList.add(osd);
                        }
                    }
                    result.setOSD1(nonEmptyList.get(0));
                    result.setOSD2(nonEmptyList.get(1));
                    result.setOSD3(nonEmptyList.get(2));
                    result.setName(nonEmptyList.get(3));
//                    List<String> nonEmptyList = new ArrayList<>();
//                    for (String osd : osdNames) {
//                        if (StringUtils.isNotEmpty(osd)) {
//                            nonEmptyList.add(osd);
//                        }
//                    }
                    result.setOSD1(osdNames[0]);
                    result.setOSD2(osdNames[1]);
                    result.setOSD3(osdNames[2]);
                    result.setName(osdNames[3]);
                }
            }
        }else {
ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java
@@ -7,6 +7,7 @@
import com.ycl.platform.mapper.TMonitorMapper;
import com.ycl.platform.service.ICheckIndexVideoService;
import constant.ApiConstants;
import constant.CheckConstants;
import constant.CheckThreadConstants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -67,11 +68,11 @@
            }
        });
        //重点指挥图像特殊处理,统一采用区县数据
        Map<Long, BigDecimal> keyCommandMap = checkIndexVideos.stream().filter(checkIndexVideo -> !checkIndexVideo.getDeptTag() && !checkIndexVideo.getProvinceTag())
        Map<Long, BigDecimal> keyCommandMap = checkIndexVideos.stream().filter(checkIndexVideo -> CheckConstants.Examine_Tag_County.equals(checkIndexVideo.getExamineTag()))
                .collect(Collectors.toMap(checkIndexVideo -> checkIndexVideo.getDeptId(), checkIndexVideo -> checkIndexVideo.getKeyCommandImageOnline()));
        for (CheckIndexVideo checkIndexVideo : checkIndexVideos) {
            //替换省厅和部级 重点指挥图像
            if(checkIndexVideo.getProvinceTag() || checkIndexVideo.getDeptTag()){
            if(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) || CheckConstants.Examine_Tag_Dept.equals(checkIndexVideo.getExamineTag())){
                BigDecimal keyCommand = keyCommandMap.get(checkIndexVideo.getDeptId());
                checkIndexVideo.setKeyCommandImageOnline(keyCommand);
            }
ycl-server/src/main/java/com/ycl/task/PlatformTask.java
@@ -45,7 +45,7 @@
    private static final String DICT_TYPE = "platform_online";
    private static final ExecutorService executorService = new ThreadPoolExecutor(16,
            128,
            64,
            5000,
            TimeUnit.SECONDS,
            new ArrayBlockingQueue<>(1000),
@@ -68,17 +68,17 @@
                    for (int tryTimes = 1; tryTimes < 3; tryTimes++) {
                        // 三秒未ping通重试一次,如果不行才扣分
                        reachable = InetAddress.getByName(platform.getPlatformIP()).isReachable(3000);
                        if (! reachable && tryTimes == 0) {
                            continue;
                        }
                        if (! reachable) {
                            // 如果ping不通,离线时长加5秒
                            redisTemplate.opsForValue().increment(REDIS_KEY_PREFIX + platform.getPlatformIP(), 5);
                            log.warn(platform.getPlatformName() + "平台未ping通");
                        if (reachable) {
                            break;
                        }
                    }
                    if (!reachable) {
                        // 如果ping不通,离线时长加5秒
                        redisTemplate.opsForValue().increment(REDIS_KEY_PREFIX + platform.getPlatformIP(), 5);
                        log.warn(platform.getPlatformName() + "平台未ping通");
                    }
                } catch (Exception e) {
                    log.error("检查平台连通性时发生错误", e);
                    log.error("检查平台连通性时发生d错误", e);
                }
            });
        }
ycl-server/src/main/java/com/ycl/task/UYTask.java
@@ -214,7 +214,7 @@
                            OnlineCheckThread thread = new OnlineCheckThread(monitor, checkPointUtil, time);
                            return thread.call(); // 假设 OnlineCheckThread 实现了 Callable 接口
                        }, executorService)
                        .orTimeout(120, TimeUnit.SECONDS)
                        .orTimeout(180, TimeUnit.SECONDS)
                        .exceptionally(ex -> {
                            if (ex instanceof TimeoutException) {
                                log.error("任务执行超时:"+monitor.getIp());
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -396,7 +396,7 @@
        IFNULL(SUM(IF((p.online = 1 and p.ping_online = 1), 1, 0)), 0) AS totalMembers,
        IFNULL(SUM(IF((p.online = -1 or p.ping_online = -1), 1, 0)), 0) AS postsPercentage,
        IFNULL(SUM(IF((p.online = 0 and p.ping_online = 0), 1, 0)), 0) AS unknownNumbers,
        IFNULL(ROUND(SUM(IF((p.online = 1 and p.online= 1), 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        IFNULL(ROUND(SUM(IF((p.online = 1 and p.ping_online= 1), 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor m
        left join t_yw_point p on m.serial_number = p.serial_number
        left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0